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?

跳至解决方案
1,307 次查看
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 解答
1,290 次查看
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 回复数
1,291 次查看
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 项奖励
回复
1,279 次查看
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 项奖励
回复
1,241 次查看
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 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2047717%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20S32%20Design%20Studio%20for%20ARM%20%E5%B0%86%E8%87%AA%E5%AE%9A%E4%B9%89%E6%95%B0%E6%8D%AE%E6%94%BE%E5%85%A5%20S32K146%20%E7%9A%84%20SRAM%20%E4%B8%AD%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2047717%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%97%A8%EF%BC%8CNXP%20%E6%94%AF%E6%8C%81%E5%9B%A2%E9%98%9F%EF%BC%9A%E6%88%91%E7%9B%AE%E5%89%8D%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20S32K146%20%E5%BE%AE%E6%8E%A7%E5%88%B6%E5%99%A8%E5%92%8C%20S32%20Design%20Studio%20for%20ARM%20%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E5%BC%80%E5%B1%95%E4%B8%80%E4%B8%AA%E9%A1%B9%E7%9B%AE%E3%80%82%E6%88%91%E6%83%B3%E5%B0%86%E8%87%AA%E5%AE%9A%E4%B9%89%E6%95%B0%E6%8D%AE%E6%94%BE%E5%85%A5%20SRAM%20%E4%B8%AD%E4%BB%A5%E4%BE%9B%E6%88%91%E7%9A%84%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%BD%BF%E7%94%A8%EF%BC%8C%E4%BD%86%E4%B8%8D%E7%A1%AE%E5%AE%9A%E5%AE%9E%E7%8E%B0%E6%AD%A4%E7%9B%AE%E7%9A%84%E7%9A%84%E6%AD%A3%E7%A1%AE%E6%AD%A5%E9%AA%A4%E3%80%82%E6%88%91%E5%B0%86%E9%9D%9E%E5%B8%B8%E6%84%9F%E6%BF%80%E4%BB%BB%E4%BD%95%E5%8F%AF%E4%BB%A5%E5%B8%AE%E5%8A%A9%E6%88%91%E5%9C%A8%E6%88%91%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD%E5%AE%9E%E7%8E%B0%E8%BF%99%E4%B8%80%E7%82%B9%E7%9A%84%E6%96%87%E6%A1%A3%E3%80%81%E7%A4%BA%E4%BE%8B%E6%88%96%E8%AF%B4%E6%98%8E%E3%80%82%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E6%97%B6%E9%97%B4%E5%92%8C%E5%B8%AE%E5%8A%A9%E3%80%82%E6%88%91%E6%9C%9F%E5%BE%85%E6%82%A8%E7%9A%84%E5%9B%9E%E5%A4%8D%E3%80%82%23S32K%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2049512%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20S32%20Design%20Studio%20for%20ARM%20%E5%B0%86%E8%87%AA%E5%AE%9A%E4%B9%89%E6%95%B0%E6%8D%AE%E6%94%BE%E5%85%A5%20S32K146%20%E7%9A%84%20SRAM%20%E4%B8%AD%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2049512%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CSPAN%3E%3Ca%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F228185%22%3E%40Chandler_L%3C%2Fa%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E6%88%91%E5%B7%B2%E7%BB%8F%E5%91%8A%E8%AF%89%E8%BF%87%E4%BD%A0%E5%A6%82%E4%BD%95%E5%B0%86%E6%95%B0%E6%8D%AE%E6%94%BE%E5%85%A5%E6%8C%87%E5%AE%9A%E7%9A%84%20RAM%20%E7%A9%BA%E9%97%B4%E3%80%82%3C%2FP%3E%0A%3CP%3E%E6%9B%B4%E5%A4%9A%E8%AF%AD%E6%B3%95%E8%A7%84%E5%88%99%E8%AF%B7%E8%87%AA%E8%A1%8CGoogle%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2047997%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20S32%20Design%20Studio%20for%20ARM%20%E5%B0%86%E8%87%AA%E5%AE%9A%E4%B9%89%E6%95%B0%E6%8D%AE%E6%94%BE%E5%85%A5%20S32K146%20%E7%9A%84%20SRAM%20%E4%B8%AD%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2047997%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CSPAN%3E%40LaiBighead%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%E8%AF%B7%E5%8F%82%E8%80%83%E8%BF%99%E7%AF%87%E6%96%87%E7%AB%A0%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E2%80%9C%E5%B1%9E%E6%80%A7%E2%80%9D%E5%B0%86%E6%95%B0%E6%8D%AE%E6%94%BE%E7%BD%AE%E5%88%B0%E7%89%B9%E5%AE%9A%E5%9C%B0%E5%9D%80%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32-Design-Studio%2FHow-can-S32K-define-a-variable-in-a-specified-address%2Fm-p%2F731255%2Fhighlight%2Ftrue%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32-Design-Studio%2FHow-can-S32K-define-a-variable-in-a-specified-address%2Fmp%2F731255%2Fhighlight%2Ftrue%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E