S32K344 S32DS Opening the DMA module causes static variables not to be initialized

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

S32K344 S32DS Opening the DMA module causes static variables not to be initialized

跳至解决方案
1,384 次查看
_tian_10
Contributor I

Hi all! 

        In the S32DS development environment, the addition of the DMA RTD module caused the static variable to be incorrectly initialized and the value to be 0. The chip is not operating properly, and it is in HardFault_Handler.

       Details are as follows:

After DMA is configured, the content in the screenshot section of the added configuration file may cause this situation.

_tian_10_0-1716373236217.png

It causes the static variable to have an initial state of 0 instead of an initial value, as follows:(Observe the variable before it is run and just entered debugging state)

_tian_10_1-1716373793799.png

How to set up to avoid this situation?  Thanks very much!

Best Regards

tian

 

 

0 项奖励
回复
1 解答
1,337 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @_tian_10 

Please test if you have the same behavior with any example that uses DMA. Also, there is the possibility that a wrong memory allocation is causing abnormal code execution, so please verify the linker file. 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,368 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @_tian_10 

Please provide more details about the situation. Also, if possible provide the steps to reproduce the issue. 

 

B.R.

VaneB

0 项奖励
回复
1,347 次查看
_tian_10
Contributor I

Hi VaneB!

 Thank you for your attention! 

 Today I did some careful debugging again and found some problems with the data and bss initializer functions.(init_data_bss)as follow:

_tian_10_0-1716453548403.png

The function here is to load the initialization data in ROM into RAM, but at this time the ROM address content actually points to the RAM space, and the contents of the RAM address space are all 0.

I don't know why this is the case, in the correct project the ROM address points to the ROM space, like the following:

_tian_10_1-1716454115368.png

Look forward to your reply!

Best Regards

tian

 

0 项奖励
回复
1,338 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @_tian_10 

Please test if you have the same behavior with any example that uses DMA. Also, there is the possibility that a wrong memory allocation is causing abnormal code execution, so please verify the linker file. 

0 项奖励
回复
1,293 次查看
_tian_10
Contributor I

Hi VaneB!

     Many thanks for your replying.The problem has been solved。The ld file is not modified when SPD is transplanted,A conflict occurs after the DMA module is added。

    Is there any reference document for SPD transplantation or related materials? The modification of ld file was ignored due to insufficient materials.

Best Regards

tian

0 项奖励
回复