cancel
Showing results for 
Search instead for 
Did you mean: 

Fix for STM32F0xx StdPeriph Lib

oliver
Associate
Posted on July 21, 2014 at 15:54

Hello,

I just ran into a trap with STM32F0xx_StdPeriph_Lib_V1.3.1 and have a suggestion for a fix. In function ADC_ChannelConfig() of file stm32f0xx_adc.c, the line 724

ADCx->CHSELR |= (uint32_t)ADC_Channel;

activates the selected channel. Previously selected channels remain selected. In my opinion this behaviour is misleading, also considering the function documentation header. Furthermore there is no function to de-select the previously selected channels, so I have to break with hardware abstraction in my code and clear CHSEL manually. My suggestion is to change line 724 to

ADCx->CHSELR = (uint32_t)ADC_Channel;

which actually configures the selection passed by parameter without having a ''memory effect''. This is already changed in Cube FW, so it would also be consistent with it. Oliver
1 REPLY 1
Posted on January 26, 2015 at 16:40

Hi Oliver,

Thanks for the valuable feedback. I've logged your fix suggestion under the STM32 SPL F0 bugs list. Keep an eye for next updates.

Regards,

Heisenberg.