Trying to port Arduino programs to STM32 boards.
Posted: Sat Mar 21, 2020 4:56 pm
Hello friends,
I am doing experiments to check the differences between an Arduino standard board and a STM32 standard board using the ArduinoIDE.
In a first test, I verified and uploaded the sample program "Blink" to the STM32L476RG board:
void setup () {
pinMode (LED_BUILTIN, OUTPUT);
}
void loop () {
digitalWrite (LED_BUILTIN, HIGH);
delay (1000);
digitalWrite (LED_BUILTIN, LOW);
delay (1000);
}
The program worked correctly.
After that, I changed the variable LED_BUILTIN to pin PA-5, which corresponds to LED1 embedded in the board:
void setup () {
pinMode (PA_5, OUTPUT);
}
void loop () {
digitalWrite (PA_5, HIGH);
delay (500);
digitalWrite (PA_5, LOW);
delay (500);
}
This time, the program did not work.
I'm trying to get some flexibility when porting programs going beyond sample programs, but it seems that things are not so simple ...
I am doing experiments to check the differences between an Arduino standard board and a STM32 standard board using the ArduinoIDE.
In a first test, I verified and uploaded the sample program "Blink" to the STM32L476RG board:
void setup () {
pinMode (LED_BUILTIN, OUTPUT);
}
void loop () {
digitalWrite (LED_BUILTIN, HIGH);
delay (1000);
digitalWrite (LED_BUILTIN, LOW);
delay (1000);
}
The program worked correctly.
After that, I changed the variable LED_BUILTIN to pin PA-5, which corresponds to LED1 embedded in the board:
void setup () {
pinMode (PA_5, OUTPUT);
}
void loop () {
digitalWrite (PA_5, HIGH);
delay (500);
digitalWrite (PA_5, LOW);
delay (500);
}
This time, the program did not work.
I'm trying to get some flexibility when porting programs going beyond sample programs, but it seems that things are not so simple ...