cancel
Showing results for 
Search instead for 
Did you mean: 

stm32l152 shows cant acess target device.

alan ajit
Associate II
Posted on May 15, 2017 at 11:52

iam working in stm31l152rct6. iam starting to create a iap bootloader (that get from st.com)when programme (FLASH_ProgramHalfPage) reaches half page word write it shows cant acess target device. i don't know whats the reason(debugging shows :- cant acess target device shutdown the debug process and terminate debug window).....any body help me please

#stm32l #stm32l1 #stm32l-discovery
8 REPLIES 8
Nesrine M_O
Lead II
Posted on May 15, 2017 at 15:22

Hi

ajit.alan

,

Could you precise in which version of STM32L1 HAL library you have found the issue. So, we can verify it.

Otherwise please try to use the last version 1.7.0, as an issue related to the half page programming is already fixed on this version.

-Nesrine-

Posted on May 15, 2017 at 16:15

If the device goes into a sleep mode or resets, you might lose connectivity. Do you have a watchdog running?

Suggest you use a USART as a diagnostic/telemetry output method.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
alan ajit
Associate II
Posted on May 15, 2017 at 16:29

Nesriam Iam using older liberaries but when iam ported stm32l0 iap to l1 using new version hal libraries,but its not working it cant take bin file from terminal(ymodem protocol) ........clive am not using watchdog

alan ajit
Associate II
Posted on May 16, 2017 at 15:45

dear friends,

                  i have another question if i load my programme in internal flash memory and next i entered in boot mode and using external flash for loading programme(another programme).is it possible if switching programme by change the base adresss(enterd boot mode and changing base adress).......i am working with stm32l152rct6. iam not much aware about this side if any mistake in my qusetion sorry...........please help me  

Posted on May 17, 2017 at 11:53

Nesriam Iam using older liberaries but when iam ported stm32l0 iap to l1 using new version hal libraries,but its not working it cant take bin file from terminal(ymodem protocol)..........now its working crc check problem , now iam not checking crc directly load to internal flash.............but its start write

while(count < 32)

{

*(__IO uint32_t*) ((uint32_t)(Address + (4 * count))) = *pBuffer;

pBuffer++;

count ++;

}

when i debugging now its show' 

Could not stop Cortex-M device! Please check the JTAG cable'

am not using jtag (discover board:stm32l152rct6)

Posted on May 17, 2017 at 11:54

clive am not using watch dog............its hang in

while(count < 32)

{

*(__IO uint32_t*) ((uint32_t)(Address + (4 * count))) = *pBuffer;

pBuffer++;

count ++;

}

here no idea whats the reason

Posted on May 17, 2017 at 14:39

So follow the advice. Take the debugger out of the equation, have a proper Hard Fault handler so you can get output if it gets there. Instrument your code so it outputs the addresses, and memory content for both the source and destination above to a terminal. You can remark out the actual writing code in the loop to just see what it is attempting.

Going to have issues with unaligned addresses, and non-empty flash cells.

Not sure why the debugger drops, commonly device entering low power modes, or reconfiguring pins. Not familiar with your design.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 18, 2017 at 07:05

its not entering haurd fault handler.erasing of flash has no problem thats work fine but when try to write dont know why behave like this.when i stopped the debugger (its take too much time - no output) the debugger reach the point(

*(__IO uint32_t*) ((uint32_t)(Address + (4 * count))) = *pBuffer;) and stops with message 'cannot acess target' adress not increamented its in intial stage............totally am stuck

while(count < 32)

{

*(__IO uint32_t*) ((uint32_t)(Address + (4 * count))) = *pBuffer;     (this point)

pBuffer++;

count ++;

}