Dynamic Flash Size for STM32L4

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
JSStabl
Posts: 78
Joined: Tue Feb 25, 2020 4:06 pm
Has thanked: 3 times
Been thanked: 2 times

Dynamic Flash Size for STM32L4

Postby JSStabl » Tue Mar 15, 2022 10:47 am

Hi everyone,

we're trying to make our efl_lld descriptor automatically get adjusted to the MCU we are using, since the L4 has different flash sizes.

Due to the struct being const, we had to define a couple and then use an if/else to return the correct one:

https://github.com/Stabl-Energy/ChibiOS/pull/4/files (our chibiOS fork).

Is there a more elegant way to do this? Or was there a fix upstream we don't know about?

Regards
Julian

User avatar
FXCoder
Posts: 384
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 180 times
Been thanked: 130 times

Re: Dynamic Flash Size for STM32L4

Postby FXCoder » Tue Mar 15, 2022 11:15 am

Hi,
Have a look at the L4+ EFL driver which does have differing sizes and dual bank support.

--
Bob


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 10 guests