But my code doesn't work with LTO enabled compile.
Is there any well known problem for LTO?
First, I wrote this code for Arduino.
Code: Select all
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
while(1) {
digitalWrite(13, HIGH);
digitalWrite(13, LOW);
digitalWrite(13, HIGH);
digitalWrite(13, LOW);
}
}
Next, I wrote this code for Arduino too.
Code: Select all
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
while(1) {
PORTC |= B10000000;
PORTC &= B01111111;
PORTC |= B10000000;
PORTC &= B01111111;
}
}
For STM32, I wrote this code.
Code: Select all
void setup() {
pinMode(PB8, OUTPUT);
}
void loop() {
while(1) {
digitalWrite(PB8,HIGH);
digitalWrite(PB8,LOW);
digitalWrite(PB8,HIGH);
digitalWrite(PB8,LOW);
}
}
I believe this code run more fast with O3 with LTO.
But it's doesn't output any signal.
I tried to debug with STLink and GDB.
The chip seems entered infinite loop in ADC1_2_IRQHandler function.
I'm not sure why this interrupt is enabled.
I use arduino ide 1.8.10 with STM32duino 1.8.0 in debian laptop.
I use bootloader in here.
https://github.com/rogerclarkmelbourne/ ... bootloader
Thanks,