HAL versions

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
king2
Posts: 98
Joined: Mon May 28, 2012 1:57 pm
Been thanked: 2 times

HAL versions

Post by king2 »

I have tried to make new project with ChibiOS from scratch.
I see GPIOv1, GPIOv2 and GPIOv3 folders in LLD, how I can decide which one I should use?
Same question with all folder with versions.

Thanks!
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: HAL versions

Post by Giovanni »

Hi,
It depends on which STM32 you are using, see the platform.mk file inside the various STM32 subdirectories, the drivers are listed there.

Giovanni
king2
Posts: 98
Joined: Mon May 28, 2012 1:57 pm
Been thanked: 2 times

Re: HAL versions

Post by king2 »

Thanks!
neums
Posts: 137
Joined: Fri May 08, 2015 1:09 pm
Has thanked: 10 times
Been thanked: 5 times

Re: HAL versions

Post by neums »

What is the reason that all the LLD driver files moved to the LLD folder?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: HAL versions

Post by Giovanni »

Because all those drivers are shared by multiple platforms.

Giovanni
Al B
Posts: 24
Joined: Thu Jun 09, 2016 4:01 am
Been thanked: 2 times

Re: HAL versions

Post by Al B »

Hi,

Some related questions to this.

Other than the platform.mk for each processor family, which describes which LLD peripheral version to use for that processor,
is there any documentation on what the different are between the versions other than doing diff's on the code?

For example, I have made fixes to SDMMCv1 and want to test these on F407, but unfortunately F407 uses SDIOv1.
When looking at these files, other than SDIO vs SDMMC constant naming and 1 define path in SDIOv1 for F2/F4 (in sdc_lld_wait_transaction_end routine) the sdc_lld.c files seem to be the same (i.e. if the STM32_DMA_ADVANCED seems to cover all the F2/F4 specific define paths).

A thought: would consolidating into a single version with backward compatibility provided using defines for the processor differences, make upgrading easier? I.e. introduce the new code with defines if required, but the legacy code is still supported.
Then earlier version XXXv1, XXXv2 files can be maintained (so that all .ld and other linker project files will still work), and demos can be upgraded to latest version if and when time is available to test them out.
And all new code and fixes is applied to the latest versions, and only ported to earlier versions on an as needed basis.

And taking this a step further, if the changes were done in a backwards compatible fashion, maybe most changes wouldn't need a new version number either? Further simplifying processor to LLD linkages.


Thanks,
Al
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: HAL versions

Post by Giovanni »

hi,

Many LLD drivers have a readme with the compatibility list and other notes, not all currently.

SDIO has been forked not just because naming differences, the peripheral is a bit different too. I think there is a reason if they stopped calling it SDIO and it is now SDMMC, they never changed a name in the past.

Giovanni
Al B
Posts: 24
Joined: Thu Jun 09, 2016 4:01 am
Been thanked: 2 times

Re: HAL versions

Post by Al B »

Hi,

OK, now that you mention it I do see note.txt files in ADC and DMA but no others.

And wrt to the SDIO vs SDMMC, that is unfortunate, since the code seems almost identical other than the naming and clearly defined ifdef code paths. I guess I'll find out pretty soon if the SDC abstraction works across SMDDC vs SDIO.

Hopefully the other ideas I mentioned may be of some use one day.

Thanks,
Al
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: HAL versions

Post by Giovanni »

I have started adding those readmes in newer drivers, I have to find time to make a pass on old ones :)

The idea is to document there each driver implementation.

Giovanni
Post Reply