STM have developed a HAL MX core

Information on the latest releases
User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM have developed a HAL MX core

Postby RogerClark » Thu Sep 15, 2016 11:23 pm

There seems to be a pre-compile library e.g. libstm32f1_nucleo-f103rb_gcc_rel.a for each variant

So far, there doesnt seem to be any source code for this.

In main.c there is a reference to initVariant() but at the moment there isnt any source for this either.

I presume that there must be some variant source code and makefile which builds the HAL init and board type dependant code into a library

So hopefully they will be able to upload that tomorrow (Friday)

I'll send Frederic an emial to see if they can give me an update


Edit.

I emailed Frederic @ STM, and he will be uploading the source code today (Friday)

I think we will need to refactor it, as I think all the MCU series will be in the same repo, and in my past experience with LibMaple, its easier if the code for each series is in its own repo, as its easier to manage PR's and reverting code etc, its not all in one huge repo.

This may mean there is duplication of the HAL, but I have a feeling that the HAL for each series if different anyway.

Tools will also probably end up in its own repo.

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM have developed a HAL MX core

Postby RogerClark » Fri Sep 16, 2016 9:45 am

Another update.

Frederic has uploaded the source code to his own repo, but all cores are in the same folder, and I think its best if each MCU series has its own repo

So I'm going to download the zip of his source code and then split it and upload to the new repos I've created on the stm32duino account

BTW.
I'm not intending to exclude anyone from this process, but I think it may be better if people fork these repos and send PR's rather than having loads of people with write permission to these master repo's

Thanks

Roger

michael_l
Posts: 274
Joined: Mon Aug 24, 2015 6:11 pm

Re: STM have developed a HAL MX core

Postby michael_l » Fri Sep 16, 2016 10:59 am

Thanks for keeping us updated.

So does this mean that in the long run can we expect STM32 to publish Arduino core for all (or at least almost all) their STM32F or L- series products ?

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM have developed a HAL MX core

Postby RogerClark » Fri Sep 16, 2016 11:09 am

Michael

I'm not sure if they have the resources to publish cores for all the MCU's

My understanding was that this initial release was developed for STM by an external development house.

STM currently have a small team managing the release, but I think this is a temporary secondment.

So in the long term it will be left to the community to manage the code on github and make new variants.

I know they do not have any code for the F7.

I believe they may have a partially complete core for the F4 series. But I can't really remember the entire 2 hour conversation I had with them on Monday

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

STM Sources for F1 and L4 are now in github

Postby RogerClark » Fri Sep 16, 2016 11:13 am

Guys

Another update.

Frederic Pillon, pushed the sources to his repo https://github.com/fpistm/STM but it was all in one repo rather than separating the cores into separate repos

I feel that over time having all the MCU's in the same repo will be a management headache, especially as the folders are self contained (and there wasnt any common code in the files he pushed)

So I've recommitted the files into separate repos in the stm32duino account


e.g.

Arduino_Core_STM32L4
Arduino_Core_STM32F1
Arduino_Tools

See

https://github.com/stm32duino

So far I have not had chance to look at the code or attempt to compile it, but there do appear to be makefiles to build the variant(s)

michael_l
Posts: 274
Joined: Mon Aug 24, 2015 6:11 pm

Re: STM have developed a HAL MX core

Postby michael_l » Fri Sep 16, 2016 11:53 am

RogerClark wrote:Michael

I'm not sure if they have the resources to publish cores for all the MCU's

My understanding was that this initial release was developed for STM by an external development house.

STM currently have a small team managing the release, but I think this is a temporary secondment.

So in the long term it will be left to the community to manage the code on github and make new variants.

I know they do not have any code for the F7.

I believe they may have a partially complete core for the F4 series. But I can't really remember the entire 2 hour conversation I had with them on Monday


Thanks,

One thing is a bit unclear to me. Are these HAL sources organized/implemented so that they use C++ interfaces/base classes... and Arduino "binding code" just uses these interfaces ? If that's the case my first thought would be that it is not that much of a work to add new variants.

User avatar
Slammer
Posts: 241
Joined: Tue Mar 01, 2016 10:35 pm
Location: Athens, Greece

Re: STM have developed a HAL MX core

Postby Slammer » Fri Sep 16, 2016 11:57 am

The HAL is different for each family (F1, F2, F3 etc..) as ST's distribution. Moreover the HALMX by design, even the source code is the same for the members of a family, it is not possible to compile the HAL for all members in a common library because there are many #defines in the code changing some lines for different members.
On the other side the API of the HAL is not the same across families (some functions are the same but there are many others with different arguments, naming etc) and therefore the implementation of wiring cannot be the same.
The arduino build system is not very flexible, it always compiles and links the contents of core and variant directories, while it is possible to unify the wiring implementation this would be very difficult for arduino building system, so the family separation as Roger suggested is the better solution.Of course this separation creates some difficulties, for example a fix or an addition in the common functions require the change of all family cores manually, but I can't see a better solution. mbed project (also based on HAL) is facing the same problem and they are keeping the families in different trees, but they use a "glue layer", a low level api, to access the functions of HAL from the unified top level API.
Anyway, I will study the sources, I think that will be easy to add more variants of the same family.... it is very positive to have a complete (or almost complete) implementation of arduino API with HAL...
Last edited by Slammer on Fri Sep 16, 2016 12:10 pm, edited 1 time in total.

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM have developed a HAL MX core

Postby RogerClark » Fri Sep 16, 2016 12:08 pm

Thanks @slammer

I agree, there is not an ideal solution, but splitting by MCU series is easier to manage in github, as I've found in the past that when people submit a PR for one MCU e.g the F4, they somehow, perhaps not on purpose change something for another MCU

So its best if the damage is only limited to one series ;-)



Another update.

I've changed the Boards Manager package file to use date based release numbering, so the release version is now todays date

2016.9.16

Note
Next month on the same day would be 2016.10.16 but the Arduino IDE has a bug where it will not accept leading zero's e.g. it will not accept 2016.09.16


However as this release is partially a beta, and this numbering system has been previously discussed for use with libmaple , I think its best to adopt it for this core

At, the moment I don't have time to download the actual gz files and rename them, but I will do that for the next time the boards manager package files are created.
But we do not have an automated way to do this at the moment.

User avatar
Slammer
Posts: 241
Joined: Tue Mar 01, 2016 10:35 pm
Location: Athens, Greece

Re: STM have developed a HAL MX core

Postby Slammer » Fri Sep 16, 2016 12:20 pm

As I see the HAL and some glue-functions are included in a library. It is not very handy, as this library is required for every variant. It is possible for arduino building system to build all sources without problem, I can't see a reason to keep library as dependency (I know, the building with a makefile is more flexible but it is not very easy to prebuild binaries for every possible variant).

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM have developed a HAL MX core

Postby RogerClark » Fri Sep 16, 2016 12:30 pm

@slammer

I suspect the reason they did that is to reduce compile time.

I did the same thing for the nRF51822 core I copied from RedBearLabs.

The problem is the Arduino IDE is not a very good version of Make, and seems to recompile files when there is no need to do so.
Consequentially the build times on the nRF51822 were around 45 seconds even on a fast machine, but precompiling all the "system" functions into a library reduced this to around 5 seconds.

However there is probably nothing stopping us from having a version that does not use a compiled library per variant.


Return to “Builds and Announcements”

Who is online

Users browsing this forum: No registered users and 1 guest