S32K310 SRAM overflowed

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

S32K310 SRAM overflowed

跳至解决方案
1,438 次查看
khty
Contributor I

S32K3 AUTOMOTIVE-RTD 

 

This week, when I was building the peripherals for an S32K310 project in my IDE, it reported an SRAM overflow error.

khty_2-1766049415447.pngkhty_2-1766049415447.png

 

But, my project is brand new, and the main function is empty. There is no application code at all; I have only configured the necessary peripherals for my MCU.

I checked the demo_310.map file to determine what was causing the excessive memory usage.

khty_3-1766049731958.pngkhty_3-1766049731958.png

I found that one of the files within the RTD package is taking up a significant amount of SRAM space. The SRAM address range for K310 is from 0×20400000 to 0×20404000, but the address allocation has now reached 0x20404200.

The RTD/src/SchM_Gpt file alone occupies more than 2KB of space. Knowing that the external SRAM space for the S32K310 MCU is only 16KB, I believe there must be some issues within the RTD package.

 

I opened the corresponding file and found the issue shown in the figure below.

khty_4-1766050734693.pngkhty_4-1766050734693.png

As shown in the figure, in the file, the length of the variable definition is set to 4 . I understand that this was prepared for multi-core systems. However, in my current project using S32K310, which has only one core, the RTD package still sets the number of cores to 4. This results in the space occupied by variables being expanded by a factor of four.

 

After adjusting the core number configuration and rebuild the project, I can see that the space occupied by RTD/src/SchM_Gpt has decreased from 0x860 to 0x218, which is quite significant.

khty_6-1766051445731.pngkhty_6-1766051445731.png

 

 

So, please explain why a single-core device like the S32K310 still sets the number of cores to 4. Is this a bug?

 

 

The version I am using is as follows:

S32S32 Design Studio for  S32 Platform 3.6.2

S32K3_RTD_6_0_0_D2506_ASR_REL_4_7_REV_0000_20250610

I have also uploaded my project files in the attachment for your confirmation.

I look forward to your reply very much because this is important to me.

Thank you.

0 项奖励
回复
1 解答
1,198 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@khty

I received a reply from the design team, and they confirmed that this is a bug.

For now, you can manually change the number of cores to 1.

I will notify you again when there is an official workaround or version fix.

 

Solution:

#ifndef NUMBER_OF_CORES
#define NUMBER_OF_CORES         (uint8)(M4_GET_SUB_PARAM(1,M4_XDM_USER_PARAM_1)U)
#endif

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,199 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@khty

I received a reply from the design team, and they confirmed that this is a bug.

For now, you can manually change the number of cores to 1.

I will notify you again when there is an official workaround or version fix.

 

Solution:

#ifndef NUMBER_OF_CORES
#define NUMBER_OF_CORES         (uint8)(M4_GET_SUB_PARAM(1,M4_XDM_USER_PARAM_1)U)
#endif
0 项奖励
回复
1,238 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@khty

I have reported this issue to the RTD design team, and it will take some time to get a response.

