STM32F103C8 BluePill VGA Project

What are you developing?
feluga
Posts: 21
Joined: Wed Mar 18, 2020 2:50 am
Answers: 1

Re: STM32F103C8 BluePill VGA Project

Post by feluga »

feluga wrote:
Sat Apr 25, 2020 5:19 pm
I'm looking for some advice..... thinking about this arduino library for VGA.

Should I focus on Roger's Core or should I move directly to STM32 Core?
What is your view on that?

Is Roger's Core sort of dead?

Thanks in advance!
I ask that because both cores are not compatible when it comes to Timer Hardware and both behave differently when I add ASM code.
Thus I see some options:

1- to forget about footprint and move into some more starndard approach that could run on both cores using a couple #ifdef
2- to move directly to STM32 Core and enjoy its better usage of memory, leaving Roger's Core
3- Something else ?

User avatar
Bakisha
Posts: 24
Joined: Fri Dec 20, 2019 6:50 pm
Contact:

Re: STM32F103C8 BluePill VGA Project

Post by Bakisha »

feluga wrote:
Sat Apr 25, 2020 5:19 pm
Is Roger's Core sort of dead?
I don't think it's dead, but rather at peek of it's glory.

IMHO, if you are planning library only for Blue pill, then Roger's core is better choise. It's not that it can't be ported, but if it's made for stm32duino hal core, then same code can be compiled for different microcontrollers, with different cpu clocks and different execution times. In one of my personal project, i ended measuring code execution time and build interrupt timings around that.
But VGA have really tight timing, so it is maybe better to build for only one type of micro-contoller or users are going to demand "Can you make library for STM32FxxxYYzz?"

mrburnette
Posts: 134
Joined: Thu Dec 19, 2019 1:23 am

Re: STM32F103C8 BluePill VGA Project

Post by mrburnette »

feluga wrote:
Sat Apr 25, 2020 5:25 pm
feluga wrote:
Sat Apr 25, 2020 5:19 pm
I'm looking for some advice..... thinking about this arduino library for VGA.

Should I focus on Roger's Core or should I move directly to STM32 Core?
What is your view on that?

Is Roger's Core sort of dead?

Thanks in advance!
I ask that because both cores are not compatible when it comes to Timer Hardware and both behave differently when I add ASM code.
Thus I see some options:

1- to forget about footprint and move into some more starndard approach that could run on both cores using a couple #ifdef
2- to move directly to STM32 Core and enjoy its better usage of memory, leaving Roger's Core
3- Something else ?
Everyone has an opinion, I usually have more than one! But, consider this:
Roger's core is really a rework (empahasis on work) of the LeafLabs Maple effort and Libmaple. The code is old, about 9 years or so and was written in a monolythic style. Likely your BIN will be smaller when compiled under Roger's libraries. But, I have seen some surprises from the ST Official core which is based on a wrapper service around HAL, LL API, and CMSIS. As such, the Arduino output has the benefit of commercial library implementations.

Is Roger's core dead. Well, it is semi-actively maintained via github. I have previously said it is on life-support. It is of the same quality, I believe, as the older AVR library code in the Arduino 8-bit world; that is, not perfect but acceptable. It too, is based on Cygnus's C library, NewLib. There is a streamlined version of newlib called newlib-nano: https://github.com/32bitmicro/newlib-nano-1.0 which I have no experience with STM32 but I have used with Cypress products.

Ray

feluga
Posts: 21
Joined: Wed Mar 18, 2020 2:50 am
Answers: 1

Re: STM32F103C8 BluePill VGA Project

Post by feluga »

Thanks Bakisha and MrBurnette for your comments and advising.

I decided to move forward with Roger's Core version and to allow the community to create a STM32 Core version in case someone consider it usefull.

As for STM32 Core I found some issues when trying porting it:

a. HardwareTimer already use and define all Timer Interrupt functions on its own. It adds a layer that generates VGA Images with jitter problems.

b. I Tried to use pure HAL for using IRQ Timer funcitons but I ended up getting Linker Errors of duplicated calls to TIM4_IRQHandler(), for instance

I hope someone more skilled is able to make this library run for STM32 Core, or get inspired to do so and create another library.

Thanks again for your considerations & Best Regards!
Last edited by feluga on Wed Apr 29, 2020 11:16 pm, edited 1 time in total.

feluga
Posts: 21
Joined: Wed Mar 18, 2020 2:50 am
Answers: 1

Re: STM32F103C8 BluePill VGA Project

Post by feluga »

Some Good News:

The Library I described is already published at GitHub.

You will be able to see it at https://github.com/RoCorbera/BlueVGA

