STM32WLxx port

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: STM32WLxx port

Postby vrollei » Fri Apr 16, 2021 2:41 pm

What kind of generator do you use for it and what should be done to support STM32WLxx mcuconf.h generator?
Vitaly

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

Re: STM32WLxx port

Postby Giovanni » Fri Apr 16, 2021 3:59 pm

vrollei wrote:What kind of generator do you use for it and what should be done to support STM32WLxx mcuconf.h generator?


Hi,

It is very simple, there is a script that updates all mcuconf.h files to their latest "spec", it uses a template engine called FMPP. You just run the script and all files are updated keeping their settings. This is the way we use to keep up-to-date all demos in ChibiOS. A port without its scripts risks to be left behind.

If you want to give it a try (I would do it anyway later so don't feel pressed to do it) look into:

- /tools/ftl/processors/conf
- /tools/updater

In addition, also the board files generator requires a script, those are used in ChibiStudio to generate board files, see in:

- /tools/ftl/processors/boards
- /tools/ftl/schema/boards
- /tools/ftl/xml

This is just for your information, no need to proceed, scripts are usually done when ports are reasonably "finished".

Giovanni

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: STM32WLxx port

Postby FXCoder » Mon Apr 19, 2021 7:04 am

Hi Vitaly,
I am setting up to build a test project to run on WL55.
Just to let you know that enabling RTC does not build due to errors:
1. In EXTiv1 (simple to fix by adding STM32WLXX in check at line #48).
2. RTCv3 has errors due to macros not defined/setup in registry.c for RTC (will take a bit more effort).

Can you take a look at those if you have a chance this week or I'll look at it later (but not this week probably).

Thanks
--
Bob

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: STM32WLxx port

Postby vrollei » Mon Apr 19, 2021 9:47 am

Hi,

I fixed compilation problem,

but RTCv3 should be modified:
- STM32WLxx has no RTC_ICSR_ALRBWF flag, simple way to solve this problem is:

Code: Select all

#if defined(RTC_ICSR_ALRBWF)
      while (!(rtcp->rtc->ICSR & RTC_ICSR_ALRBWF))
        ;
#endif


- STM32WLxx has additional flag TAMP_CR2 BKERASE: Backup registers erase - should Backup registers be erased on RTC initialisation?

- STM32WLxx has additional register TAMP_CR3 - should it be initialised with specific value or default value ok (default - not erase backup on temper events)?
Vitaly

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

Re: STM32WLxx port

Postby Giovanni » Mon Apr 19, 2021 9:51 am

If there are too many differences then a new RTCv4 could be considered.

Are those bits missing or just renamed? this happened already in the past.

Giovanni

User avatar
alex31
Posts: 379
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 62 times
Contact:

Re: STM32WLxx port

Postby alex31 » Mon Apr 19, 2021 10:02 am

Hello,

but RTCv3 should be modified:
- STM32WLxx has no RTC_ICSR_ALRBWF flag, simple way to solve this problem is:


STM32L41x and stm32L42x families, which are using RTCv3 (instead of the RTCv2 for other L4), don't have neither RTC_ICSR_ALRBWF flags, and I confirm that the proposed patch is fine : you don't have to wait to be able to write alarm registers, so there is no equivalent bit with different name in different register.

A.

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: STM32WLxx port

Postby vrollei » Mon Apr 19, 2021 10:16 am

According this doc: https://www.st.com/resource/en/applicat ... ronics.pdf

STM32G0, G1, WL... have all RTC3

But yes, WL does not have ALRAWF/ALRBWF and according documentation there is no need to check any flag before programming AlramA/B just reset ALRAE;

The rest of RTC seems is the same (at least there is no any compilation warning/error), but need to be tested on HW.

If proposed solution to skip ALRAWF/ALRBWF checking is ok, I will update code and check HW.
Vitaly

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

Re: STM32WLxx port

Postby Giovanni » Mon Apr 19, 2021 10:25 am

vrollei wrote:If proposed solution to skip ALRAWF/ALRBWF checking is ok, I will update code and check HW.


OK thanks.

Giovanni

vrollei
Posts: 163
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 26 times

Re: STM32WLxx port

Postby vrollei » Mon Apr 19, 2021 10:27 am

And what about TAMP?

- STM32WLxx has additional flag TAMP_CR2 BKERASE: Backup registers erase - should Backup registers be erased on RTC initialisation?

- STM32WLxx has additional register TAMP_CR3 - should it be initialised with specific value or default value ok (default - not erase backup on temper events)?
Vitaly

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

Re: STM32WLxx port

Postby Giovanni » Mon Apr 19, 2021 10:33 am

For the time being use acceptable defaults (erase on init I guess), we could add configuration options later.

Giovanni


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 26 guests