0

I flashed my blue pill board with the following OpenOCD command and then my OpenOCD does not connect to my board anymore. My boot0 and boot1 pins was grounded.

flash write_image erase blinkled.hex

I forgot to specified the typical init memory map 0x08000000 at the end of the command. What just happend?

Since this mistake, my OpenOCD only connect with the board when boot0 is 1 and boot1 is 0. Does anyone know how to solve the problem? I am using Linux by the way.

  • what address did you specify instead? maybe post a little bit of the beginning of the hex file. and that is the point of the boot jumpers/pins so that you can get out of trouble when you brick the chip. erase and re-try (with a new build). – old_timer Sep 13 '18 at 22:33
  • this is an intel hex file yes? the address is in the file. easier just to stick with the elf format file assuming you are using tools that generate elf files... – old_timer Sep 13 '18 at 22:34
  • 1
    Connect it under reset. You can't brick the arm micro (If you do not change option bytes) – 0___________ Sep 13 '18 at 23:03
  • @old_timer the first bytes of the memory has the following values, initiating from 0x08000000: "0x020005000", "0x08000CBD", "0x08000C55". Still not working – Mathias Scroccaro Sep 14 '18 at 19:51
  • we will need a minimal example that demonstrates the problem. likewise perhaps try a much simpler first program. – old_timer Sep 15 '18 at 00:48

1 Answers1

0

I put together a CMake based build project yesterday. The CMakeLists has the OpenOCD commands for flashing and debugging.

Namely

Flashing:

openocd  -c 'source [find interface/stlink-v2.cfg]' -c 'transport select hla_swd' -c 'source [find target/stm32f1x.cfg]' -c 'program ${PROJECT_ELF_FILE} verify reset exit'

where ${PROJECT_ELF_FILE} is your elf file

Debugging:

See here and here

To read more on the specifics of flashing the board I would look at stm32f1x.cfg where details of the target are given, for example

flash bank $_FLASHNAME stm32f1x 0x08000000 0 0 0 $_TARGETNAME
Alex Hoffmann
  • 355
  • 4
  • 20