4 years, 8 months ago.

MBED error when using STM32F401RET6 PA_2 pin as analog Input

Hello ,

I'm developping on a STM32F401RET6 in a custom pcb and i'm programming from mbed compiler . I have an issue when i use PA_2 as an analog input . /media/uploads/woulageek/capture5.png

Really need help because i have got olready the pcb and connected the PA2 to my sensor .

Regards

PS : I'm just using the Arduino Serial monitor

1 Answer

4 years, 8 months ago.

Hi Alioune,

The platform in Mbed OS using STM32F401RE chip is NUCLEO_F401RE, so first you should check if you are using the correct PinMap.

And refer to PeripheralPins.c,

https://github.com/ARMmbed/mbed-os/blob/417a9fe2fb9891036324b062bd4c831cefba759a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/PeripheralPins.c#L59

You can see PA_2 is set to STDIO_UART_TX as default, it'd better if you choose another pin, or you have to change the UART_TX to another pin.

Regards, Desmond