Skip to main content
Visitor II
May 10, 2024
Question

FileX help

  • May 10, 2024
  • 3 replies
  • 1822 views

Platform Nucleo-H563ZI
CubeIDE V1.15.0
ioc file attached


I'm starting with a simple app to get fimilar with the new Middleware.
I created a new STM32 app and enabled ThreadX and FileX.
I also changed the recommended settings for IChache and the system timer (TIM2)

I enabled the BSP LEDs, button, and virtual serial port.

For ThreadX I enabled the core and used static allocation
I tried a pool size of 2048 and 8096 with the same results

For FileX I enabled the core and checked the 'Internal RAM Interface' setting
I tried SRAM3 and SRAM1 with the same results

I created one user thread and put the following in it.

while(1)
{
tx_thread_sleep(10);

BSP_LED_Toggle(LED_GREEN);
BSP_LED_Toggle(LED_YELLOW);
BSP_LED_Toggle(LED_RED);
}

The first thing I noticed is that the BSP init code is placed after
MX_ThreadX_Init(), and does not get executed.
I copied that code before MX_ThreadX_Init()

If the call to create the FileX thread in tx_application_define() is executed,
the code crashes with the cursor at the top of _fx_utility_logical_sector_read()
which is called from _fx_utility_FAT_entry_read()

If I comment the line: status = MX_FileX_Init(memory_ptr); and the return check code,
the code runs and my LEDs blink.

Is there something I missed?


Karl

 

    This topic has been closed for replies.

    3 replies

    ST Employee
    May 14, 2024

    Hello @KKobe.1 ,

    Could you please attach the IOC file associated with your project? 

    Graduate II
    December 9, 2024

    I am having this exact issue. Trying to get Filex working on a basic Threadx project for the Nucleo-H563ZI using SRAM. 
    If the call to create the FileX thread in tx_application_define() is executed,
    the code crashes with the cursor at the top of _fx_utility_logical_sector_read()

    Were you able to solve this issue or does ST have any advice to what is causing the problem?

    Graduate II
    December 9, 2024

    Attached is the ioc for reference.

    Graduate II
    December 11, 2024

    Thanks! Disabling cache allowed me to get further into the program. I finally got the basic project working. Turns out the default 'FileX Application Thread Stack Size" is too small to run the base generated code (fx_media_open). After increasing the Stack Size and the Memory Pool Size, I was finally able to get a functioning prototype. 
    I made the assumption that the default settings were acceptable:)
    If anyone has this same issue, I added my FileX Core Init settings to this post.
    Solved: Basic ThreadX / FileX example - STMicroelectronics Community

    Visitor II
    December 11, 2024

    Hi @potatobandit ,

     

    perfect, but without cache your applications will run too slow. I suggest finding the error with cache. As an alternative you may try to align all buffers that you pass to file read and write functions to a cache line (32 bytes). For me that was not possible as the buffers were presented by SQLite, so I had to find the bug.

     

    Regards,

    Dmitry