cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 Write to QSPI using Filex and Levelx. Issue at fx_media_format.

HMago.1
Associate

Hi,

I am using the STM32H747I-DISCO and wanting to write to the QSPI using Filex.

I tried using the example FX_Dual_Instance, but could not get this working. Since then I have built a project step by step using the CubeMx initialization tool.

Both times my code stops (gets caught in a loop) at fx_media_format. When drilled down with the debugger I found it was waiting for a thread to execute?

Any ideas what I'm missing. I've attached my project below.

Couple of things to note:

  • Hardware works and has successfully been manipulated using BSP package just not through filex commands
  • stm32cubeIDE version 1.12.0

Thanks,

Hannah

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hello @HMago.1​ ,

For Fx_Dual_Instance example and when you using FileX/LevelX, some usage hints must be respected such as:

- FileX sd driver is using SDMMC1 and the DMA, thus only D1 AXI-SRAM memoru (@ 0x24000000) is accessible by the sd driver.

- When calling the fx_media_format() API, it is highly recommended to understand all the parameters used by the API to correctly generate a valid filesystem.

- When calling the fx_media_format() API, NOR sector size is always 512 bytes.

- FileX is ata buffusing ders, passed as arguments to fx_media_open(), fx_media_read() and fx_media_write() API it is recommended that these buffers are multiple of sector size and "32 bytes" aligned to avoid cache maintenance issues.

I hope this help you to solve the issue 🙂 !

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
KDJEM.1
ST Employee

Hello @HMago.1​ ,

For Fx_Dual_Instance example and when you using FileX/LevelX, some usage hints must be respected such as:

- FileX sd driver is using SDMMC1 and the DMA, thus only D1 AXI-SRAM memoru (@ 0x24000000) is accessible by the sd driver.

- When calling the fx_media_format() API, it is highly recommended to understand all the parameters used by the API to correctly generate a valid filesystem.

- When calling the fx_media_format() API, NOR sector size is always 512 bytes.

- FileX is ata buffusing ders, passed as arguments to fx_media_open(), fx_media_read() and fx_media_write() API it is recommended that these buffers are multiple of sector size and "32 bytes" aligned to avoid cache maintenance issues.

I hope this help you to solve the issue 🙂 !

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

QSPI NOR Flash generally going to work more efficiently at 4KB as most devices this is the smallest erase size. The page writes are also usually 256-byte maximum at a time, but will decompose well with 4KB alignment.

Done this with FatFS on QSPI.

Trying to manage 512-byte sectors onto 4KB devices is just going to be a headache, as well as issues with speed and wear.

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