Skip to main content
MAlfo.1
Associate
March 17, 2021
Solved

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

  • March 17, 2021
  • 3 replies
  • 3593 views

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!

This topic has been closed for replies.
Best answer by MAlfo.1

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.

3 replies

Tesla DeLorean
Guru
March 17, 2021

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 VenmoUp vote any posts that you find helpful, it shows what's working..
MAlfo.1
MAlfo.1Author
Associate
March 17, 2021

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.

MAlfo.1
MAlfo.1Author
Associate
March 17, 2021

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.

Tesla DeLorean
Guru
March 18, 2021

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 VenmoUp vote any posts that you find helpful, it shows what's working..
MAlfo.1
MAlfo.1Author
Associate
March 18, 2021

Ok, I've uploaded code on this repository.

MAlfo.1
MAlfo.1AuthorBest answer
Associate
March 18, 2021

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.