DMA CHn_ES Bit Assertion Issue on S32K312 Development Board

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

DMA CHn_ES Bit Assertion Issue on S32K312 Development Board

跳至解决方案
724 次查看
dongxun
Contributor II

Dear Technical Support Team,

    We are facing a critical issue with the DMA module on the S32K312 development board where the CHn_ES (Channel Error Status) bit is being unexpectedly set, leading to program freezes. Here are the details:

  1. Configuration:

    • Toolchain: EB Tresos (EB 28) for peripheral configuration.
    • ADC Setup: ADC0 and ADC1 configured with ADC_DMA interrupts for data transfer.
    • DMAMUX: Configured in the MCL to route ADC triggers to DMA channels.
  2. Issue:

    • After initializing the MCL and running the code (see snippet below), the CHn_ES bit asserts immediately, halting the system.
    • The error persists despite correct DMA transfer configurations. Power cycling is required to clear the error. Software reset cannot solve the problem.
    • A similar unresolved case was referenced here: https://community.nxp.com/t5/S32K/Dma-transfer-on-S32K310/m-p/1938347.
  3. Code Snippet:

void IoHwAdc_SetupInit(void)
{
   Adc_Calibrate(0U, &iohwadc_hw_uint0_calib_status);
   while(E_OK != iohwadc_hw_uint0_calib_status.AdcUnitSelfTestStatus) {};
   Adc_Calibrate(1U, &iohwadc_hw_uint1_calib_status);
   while(E_OK != iohwadc_hw_uint1_calib_status.AdcUnitSelfTestStatus) {};

   Mcl_SetDmaChannelTransferList(DMA_LOGIC_CH_4, DmaCh_TransferList, IOHWADC_DMA_CH0_CONFIG_LIST_DIMENSION);
   Mcl_SetDmaChannelTransferList(DMA_LOGIC_CH_3, DmaCh_TransferList, IOHWADC_DMA_CH0_CONFIG_LIST_DIMENSION);

}​

4. EB configuration

dongxun_0-1749030396825.pngdongxun_1-1749030435519.pngdongxun_2-1749030473652.png

 

5.  Read Register

dongxun_3-1749030528090.png

 

Request for Assistance:

  • Could this be caused by DMAMUX/DMA channel misconfiguration or a known hardware/software defect?
  • Are there specific initialization sequences or errata patches for the S32K312 DMA subsystem?
  • How can we reliably prevent CHn_ES assertion during startup?

Best regards,

dongxun.

 

 

标记 (1)
0 项奖励
回复
1 解答
670 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @dongxun,

The clock configuration in the MCU driver is incorrect.

You selected 120MHz for the core:

danielmartynek_0-1749113285963.png

Which means you have Option B - Reduced Speed mode (CORE_CLK @ 120 MHz) RM rev10, Table 158. 

However, both AIPS clocks are set to 40MHz.

danielmartynek_2-1749113438861.png

It should be set to 60MHz (PLAT) and 30MHz (SLOW).

Otherwise we cannot guarantee the functionality of the MCU, it can behave unpredictable.

 

The clock configuration does not have to follow the options precisely (Option B, in this case), but the ratios between the clocks must.

danielmartynek_3-1749113643866.png

 

Best regards,

Daniel

 

 

 

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
707 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @dongxun,

I see there is a bus error on the source.

And the source address is not configured:

danielmartynek_0-1749047438674.png

Double check the DMA configuration in EB tresos.

Can you share the project or the configuration .xdm files?

Which RTD revision do you use?

 

Regards,

Daniel

 

 

0 项奖励
回复
690 次查看
dongxun
Contributor II

Hi Daniel Martynek,

Thank you for your reply. I've attached the xdm files. We are using RTD version "SW32K3_RTD_4.4_2.0.2_D2211".

I want to mention that this issue is intermittent. Two of my colleagues frequently encounter it, while others do not experience it at all. Personally, the program runs fine in the evening before I leave work, but when I reopen the debugger and upload it in the morning, it goes into ErrorHook. Additionally, the problematic DMA channels are Channel 3 and Channel 4, which are designated for ADC services.

Best regards,

dongxun

标记 (1)
0 项奖励
回复
671 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @dongxun,

The clock configuration in the MCU driver is incorrect.

You selected 120MHz for the core:

danielmartynek_0-1749113285963.png

Which means you have Option B - Reduced Speed mode (CORE_CLK @ 120 MHz) RM rev10, Table 158. 

However, both AIPS clocks are set to 40MHz.

danielmartynek_2-1749113438861.png

It should be set to 60MHz (PLAT) and 30MHz (SLOW).

Otherwise we cannot guarantee the functionality of the MCU, it can behave unpredictable.

 

The clock configuration does not have to follow the options precisely (Option B, in this case), but the ratios between the clocks must.

danielmartynek_3-1749113643866.png

 

Best regards,

Daniel

 

 

 

 

0 项奖励
回复