embedded - STM32 flashing disabled after flashing a code without R/W protection -


i have experience of stdperiph libraries usage programming stm32. tried stm32cube hal stm32cubemx code generator. generated project options:

  • middleware: freertos , fatfs via sdio
  • compiler gcc
  • stm32f103ret6 mcu

i imported generated code eclipse environment. made binary , flashed "st-flash write ..." usual. test program successfuly wrote usart1 "hello" in cycle - no problem. then, when tried flash code, failed "unknown chip id". if manually connect nrst gnd, st-flash gives:

...flash: 0 bytes (0 kib) in pages of 2048 bytes 

full output:

2015-06-14t16:07:29 info src/stlink-common.c: loading device parameters.... 2015-06-14t16:07:29 info src/stlink-common.c: device connected is: f1 high-density device, id 0x10036414 2015-06-14t16:07:29 info src/stlink-common.c: sram size: 0x10000 bytes (64 kib), flash: 0 bytes (0 kib) in pages of 2048 bytes 

i tried use st-link utility windows, cannot connect mcu change option bytes (connection devices stm32 works well). tried flash through usart1, failed.

source code flashed, of course, not contain read/write protection enabling. tried 2 mcu, error reproduced.

how can unbrick mcus , flash anything?

if set pin assignments jtag/swd pins correctly (e.g. sys_jtdi, sys_jtdo-traceswo, etc.) on pinout tab of stm32cubemx, generated code not disable jtag/swd.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -