S32K344 SPI DMA HardFault errror

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

S32K344 SPI DMA HardFault errror

922 次查看
MyLV
Contributor I

Hello,

I configured SPI with DMA send 10 bytes to slave on 

SW32K3_RTD_4.4_1.0.0_HF02 and S32DS.

I already referred to SPI plugin's example and the following link: https://community.nxp.com/t5/S32K/Example-DMA-SPI-S32K344/td-p/1535843

https://community.nxp.com/t5/S32K/S32K3-HardFault-Error/m-p/1343310/highlight/true#M12172

I already add Platform_InstallIrqHandler() for Dma0_Ch0_IRQHandler

but I am facing to Hard-fault exception at 

/* Done shall be cleared before a new transfer is configured. */

HwAccDmaCh_SetCommand((uint32)DMA_IP_CH_CLEAR_DONE, LocHwVers, LocHwInst, LocHwCh);

The following main.c file and configured image captured.

any wrong configuration from myside?

image.pngimage.pngimage.pngimage.png

 

 

 

 

0 项奖励
回复
3 回复数

579 次查看
nehalp
Contributor III

I am seeing a similar problem trying to use Flexio I2C with DMA. I'm seeing a Hard fault at the same line. Per the MC_ME it seems all the relevant the eDMA and TCD clocks are enabled, yet I get a hardfault just after HwAccDmaCh_CmdClearDone returns.

DMA seems to be working fine for ADC, so I'm not sure if I misconfigured something through S32DS for Flexio I2C + DMA. (Note that I am also not using the higher-level AutoSAR drivers; IP driver modules only)

0 项奖励
回复

913 次查看
MyLV
Contributor I

Hi all, 
I resolved that one by enable peripheral clock inside MCU module. 

reference link as below:

https://community.nxp.com/t5/S32K/S32K344-HardFault/m-p/1389714#M13311

 

0 项奖励
回复

748 次查看
Mark_977
Contributor I
Hi MyLV,

I met exactlly the same probelm, when run to the same function will trigger hard fault.
The casue is relevant DMA TCD channel clock didn't enable.
DMA TCD clock enable is enabled channel by channel, so I forgot the channel I used is not enabled.
Your answer help me a lot!! Thank you very much!
0 项奖励
回复