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.

5
  • 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). Commented Sep 13, 2018 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... Commented Sep 13, 2018 at 22:34
  • 1
    Connect it under reset. You can't brick the arm micro (If you do not change option bytes) Commented Sep 13, 2018 at 23:03
  • @old_timer the first bytes of the memory has the following values, initiating from 0x08000000: "0x020005000", "0x08000CBD", "0x08000C55". Still not working Commented Sep 14, 2018 at 19:51
  • we will need a minimal example that demonstrates the problem. likewise perhaps try a much simpler first program. Commented Sep 15, 2018 at 0:48

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.