Skip to main content
TDJ
Senior III
September 13, 2023
Solved

How to configure FileX using CubeMX?

  • September 13, 2023
  • 4 replies
  • 5388 views

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

Best answer by FBL

Hi @TDJ,

Thank you for you feedback. I confirm the issue, I reproduced on myside reported the issue internally. 

Internal ticket number 161368 for tracking.

 

4 replies

Technical Moderator
September 13, 2023
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.Best regards,FBL
TDJ
TDJAuthor
Senior III
September 13, 2023

@FBL Thank you, but my goal is to get FileX working with ThreadX while it seems that current CubeMX version is unable to get even the most basic configuration right. This likely is an issue which should be raised internally. Otherwise, what is the point of having it supported in CubeMX?
Anyway, this example may be more relevant.

FBLBest answer
Technical Moderator
September 13, 2023

Hi @TDJ,

Thank you for you feedback. I confirm the issue, I reproduced on myside reported the issue internally. 

Internal ticket number 161368 for tracking.

 

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.Best regards,FBL
jacopokunak
Associate III
March 7, 2024

Hi, 

any news on this topic? 

Has the issue been resolved by ST ?

I am insterested too in building applications on STM32U5 that will need to include ThreadX as well as FileX and UsbX.

TDJ
TDJAuthor
Senior III
March 7, 2024

@jacopokunak See my working example here. However, because of this issue on STM32U5xx you better reconfigure it the way so PLL1 and, consequently, USB-C (OTG_HS) are clocked by HSE.

Technical Moderator
March 25, 2024

Hello All 

The fix is implemented in the CubeMX 6.11.0 published on st.com

Don't hesitate to come back and report issues.

Thanks

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.Best regards,FBL
Associate III
June 17, 2024

Hi, FBL,

     I installed CubeMX 6.11.1. Still fails  MX_FileX_Init() fails - tx_byte_allocate(). Have you verified the latest CubeMX and check if FileX and ThreadX can be working together? Thanks in advance.

Technical Moderator
June 18, 2024

Hi @Victorheca01 

Do you mean you still have an issue of memory pool size? Same error TX_NO_MEMORY ?  or section placement failed ? If so, MX team suggests implementing a warning message as workaround to prevent surpassing the available total memory size AzureRTOS (+threadX ..). Nonetheless, should you encounter any problems with the thread stack size exceeding the memory pool size, please feel free to report back.

FBL_1-1718709933431.png

 

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.Best regards,FBL
Associate III
June 19, 2024

@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.