Serial port stm32F103

the serial port don’t work when we have a define to a variable…
like this :
int EN_PSU= PA10; // i want use the pin PA10 a OUTPUT
#define PWR_ON PA2 // // i want use the pin PA2 a OUTPUT

and in
void setup()
pinMode(EN_PSU, OUTPUT); // this is a int
pinMode(PWR_ON, OUTPUT); // this is a define

MY CODE line in platformio.ini is :

platform = ststm32@5.1.0
board = genericSTM32F103RB
framework = arduino
debug_tool = stlink
upload_protocol = stlink
monitor_speed = 115200
monitor_port = COM9 ;is correct

What i need to do to work fine?

PA2 is Serial2 TX and PA10 is Serial1 RX. You have a pin conflict?

1 Like