cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 External loader problem

YGU.1
Associate II

Hello,

I'm learning STM32 and wrote an quadspi external loader for my NUCLEO -144 (STM32743ZI) and 1M external flash. I've it tested in the Cube IDE and everything looks OK, I can read and write the external flash. When I use the loader in STM32CudeProgrammer I managed to read , but not erase and write accordingly.  Any help will be appreciated. Please find attachments.

Thanks

19 REPLIES 19
YGU.1
Associate II

cVass.1,

I just try to understand.. You managed read\erase\write an external flash by using STM32Cubeprogrammer and your custom external Quadspi loader (stldr) based on the project I sent you 4 days ago. Is it correct?

clive1 

I get an error when trying to erase a sector of the external nor flash. Error: Sector erase operation has failed at least for one of the existing specified sectors.Please verify flash memory protection (shown on the picture) . I have EnableMemoryMappedMode enabled in my Init() of Loader_Scr.c

Does it make the problem? Have you idea?

Thanks

cVass.1
Associate II

YGU.1

no this is my project, I just compare with mine.

during my tests I noticed that I was in EnableMemoryMappedMode in the Init (); I couldn't erase anymore.

I've been complaining about this for over a year

https://community.st.com/s/question/0D50X0000BRWFmKSQX/stm32-cube-programmer-v210-not-working-with-stm32h750bdk-qspi-external-loader

The initial load fails, the connect/disconnect/connect gets it right the second time around.

The ELF loader needs fixing if you're going to modify the addresses passed in the damn header and symbols. They'd actually work properly if left alone.

@STOne-32​ 

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

If you're in memory-mapped the erase probably will fail with HAL libraries.

Validate all code outside of the External Loader model first. Build a test harness so you can sequence the functions as Cube Programmer would so you can utilize a debugger.

You can always instrument your code to understand what it is doing, how Cube Programmer is interacting with it, and the errors you encounter on the HAL side. The USART and all your board hardware is available and can be used.

You can't really use interrupts, although I've seen some awful hacks from ST to get the HAL internal dependencies to work, you really don't need that for HAL_Delay and Ticks to work.

@STOne-32​ we really need to get some of this code on GitHub so we can fix the broken issues with Cube Programmer and ST-LINK Utilities that have persisted for years, and been ignored despite clear evidence of coding issues and initialization problems.

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

indeed I have the same concern as you.

I saw your other post.

18:57:48:223 : STLinkUSBDriver.dll loaded

18:57:48:224 : STLinkUSBDriver.dll loaded

18:57:48:225 : ST-LINK SN : 48FF6E068278535310410181

18:57:48:225 : ST-LINK FW : V2J37S7

18:57:48:226 : Board    : --

18:57:48:226 : Voltage   : 2.73V

18:57:48:233 : SWD freq  : 4000 KHz

18:57:48:233 : Connect mode: Normal

18:57:48:233 : Reset mode : Software reset

18:57:48:237 : Device ID  : 0x450

18:57:48:243 : Revision ID : Rev Y

18:57:48:278 : Buffer program...

18:57:48:278 : w ap 0 @0x580244F4 0x00000004 bytes Data 0x00000002

18:57:48:278 : Reading data...

18:57:48:278 : r ap 0 @0x58000528 0x00000004 bytes Data 0x00000001

18:57:48:279 : Buffer program...

18:57:48:279 : w ap 0 @0x580244F4 0x00000004 bytes Data 0x00000002

18:57:48:279 : Reading data...

18:57:48:280 : r ap 0 @0x58000528 0x00000004 bytes Data 0x00000001

18:57:48:280 : Buffer program...

18:57:48:281 : w ap 0 @0x580244F4 0x00000004 bytes Data 0x00000002

18:57:48:282 : Reading data...

18:57:48:283 : r ap 0 @0x58000528 0x00000004 bytes Data 0x00000001

18:57:48:283 : Buffer program...

18:57:48:283 : w ap 0 @0x580244F4 0x00000004 bytes Data 0x00000002

18:57:48:284 : Reading data...

18:57:48:284 : r ap 0 @0x58000528 0x00000004 bytes Data 0x00000001

18:57:48:285 : Reading data...

18:57:48:285 : r ap 0 @0x1FF1E880 0x00000004 bytes Data 0x00000800

18:57:48:285 : Database: Config 3 is active.

18:57:48:293 : flash loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/FlashLoader/0x450.stldr is loaded

18:57:48:297 : Reading data...

18:57:48:297 : r ap 0 @0x1FF1E880 0x00000004 bytes Data 0x00000800

