2021-03-17 08:29 AM
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!
Solved! Go to Solution.
2021-03-18 10:10 AM
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.
2021-03-17 11:12 AM
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.
2021-03-17 04:12 PM
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.
2021-03-17 04:14 PM
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.
2021-03-17 05:14 PM
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.
2021-03-18 02:44 AM
Ok, I've uploaded code on this repository.
2021-03-18 04:55 AM
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.
2021-03-18 10:10 AM
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.