2025-08-19 6:52 PM - last edited on 2025-08-24 8:15 AM by Imen.D
I have been struggling with this chip for a few days now. I have code up for the STM32F072, and the STM32F100 series chips, but the GPDMA in the STM32U535 is baffling me. And no, I am not a big fan of the product notes for the GPDMA, while I've gone through them, I couldn't find much to help.
Here's the challenge; the chip fails immediately with a DMA_FLAG_DTE error, with the trigger overrun flag being set in the CSR. No idea why or where to go next after 2 days of trying to troubleshoot this. Here is the MXCube configuration:
In the code, there is a simple 8Khz WAV file stored in the "tinkles" array. Using the standard generated code from MXCube, I have attempted to just play it out the DAC with the following calls:
HAL_DAC_Start_DMA(&hdac1, DAC_CHANNEL_1, (uint32_t*)tinkles_wav, tinkles_wav_len, DAC_ALIGN_8B_R);
HAL_TIM_Base_Start(&htim2);
It *is* an 8-bit array, and I am not sure if that may be part of this. Here is the code:
/* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
void HALDelayDontWork(uint32_t t) {
uint32_t s;
for (s = 0; s < t * 32222; s++) {
}
}
void HAL_DAC_ErrorCallbackCh1(DAC_HandleTypeDef *hdac) {
// while (1) {
GPIOB->ODR ^= 0x0100; //ground the bit - to turn the LED on
HALDelayDontWork(100);
GPIOB->ODR |= 0x0100; //Turn off the PCB LED
HALDelayDontWork(100);
// }
}
/* USER CODE END 0 */
/**
* @brief The application entry point.
* @retval int
*/
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_GPDMA1_Init();
MX_DAC1_Init();
MX_FLASH_Init();
MX_RTC_Init();
MX_TIM1_Init();
MX_TIM2_Init();
MX_USB_DRD_FS_PCD_Init();
MX_FileX_Init();
MX_ICACHE_Init();
MX_SPI1_Init();
/* USER CODE BEGIN 2 */
GPIOB->ODR |= 0x0100; //Turn off the PCB LED
GPIOB->ODR |= 0x0200; //Turn off the USB LED
HAL_DAC_Start_DMA(&hdac1, DAC_CHANNEL_1, (uint32_t*)tinkles_wav, tinkles_wav_len, DAC_ALIGN_8B_R);
HAL_TIM_Base_Start(&htim2);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1) {
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
2025-08-27 5:35 AM
Figured it out. The DMA_FLAG_DTE error is thrown when the source and destination address in the DAC_Start_DMA call is not expressed as a 32-bit pointer.
2025-08-27 6:35 AM
Hello,
If you solved your issue please accept your answer as solution.
Thank you.