Page 1 of 1

proposal for stm32l422 support

Posted: Wed Apr 14, 2021 8:21 am
by alex31
Hello,

I propose the needed files for stm32l422 support :

Code: Select all

os/common/ext/ST/STM32L4xx/stm32l422xx.h
os/common/ext/ST/STM32L4xx/stm32l4xx.h
os/common/startup/ARMCMx/compilers/GCC/ld/STM32L422.ld
os/hal/ports/STM32/STM32L4xx/hal_lld.h
os/hal/ports/STM32/STM32L4xx/stm32_registry.h
tools/ftl/processors/conf/mcuconf_stm32l422xx/mcuconf.h.ftl
tools/updater/update_mcuconf_stm32l422xx.sh


The l422 is a striped down version of the L432, without CAN, DAC, SPI3, but with two ADC instead of one.

It is interesting for us because at the contrary of L432, it is available in the LQFP package.

LQFP has the smallest pad that our antic PCB lab is able to make, so we can give projects to students where they design electronics, software, packaging, and are able to make the prototype themselves.

There is no devboard on the market with L422, but if someone is interested, PM me and I can send you kikad files of a devboard that we made.

The diff is made for 20.3 latest, does it help if it's made against trunk instead ?

Alexandre

Re: proposal for stm32l422 support

Posted: Wed Apr 14, 2021 8:49 am
by Giovanni
Hi,

20.x will not receive enhancements because it is a stable release, bug fixes only, any new addition should be made on trunk.

Giovanni

Re: proposal for stm32l422 support

Posted: Wed Apr 14, 2021 4:45 pm
by alex31
I have made the patch for trunk.
Nearly no change over the one for 20.3, albeit the mcuconf ftl skeleton has changed a little bit.
It is also a lot smaller since trunk already provide cmsis header for the 42x family.


Alexandre

Re: proposal for stm32l422 support

Posted: Thu Apr 22, 2021 6:22 pm
by alex31
Hello,

Here is a new version of the patch for the L422/L412 family :

I fact they are not only strip down version of 432 (without DAC and CAN), but also have RTCv3 instead of RTCv2 on others L4, so they deserve specific platform.mk.

Took care of tab (pcregrep and expand are my friends) :-)

Alexandre

Re: proposal for stm32l422 support

Posted: Sat Apr 24, 2021 9:02 am
by Giovanni
Hi,

I merged the patch but RTCv3 didn't work because recent changes, could you look into it? You also left a "TODO" in the registry.

Additionally, board files for a nucleo and a "standard demo" would be useful for completeness.

Giovanni

Re: proposal for stm32l422 support

Posted: Sun Apr 25, 2021 8:37 am
by alex31
Hi,

Thanks for the merge.

RTCv3 didn't work because recent changes,


The recent change also fixes the l422 problem, so it's all good.

There is an RCC problem, but not related to 422 : missing #if #endif in void pllsaix_deinit in pllsai1.inc and pllsai2.inc (see patches)

Also, there is a need for a specific ldconfig where all is the same than l432 but the ram size. (see patches)

For the standard demo, I will do it on beginning of next week, but there is no devboard available for this MCU. We have done a devboard here at enac, so we can make the demo for this board and link in the demo the url of the project (the devboard schematics is GPL). We choose this MCU because the package is compatible with our old PCB making system.

Alexandre

Re: proposal for stm32l422 support

Posted: Sun Apr 25, 2021 10:27 am
by Giovanni
Hi,

Fixed the check but the .ld has an incomplete name, which L422 is it? B?

Giovanni

Re: proposal for stm32l422 support

Posted: Sun Apr 25, 2021 2:12 pm
by alex31
Yes it's 'B'. But all 422 are 'B' => flash:128/ ram:40

Only 412 exists in 'B' and '8' (F64/R40)

A.

Re: proposal for stm32l422 support

Posted: Sun Apr 25, 2021 2:44 pm
by Giovanni
OK thanks, just to name the file appropriately, patterns.

Giovanni

Re: proposal for stm32l422 support

Posted: Mon Apr 26, 2021 1:59 pm
by alex31
Hello,

L422 support is not so easy ..

Attached a set of 4 patches in one zip :
1-l422_conditionnal_compilation.patch addresses
°missing SAI define conditionnal compilation
°missing default STM32_PLLPDIV=0 when RCC_PLL_HAS_P not defined

2-l422_registry.patch adresses
° l422 has no SAI, no RCC_PLL_P_OUT
since L422 is the only L4 without SAI and RCC_PLL_P_OUT, I have set macro for the 422, and different macros for all others L4, but perhaps you prefer to ungroup the definition ? So, beware of that patch is perhaps not following the rules, tell me if it needs rework.

3-elgo422_board.patch
° the elgo422 board support

4-elgo422_demo.patch
° a demo which use elgo422 board

Alexandre