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

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

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.


I'm out of offce with limited access to my emails.
Happy New Year!

View solution in original post

10 REPLIES 10
FBL
ST Employee

Hello @TDJ,

I am not sure if this wiki would help you Introduction to FILEX - stm32mcu 

You can try using this example (without ThreadX) STM32CubeU5/Projects/STM32U5G9J-DK2/Applications/FileX/Fx_File_Edit_Standalone at 7942fc4ea05026e4e9ce72d680f704e9433bce42 · STMicroelectronics/STM32CubeU5 (github.com) 

 

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.


I'm out of offce with limited access to my emails.
Happy New Year!

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

FBL
ST Employee

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.


I'm out of offce with limited access to my emails.
Happy New Year!
jacopokunak
Associate III

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.

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

Hi,

i use FileX on sd-card (because forced by STM to use it, no more fatFS ... grrr )

and have exfat enabled, which is used on most >32GB cards.

Here my (working :) ) setting:

AScha3_0-1709813360359.png

btw

also ThreadX delay-tick is set to 1ms , to have same delays as in HAL without much thinking or conversion.

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

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.


I'm out of offce with limited access to my emails.
Happy New Year!

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.

FBL
ST Employee

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.


I'm out of offce with limited access to my emails.
Happy New Year!