18:57:48:459 : UPLOADING OPTION BYTES DATA ...

18:57:48:459 :  Bank     : 0x00

18:57:48:459 :  Address    : 0x5200201c

18:57:48:459 :  Size     : 308 Bytes

18:57:48:460 : Reading data...

18:57:48:460 : r ap 0 @0x5200201C 0x00000134 bytes Data 0x0BD6AAF0

18:57:48:460 : UPLOADING OPTION BYTES DATA ...

18:57:48:460 :  Bank     : 0x00

18:57:48:461 :  Address    : 0x5200201c

18:57:48:461 :  Size     : 308 Bytes

18:57:48:461 : Reading data...

18:57:48:461 : r ap 0 @0x5200201C 0x00000134 bytes Data 0x0BD6AAF0

18:57:48:461 : UPLOADING ...

18:57:48:462 :  Size     : 1024 Bytes

18:57:48:462 :  Address    : 0x90000000

18:57:48:462 : Read progress:

18:57:48:462 : Reading data...

18:57:48:482 : halt ap 0 Status = 0

18:57:48:482 : halt ap 1 Status = 32

18:57:48:482 : halt ap 2 Status = 32

18:57:48:482 : w ap 0 reg 15 PC  (0x24000000)  

18:57:48:482 : w ap 0 reg 17 MSP (0x24000500)  

18:57:48:483 : w ap 0 reg 16 xPSR (0x01000000)  

18:57:48:483 : w ap 0 @0x24016F40 0x00000200 bytes Data 0x00000000

18:57:48:484 : w ap 0 @0x24000000 0x00000004 bytes Data 0x0000BE00

18:57:49:103 : w ap 0 @0x24000004 0x00016B08 bytes Data 0x00000000

18:57:49:103 : Init flashloader...

18:57:49:105 : halt ap 0 

18:57:49:107 : w ap 0 reg 0 R0  0x00000000

18:57:49:107 : w ap 0 reg 1 R1  0x00000000

18:57:49:108 : w ap 0 reg 2 R2  0x00000000

18:57:49:108 : w ap 0 reg 3 R3  0x00000000

18:57:49:109 : w ap 0 reg 4 R4  0x00000000

18:57:49:109 : w ap 0 reg 5 R5  0x00000000

18:57:49:110 : w ap 0 reg 6 R6  0x00000000

18:57:49:110 : w ap 0 reg 7 R7  0x00000000

18:57:49:111 : w ap 0 reg 8 R8  0x00000000

18:57:49:112 : w ap 0 reg 9 R9  0x00000000

18:57:49:114 : w ap 0 reg 10 R10 0x00000000

18:57:49:114 : w ap 0 reg 11 R11 0x00000000

18:57:49:115 : w ap 0 reg 12 R12 0x00000000

18:57:49:116 : w ap 0 reg 13 SP  0x00000000

18:57:49:118 : w ap 0 reg 14 LR  0x24000001

18:57:49:118 : w ap 0 reg 15 PC  0x2000067D

18:57:49:119 : w ap 0 reg 16 xPSR 0x01000000

18:57:49:120 : w ap 0 reg 17 MSP 0x24016F08

18:57:49:120 : w ap 0 reg 18 PSP 0x00000000

18:57:49:121 : run ap 0 

18:57:54:000 : halt ap 0 

18:57:54:000 : Init function fail with timeout

18:57:54:001 : r ap 0 reg 16 xPSR 0x81000003

18:57:54:007 : halt ap 0 Status = 0

18:57:54:008 : halt ap 1 Status = 32

18:57:54:009 : halt ap 2 Status = 32

18:57:54:009 : w ap 0 reg 15 PC  (0x24000000)  

18:57:54:010 : w ap 0 reg 17 MSP (0x24000500)  

18:57:54:011 : w ap 0 reg 16 xPSR (0x01000000)  

18:57:54:012 : Error: Data read failed

I'm using a STM32H743 and I've tried to use your Loader_src.c, linker.ld, Dev_Inf.c/.h but get read error in programmer when I try to read the flash at 0x90000000.  I've proven the quadspi.h and quadspi.c drivers for the Windbond W25Q64 work fine for Read, Write, and memory mapped.  Any advice?

 

urbito
Senior

Have you mapped to your actual pins? Each Loader works for the chip but also for the pin distribution.

You're posting to a 3+ year old thread.

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

Yes, used the .ioc of the project to configure qspi so the drivers for qspi have the correct pin assignments.  have a test in the code that writes a buffer to flash, reads flash, and enters memory mapped mode, all these tests passed just problem with .stldr used in programmer for some reason.