Dear NXP,
I created a new FREERTOS project from example for S32K144 in the SDK version 2.9.0:
The example compiles and runs fine, however I would like to use static memory allocation, therefore I change this setting in the Processor Expert:
This way a few new lines are added to the generated FreeRTOSConfig.h:
When I try to compile the code, the following error occurs:
There is a workaround for this (adding these few lines into the generated FreeRTOSConfig.h), which works, but it is not nice and gives warning messages while compiling:
This way the code is working and it compiles. Is there a better solution for overcome this issue?
Thank you very much.
Solved! Go to Solution.
Hi tamaslorincz,
There is indeed a defect in the Processor Expert component for FreeRTOS, which will be fixed for future releases.
Meanwhile, please use the following workaround for your project:
1. Check only the "Dynamic allocation" scheme Processor Expert component, and override with the "User Settings" option.
In the FreeRTOS PEx component, check only the "Dynamic memory allocation" checkbox:
Then, in "User Settings" tab, click on the "Definitions" button (with three dots):
In the window, add these lines:
/* Additional settings can be defined in the property Settings > User settings > Definitions of the FreeRTOS component */
#undef configSUPPORT_DYNAMIC_ALLOCATION
#undef configSUPPORT_STATIC_ALLOCATION#define configSUPPORT_DYNAMIC_ALLOCATION 0
#define configSUPPORT_STATIC_ALLOCATION 1
Now, the static allocation will be used and dynamic allocation will be disabled. There is one more step to be done:
2. Exclude "heap_x.c" file from build
The Pex component will still link a heap_x.c file to the project at this point. You will need to exclude it by selecting it, right click -> Resource Configurations -> "Exclude from Build..." and select all options.
After this, the file should appear slightly greyed out and with a different icon, as below:
At this point, the setup is complete.
If you will need to use dynamic memory allocation as well, you will need to revert step 2 and remove the lines concerning configSUPPORT_DYNAMIC_ALLOCATION from the "User Settings" window.
Best regards,
Ovidiu
Dear NXP,
Could you please check and confirm whether this bug is already fixed in S32 Design Studio for Arm version 2018.R1?
Best regards,
Tibor
Sorry for long delay. I can confirm the issue is fixed since S32 SDK S32K1xx RTM 3.0.0, which is included in Update 9 for S32 Design Studio.
Best regards,
Ovidiu
Hi Ovidiu,
Great! Thank you for your assistance. :smileyhappy:
Best regards,
Tibor
Hi tamaslorincz,
There is indeed a defect in the Processor Expert component for FreeRTOS, which will be fixed for future releases.
Meanwhile, please use the following workaround for your project:
1. Check only the "Dynamic allocation" scheme Processor Expert component, and override with the "User Settings" option.
In the FreeRTOS PEx component, check only the "Dynamic memory allocation" checkbox:
Then, in "User Settings" tab, click on the "Definitions" button (with three dots):
In the window, add these lines:
/* Additional settings can be defined in the property Settings > User settings > Definitions of the FreeRTOS component */
#undef configSUPPORT_DYNAMIC_ALLOCATION
#undef configSUPPORT_STATIC_ALLOCATION#define configSUPPORT_DYNAMIC_ALLOCATION 0
#define configSUPPORT_STATIC_ALLOCATION 1
Now, the static allocation will be used and dynamic allocation will be disabled. There is one more step to be done:
2. Exclude "heap_x.c" file from build
The Pex component will still link a heap_x.c file to the project at this point. You will need to exclude it by selecting it, right click -> Resource Configurations -> "Exclude from Build..." and select all options.
After this, the file should appear slightly greyed out and with a different icon, as below:
At this point, the setup is complete.
If you will need to use dynamic memory allocation as well, you will need to revert step 2 and remove the lines concerning configSUPPORT_DYNAMIC_ALLOCATION from the "User Settings" window.
Best regards,
Ovidiu
Thank you very much, it is working.