K
K
Klaxons2019-10-23 10:48:50
Microcontrollers
Klaxons, 2019-10-23 10:48:50

Why does stm32 not start after flashing?

The essence of the problem is as follows, I flash stm32f103 with my firmware, in openocd debug mode everything is OK, everything works, when I upload the firmware via st-flash nothing works.
I tried to clean / delete the entire assembly and rebuild, all the same. I upload the binary at the correct address 0x8000000.
It seems to me that the problem is with the linker, since I uploaded an example with blink, everything went well and the LED blinks, but my firmware does not play. The same firmware, compiled and uploaded via Keil, works with a bang.
I checked the memory and flash drives too, everything is ok

MEMORY
{
  RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
  CCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 0
  FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
  FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
  EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
  EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
  EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
  EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
  MEMORY_ARRAY (xrw)  : ORIGIN = 0x00000000, LENGTH = 0
}

UPD: it turned out that the firmware took up more space than it can fit on flash memory and in debug mode they could somehow get around this, and in release mode optimization was required, while the project template in eclipse did not handle this error in any way and, ignoring the final file size, I tried to sew it. Cured by refactoring, code and compiler optimization

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question