%3CLINGO-SUB%20id%3D%22lingo-sub-2265998%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K310%20SRAM%20%E6%BA%A2%E5%87%BA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2265998%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FS32K3%2Fpd-p%2FS32K3%22%20class%3D%22lia-product-mention%22%20data-product%3D%221688-1%22%20target%3D%22_blank%22%3ES32K3%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FAUTOMOTIVE-RTD%2Fpd-p%2FAUTOMOTIVE-RTD%22%20class%3D%22lia-product-mention%22%20data-product%3D%222258-1%22%20target%3D%22_blank%22%3EAutomotive-Rtd%3C%2FA%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E6%9C%AC%E5%91%A8%EF%BC%8C%E5%BD%93%E6%88%91%E5%9C%A8%E9%9B%86%E6%88%90%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E4%B8%AD%E4%B8%BA%20S32K310%20%E9%A1%B9%E7%9B%AE%E6%9E%84%E5%BB%BA%E5%A4%96%E8%AE%BE%E6%97%B6%EF%BC%8C%E5%AE%83%E6%8A%A5%E5%91%8A%E4%BA%86%20SRAM%20%E6%BA%A2%E5%87%BA%E9%94%99%E8%AF%AF%E3%80%82%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22khty_2-1766049415447.png%22%20style%3D%22width%3A%20727px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_2-1766049415447.png%22%20style%3D%22width%3A%20727px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_2-1766049415447.png%22%20style%3D%22width%3A%20727px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_2-1766049415447.png%22%20style%3D%22width%3A%20727px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370587i32589055761905EB%2Fimage-dimensions%2F727x360%3Fv%3Dv2%22%20width%3D%22727%22%20height%3D%22360%22%20role%3D%22button%22%20title%3D%22khty_2-1766049415447.png%22%20alt%3D%22khty_2-1766049415447.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ekhty_2-1766049415447.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%40Smartling%20Language%20Service%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E6%88%91%E7%9A%84%E9%A1%B9%E7%9B%AE%E6%98%AF%E5%85%A8%E6%96%B0%E7%9A%84%EF%BC%8C%E4%B8%BB%E5%8A%9F%E8%83%BD%E6%98%AF%E7%A9%BA%E7%9A%84%E3%80%82%E6%A0%B9%E6%9C%AC%E6%B2%A1%E6%9C%89%E5%BA%94%E7%94%A8%E4%BB%A3%E7%A0%81%EF%BC%8C%E6%88%91%E5%8F%AA%E6%98%AF%E4%B8%BA%E6%88%91%E7%9A%84%20MCU%20%E9%85%8D%E7%BD%AE%E4%BA%86%E5%BF%85%E8%A6%81%E7%9A%84%E5%A4%96%E8%AE%BE%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E6%A3%80%E6%9F%A5%E4%BA%86%20demo_310.map%20%E6%96%87%E4%BB%B6%EF%BC%8C%E4%BB%A5%E7%A1%AE%E5%AE%9A%E5%86%85%E5%AD%98%E4%BD%BF%E7%94%A8%E8%BF%87%E5%A4%9A%E7%9A%84%E5%8E%9F%E5%9B%A0%E3%80%82%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22khty_3-1766049731958.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_3-1766049731958.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_3-1766049731958.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_3-1766049731958.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370592i6BBC16C886CCF0C1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22khty_3-1766049731958.png%22%20alt%3D%22khty_3-1766049731958.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ekhty_3-1766049731958.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E6%88%91%E5%8F%91%E7%8E%B0%20RTD%20%E4%BB%A3%E7%A0%81%E5%8C%85%E4%B8%AD%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%87%E4%BB%B6%E5%8D%A0%E7%94%A8%E4%BA%86%E5%A4%A7%E9%87%8F%E7%9A%84%20SRAM%20%E7%A9%BA%E9%97%B4%E3%80%82K310%20%E7%9A%84%20SRAM%20%E5%9C%B0%E5%9D%80%E8%8C%83%E5%9B%B4%E4%B8%BA%200%C3%9720400000%20%E8%87%B3%200%C3%9720404000%EF%BC%8C%E4%BD%86%E7%8E%B0%E5%9C%A8%E7%9A%84%E5%9C%B0%E5%9D%80%E5%88%86%E9%85%8D%E5%B7%B2%E8%BE%BE%E5%88%B0%200x20404200%E3%80%82%3C%2FP%3E%3CP%3E%E4%BB%85%20RTD%2Fsrc%2FSchM_Gpt%20%E6%96%87%E4%BB%B6%E5%B0%B1%E5%8D%A0%E7%94%A8%E4%BA%86%E8%B6%85%E8%BF%87%202KB%20%E7%9A%84%E7%A9%BA%E9%97%B4%E3%80%82%E6%88%91%E7%9F%A5%E9%81%93%20S32K310%20MCU%20%E7%9A%84%E5%A4%96%E9%83%A8%20SRAM%20%E7%A9%BA%E9%97%B4%E5%8F%AA%E6%9C%89%2016KB%EF%BC%8C%E6%88%91%E7%9B%B8%E4%BF%A1%20RTD%20%E8%BD%AF%E4%BB%B6%E5%8C%85%E4%B8%AD%E8%82%AF%E5%AE%9A%E5%AD%98%E5%9C%A8%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E6%88%91%E6%89%93%E5%BC%80%E4%BA%86%E7%9B%B8%E5%BA%94%E7%9A%84%E6%96%87%E4%BB%B6%EF%BC%8C%E5%8F%91%E7%8E%B0%E4%BA%86%E4%B8%8B%E5%9B%BE%E6%89%80%E7%A4%BA%E7%9A%84%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22khty_4-1766050734693.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_4-1766050734693.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_4-1766050734693.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_4-1766050734693.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370597iA3D71B219E4C2B23%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22khty_4-1766050734693.png%22%20alt%3D%22khty_4-1766050734693.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ekhty_4-1766050734693.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E5%A6%82%E5%9B%BE%E6%89%80%E7%A4%BA%EF%BC%8C%E5%9C%A8%E6%96%87%E4%BB%B6%E4%B8%AD%EF%BC%8C%E5%8F%98%E9%87%8F%E5%AE%9A%E4%B9%89%E7%9A%84%E9%95%BF%E5%BA%A6%E8%AE%BE%E7%BD%AE%E4%B8%BA%204%E3%80%82%E6%88%91%E7%9F%A5%E9%81%93%E8%BF%99%E6%98%AF%E4%B8%BA%E5%A4%9A%E6%A0%B8%E7%B3%BB%E7%BB%9F%E5%87%86%E5%A4%87%E7%9A%84%E3%80%82%E4%BD%86%E6%98%AF%EF%BC%8C%E5%9C%A8%E6%88%91%E7%9B%AE%E5%89%8D%E4%BD%BF%E7%94%A8%E5%8F%AA%E6%9C%89%E4%B8%80%E4%B8%AA%E5%86%85%E6%A0%B8%E7%9A%84%20S32K310%20%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD%EF%BC%8CRTD%20%E8%BD%AF%E4%BB%B6%E5%8C%85%E4%BB%8D%E7%84%B6%E5%B0%86%E5%86%85%E6%A0%B8%E6%95%B0%E9%87%8F%E8%AE%BE%E7%BD%AE%E4%B8%BA%204%E3%80%82%E8%BF%99%E4%BC%9A%E5%AF%BC%E8%87%B4%E5%8F%98%E9%87%8F%E5%8D%A0%E7%94%A8%E7%9A%84%E7%A9%BA%E9%97%B4%E6%89%A9%E5%A4%A7%E5%9B%9B%E5%80%8D%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E8%B0%83%E6%95%B4%E6%A0%B8%E5%BF%83%E7%BC%96%E5%8F%B7%E9%85%8D%E7%BD%AE%E5%B9%B6%E9%87%8D%E5%BB%BA%E9%A1%B9%E7%9B%AE%E5%90%8E%EF%BC%8C%E6%88%91%E5%8F%AF%E4%BB%A5%E7%9C%8B%E5%88%B0%20RTD%2Fsrc%2FSchM_Gpt%20%E5%8D%A0%E7%94%A8%E7%9A%84%E7%A9%BA%E9%97%B4%E4%BB%8E%200x860%20%E9%99%8D%E8%87%B3%200x218%EF%BC%8C%E8%BF%99%E6%98%AF%E7%9B%B8%E5%BD%93%E5%8F%AF%E8%A7%82%E7%9A%84%E3%80%82%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22khty_6-1766051445731.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_6-1766051445731.png%22%20style%3D%22width%3A%20399px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_6-1766051445731.png%22%20style%3D%22width%3A%20399px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22khty_6-1766051445731.png%22%20style%3D%22width%3A%20399px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370600iA64C0662F26EEFBE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22khty_6-1766051445731.png%22%20alt%3D%22khty_6-1766051445731.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ekhty_6-1766051445731.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%E5%9B%A0%E6%AD%A4%EF%BC%8C%E8%AF%B7%E8%A7%A3%E9%87%8A%E4%B8%BA%E4%BB%80%E4%B9%88%E5%83%8F%20S32K310%20%E8%BF%99%E6%A0%B7%E7%9A%84%E5%8D%95%E6%A0%B8%E8%AE%BE%E5%A4%87%E4%BB%8D%E7%84%B6%E5%B0%86%E5%86%85%E6%A0%B8%E6%95%B0%E8%AE%BE%E7%BD%AE%E4%B8%BA%204%E3%80%82%E8%BF%99%E6%98%AF%E9%94%99%E8%AF%AF%E5%90%97%EF%BC%9F%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%E6%88%91%E4%BD%BF%E7%94%A8%E7%9A%84%E7%89%88%E6%9C%AC%E5%A6%82%E4%B8%8B%EF%BC%9A%3C%2FP%3E%3CP%3E%E7%94%A8%E4%BA%8E%20S32%20%E5%B9%B3%E5%8F%B0%E7%9A%84%20S32S32%20Design%20Studio%203.6.2%3C%2FP%3E%3CP%3E%3CSPAN%3ES32K3_RTD_6_0_0_D2506_ASR_REL_4_7_REV_0000_20250610%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E6%88%91%E8%BF%98%E5%9C%A8%E9%99%84%E4%BB%B6%E4%B8%AD%E4%B8%8A%E4%BC%A0%E4%BA%86%E6%88%91%E7%9A%84%E9%A1%B9%E7%9B%AE%E6%96%87%E4%BB%B6%EF%BC%8C%E4%BE%9B%E6%82%A8%E7%A1%AE%E8%AE%A4%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E9%9D%9E%E5%B8%B8%E6%9C%9F%E5%BE%85%E6%82%A8%E7%9A%84%E7%AD%94%E5%A4%8D%EF%BC%8C%E5%9B%A0%E4%B8%BA%E8%BF%99%E5%AF%B9%E6%88%91%E5%BE%88%E9%87%8D%E8%A6%81%E3%80%82%3C%2FP%3E%3CP%3E%E8%B0%A2%E8%B0%A2%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2269540%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K310%20SRAM%20overflowed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269540%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EHi%40khty%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E6%88%91%E5%B7%B2%E7%BB%8F%E5%90%91%20RTD%20%E8%AE%BE%E8%AE%A1%E5%9B%A2%E9%98%9F%E6%8A%A5%E5%91%8A%E4%BA%86%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%EF%BC%8C%E9%9C%80%E8%A6%81%E4%B8%80%E4%BA%9B%E6%97%B6%E9%97%B4%E6%89%8D%E8%83%BD%E5%BE%97%E5%88%B0%E5%9B%9E%E5%A4%8D%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2269732%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K310%20SRAM%20overflowed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269732%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EHi%40khty%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E6%88%91%E6%94%B6%E5%88%B0%E4%BA%86%E8%AE%BE%E8%AE%A1%E5%9B%A2%E9%98%9F%E7%9A%84%E5%9B%9E%E5%A4%8D%EF%BC%8C%E4%BB%96%E4%BB%AC%E7%A1%AE%E8%AE%A4%E8%BF%99%E6%98%AF%E4%B8%80%E4%B8%AA%E9%94%99%E8%AF%AF%E3%80%82%3C%2FP%3E%0A%3CP%3E%E7%9B%AE%E5%89%8D%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E6%89%8B%E5%8A%A8%E5%B0%86%E5%86%85%E6%A0%B8%E6%95%B0%E6%94%B9%E4%B8%BA%201%E3%80%82%3C%2FP%3E%0A%3CP%3E%E5%BD%93%E6%9C%89%E6%AD%A3%E5%BC%8F%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95%E6%88%96%E7%89%88%E6%9C%AC%E4%BF%AE%E5%A4%8D%E6%97%B6%EF%BC%8C%E6%88%91%E4%BC%9A%E5%86%8D%E6%AC%A1%E9%80%9A%E7%9F%A5%E6%82%A8%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E