cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure FileX using CubeMX?

TDJ
Lead

How to start with FileX using CubeMX?
In CubeMX I enabled ThreadX and FileX with the default configuration, increased ThreadX "memory pool size" to 2k and  enabled "Generate Init Code" for both.

In app_azure_rtos.ctx_application_define() function MX_FileX_Init() fails - tx_byte_allocate() returns error code 16. According to docs that means TX_NO_MEMORY "Service was unable to allocate a block of memory within the specified time to wait.".
I get this error even when I substantially increase ThreadX "memory pool size" to 64k.
Without FileX enabled ThreadX works - I created a timer which nicely blinks the onboard LED.
I know FileX does not really require ThreadX, but I need it for other purposes.

This is probably something simple, but I admit I am new to ThreadX.
Tested with the latest CubeMX, STM32U5A9 MCU as well as NUCLEO-U575ZI-Q boards.

Please advise.

STM32-ThreadX-1.png

STM32-ThreadX-2.png

11 REPLIES 11

@FBL 

Hi FBL,

     I am using STM Cube 1.14.0 to develop my project. I found that the FileX and ThreadX can not work together. my hardware is U575 eval board.

  • Just use FileX, SDCARD is working and can create file;
  • Enable ThreadX, SDCARD failed in initialisation;
  • Disable ThreadX, FileX works as usual.

 

Could you confirm this problem and tell me if there is any solutions.

I checked ST’s community, it seems that many people complain about this problem and there is no solution so far.

I can send you my project source code if you would like to verify. Thanks in advance.

 

Any good news?
Facing the same problem here.

We are using an STM32H563 with an SD card under FileX/ThreadX.

Initially, operating files in SRAM via fx_media_open only worked after increasing the default value of FX_APP_THREAD_STACK_SIZE from 512B to 4 × 512B.

Subsequently, we switched to operations with a 16 GB SD card, maintaining the same parameters. However, the fx_media_open command fails to open the media, returning FX_BOOT_ERROR (0x01).

Observations:

1. The presence of the SD card is correctly detected.

2. The SDMMC clock was reduced to 25 MHz.

3. On the STM32H735G-DK board, as per the official example (link), all FileX operations worked, but only with cards smaller than 64 GB (no support when formatted in exFAT).

4. STM32CubeMX, Version: 6.15.0-RC7, Build: 20250701-1659 (UTC).

5. STM32CubeIDE, Version: 1.19.0, Build: 25607_20250703_0907 (UTC).

Attached are some screenshots of CubeIDE/MX for reference.

DEBUG.png

 

ThreadX.png

FileX.png

SDMMC2_GPIO.png

SDMMC2_Parameters.png