cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f217 now unresponsive...

martingingras9
Associate II
Posted on September 22, 2014 at 17:44

Hi,

I was working with Keil+ulinkpro on a custom board using an stm32f217 and everything was fine.  I start working on some automated script for inital setup for our product using openocd.  Somehow, it rendered the chip unresponsive.  I am now unable to write/read with openocd and with keil/ulinkpro.  I can see the SW device in the keil debugging tab.... I was wondering if there is a way to reset the MCU to it's initial state?

Regards,

Mart
12 REPLIES 12
Posted on September 22, 2014 at 17:50

You can reset it with BOOT0 High, and then erase it. Still things like OTP, and protection options can be irreversible.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
megahercas6
Senior
Posted on September 22, 2014 at 18:20

where is two ways to make mcu unresponsive.

1) incorrect PLL settings, so if you have 25MHz clk, and you state that HSE is 8MHz, it will lock up ( just had this problem, shorted clk, and reprogrammed)

2) you programmed SWD pins as GPIO,  (PA13-PA14), in that case you must connect under reset, and leave GPIOA 13-14 pins alone

Posted on September 22, 2014 at 18:55

Turning the power off will also break the interface. WFI and DMA can also cause problems.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
martingingras9
Associate II
Posted on September 22, 2014 at 19:29

how do I erase? Using the ulinkpro doesnt seems to work so far...

Posted on September 22, 2014 at 19:43

In Keil uv4 :  Flash -> Erase (with a projected loaded will perform Full Chip Erase)

The BOOT0 High trick will get the chip into System Loader mode, which is a safe harbour if user code is running errant.

There's things like ST-LINK Utilities for the ST-LINK pods, the ULINKPro doesn't have any stand-alone tools
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
martingingras9
Associate II
Posted on September 22, 2014 at 20:12

That is exactly what I did for the erase.  it took like one second and output ''Full Chip Erase Done''.. yeah right...   I am still unable to program....  very strange... 

Posted on September 22, 2014 at 21:05

Yeah, not much to work with there. Any messages or anything?

Program something simple. Use Flash -> Download, and make sure you have suitable ''Load Application'', ''Update Target'', ''Download to Flash'', ''Verify Code Download'' options.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
chen
Associate II
Posted on September 23, 2014 at 10:19

Hi

As clive1 said - not much to go on there.

''I was working with Keil+ulinkpro on a custom board using an stm32f217''

Have any of the JTAG/SWD pins been used for anything (IO or other alternate function)?

Has the BOOT0 pin been used for anything ?

martingingras9
Associate II
Posted on September 24, 2014 at 21:30

well I switched back to my STM3221G-EVAL board.  Knowing that I have a proper tool (ST-LINK and ST-LINK utility) to save my ass. After numerous run of the code, the keil IDE was unable to erase and flash again.  I fired up the ST-LINK utility and discovered that the Readout Protection was now set to 1.  All I am doing is:

HAL_FLASH_Unlock();

HAL_FLASHEx_Erase();

HAL_FLASH_Program()

HAL_FLASH_Lock();

I started to play with the Write protection of the flash today but I do believe this is completely separate from the ReadOut Protection stuff...

Mart