2019-03-11 03:58 AM
From LL_ADC_SetChannelSingleDiff:
/* Bits of channels in single or differential mode are set only for */
/* differential mode (for single mode, mask of bits allowed to be set is */
/* shifted out of range of bits of channels in single or differential mode. */
The assumption that it is ok to shift the bits out of the register is wrong, because it is undefined bahviour: C11 6.5.7 / http://c0x.coding-guidelines.com/6.5.7.html
This causes gcc (https://godbolt.org/z/eH-T_m), as well as clang (and therefore probably armcc, too), to replace the bic-instruction with an orr-instruction; inverting the intent.
The reasoning why they do that can be found here:
2019-03-13 01:46 AM
Hello Morty,
Thanks for reports this issue.
We will look on this issue, then we will keep you updated.
Kind Regards,
Imen
2019-08-20 02:49 AM
Hello @Moritz Strübe ,
This issue will be fixed on the coming release of all relevant STM32 series.
Thank you for your contribution.
Best Regards,
Imen