Skip to main content
Lars Beiderbecke
Senior III
December 14, 2020
Solved

STM32F746 "forgets" flashed program (and more)

  • December 14, 2020
  • 36 replies
  • 4989 views

I migrated to a new self-created PCB with a STM32F746IE. I noticed that if I flash anything, the program works immediately after flashing, but not after power off/on. As a simple example, I created a program with two blinking LEDs. They blink after flashing, but remain dark after power cycling.

In both CubeMX and TrueSTUDIO, I selected STM32F746IE as device. I configured to use the TCM interface with ART controller and command prefetch. The flash for TCM interface is located at 0x0020 0000. Looking at the HEX file, I see that the target address is indeed 0x0020 0000.

For reference, here is my linker file: [removed]

I also cannot debug. Flashing works, the breakpoint at main() is created, but never reached. This is my debug script: [removed]

The power supply provides stable 3.3V and 1.2A. I disabled HSE and LSE and enabled HSI/LSI to rule out clock problems.

So what could cause the flash (and the debug) problems? Obviously, the layout or the soldering could be bad. But I solder SMD regularly, and I cannot find any lack of solder or shorts. The layout is more or less unchanged from the previous version with a STM32F722, which didn't have such problems.

Is there a way to further diagnose this? Since debugging doesn't work reliably, the memory view also doesn't work.

This topic has been closed for replies.
Best answer by MM..1

When you power off on need Vcc have proper rising edge speed. On some speed MCU without reset dont start.

Try when your board dont blink use reset pulse without power disconnect

Second source of possible trouble i see in line

  1. FLASH (xr) : ORIGIN = 0x00200000, LENGTH = 512K /* TCM bus, max=1024K */

from where you have this file?

Third is proper state on BOOT pins.

36 replies

MM..1
Super User
December 20, 2020
Lars Beiderbecke
Senior III
December 20, 2020

Actually, let me just mention that I finally set it by splitting the writes, but the STM32 still won't start up.

MM..1
Super User
December 20, 2020

Now your thread is STM32F746 "forgets" flashed program (and more) ?

Or My Segger Jlink dont do what i mean?

Pls close this thread i stop read it and mean others have too problem ...

Use 6pin or only 5pin from six on Nucleo to STlink target connect and erase, programm over utility desired for STM32.

Piranha
Principal III
December 24, 2020

> NRST, which also has a 10K pull-up (I guess the built-in pull-up would be sufficient).

There is one of the problems. Why is that pull-up there? Copy-paste design from BluePill or some other internet "marvels"? The pull-up on NRST is not just an ordinary pull-up like on a GPIO input. Together with the 100 nF capacitor on NRST it forms a RC circuit, which ensures a sufficient reset delay. Read the AN4661.

Lars Beiderbecke
Senior III
December 24, 2020

While now irrelevant, I put it there because the built-in pull-up is weak, and -- according to some -- too weak.

Frankly, I don't get the need for a reset delay, when the brown out detector can handle this just fine.

Piranha
Principal III
December 24, 2020

Pull-up can be too weak only if you hang dozens of chips on NRST line together sinking significant current. That is not the case with typical one to few chips. And even if pull-up resistance needs to be decreased,m capacitance should be increased accordingly.

POR/BOR will release the reset even from an extremely short glitch on power line. The RC circuit filters that out.

> Looking at the voltage rise, one can see that startup takes more than 1 ms -- in this particular case, the STM32 did not start up (1 grid cell is 1V/1ms, I used a 10x probe).

To me it seems that sufficient reset delay of few ms is exactly what is missing here.