STM32WB55 support

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
riz94107
Posts: 3
Joined: Fri Nov 13, 2020 11:05 pm

Re: STM32WB55 support

Post by riz94107 »

OK, I will look closer at the clocks. Thanks!

As far as OpenOCD goes, there does appear to be support added earlier this year (looking through commit emails, I see a few commits that claim adding various features for both STM32WB5x and STM32WB3x), though I will admit I haven't used OpenOCD on this board yet.
User avatar
akscram
Posts: 27
Joined: Sat Jan 25, 2020 8:21 pm
Has thanked: 16 times
Been thanked: 17 times

Re: STM32WB55 support

Post by akscram »

Hi riz94107,

I didn't test USB, however I have added basic clock initialization for it. I can rebase my changes on top of the latest version of the subversion trunk and verify USB. Please, keep in mind that I'm still working on adding IPCC/HSE support needed for communication with the radio stack running in CPU2.

Hi Giovanni,

OpenOCD 0.10.0 supports STM32WB without enabling `-rtos auto`. I use the following command to attach:

Code: Select all

openocd --search ~/openocd/scripts -f board/st_nucleo_wb55.cfg


However, I noticed that the `-c "stm32wbx.cpu configure -rtos auto"` flag, which provides an ability to see a list of threads, doesn't properly work after the following change:

Code: Select all

svn://svn.code.sf.net/p/chibios/svn/trunk@13496


Which fails with the following:

Code: Select all

Error: ChibiOS registry integrity check failed, double linked list violation
    Info : Only showing current execution because of a broken ChibiOS thread registry.
    Error: ChibiOS registry integrity check failed, double linked list violation
    Info : Only showing current execution because of a broken ChibiOS thread registry.
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    target halted due to debug-request, current mode: Thread
    xPSR: 0x01000000 pc: 0x08000218 msp: 0x20000400
    Error: ChibiOS registry integrity check failed, double linked list violation
    Info : Only showing current execution because of a broken ChibiOS thread registry.


Best regards,
Ilya.
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Re: STM32WB55 support

Post by FXCoder »

Hi,
Interesting progress and would be useful for upcoming projects I have.
Could IPCC & HSE become ChibiOS drivers since these are needed for STM32WL as well?
We'll get Giovanni's comments on that...
--
Bob
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32WB55 support

Post by Giovanni »

Those could become helper drivers, like DMAs, for sure but not "abstract" high level drivers in the HAL, too specific.

Giovanni
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Re: STM32WB55 support

Post by FXCoder »

Giovanni,
Sounds good on the helper driver approach for IPCC and HSE

How about proceeding as follows:
1. Add the latest WB55 work by Ilya to trunk.
2. Then WB standard peripheral work/fixes continue as required in trunk.
3. The iPCC and HSE helper drivers can be started (get implementation clues out of CUBE).
4. WL can be started (not too different to WB) and put into trunk.

I can assist with above as time permits.
--
Bob
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32WB55 support

Post by Giovanni »

I wanted to do the clock tree like in L5 and G4, this could take a bit of extra work if you start from the code as it is now.

Giovanni
User avatar
akscram
Posts: 27
Joined: Sat Jan 25, 2020 8:21 pm
Has thanked: 16 times
Been thanked: 17 times

Re: STM32WB55 support

Post by akscram »

Hi Giovanni,

Can you be more specific in what is wrong with `os/hal/ports/STM32/STM32WBxx/hal_lld.h` which I've uploaded in the last tar-ball a while ago?

Best regards,
Ilya.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32WB55 support

Post by Giovanni »

Hi Ilya,

There is nothing wrong, if you look at the latest G4 and L5 ports you can see that there is a lot less code in hal_lld.h/c because both ports include common parts from LLD/RCCv1. If WB is close enough to L5/G4 then it could do the same thing, if it is different then a RCCv2 may be required.

The idea is to minimize code duplication in clock initialization so all new ports use this new system, it would be strange to introduce a new port and not use it, with time I will rework also some of the old ones.

I will give it a try very soon starting from your code, I have the board already.

Giovanni
User avatar
akscram
Posts: 27
Joined: Sat Jan 25, 2020 8:21 pm
Has thanked: 16 times
Been thanked: 17 times

Re: STM32WB55 support

Post by akscram »

Hi Giovanni,

Thank you for the details about RCCv1, it makes sense. I've attached the tarball with previous changes rebased on top of the trunk and in addition to that I've update chconfigs for included demos and tests (ADC, RTC and TRNG) which I manually verified.

Best regards,
Ilya.
Attachments
STM32WB55xx-b76f7a.zip
STM32WB55 with demos and tests (ADC, RTC and TRNG)
(344.92 KiB) Downloaded 458 times
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32WB55 support

Post by Giovanni »

Hi,

I merged all the 21 :) patches with very minor changes, could you validate it works correctly before evaluating changes along the lines of G4/L5?

Giovanni
Post Reply