cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer doesn't program the Nucleo-H745ZI board reliably

YYu.5
Associate II

I developed a stm32 project for the Nucle-H745ZIQ board with stm32cube ide, there's no issue downloading the code from IDE using its debugger. However, when I tried to download with stm32cube programmer, the code doesn't run (no expected actions can be observed on the board) after the download even though the cube programmer shows "download/verify successfully" and the "Device memory" tab shows data have been written to memory address. It doesn't happen every time, but it happens.

The ide version is 1.6.1, programmer version is 2.8. The connection is "ST-LINK", Port is "SWD", Mode I tried "Hot plug" and "Under reset". And I tried both .hex and .bin generated from IDE, the problem could not get fixed.

A brand new board is more likely to have this issue, no .hex file can run on board as expected by downloading from cube programmer. A workaround is to program the new board with CUBE IDE once, then it's less like to have this issue for this particular board while programming with CUBE programmer.

Can someone explain this and tell how this can be avoid?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
YYu.5
Associate II

Hi guys, this problem was solved. For dual-core device like the STM32H745 I used, you have to program two separate hex files (one for CM4, the other for CM7) with CUBE PROGRAMMER. You won't find this trick if you keep using CUBE IDE, because the IDE takes care of two hex files internally, you only run the debugger of CM7 to get them both work. Thus it looks like the CM7.hex has included all the code in CM4.hex.

View solution in original post

4 REPLIES 4
TDK
Guru

> the code doesn't run (no expected actions can be observed on the board)

Perhaps BOOT0 is held high or (more likely) the relevant option bytes which override this and set the user code address are incorrect. Or it's running user code but is hung up in initialization somewhere. You can attach a debugger to the already running board to check.

If it says programming and verification worked, it probably programmed the board successfully.

If you feel a post has answered your question, please click "Accept as Solution".

Might want to power cycle, the H7 latches states at power-up, and regular reset won't overcome them, and it will always go into the ROM loader, and not the FLASH code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
YYu.5
Associate II

Power cycle doesn't work. BOOT0 is tied low, this is hardware circuit on the Nucleo board, nobody changed it.

It seems like CUBE IDE did something extra in configuration while downloading, so it works fine every time. And CUBE Programmer doesn't do this extra configuration (not change it either), so it only works after the board is previously programmed by IDE.

YYu.5
Associate II

Hi guys, this problem was solved. For dual-core device like the STM32H745 I used, you have to program two separate hex files (one for CM4, the other for CM7) with CUBE PROGRAMMER. You won't find this trick if you keep using CUBE IDE, because the IDE takes care of two hex files internally, you only run the debugger of CM7 to get them both work. Thus it looks like the CM7.hex has included all the code in CM4.hex.