Please let me know if you have critics or improvements to suggest.
Any suggetions to improve it are welcome!

Thanks you all!

feluga
Posts: 21
Joined: Wed Mar 18, 2020 2:50 am
Answers: 1

Re: STM32F103C8 BluePill VGA Project

Post by feluga »

feluga wrote:
Wed Apr 29, 2020 2:08 pm
You will be able to see it at https://github.com/RoCorbera/BlueVGA
Hey guys, BlueVGA is officially published as an Arduino Library!
I hope it is usefull for some of you! :D
BlueVGA Library officially listed in Arduino IDE-min.png
BlueVGA Library officially listed in Arduino IDE-min.png (28.27 KiB) Viewed 421 times

ag123
Posts: 384
Joined: Thu Dec 19, 2019 5:30 am
Answers: 1

Re: STM32F103C8 BluePill VGA Project

Post by ag123 »

+10 really good work :D
feluga wrote:
Sat Apr 25, 2020 5:19 pm
I'm looking for some advice..... thinking about this arduino library for VGA.

Should I focus on Roger's Core or should I move directly to STM32 Core?
What is your view on that?

Is Roger's Core sort of dead?

Thanks in advance!
the official core (based on HAL) and Roger's libmaple are probably 2 of the most popular around. And to 'pacify' clueless newbies, we tend to just mention the official core (being the official core) and Roger's libmaple being the 'community' core. actually if you bother to search around, and for those who remember in the old forums there is another core
https://github.com/danieleff/STM32GENERIC
this one is also based off HAL quite similar to the official core.
then there is libopencm3
https://github.com/libopencm3/libopencm3
oh and there is still mbed
https://os.mbed.com/
and if one don't want to use them there is HAL (and even the old standard pheriperials libraries)
and if you like there is even the 'ancient' libmaple
https://github.com/leaflabs/libmaple
and if you are hardcore, there is still gcc, cmsis and the bare registers and even assembly.
my guess is that these are after all tiny devices with (very) limited memory and storage, it is simply good to have alternatives around.

but people like to talk about being 'mainstream' i'd say the official core is it, but for myself i still like the libmaple core as i meddle in it and is familiar with it. the official core based on HAL do have some downsides, in particular it is somewhat 'fatter' , more correctly more feature complete and it is the only core that supports a broad spectrum of currently available boards in particular the Nucleo and Discovery boards. and if you are in a situation to squeeze every nano seconds of clocks or to pack as much as is possible into 20k ram, it may help to go more bare metal than 'cores'. hence the plural of alternatives really helps here.

the 'focus' on cores is mainly that newbies often drop in with a blue pill and asked point blank how do i use it? oh well, so to answer it sweet and short there are 2 cores official and 'community' take your pick (actually there are multitudes but libmaple has been a fad and i hope it lasts) ;)

feluga
Posts: 21
Joined: Wed Mar 18, 2020 2:50 am
Answers: 1

Re: STM32F103C8 BluePill VGA Project

Post by feluga »

ag123 wrote:
Tue May 05, 2020 5:14 pm
there are 2 cores official and 'community' take your pick (actually there are multitudes but libmaple has been a fad and i hope it lasts) ;)
Thanks Ag123 for your answer and tips.
I agree that the 2 most known cores are the STM32 and Roger's.
I have initialy decided to move forward with a version of BlueVGA for Roger's core as I stated above.

The library and source code can be found in https://github.com/RoCorbera/BlueVGA

I'm now working on creating a "dual-core" :roll: version of this VGA library that can be used transparently with Roger's Core and Official Core.

That may be a good solution for making it work for the main used cores.

The fact is that Roger's and SMT32 Cores are very different when it comes down to how Hardware Timer is implemented.
One simple example is that Roger's Core is about 100 cycles faster than STM32 to start a Timer IRQ.
For a VGA library, Timming is crucial and a few nanoseconds usually make a lot of difference.

feluga
Posts: 21
Joined: Wed Mar 18, 2020 2:50 am
Answers: 1

Re: STM32F103C8 BluePill VGA Project

Post by feluga »

feluga wrote:
Sun May 10, 2020 10:10 pm
I'm now working on creating a "dual-core" :roll: version of this VGA library that can be used transparently with Roger's Core and Official Core.
This new version is now released. The library BlueVGA 1.0 works transparently for both cores (STM32 and Roger's).
The library and source code can be found in https://github.com/RoCorbera/BlueVGA

User avatar
fpiSTM
Posts: 478
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 15
Location: Le Mans
Contact:

Re: STM32F103C8 BluePill VGA Project

Post by fpiSTM »

Nice! Thanks ;)

Post Reply

Return to “Projects”