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

Conversation

@LMESTM
Copy link
Contributor

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 ARMmbed/mbed-os-maintainers Feb 22, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented Feb 22, 2019

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

@0xc0170

This comment has been minimized.

Copy link
Member

commented Feb 22, 2019

We are missing tests logs shared, please add them.

@LMESTM

This comment has been minimized.

Copy link
Contributor Author

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
Show resolved Hide resolved features/FEATURE_BLE/targets/TARGET_STM/TARGET_NUCLEO_WB55RG/hw.h Outdated
@LMESTM

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

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 |

@cmonr cmonr added needs: work and removed needs: review labels Feb 25, 2019

@LMESTM

This comment has been minimized.

Copy link
Contributor Author

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

Show resolved Hide resolved ...ET_STM32WB/TARGET_STM32WB55xG/device/TOOLCHAIN_ARM_MICRO/stm32wb55xx.sct Outdated

@LMESTM LMESTM force-pushed the LMESTM:dev_NUCLEO_WB55RG branch 2 times, most recently Feb 26, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

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 LMESTM force-pushed the LMESTM:dev_NUCLEO_WB55RG branch Feb 27, 2019

@LMESTM

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor

commented Feb 27, 2019

@cmonr

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Feb 27, 2019

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

@LMESTM

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

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 ?

LMESTM added some commits Mar 29, 2019

STM32WB: Only configure default peripherals in SetSysClock
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.
STM32WB: ADC INTERNAL CHANNEL reset after read
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 #10143.
@LMESTM

This comment has been minimized.

Copy link
Contributor Author

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

@cmonr cmonr requested review from paul-szczepanek-arm, screamerbg and 0xc0170 and removed request for paul-szczepanek-arm and screamerbg Mar 29, 2019

@pan-

pan- approved these changes Apr 3, 2019

Copy link
Member

left a comment

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

@0xc0170

0xc0170 approved these changes Apr 3, 2019

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Apr 3, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

CI started

@0xc0170

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

@ashok-rao Please review

@LMESTM

This comment has been minimized.

Copy link
Contributor Author

commented Apr 3, 2019

Special thanks to @paul-szczepanek-arm !

@mbed-ci

This comment has been minimized.

Copy link

commented Apr 3, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 added needs: review and removed needs: CI labels Apr 3, 2019

@LMESTM

This comment has been minimized.

Copy link
Contributor Author

commented Apr 4, 2019

@0xc0170 Is there anything blocking the merge now ?

@0xc0170

This comment has been minimized.

Copy link
Member

commented Apr 4, 2019

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

@ashok-rao
Copy link
Contributor

left a comment

LGTM from a new target perspective. Thanks @LMESTM

@LMESTM

This comment has been minimized.

Copy link
Contributor Author

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

28 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARMC5 Success
Details
jenkins-ci/build-ARMC6 Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR8 Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARMC5 Success
Details
jenkins-ci/mbed2-build-ARMC6 Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR8 Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Local astyle testing has passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/doxy-spellcheck Local doxy-spellcheck testing has passed
Details
travis-ci/events Passed, runtime is 10356 cycles
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/include_check Local include_check testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8408B
Details
travis-ci/psa-autogen Local psa-autogen testing has passed
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
travis-ci/tools-py3.5 Local tools-py3.5 testing has passed
Details
travis-ci/tools-py3.6 Local tools-py3.6 testing has passed
Details
travis-ci/tools-py3.7 Local tools-py3.7 testing has passed
Details

@0xc0170 0xc0170 removed the ready for merge label Apr 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.