Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding NUCLEO_WB55RG support #9814

Merged
merged 38 commits into from
Apr 4, 2019
Merged

Conversation

LMESTM
Copy link
Contributor

@LMESTM LMESTM commented Feb 22, 2019

Description

Here is the first Pull request to enable STM32WB55 support.
https://www.st.com/en/microcontrollers-microprocessors/stm32wb55rg.html

This port includes BLE support with CORDIO stack.

Pull request type

[ ] Fix
[ ] Refactor
[X ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@jeromecoutant @pan- @screamerbg @avilei

Release Notes

Tests are ongoing but feedback and review are welcome already.

@LMESTM LMESTM changed the title Dev nucleo wb55 rg Adding NUCLEO_WB55RG support Feb 22, 2019
@ciarmcom ciarmcom requested review from pan-, screamerbg and a team February 22, 2019 16:00
@ciarmcom
Copy link
Member

@LMESTM, thank you for your changes.
@screamerbg @pan- @ARMmbed/mbed-os-pan @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 22, 2019

We are missing tests logs shared, please add them.

@LMESTM
Copy link
Contributor Author

LMESTM commented Feb 25, 2019

First test report - CI test shield tests ALL OK.
mbed2 and mbed-os tests still ongoing (there is an issue for ARM /µARM with mbed2 that I will fix)

target platform_name test suite result elapsed_time (sec) copy_method
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-api-analogin OK 17.19 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-api-businout OK 32.59 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-api-digitalio OK 17.69 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-api-i2c OK 18.92 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-api-interruptin OK 17.63 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-api-pwm_fall OK 28.95 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-api-pwm_rise OK 28.92 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-api-pwm_rise_fall OK 181.58 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-api-spi OK 18.53 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-assumptions-analogin OK 20.15 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-assumptions-digitalio OK 18.36 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-assumptions-i2c OK 16.07 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-assumptions-pwm OK 16.54 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-assumptions-pwmout OK 15.93 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-assumptions-spi OK 16.5 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-concurrent-comms OK 18.3 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-concurrent-gpio OK 20.06 default
NUCLEO_WB55RG-ARM NUCLEO_WB55RG tests-concurrent-mixed OK 19.25 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-api-analogin OK 17.6 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-api-businout OK 32.95 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-api-digitalio OK 18.14 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-api-i2c OK 19.16 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-api-interruptin OK 18.06 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-api-pwm_fall OK 29.36 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-api-pwm_rise OK 29.41 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-api-pwm_rise_fall OK 181.88 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-api-spi OK 19.33 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-assumptions-analogin OK 20.3 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-assumptions-digitalio OK 19.06 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-assumptions-i2c OK 16.54 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-assumptions-pwm OK 17.08 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-assumptions-pwmout OK 16.47 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-assumptions-spi OK 17.04 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-concurrent-comms OK 19.0 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-concurrent-gpio OK 20.37 default
NUCLEO_WB55RG-GCC_ARM NUCLEO_WB55RG tests-concurrent-mixed OK 19.89 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-api-analogin OK 17.02 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-api-businout OK 33.66 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-api-digitalio OK 17.63 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-api-i2c OK 18.6 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-api-interruptin OK 17.35 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-api-pwm_fall OK 29.0 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-api-pwm_rise OK 28.69 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-api-pwm_rise_fall OK 181.29 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-api-spi OK 18.44 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-assumptions-analogin OK 19.92 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-assumptions-digitalio OK 18.41 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-assumptions-i2c OK 15.91 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-assumptions-pwm OK 16.46 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-assumptions-pwmout OK 16.07 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-assumptions-spi OK 16.39 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-concurrent-comms OK 18.0 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-concurrent-gpio OK 19.92 default
NUCLEO_WB55RG-IAR NUCLEO_WB55RG tests-concurrent-mixed OK 18.86 default

@LMESTM
Copy link
Contributor Author

LMESTM commented Feb 25, 2019

@0xc0170 Hi Martin, I'm looking for some guidance about my issue with ARM toolchain.

In STM32WB55RG, there is a section in shared memory that is used to communicate with the BLE sub-system.

  ; SRAM2 - Shared memory
  RW_IRAM2a 0x20030000 0x00002800  {  ; RW data
   *(MAPPING_TABLE, +First)
   *(MB_MEM1)
  }

This section is actually being used when FEATURE_BLE is active. the problem with ARM is that I get an error when compiling for MBED2 because the BLE feature is not compiled. I'd like to introduce a condition which allows to distinguish between OS2/OS5 or between BLE/not BLE in the linker script, but I could not find my way so far.

I tried using

#if defined(FEATURE_BLE)
   *(MAPPING_TABLE, +First)
#endif

but it won't be defined in mbed-os case either in the context of the linker script.

Any idea how I could / should implement this ?

EDIT: SOLVED with Martin support: no need to use the +First attribute as the alphabetical order will ensure that MAPPING_TABLE is placed before MB_MEM1 : tested OK and branch updated.
*(MAPPING_TABLE, +First)

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 25, 2019

This section is actually being used when FEATURE_BLE is active. the problem with ARM is that I get an error when compiling for MBED2

What is the error ? Why does it fail?

@LMESTM
Copy link
Contributor Author

LMESTM commented Feb 25, 2019

This section is actually being used when FEATURE_BLE is active. the problem with ARM is that I get an error when compiling for MBED2

What is the error ? Why does it fail?

In mbed2, it will report:

    [ERROR] "C:/Data/Workspace/mbed/BUILD/test/NUCLEO_WB55RG/ARM/MBED_2/
    .link_script.sct", line 65 (column 6): Error: L6236E:
    No section matches selector - no section to be FIRST/LAST.

Because without BLE feature, there is no content fitting into the MAPPING_TABLE section, so this is empty and this seems not supported for a section with +FIRST attribute.

@LMESTM
Copy link
Contributor Author

LMESTM commented Feb 25, 2019

MBED2 test results for IAR and GCC_ARM - ARM (and µARM) FAILs for now because of scatter file issue, as being discussed ...

Test summary:

Result Target Toolchain Test ID Test Description Elapsed Time (sec) Timeout (sec) Loops

| OK | NUCLEO_WB55RG | GCC_ARM | DTCT_1 | Simple detect test | 0.48 | 10 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | EXAMPLE_1 | /dev/null | 3.45 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_10 | Hello World | 0.37 | 5 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_11 | Ticker Int | 11.4 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_12 | C++ | 1.36 | 10 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_16 | RTC | 4.59 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_2 | stdio | 0.76 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_23 | Ticker Int us | 11.39 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_24 | Timeout Int us | 12.29 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_25 | Time us | 11.43 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_26 | Integer constant division | 1.37 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_34 | Ticker Two callbacks | 11.43 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_37 | Serial NC RX | 7.03 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_38 | Serial NC TX | 6.02 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_A1 | Basic | 1.4 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_A21 | Call function before main (mbed_main) | 1.45 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_A9 | Serial Echo at 115200 | 1.26 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | GCC_ARM | MBED_BUSOUT | BusOut | 2.31 | 30 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | DTCT_1 | Simple detect test | 0.47 | 10 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | EXAMPLE_1 | /dev/null | 3.48 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_10 | Hello World | 0.36 | 5 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_11 | Ticker Int | 11.42 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_12 | C++ | 1.4 | 10 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_16 | RTC | 4.54 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_2 | stdio | 0.76 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_23 | Ticker Int us | 11.39 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_24 | Timeout Int us | 12.15 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_25 | Time us | 11.51 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_26 | Integer constant division | 1.4 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_34 | Ticker Two callbacks | 11.39 | 15 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_37 | Serial NC RX | 7.05 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_38 | Serial NC TX | 5.99 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_A1 | Basic | 1.39 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_A21 | Call function before main (mbed_main) | 1.44 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_A9 | Serial Echo at 115200 | 1.23 | 20 | 1/1 |
| OK | NUCLEO_WB55RG | IAR | MBED_BUSOUT | BusOut | 2.29 | 30 | 1/1 |

@LMESTM
Copy link
Contributor Author

LMESTM commented Feb 26, 2019

And the mbed-os 5 results.

The BLE timeout cases in ARM TC are related to the mbed2 / linker script problem I've raised : I have tried to make the Shared Memory section conditional and I haven't succeeded, so the shared memory section is missing in this ARM build.

Updated with last commit:

+-------------------+---------------+-----------------------------------------------------------------------+--------+--------------------+-------------+
| target            | platform_name | test suite                                                            | result | elapsed_time (sec) | copy_method |
+-------------------+---------------+-----------------------------------------------------------------------+--------+--------------------+-------------+
| NUCLEO_WB55RG-ARM | NUCLEO_WB55RG | features-feature_ble-targets-target_cordio-tests-cordio_hci-driver    | OK     | 17.17              | default     |
| NUCLEO_WB55RG-ARM | NUCLEO_WB55RG | features-feature_ble-targets-target_cordio-tests-cordio_hci-transport | OK     | 28.79              | default     |
+-------------------+---------------+-----------------------------------------------------------------------+--------+--------------------+-------------+

TOTAL:
mbedgt: test suite results: 321 OK

@LMESTM LMESTM force-pushed the dev_NUCLEO_WB55RG branch 2 times, most recently from 2d249d0 to d91cc65 Compare February 27, 2019 09:40
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2019

Note, #9571 - might have implications for new targets. Please review (there's design document, and targets updated, if any questions, let us know). In any case, please reply to this comment if this change is already done or when completed.

@LMESTM
Copy link
Contributor Author

LMESTM commented Feb 27, 2019

One comment about MBED2 testing, I have rebased on top of master and there seems to be issues with building MBED2 with uARM toolchain.
I get
Error: L6218E: Undefined symbol $Super$$__rt_lib_init (referred from mbed_retarget.o).
Error: L6218E: Undefined symbol __use_two_region_memory (referred from mbed_retarget.o).

Not only for STM32WB but also for other targets like L496.
Is this a know issue ?

@cmonr
Copy link
Contributor

cmonr commented Feb 27, 2019

@ARMmbed/mbed-os-core ^^^

@cmonr
Copy link
Contributor

cmonr commented Feb 27, 2019

@LMESTM Would it be worth looking into the Python issues while the team gets a chance to look this over?

@deepikabhavnani
Copy link

@LMESTM - uARM issue should be resolved with #9766. Please let me know if you still see failures after applying changes form 9766

@LMESTM
Copy link
Contributor Author

LMESTM commented Feb 28, 2019

@deepikabhavnani Thanks - I'm good as this is clearly already known and addressed :-)

@cmonr About python issues, I guess you're referring to travis-ci/tools-py2.7errors ? It says the device name is not known. Where does the list of known device come from ?

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 28, 2019

@LMESTM device_name error comes from cmsis pack manager - the device is not known - is it valid ?

From the docs: We use the tool ArmPackManager to parse CMSIS Packs for target information. index.json stores the parsed information from the PDSC (Pack Description) See https://os.mbed.com/docs/mbed-os/v5.11/reference/adding-and-configuring-targets.html

@LMESTM
Copy link
Contributor Author

LMESTM commented Feb 28, 2019

@LMESTM device_name error comes from cmsis pack manager - the device is not known - is it valid ?

I think it is valid, but this target has been officially published only last week. I don't know how much time it'll take to get into the CMSIS pack and then from CMSIS pack to mbed-os ?

When doing so, do not disbale GPIO clocks as they may be used by other
drivers !

As a result, debug will be disabled by default, but can be enabled by
either modifying code or selecting MBED debug profile.
Typically the RTC clock is configured by RTC driver itself.

RNG on the other hand is shared with M0+ core and it is expected that
M4 turns it on at boot time.
Internal channels use is enabling ADC "internal path" which needs
to be disabled after measurement.

Same applied here for WB family as was done for others in ARMmbed#10143.
@LMESTM
Copy link
Contributor Author

LMESTM commented Mar 29, 2019

I was planning to wait for merge, then send separate PRs for supporting deep sleep mode and add few other side fixes, but considering the situation, I've rebased on top of mbed/mater an added few more commits to this PR. This update includes:

  • Adding HW semaphore for Flash and TRNG
  • Update linker script for GCC to align with recent changes on master
  • Fix clock settings to support Deep sleep entry / exit when tickless mode is active

Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated on the BLE side. Thanks @paul-szczepanek-arm

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 3, 2019

CI started

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 3, 2019

@ashok-rao Please review

@LMESTM
Copy link
Contributor Author

LMESTM commented Apr 3, 2019

Special thanks to @paul-szczepanek-arm !

@mbed-ci
Copy link

mbed-ci commented Apr 3, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 5
Build artifacts

@LMESTM
Copy link
Contributor Author

LMESTM commented Apr 4, 2019

@0xc0170 Is there anything blocking the merge now ?

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 4, 2019

I would like to have @ashok-rao review, let me check with him again today and make this ready asap.

Copy link
Contributor

@ashok-rao ashok-rao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a new target perspective. Thanks @LMESTM

@LMESTM
Copy link
Contributor Author

LMESTM commented Apr 4, 2019

LGTM from a new target perspective. Thanks @LMESTM
@ashok-rao Thanks for quick feedback

@0xc0170 0xc0170 merged commit c2ebb79 into ARMmbed:master Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.