1

With the DMA continuous requests, the program will just loop in DMA1_Channel1_IRQHandler and the FreeRTOS thread is not running.

Does anyone have any idea how to resolve this?

{

  HAL_Init();


  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_ADC1_Init();
  MX_I2C2_Init();
  MX_IWDG_Init();
  MX_USART1_UART_Init();
  MX_USART2_UART_Init();
  /* USER CODE BEGIN 2 */
  uprintf("Before dma\n");
  HAL_ADC_Start_DMA(&hadc1, adcBuffer, 2);
  uprintf("After dma\n");

  /* Call init function for freertos objects (in freertos.c) */
  MX_FREERTOS_Init();

  /* Start scheduler */
  osKernelStart();

  /* We should never get here as control is now taken by the scheduler */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
  }
  /* USER CODE END 3 */
}
Satyam Miri
  • 33
  • 1
  • 6

1 Answers1

2

It sounds like your DMA channel has higher priority (NVIC priority) than the FreeRTOS task (NVIC priority) and is starving the scheduler. For troubleshooting, try setting your DMA channel to match FreeRTOS task setting (NVIC priority), or elevate the FreeRTOS to a higher priority than the DMA.

Setting the DMA to continuous requests probably is not the desired configuration for your application, or it just might be.

abonneville
  • 334
  • 2
  • 5