cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F746 "forgets" flashed program (and more)

Lars Beiderbecke
Senior III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
MM..1
Chief III

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.

View solution in original post

36 REPLIES 36
MM..1
Chief III

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.

Lars Beiderbecke
Senior III

I thought you nailed it with your second remark, as the FLASH line missed w -- however, adding it and building from scratch didn't change a thing. Also, when the linker file is generated by CubeMX, FLASH only has rx.

I'll test/check your other items now.

MM..1
Chief III

rx is ok but ORIGIN is question , check datasheet about location of flash memory map

Oh, I see. Yes, Flash on the TCM bus starts at 0x0020 0000:

0693W000006FihXQAS.png

Yes but read too page about boot modes, you need program option bytes BOOT_ADDR for start from TCM

Normal default boot is i mean 0X0800 0000

That could be, but I'm using CubeMX, which can configure the bus mode. I've used TCM bus successfully in the past (in the same project on a previous board with a F722, in fact).

Andreas Bolsch
Lead II

In fact, the flash is aliased on 0x00200000, but the RM says explicitly

"64-bits ITCM interface:

– It is connected to the ITCM bus of Cortex-M7 and used for instruction execution

and data read access.

– Write accesses are not supported on ITCM interface <--- !!!

– Supports a unified 64 cache lines of 256 bits (ART accelerator)"

That is, for programming the flash, you must specify the address range starting at 0x08000000 (as for all STM32 devices). Depending on the programmer/software you're using, the address range starting at 0x00200000 might not be recognized as belonging to flash at all.

And depending on your programmer, there *might* be an option to use the ITCM-interface addresses for programming, see AN4667.

Thanks for your suggestion, but I've been using 0x0020 0000 before in this project (with a F722), and it did work flawlessly. I think "write access" refers to run time, hence the missing w permission. But anyway, just for testing I changed it to 0x0800 0000 now and reflashed, but the program is still not retained.

I probably have an error in the layout, which I will check now.