How to Place Custom Data into SRAM for S32K146 Using S32 Design Studio for ARM?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to Place Custom Data into SRAM for S32K146 Using S32 Design Studio for ARM?

跳至解决方案
683 次查看
Chandler_L
Contributor II
Hi NXP Support Team: I am currently working on a project using the S32K146 microcontroller and the S32 Design Studio for ARM development environment. I would like to place custom data into SRAM for my application but am unsure of the correct procedure to achieve this. I would appreciate any documentation, examples, or instructions that could help me implement this in my project. Thank you for your time and assistance. I look forward to your response. #S32K
0 项奖励
回复
1 解答
666 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@LaiBighead

Please refero to this post, you can use "attribute" to place data to specific address.

https://community.nxp.com/t5/S32-Design-Studio/How-can-S32K-define-a-variable-in-a-specified-address...

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
667 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@LaiBighead

Please refero to this post, you can use "attribute" to place data to specific address.

https://community.nxp.com/t5/S32-Design-Studio/How-can-S32K-define-a-variable-in-a-specified-address...

 

0 项奖励
回复
655 次查看
Chandler_L
Contributor II

Hi@LSenlent :

I appreciate your help,  I have defined a memory region in the linker script with a length of 4 bytes as shown below:

oem_ram (RW) : ORIGIN = 0x20002A0A, LENGTH = 0x00000004 

._oem_ram :
{
KEEP(*(._oem_ram ))
} > oem_ram

In (.c) file

uint8_t DID_F183_PRO_CODE[4] __attribute__((section(".oem_did_data_ram_area2"))) = { 0xFF, 0xFF, 0xFF, 0xFF };

However, I am receiving the following error during the build process:

Ld error: region `oem_ram' overflowed by 2 bytes

ECU_APP_DemoProject.elf section `._oem_ram ' will not fit in region `oem_ram' 

This suggests that the data segment's actual size exceeds the allocated 4-byte region, causing an overflow. I am unable to understand the exact reason for this overflow, as the data I have defined is just 4 bytes in size.

Could you please help me understand why this overflow is happening and what might be causing the data size to exceed the allocated 4 bytes?

 

I have a question regarding operations in the .id file. Specifically, I would like to know how to copy a custom Flash data segment to SRAM during startup in the S32K146 environment, using S32Studio for ARM.

In other development environments (such as CodeWarrior), I am familiar with the syntax:

cal_flash:             org = 0x00009000,   len = 0x00002000

cal_ram:              org = 0x40001000, len = 0x00001800

_cal_ram LOAD(ADDR(cal_flash)): {} > cal_ram

Could you please guide me on how to implement this operation in S32K146 using S32Studio for ARM?

 

0 项奖励
回复
617 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@Chandler_L

I have told you how to put data in a specified RAM space.

For more syntax rules, please Google it.

0 项奖励
回复