Page 1 of 1

[Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Posted: Sat Apr 04, 2020 9:26 am
by meitao605
Version: STM32 Core 1.8.0
Arduino Verison: 1.8.12
UploadMethod: ST_LINK

Chip:STM32F103RCT6

code:
HardwareSerial Uart1(PA10,PA9);
int fold_current;

void setup() {
pinMode(PC3,INPUT_ANALOG);
Uart1.begin(9600);
}

void loop()
{
fold_current = analogRead(PC3);
Uart1.println(fold_current);
delay(100);
}
After Upload this code, it will stuck and nothing print out from the Uart1.
but works fine and print out the value for other pins, simple replace the PC3 to other pins will work.

the pins i have tried:

PC1
PC2
PC4
PC5
PA1

Hardware: 2 different boards with STM32F103RCT6. one is my self-made boards. another is the AlienTEK develop Boards. which can be found www.alientek.com( MiniSTM32F103 )

I tried to check the pin-Map, it seems OK.

Re: AnalogRead() for PC3 stucked of STM32F103RCT6

Posted: Sat Apr 04, 2020 12:18 pm
by fpiSTM
Hi,

before submitting an issue on GitHub please wait to have an answer.
This is a known issue and already fixed.
viewtopic.php?p=1087#p1087

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Posted: Sat Apr 04, 2020 12:59 pm
by meitao605
I'm sorry for that.

I'm very new here, and this is my first time work with Arduino_STM32.

I tried to read the issue, but i don't quite understand 'analogRead: don't set ADC common register when ADC doesn't support it.'

does that mean i can't use this ADC3,or is there another we to get the number except analogRead()?

if it's possible to use ADC3, please help to share a piece of code.

thanks

Mei Tao

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Posted: Sat Apr 04, 2020 1:17 pm
by fpiSTM
As explained it is fixed. In ghe github issue and in the forum you have the link to the PR which fix this.
It is availabke in the master repo and will be in the next release.

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Posted: Sat Apr 04, 2020 1:35 pm
by meitao605
Thanks. very much. :D

now i have to learn how to install from git rather than just download from IDE. :o

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Posted: Sat Apr 04, 2020 1:56 pm
by fpiSTM
See the wiki for that ;)

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Posted: Mon Apr 06, 2020 5:38 am
by meitao605
Confirmed, it works.

Thanks.