2133843_en-US

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

2133843_en-US

2133843_en-US

SPD and DMA modules are used at the same time, a hardfault will occur

Hi team,

I encountered some problems when testing SPD.

As long as I use DMA and SPD modules at the same time, the program will enter hardfault.

The strange thing is that I didn't even include these drivers, but I still encountered such errors.

Senlent_0-1750844105314.png

Attached is the test project, which is actually the routine in S32 DS (S32 DS V3.5 + RTD 5.0.0+SPD 1.0.5), adding SPD components and DMA.

thanks for you help always.

BR,jim.


RTDS32_CONFIG_TOOLS32DSSafety_SWRe: SPD and DMA modules are used at the same time, a hardfault will occur

Hi @cuongnguyenphu 

one more finding:
RTD Port example enables MPU in the startup, when you disable MPU, the bus fault is not happening.

This is instruction causing the issue:

RadoslavB_1-1753258418918.png
as you can see it resides in MPU Region 6 where I don't see any issue with that.
If I do write into the address 0x2040938 via Lauterbach it's not a problem.

Anyway disabling MPU helped, so not sure what's going on now.
I'm leaving for vacation today so I can't support until 1st August.

Kind Regards,
Radoslav

Re: SPD and DMA modules are used at the same time, a hardfault will occur

Hi@ @cuongnguyenphu 

Thanks for your help, is there any way we can avoid this problem or how to explain it to customers? Or is this a bug?

Re: SPD and DMA modules are used at the same time, a hardfault will occur

Hi @cuongnguyenphu ,

when adding the SAF drivers, I'd add correctly SAF mem sections into linker file (not relying on default placement) and maybe examine size of regions if there is enough reserve.

I can now confirm just the fact that original SIUL2 example + SAF does work, but + DMA doesn't.

Kind Regards,
Radoslav

Re: SPD and DMA modules are used at the same time, a hardfault will occur

Hi @RadoslavB ,
I see the hardfault happend when I add eMCEM and SafetyBase to our working project, even we doesn't call any APIs from it SPD APIs.
When deeper investigate, I see it raised a Bus fault error when trying to access 0x20430938.
I'm wonder did I missed any steps when include eMCEM and SafetyBase module?
Below is my debugging screenshot and .map file
1. Add eMCeM and SafetyBase:

cuongnguyenphu_0-1753087283225.png


2. SBC->BFAR:

cuongnguyenphu_1-1753087385051.png


3. Program counter when Hardfault:

cuongnguyenphu_2-1753087539780.png


4. Map file:

Re: SPD and DMA modules are used at the same time, a hardfault will occur

Hi @Senlent 
Yes I can reporduce the issue at my side. it jumped to hardfault when trying to access exclusive area.
It seems that when adding SPD/DMA, there're memory protection of the address exclusive area

Re: SPD and DMA modules are used at the same time, a hardfault will occur

Hi@ cuongnguyenphu

Thank you very much for your help, could you please let me know if you can reproduce the problem?

Re: SPD and DMA modules are used at the same time, a hardfault will occur

Hi @Senlent 
Let me check this issue and feedback to you soon


Tags (1)
No ratings
Version history
Last update:
‎11-21-2025 09:43 AM
Updated by: