cancel
Showing results for 
Search instead for 
Did you mean: 

Flashing problem in STM32F207

Manikandan K
Associate III

I try to flash using st-link v2 but it show the error message. In my design I cant able to access the Boot 0 and Boot1 pins so no possibility to go for DFU mode.Please give any solution to flash using st-linkV2

kmani@kmani:~$ st-flash erase

2018-09-25T14:18:48 INFO src/stlink-usb.c: -- exit_dfu_mode

2018-09-25T14:18:48 INFO src/stlink-common.c: Loading device parameters....

2018-09-25T14:18:48 WARN src/stlink-common.c: unknown chip id! 0

Mass erasing

kmani@kmani:~$ st-flash erase

2018-09-25T14:19:11 INFO src/stlink-common.c: Loading device parameters....

2018-09-25T14:19:11 WARN src/stlink-common.c: unknown chip id! 0

Mass erasing

13 REPLIES 13
AvaTar
Lead

Put your own bootloader in front of your application, of free the BOOT pins for the purpose they are made for.

You can't have your cake and eat it, too.

I've posted example of getting the STM32F2 to boot into DFU mode in the system loader from the application.

For the ST-LINK use the ST-LINK Utilities or STM32 Cube Programmer.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Manikandan K
Associate III

Without Boot pin ​is there any possibility of getting STM32F2 to boot into DFU mode by programmer,

Sometimes while I'm flasing it shows ​

warn src/stlink-common.c: unknown chip id! 0xa05f0000 in stm32f207

Not sure what you're attempting to do with the ST-LINK in this context.

The DFU mode of the F207 would expect connectivity to it's USB FS port, not via JTAG/SWD or that of the ST-LINK.

Yes, like I said I have demonstrated on numerous occasions how to get F2/F4 parts into DFU mode from application space, irrespective of the BOOT0 pin state. A better board design would permit you to jumper BOOT0, and also access USART1 via PA9/PA10

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Manikandan K
Associate III

Three times I flased the same board it's working but now only I can't. What is the reason for unknow chip id and what I did wrong? ​

The system is sensitive to a number of things, as the JTAG/SWD process needs to wrestle control of the processor and halt it.

ie

Code that reconfigures GPIOA PA13/PA14, and perhaps other including PB3

Code that remaps or disables JTAG/SWD

DMA activity on memory independent of the processor halt state

Low power modes which turn off cells, or block execution pending an IRQ, etc.

GPIOA/B to analogue inputs

Some ways around this are settings which "Hold in Reset" during connectivity, or pulling BOOT0 HIGH so it finds safe harbour in the System ROM and doesn't run your code interfering in the manners described earlier.

Also use ST tools, not third-party apps like st-flash

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Manikandan K
Associate III

So now with boot pins only I can able to flash right? ​ I try to connect the device with programmer in "connect on reset" mode in that it's show st-link communication error.

Which tools is giving you the error?

If this is a custom board I'd need to better understand the connectivity.

Using an official external ST-LINK? or wired to a NUCLEO/DISCO exporting SWD connectivity?

I would avoid using st-flash, it's not an official tool and not something I'm going to chase down issues with.

>>So now with boot pins only I can able to flash right? ​

Depends on the debugger, I can script mine to execute arbitrary code once it is stopped.

The key purpose here however is to try and recover your part, and confirm if it is user code that's the cause of the underlying problem. If it's your code you'll need to dig into that a bit, isolate the offending code, and stop doing that.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Manikandan K
Associate III

St-link utility gives error.I'm using external st-link.​ How should I isolate the offending code and stop it?