Skip to main content
Reza Hosseinzadeh
Associate
June 21, 2017
Question

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

  • June 21, 2017
  • 1 reply
  • 1200 views
Posted on June 21, 2017 at 09:25

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 ?!

#dma #stm32mattarget #adc #c-code
This topic has been closed for replies.

1 reply

Nickname12840_O
Associate
June 21, 2017
Posted on June 21, 2017 at 17:10

Hi Reza,

this is because L0/F0 families are not supported.

Generated code doesn't make any sense.

Best regards

Pascal

Reza Hosseinzadeh
Associate
June 21, 2017
Posted on June 21, 2017 at 17:50

REYNAUD.PASCAL

Hi reynaud,

So can you please tell me which MCU families are supported by the stm32mattarget and among them which is known to be the most compatible and with the least possible issues?

Regards

Reza

Nickname12840_O
Associate
June 22, 2017
Posted on June 22, 2017 at 11:08

Hi Reza,

STM32-MAT/TARGET is generic and should be available for all STM32 .. except 0 families (F0/L0).

Best regards

Pascal REYNAUD