3

I have an Nucleo STM32F446RE and I'm used to enable DMA Continuous Requests with ADC. But in this case, I can only select disable. Why? If it's not possible to use DMA Continuous Requests with ADC. How can I use my multi-scan ADC?

I can anyway create a DMA Stream and connect it to the ADC inside the DMA tab.

Here is some print screens.

Here I cannot select "Enable" enter image description here

But according to data sheet, I can select Enable enter image description here enter image description here

https://www.st.com/content/ccc/resource/technical/document/reference_manual/4d/ed/bc/89/b5/70/40/dc/DM00135183.pdf/files/DM00135183.pdf/jcr:content/translations/en.DM00135183.pdf

Should I just change DISBALE to ENABLE here?

static void MX_ADC1_Init(void)
{

  /* USER CODE BEGIN ADC1_Init 0 */

  /* USER CODE END ADC1_Init 0 */

  ADC_ChannelConfTypeDef sConfig = {0};

  /* USER CODE BEGIN ADC1_Init 1 */

  /* USER CODE END ADC1_Init 1 */
  /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) 
  */
  hadc1.Instance = ADC1;
  hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4;
  hadc1.Init.Resolution = ADC_RESOLUTION_12B;
  hadc1.Init.ScanConvMode = ENABLE;
  hadc1.Init.ContinuousConvMode = DISABLE;
  hadc1.Init.DiscontinuousConvMode = DISABLE;
  hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING;
  hadc1.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T8_TRGO;
  hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
  hadc1.Init.NbrOfConversion = 6;
  hadc1.Init.DMAContinuousRequests = DISABLE; // <---- HERE!? 
  hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV;
  if (HAL_ADC_Init(&hadc1) != HAL_OK)
  {
    Error_Handler();
  }
euraad
  • 1,025
  • 11
  • 30
  • If you feel that the silly "cube" wizard mismatches the alleged/advertised hardware capability, that is probably something you will have to pursue with ST in order to find out which is in error. – Chris Stratton Sep 23 '19 at 01:42
  • Is DMA2 Ch0 already in use or not enabled? – Jeroen3 Sep 23 '19 at 05:47
  • The code you show has `ContinuousConvMode = DISABLE` that doesn't sound right, your screenshot shows it is enabled. – Arsenal Sep 23 '19 at 06:52
  • ADC is one of the peripherals which should be programmed using registers. It would be programmed by you faster quicker than writing this question. Another bonus - you will know what is exactly going on. using HAL you can only guess or waste time going through its source code – 0___________ Sep 23 '19 at 07:14
  • @P__J__ Acorrding to STM. They recommend using CubeMX instead of registrers. – euraad Sep 23 '19 at 10:03
  • @Arsenal no. Have a look again :) – euraad Sep 23 '19 at 10:04
  • @Jeroen3 None of them. – euraad Sep 23 '19 at 10:05
  • @ChrisStratton CubeMX invented for a reason. To make it much simpler to set up a project. Everyone is using CubeMX and its hard to find a tutorial about how to use registers only. – euraad Sep 23 '19 at 10:09
  • Every attempt ever made to make things "simpler" has ended up making them more limited. The data manuals describing the registers exist for a reason. – Chris Stratton Sep 23 '19 at 10:30
  • @ChrisStratton yes. But in this case, there must be a bug in the software? – euraad Sep 23 '19 at 10:35
  • @DanielMårtensson sorry - but you are a very beginner and already you know what is the correct approach. Good luck – 0___________ Sep 23 '19 at 12:59
  • @P__J__ CubeMX and report bugs to STM ? – euraad Sep 23 '19 at 13:56

1 Answers1

1

Vá para a aba DMA Settings adicione ADC1 a DMA. Após será habilitada a opção Enable DMA.


Google translate says:

Go to the DMA Settings tab add ADC1 to DMA. After this the Enable DMA option will be enabled.

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393
user238412
  • 26
  • 1