2025-06-05 4:32 AM - edited 2025-06-05 4:45 AM
Hi,
The example for FSBL works as described
But if the same approach is applied to Appli (Secure) code, the "User Setting Error" raised in DMA IRQ.
I use the XIP configuration.
Could you please elaborate chages to be made in Secure code?
2025-06-05 4:43 AM
Looks like I am not alone with this
2025-06-05 4:44 AM
BTW, I played with MPU regions, and even disabled the MPU at all. It had no effect.
2025-06-18 2:27 AM - edited 2025-06-18 9:15 AM
I am having the same issue with "User Setting Error" on GPDMA.
Edit: I found the root of my issue. I based my code off the example ADC_SingleConversion_TriggerTimer_DMA for the NUCLEO-N657X0-Q, instead of FSBL I used secure application. So if anyone else sees the same error this is the cause.
The problem is in two places.
if (HAL_DMA_ConfigChannelAttributes(&handle_GPDMA1_Channel0,DMA_CHANNEL_SEC|DMA_CHANNEL_NPRIV)!= HAL_OK )
{
Error_Handler();
}
if you attach any peripheral (such as ADC) to the GPDMA in the application context you will see another call to this method in stm32n6xx_hal_msp.c HAL_ADC_MspInit
if (HAL_DMA_ConfigChannelAttributes(&handle_GPDMA1_Channel0, DMA_CHANNEL_PRIV|DMA_CHANNEL_SEC
|DMA_CHANNEL_SRC_SEC|DMA_CHANNEL_DEST_SEC) != HAL_OK)
{
Error_Handler();
}
it gets called before the SystemIsolation_Config one. Commenting out the second one here fixes the first issue.
default_config.BaseAddress = __NON_CACHEABLE_SECTION_BEGIN;
default_config.LimitAddress = __NON_CACHEABLE_SECTION_END;
does not work in the application context. The base and limit address is the same so if you use the __NON_CACHEABLE macros they do nothing. All you will see is zeroes at the memory addresses and the DMA user error. Changing the limit address to base address + your required buffer size allows the DMA to work.