Search code examples
arduinostm32bluepill

STM32 Blue pill and Arduino IDE


I want to program Stm32 bluepill with Arduino IDE but when I want to define pins like I write " pinMode(A10, OUTPUT)" it gives error. the error is "'A10' was not declared in this scope" I want to know how should I declare Pins in Arduino IDE for STM32


Solution

  • Based on the error you're reporting, you're not building your code for the correct board. I suspect you're targeting the ArduinoUNO (default) which does not have an A10.

    Also, as hcheung's answer mentions, the name on the blue pill is "PA10".

    Follow the instructions here to install the board configuration for the STM "blue pill" then select it and build again.

    https://maker.pro/arduino/tutorial/how-to-program-the-stm32-blue-pill-with-arduino-ide

    Note, the board selection as of today is now "STM32F1 series" instead of "STM32F103C series" as specified at the link.