WHICH CORE?!
WHICH CORE?!
Hi
the question is simple but the answer is hard:
which core? official or Roger's core?
the question is simple but the answer is hard:
which core? official or Roger's core?
Not hard: Official is the professional choice with STM Corporate support. Core built on their professional libraries. Official core provides a supported codebase beyond ArduinoIDE if needs require a migration path.saeed144 wrote: Sun Oct 11, 2020 12:42 pm Hi
the question is simple but the answer is hard:
which core? official or Roger's core?
Opinion, libmaple (Roger's reworked core) may be easier for home experimenters and makers but is not supported beyond the occasional fix. Libmaple is more like Arduino in the version 0022 days. Roger + community took this from V0022 to version 1.51 and beyond.
Ray
-
- Posts: 633
- Joined: Thu Dec 19, 2019 1:23 am
Re: WHICH CORE?!
Not hard: Official is the professional choice with STM Corporate support. Core built on their professional libraries. Official core provides a supported codebase beyond ArduinoIDE if needs require a migration path.saeed144 wrote: Sun Oct 11, 2020 12:42 pm Hi
the question is simple but the answer is hard:
which core? official or Roger's core?
Opinion, libmaple (Roger's reworked core) may be easier for home experimenters and makers but is not supported beyond the occasional fix. Libmaple is more like Arduino in the version 0022 days. Roger + community took this from V0022 to version 1.51 and beyond.
Ray
Re: WHICH CORE?!
I have question about the 2 cores too, is there a test for performance? Which one is overall faster? And the storage/memory consumption?
-
- Posts: 633
- Joined: Thu Dec 19, 2019 1:23 am
Re: WHICH CORE?!
To my knowledge, there is no direct comparison.windyyam wrote: Tue Oct 27, 2020 11:58 am I have question about the 2 cores too, is there a test for performance? Which one is overall faster? And the storage/memory consumption?
Consider the monolithic nature of libmaple (Roger's core), my suspicion is that Roger's core will be the smaller compiled bin file, but the Official core may have better performance and peripheral support.
"Fastest" is not a reasonable attribute, rather quality is a better comparison. If you are a professional programmer, the Official core will provide everything you need. If you are a weekend hobby programmer, Roger's core will likely meet your requirements.
Re: WHICH CORE?!
Sometimes it is simply a preference, sometimes it is driven by which soc / board that one uses e.g. STM core support many of nucleo and discovery boards right out of the core. If you want to use libmaple for it you may end up coding most of it yourself if it isn't supported after all
In terms of performance it depends on how you do it, even with either core one can always access the hardware registers directly and even resort to assembler. the thing to remember is it's still bare metal programming, the core is the icing on the cake, you can choose a flavour
In terms of performance it depends on how you do it, even with either core one can always access the hardware registers directly and even resort to assembler. the thing to remember is it's still bare metal programming, the core is the icing on the cake, you can choose a flavour
Re: WHICH CORE?!
Roger's core uses a lot more RAM and Flash to build the final binary file.windyyam wrote: Tue Oct 27, 2020 11:58 am I have question about the 2 cores too, is there a test for performance? Which one is overall faster? And the storage/memory consumption?
In this matter, STM32 Official Core is way better, thus if your sketch needs RAM space, this is the best option.
Talking about performance, I built an Arduino VGA library that has to deal with very tiny timing limitations.
Regarding performance, I found Roger's core faster when it deals with TIMER IRQ callback.
When using STM32 Core it takes maybe 50 to 100 more cycles to start the IRQ, which in my case leaded to a bad VGA image on screen.
To solve it, I had to disable Hardware Timer on the sketch and to use it directly linked to NVIC, avoiding software overhead.
More details about the memory consumption difference at viewtopic.php?f=10&t=347
and about the way I solved the HW TIMER issue on the Github page for this project.
It means that there are performance and consumption differences between both cores, but only when you really need every bit of RAM or every CPU cycle for the job. Otherwise, as MrBurnette said, it's a matter of preference - but it's important to notice that I think that only STM32 Offical Core is being currently updated and evolving.
Re: WHICH CORE?!
wow, that's an interesting project, I never thought a microcontroller could do that~feluga wrote: Wed Oct 28, 2020 3:43 amRoger's core uses a lot more RAM and Flash to build the final binary file.windyyam wrote: Tue Oct 27, 2020 11:58 am I have question about the 2 cores too, is there a test for performance? Which one is overall faster? And the storage/memory consumption?
In this matter, STM32 Official Core is way better, thus if your sketch needs RAM space, this is the best option.
Talking about performance, I built an Arduino VGA library that has to deal with very tiny timing limitations.
Regarding performance, I found Roger's core faster when it deals with TIMER IRQ callback.
When using STM32 Core it takes maybe 50 to 100 more cycles to start the IRQ, which in my case leaded to a bad VGA image on screen.
To solve it, I had to disable Hardware Timer on the sketch and to use it directly linked to NVIC, avoiding software overhead.
More details about the memory consumption difference at viewtopic.php?f=10&t=347
and about the way I solved the HW TIMER issue on the Github page for this project.
It means that there are performance and consumption differences between both cores, but only when you really need every bit of RAM or every CPU cycle for the job. Otherwise, as MrBurnette said, it's a matter of preference - but it's important to notice that I think that only STM32 Offical Core is being currently updated and evolving.
Re: WHICH CORE?!
Yes, thanks for the direction. It makes totally sense that ST's core got more attention as it's more "alive" and have official support.mrburnette wrote: Tue Oct 27, 2020 2:39 pmTo my knowledge, there is no direct comparison.windyyam wrote: Tue Oct 27, 2020 11:58 am I have question about the 2 cores too, is there a test for performance? Which one is overall faster? And the storage/memory consumption?
Consider the monolithic nature of libmaple (Roger's core), my suspicion is that Roger's core will be the smaller compiled bin file, but the Official core may have better performance and peripheral support.
"Fastest" is not a reasonable attribute, rather quality is a better comparison. If you are a professional programmer, the Official core will provide everything you need. If you are a weekend hobby programmer, Roger's core will likely meet your requirements.
But on the other hand, I've already get used to Roger's core as many of my projects are based upon it.
I've done a simple test with the infamous digitalWrite from Arduino. We all know that function took a lot of unnecessary overhead and can be quite slow in some of the situations.
The test is done on bluepill f103, using Os optimization, without USB serial. code is as follows:
Code: Select all
unsigned long lasttick = 0;
void setup() {
// put your setup code here, to run once:
pinMode(PC13, OUTPUT);
Serial.begin(115200);
lasttick = micros();
}
void loop() {
// put your main code here, to run repeatedly:
for(int i=0;i<10000;i++){
digitalWrite(PC13, HIGH);
digitalWrite(PC13, LOW);
}
unsigned long nowtick = micros();
Serial.println(nowtick - lasttick);
lasttick = nowtick;
}
If I turn on O2 with LTO, Roger's core output is 1290, while ST's fail to serial output
So be fair, on Os optimization Roger's core is 34.7% faster than ST's on digitalWrite.
Re: WHICH CORE?!
Try
Code: Select all
digitalWriteFast(PC_13,HIGH);
digitalWriteFast(PC_13,LOW);