proposal for stm32l422 support

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
User avatar
alex31
Posts: 338
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 34 times
Been thanked: 50 times
Contact:

proposal for stm32l422 support

Postby alex31 » Wed Apr 14, 2021 8:21 am

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
Attachments
stm32l422_support.patch.zip
(101.17 KiB) Downloaded 15 times

User avatar
Giovanni
Site Admin
Posts: 13577
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 876 times
Been thanked: 750 times
Contact:

Re: proposal for stm32l422 support

Postby Giovanni » Wed Apr 14, 2021 8:49 am

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

User avatar
alex31
Posts: 338
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 34 times
Been thanked: 50 times
Contact:

Re: proposal for stm32l422 support

Postby alex31 » Wed Apr 14, 2021 4:45 pm

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
Attachments
l422_support_over_trunk.patch.zip
patch to support l422 family of processor to apply over trunk (04/21)
(5.67 KiB) Downloaded 15 times

User avatar
alex31
Posts: 338
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 34 times
Been thanked: 50 times
Contact:

Re: proposal for stm32l422 support

Postby alex31 » Thu Apr 22, 2021 6:22 pm

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
Attachments
l422_support_over_trunk_v3.patch.zip
(6.65 KiB) Downloaded 12 times

User avatar
Giovanni
Site Admin
Posts: 13577
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 876 times
Been thanked: 750 times
Contact:

Re: proposal for stm32l422 support

Postby Giovanni » Sat Apr 24, 2021 9:02 am

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

User avatar
alex31
Posts: 338
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 34 times
Been thanked: 50 times
Contact:

Re: proposal for stm32l422 support

Postby alex31 » Sun Apr 25, 2021 8:37 am

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
Attachments
l422_ldconfig.patch.zip
specific ldconfig for 40Ko ram
(1.23 KiB) Downloaded 13 times
rcc_fix.patch.zip
fix conditionnal compilation problem
(486 Bytes) Downloaded 12 times

User avatar
Giovanni
Site Admin
Posts: 13577
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 876 times
Been thanked: 750 times
Contact:

Re: proposal for stm32l422 support

Postby Giovanni » Sun Apr 25, 2021 10:27 am

Hi,

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

Giovanni

User avatar
alex31
Posts: 338
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 34 times
Been thanked: 50 times
Contact:

Re: proposal for stm32l422 support

Postby alex31 » Sun Apr 25, 2021 2:12 pm

Yes it's 'B'. But all 422 are 'B' => flash:128/ ram:40

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

A.

User avatar
Giovanni
Site Admin
Posts: 13577
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 876 times
Been thanked: 750 times
Contact:

Re: proposal for stm32l422 support

Postby Giovanni » Sun Apr 25, 2021 2:44 pm

OK thanks, just to name the file appropriately, patterns.

Giovanni

User avatar
alex31
Posts: 338
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 34 times
Been thanked: 50 times
Contact:

Re: proposal for stm32l422 support

Postby alex31 » Mon Apr 26, 2021 1:59 pm

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
Attachments
l422_patches_over_truck_26_04_21.zip
4 different patches : SAI RCC_PLL_OUT, L4 registry, elgo_422 board, elgo_422 demo
(22.36 KiB) Downloaded 12 times


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 2 guests