FreeRTOS Processor Expert bug with static memory allocation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FreeRTOS Processor Expert bug with static memory allocation

ソリューションへジャンプ
1,858件の閲覧回数
tamaslorincz
Contributor I

Dear NXP,

I created a new FREERTOS project from example for S32K144 in the SDK version 2.9.0:

pastedImage_1.png

The example compiles and runs fine, however I would like to use static memory allocation, therefore I change this setting in the Processor Expert:

pastedImage_2.png

This way a few new lines are added to the generated FreeRTOSConfig.h:

pastedImage_3.png

When I try to compile the code, the following error occurs:

pastedImage_4.png

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:

pastedImage_6.png

This way the code is working and it compiles. Is there a better solution for overcome this issue?

Thank you very much.

1 解決策
1,409件の閲覧回数
ovidiualexandru
NXP TechSupport
NXP TechSupport

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:

pastedImage_3.png

Then, in "User Settings" tab, click on the "Definitions" button (with three dots):

pastedImage_4.png

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

pastedImage_7.png

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.

pastedImage_8.png

After this, the file should appear slightly greyed out and with a different icon, as below:

pastedImage_9.png

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

元の投稿で解決策を見る

5 返答(返信)
1,409件の閲覧回数
tibor_bekesi
Contributor II

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

0 件の賞賛
1,409件の閲覧回数
ovidiualexandru
NXP TechSupport
NXP TechSupport

Hi tibor.bekesi@valeo.com‌,

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

1,409件の閲覧回数
tibor_bekesi
Contributor II

Hi Ovidiu,

Great! Thank you for your assistance. :smileyhappy:

Best regards,

Tibor

0 件の賞賛
1,410件の閲覧回数
ovidiualexandru
NXP TechSupport
NXP TechSupport

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:

pastedImage_3.png

Then, in "User Settings" tab, click on the "Definitions" button (with three dots):

pastedImage_4.png

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

pastedImage_7.png

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.

pastedImage_8.png

After this, the file should appear slightly greyed out and with a different icon, as below:

pastedImage_9.png

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

1,409件の閲覧回数
tamaslorincz
Contributor I

Thank you very much, it is working.