Optimizing Flash used for SDK on S32K1xx

cancel
Showing results for 
Search instead for 
Did you mean: 

Optimizing Flash used for SDK on S32K1xx

146 Views
Contributor II

Hello, 

I am working on S32K116 µC with SDK RTM 3.0.0 on s32 DS 2018.R1.

As soon I created a task using FreeRTOS, the flash used increases by 20k

and as soon as I select "semaphores" from FreeRTOS setting, it increases flash size for more 20k.

I would like to know how I could optimize the flash and RAM used by SDK in the project.

I have already done below optimization:

activatign "LTO"

Optimization level: for size

Would you please give me more input?

Best regards,

Leila

0 Kudos
6 Replies

22 Views
Contributor II

Hello, 

Would you also let me knwo if I could have a debugging page like in DS the same as expalined (Image Info) in below link?

Tutorial: How to Optimize Code and RAM Size | MCU on Eclipse 

0 Kudos

22 Views
NXP TechSupport
NXP TechSupport

Hello Leila,

Unfortunately, the image view is not available in S32 Design, but there's other ways to see the code size for your project and manage the task size.

In the following link, you can see how to in the console the code size for your project:

S32 code size? 

Since you're using FreeRTOS you can enable the Task List view that shows the usage of the heap that each task has:

pastedImage_5.png

In the heap usage view you can see how much free space you have:

pastedImage_2.png

Also, in the FreeRTOS component you have you can set how much of the memory the heap will use:

pastedImage_7.png

So, knowing how much of the heap the task will use you can modify the stack usage in the xTaskCreate to fit the needs of your task.

Best Regards,

Alexis Andalon

0 Kudos

22 Views
Contributor II

Hi Alexis,

Thank you for the response. 

Would you please also give me some info/tips how to optimize usage of SDK?

As soon I created a task using FreeRTOS, the flash used increases by 20k

and as soon as I select "semaphores" from FreeRTOS setting, it increases flash size for more 20k.

Thank you.

Best regards,

Leila

0 Kudos

22 Views
NXP TechSupport
NXP TechSupport

Hello Leila,

Can you let me know how are you adding these components? I'm using the FreeRTOS example that comes with the SDK, this is the example size without modifications: pastedImage_1.png

After adding a simple task this is the size:

pastedImage_2.png

And after adding the semaphore support this is the size:

pastedImage_3.png

Best Regards,

Alexis Andalon

0 Kudos

22 Views
Contributor II

Hello Alexis,

Thank you for the reply. The difference in flash usage is interesting.

I just drag and drop a FreeRTOS component into the Prosessor Expert, generate code, and call "xTaskCreate(demoTask, "demo", configMINIMAL_STACK_SIZE, (void *) 0, tskIDLE_PRIORITY , NULL)" in the code. and nothing more.

I just checked the example code. I don't understand what is makeing this big difference. any hints or idea?

Thank you.

Best regards,

Leila

0 Kudos

22 Views
NXP TechSupport
NXP TechSupport

Hello Leila,

I also did the same process as you but the difference in size is around 1Kb, so I'm thinking this could be due to the software difference.

I'm using the S32 Design Studio 2.2 so you could try updating the IDE.

Best Regards,

Alexis Andalon

0 Kudos