cancel
Showing results for 
Search instead for 
Did you mean: 

External Loader works on STM32CubeProgrammer, but read operation returns incorrect data

MAlfo.1
Associate II

Hi all.

I've created an external loader for a custom STM32H743 board with external W25Q64 FLASH (MCUDEV DevEBox H743).

The project works really well when I'm testing on CubeIDE.

When exported to .stldr inside CubeProgrammer I can upload a 1MB file to the external FLASH, but the returned data when reading is incorrect. It always shows 0x99999999 for all the data.

If I switched to another loader made by @Community member​ for the same board (view it here), data returned is as expected, so I'm pretty sure data has been written correctly.

What could be the problem? Read operation is managed directly by CubeProgrammer and dummy cycles are configured conform the datasheet. Any Idea?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
MAlfo.1
Associate II

Problem solved.

I've refactor some functions and now it works very well in CubeProgrammer with no need to reconnect. I've also tested it in a CubeIDE project and the data is saved without problems during compilation.

Here is the source code repository. Hope it will be useful for someone.

View solution in original post

7 REPLIES 7

Reading all 9's guess you're using 4-bit mode instruction on a device that's not had the QE bit enabled. Or you're just using the wrong command.

Be easier to know with the read function that sends the QSPI commands.

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

Thanks for your reply, @Community member​ .

The device have the QE bit enabled (command 0x35 returns a value of 0x32, being bit 1 the QE flag).

To enable the mapping mode I'm using Fast Read Quad Output command (0x6B) and also tried Fast Read Quad I/O (0xEB) with no luck, with all responses to 0x88888888 in that case.

Not sure to understand your last sentence... Reading data works fine from code once memory-mapped is enabled. The problem is with CubeProgrammer, that returns invalid data reading from 0x90000000 address with the external loader selected.

Sorry, I wrote a new answer instead replying yours.

Thanks for your reply.

The device have the QE bit enabled (command 0x35 returns a value of 0x32, being bit 1 the QE flag).

To enable the mapping mode I'm using Fast Read Quad Output command (0x6B) and also tried Fast Read Quad I/O (0xEB) with no luck, with all responses to 0x88888888 in that case.

Not sure to understand your last sentence... Reading data works fine from code once memory-mapped is enabled. The problem is with CubeProgrammer, that returns invalid data reading from 0x90000000 address with the external loader selected.

Rough translation is show codes, I'm not much for playing 'guess what's wrong'

ST has made the whole external loader process much more of goat rodeo than it needs to be. Bad examples, broken example and broken front end interface. You could do everything properly and still get bitten by some hack they added to fix some other bug they couldn't resolve elsewhere.

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

Ok, I've uploaded code on this repository.

Done some more tests and now it seems to work well.

I had to implement Read function on Loader_Src.c, despite it's not mandatory for NOR_FLASH. Also I've disabled memory mapped mode on Init function and called it only when needed (Read and Verify). Repo updated with last changes.

It's very tedious to work with loaders in CubeProgrammer. Multiple reconnects are needed to make it works, and you have to reselect loader once disconnected (v2.7.0). I'll try now how it works from CubeIDE.

MAlfo.1
Associate II

Problem solved.

I've refactor some functions and now it works very well in CubeProgrammer with no need to reconnect. I've also tested it in a CubeIDE project and the data is saved without problems during compilation.

Here is the source code repository. Hope it will be useful for someone.