AnsweredAssumed Answered

STM32MATTarget v4.4.1 generates c-code for adc that contains error!

Question asked by Reza Hosseinzadeh on Jun 21, 2017
Latest reply on Jun 22, 2017 by reynaud.pascal

Hello,

I am using stm32f051 and as far as I know there is no injected scan mode but when the STM32MATTarget  generates the c-code there is this line :

ADC_DataLink.InjectedCurrentRank = ADC_INJECTED_RANK_1;

which when I try to debug it I get :

Error[Pe020]: identifier "ADC_INJECTED_RANK_1" is undefined C:\MATLAB\STM32-MAT\STM32\STM32demos\CodeGeneration\su3\untitled\Src\ds.c 112

Additionally, whenever I enable DMA for the ADC, the below line is generated but I think since the array size is zero

  HAL_ADC_Start_DMA(&hadc0, (uint32_t*)&ADC_RegularConvertedValue[0], 4);

I get this error

Error[Pe020]: identifier "ADC_RegularConvertedValue" is undefined C:\MATLAB\STM32-MAT\STM32\STM32demos\CodeGeneration\su3\untitled\Src\ds.c 133

I found a similar question in the forum but the work around does n t work ( I set the dma buffer size to  2,3,4,.. )  but it does not solve the problem.

I wonder if I should switch to an older version of stm32mattarget or there is a fix for it ?!

Outcomes