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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,378 Views
_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 Kudos
Reply
1 Solution
1,331 Views
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. 

View solution in original post

0 Kudos
Reply
4 Replies
1,362 Views
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 Kudos
Reply
1,341 Views
_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 Kudos
Reply
1,332 Views
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 Kudos
Reply
1,287 Views
_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 Kudos
Reply