x-cube-azrtos-h7 icon indicating copy to clipboard operation
x-cube-azrtos-h7 copied to clipboard

FX_IO_ERROR on Fx_NoR_Write_Read_File example

Open bdlr2 opened this issue 2 years ago • 4 comments

Describe the set-up

  • The board: STM32H735G-DK
  • IDE: IAR 9.10.2
  • Project: Fx_NoR_Write_Read_File example

Describe the bug (skip if none)

I start the example out of the box, generated with CubeMX for STM32H735G-DK. The fx_media_format at line 147 in app_filex.c returns a FX_IO_ERROR, which ends the program.

How to reproduce the bug (skip if none)

Start the app and run it step by step up to the fx_media_format call in app_filex, you'll see the return value that is not FX_SUCCESS as it should.

bdlr2 avatar May 03 '22 10:05 bdlr2

Hi @bdlr2,

Your report has been forwarded to our development teams. They will be back to you after a deeper analysis of the issue you reported.

With regards,

PS: Please excuse the delay it may take to reply.

ALABSTM avatar Jul 29 '22 10:07 ALABSTM

Hi @bdlr2, Did the NOR memory contain any data before running the application?

regards Haithem.

rahmanih avatar Jul 29 '22 15:07 rahmanih

HI @rahmanih,

I finally found that it's indeed because of the NOR that was not completely erased that this problem happened. I agree it's not a bug, but may I suggest to add some info about this prerequisite in the documentation, or to perform a test to erase the NOR automatically ?

Best regards

bdlr2 avatar Aug 08 '22 06:08 bdlr2

Hi @bdlr2 Great news! Actually, the request to erase the memory is mentioned in the README.md

The NOR flash should be erased prior to format either by the application or by the STM32CubeProgrammer, this allows LevelX and FileX to create a clean FAT FileSystem.

Chip erase operation takes considerable time when done by the application, therefore it is disabled by default.

To enable it, please define the flag LX_STM32_OSPI_ERASE to 1 in "lx_stm32_ospi_driver.h":

rahmanih avatar Aug 08 '22 08:08 rahmanih