Unfortunately, I have no more clue and I have no board with this MCU version to test.
Anyway, I see no reason it could not work.
You said you use PIO? Did you try with Arduino IDE?
analogRead and analogWrite troubles
Re: analogRead and analogWrite troubles
Yes, at first I try with Arduino IDE, then try and debug under PIO.fpiSTM wrote: Fri Jan 03, 2020 1:27 pm Unfortunately, I have no more clue and I have no board with this MCU version to test.
Anyway, I see no reason it could not work.
You said you use PIO? Did you try with Arduino IDE?
I did one more experiment based on your amendment at GitHub. It seems that only one line is modified and one added at variant.cpp. I had an amendment of my local variant.cpp according to your amendments.
The result it the same - the board falls into infinite loop when try to analogRead(PA3).
Re: analogRead and analogWrite troubles
It seems that I've managed to find the problem with analogRead PA_3:
There can be a mistake at line 32. Instead of #ifdef #ifndef is used. So in that case PA_3 refers to ADC3 with 3rd channel. But the rest of refers to ADC1 and ADC2. So, I've commented 46 and added 47 with ADC2. After that it started to work.
That is in file PeripheralPins.c from variant. Should I suggest this as a change for commit or better correct #ifndef to #ifdef?
There can be a mistake at line 32. Instead of #ifdef #ifndef is used. So in that case PA_3 refers to ADC3 with 3rd channel. But the rest of refers to ADC1 and ADC2. So, I've commented 46 and added 47 with ADC2. After that it started to work.
That is in file PeripheralPins.c from variant. Should I suggest this as a change for commit or better correct #ifndef to #ifdef?
Re: analogRead and analogWrite troubles
@kvv213
ADC3 should be functional, anyway as a workaround use the other.
I will have soon an STM32F103 based board with ADC3 then I will be able to test.
ADC3 should be functional, anyway as a workaround use the other.
I will have soon an STM32F103 based board with ADC3 then I will be able to test.
Re: analogRead and analogWrite troubles
Well, I've reproduced the issue but I didn't have the solution.
Seems it is current to have issue with ADC3 on those series.
I raise an issue internal.
As a workaround simply use other ADC1 or 2.
Seems it is current to have issue with ADC3 on those series.
I raise an issue internal.
As a workaround simply use other ADC1 or 2.
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: analogRead and analogWrite troubles
Libmaple core also has problem with ADC3, see: https://github.com/rogerclarkmelbourne/ ... -569238509
Re: analogRead and analogWrite troubles
Thanks to @ABOSTM issue with ADC3 is solved.
See https://github.com/stm32duino/Arduino_C ... 2/pull/910
See https://github.com/stm32duino/Arduino_C ... 2/pull/910