This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I am using mcu_plus_sdk_am243x_08_03_00_18 SDK.
I found source code in the source/fs/freertos_fat directory. It actually does not support FreeRTOS and current code supports nortos.
I found a problem in the configNUM_THREAD_LOCAL_STORAGE_POINTERS and ffconfigCWD_THREAD_LOCAL_INDEX values.
The configNUM_THREAD_LOCAL_STORAGE_POINTERS is defined in the source\fs\freertos_fat\portable\nortos\FreeRTOS.h file and the defined value is 3.
The ffconfigCWD_THREAD_LOCAL_INDEX is defined in the source\fs\freertos_fat\config\FreeRTOSFATConfig.h file and the defined value is 4.
The problem is in the source\fs\freertos_fat\FreeRTOS-FAT\include\ff_stdio.h file and it checks these values as below in line 154:
#if ( ( configNUM_THREAD_LOCAL_STORAGE_POINTERS - ffconfigCWD_THREAD_LOCAL_INDEX ) < 3 )
#error Please define space for 3 entries
#endif
The problem is compiler doesn't generate compile errors for this. I think it should be fixed.
Hi Chahee,
it seems like the ffconfigCWD_THREAD_LOCAL_INDEX is 4U which converts the entire calculation to unsigned and the value -1 is 0xFFFFFFFF which is greater than 3 (in unsigned). So compiler does not give an error.
I think that this should be fixed in MCU+ SDK as well. Thanks for pointing it out. I will raise a bug for the same.
Thanks and Regards,
Aakash Kedia