how to place function in ram section?

cancel
Showing results for 
Search instead for 
Did you mean: 

how to place function in ram section?

380 Views
myna
Contributor III

Hello. nxp team.

Now I am using s32k118 and sdk3.0.

Could you please let me know How to place function in ram section?

I have a problem about using Flash Driver.

The cause of my problem is that 'FLASH_DRV_CommandSequence' is not loaded ram section.

fsl_flash_driver_c90tfs.c --> FlashCommandSequence is loaded ram section.

flash_driver.c -->FLASH_DRV_CommandSequence is not loaded ram section.

Could you please let me know difference of two files?

and

how to solve this problem?(How to load function to ram section)

Thank you.

best regards.

Labels (1)
0 Kudos
3 Replies

258 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

One option to place function into RAM is:
__attribute__((section (".code_ram"))) void MyFuncInRAM (void);

However, you can see that the FLASH_DRV_CommandSequence or FlashCommandSequence functions are placed in RAM between:

START_FUNCTION_DEFINITION_RAMSECTION
END_FUNCTION_DEFINITION_RAMSECTION

flash_driver.c is generated by SDK after adding a flash component in the S32DS project.

Usage can be seen in the example of flash_partitioning_s32k118.
The usage of fsl_flash_driver_c90tfs.c can be seen in nonSDK example such as AN12218SW

I hope it helps.

Best regards,

Diana

0 Kudos

258 Views
myna
Contributor III

Hello Diana Batrlova.

Thank you for answer my question.

But, Your guide doesn't work for my project.

I checked the map file.

In a flash_partitioning_s32k118 project, FLASH_DRV_CommandSequence is loaded on ram.

But, In my project, FLASH_DRV_CommandSequence is not loaded on ram.

Is there anything else to do? 

Could you please check my project why any function is not loaded on ram?

i did upload my project(s32k118_bootloader_sdk.zip).

Thank you.

Best Regards

0 Kudos

258 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

I can see that you combined AN12218SW with the SDK flash_partitioning_S32K118 example. 

Unfortunately, I cannot debug your code.

It is not needed to put the JumpToApplication function into RAM.

I assume that the issue is somewhere else because the FLASH_DRV_CommandSequence is placed in RAM between:

START_FUNCTION_DEFINITION_RAMSECTION
END_FUNCTION_DEFINITION_RAMSECTION

Have you tried debug your code? What happens when you call FLASH_DRV_DEFlashPartition?

Best regards,

Diana

0 Kudos