LTO isn't working?
Posted: Fri Dec 27, 2019 7:15 pm
I'm trying to measure how first the STM32 compare to AVR based arduino.
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.
This outputs 100khz square wave (measured by oscilloscope)
Next, I wrote this code for Arduino too.
This code outputs 4Mhz square wave.
For STM32, I wrote this code.
My bluepill board(STM32F103) outputs 500khz square wave if I select O3(without LTO).
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,
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,