Skip to content

Support Nuvoton's NUMAKER_PFM_M2351 target #7302

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

Merged
merged 91 commits into from
Jul 18, 2018

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Jun 22, 2018

Description

This PR supports Nuvoton's new target NUMAKER_PFM_M2351, which is Cortex-M23 based.

Support toolchains

  1. ARMC6 (6.10)
    Pass Greentea/CI test
  2. GCC_ARM (2017/Q4)
    Need to fix toolchain issue with cmse_nonsecure_caller and printf/scanf
  3. IAR (7.8)
    Doesn't support yet because cmsis_iccarm.h doesn't support ARMv8M BL completely.

Partition flash/SRAM/peripherals

This version doesn't support configurable for partitioning flash/SRAM/peripherals yet.

  1. Flash: can only be partitioned by external tool and secure code must match it. It defaults to secure 256KiB/non-secure 256KiB.
  2. SRAM: can be partitioned by secure code. It defaults to secure 32KiB/non-secure 64KiB.
  3. Peripherals: can be partitioned by secure code. All peripherals default to non-secure except some reserved for secure.

Build secure/non-secure code

  1. To build secure code, see secure code. Note this example defaults with RTOS disabled and heap/printf disabled to reduce memory footprint. To build with RTOS disabled and heap/printf enabled, please apply the patch Fix heap base/limit error with ARM_LIB_STACK/ARM_LIB_HEAP in RTOS-less #6985 first to fix two-region/RTOS-less issue on Nuvoton targets.
  2. To build non-secure code, see non-secure code.

Pull request type

[ ] Fix
[ ] Refactor
[X] New target
[ ] Feature
[ ] Breaking change

@deepikabhavnani @cyliangtw

@ccli8
Copy link
Contributor Author

ccli8 commented Jun 22, 2018

ARMC6/M2351 Greentea test report

+-------------------------+-------------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
| target                  | platform_name     | test suite                                                                           | result | elapsed_time (sec) | copy_method |
+-------------------------+-------------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-device_key-tests-device_key-functionality                           | OK     | 25.24              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test                        | OK     | 17.07              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test_default                | OK     | 17.04              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-case_async_validate               | OK     | 18.53              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_async                | OK     | 24.62              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_repeat               | OK     | 18.85              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-case_selection                    | OK     | 16.97              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-case_setup_failure                | OK     | 17.44              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-case_teardown_failure             | OK     | 17.46              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-control_type                      | OK     | 17.82              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_async_scheduler           | OK     | 17.86              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_scheduler                 | OK     | 18.64              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-test_assertion_failure_test_setup | OK     | 16.55              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_case_selection_failure | OK     | 16.74              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_failure                | OK     | 16.89              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-nvstore-tests-nvstore-functionality                                 | OK     | 31.68              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-tests-filesystem-buffered_block_device                              | OK     | 16.83              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-tests-filesystem-flashsim_block_device                              | OK     | 16.71              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-tests-filesystem-heap_block_device                                  | OK     | 16.76              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-tests-filesystem-mbr_block_device                                   | OK     | 17.16              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-features-tests-filesystem-util_block_device                                  | OK     | 17.47              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-events-queue                                                           | OK     | 24.46              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-events-timing                                                          | OK     | 77.35              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-integration-basic                                                      | OK     | 15.98              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-c_strings                                                 | OK     | 18.67              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-crc                                                       | OK     | 17.57              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-dev_null                                                  | OK     | 17.97              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-echo                                                      | OK     | 18.72              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-flashiap                                                  | OK     | 17.72              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-generic_tests                                             | OK     | 17.12              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-lp_ticker                                                 | OK     | 23.09              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-lp_timeout                                                | OK     | 60.82              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-lp_timer                                                  | OK     | 21.84              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-race_test                                                 | OK     | 17.88              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-rtc                                                       | OK     | 31.67              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-sleep_lock                                                | OK     | 16.96              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-stl_features                                              | OK     | 17.63              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-ticker                                                    | OK     | 45.89              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-timeout                                                   | OK     | 59.26              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-timer                                                     | OK     | 24.31              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_drivers-timerevent                                                | OK     | 18.72              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_functional-callback                                               | OK     | 18.03              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_functional-callback_big                                           | OK     | 18.27              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_functional-callback_small                                         | OK     | 18.29              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_functional-functionpointer                                        | OK     | 16.97              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-common_tickers                                                | OK     | 34.54              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-common_tickers_freq                                           | OK     | 40.06              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-critical_section                                              | OK     | 16.82              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-flash                                                         | OK     | 18.67              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-lp_ticker                                                     | OK     | 17.13              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-rtc                                                           | OK     | 60.08              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-rtc_reset                                                     | OK     | 21.71              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-rtc_time                                                      | OK     | 18.59              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-rtc_time_conv                                                 | OK     | 37.92              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-sleep                                                         | OK     | 18.52              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-sleep_manager                                                 | OK     | 16.66              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-sleep_manager_racecondition                                   | OK     | 29.72              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-ticker                                                        | OK     | 34.55              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_hal-us_ticker                                                     | OK     | 16.41              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_platform-critical_section                                         | OK     | 18.55              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_platform-error_handling                                           | OK     | 20.44              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_platform-filehandle                                               | OK     | 17.94              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_platform-singletonptr                                             | OK     | 16.76              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_platform-system_reset                                             | OK     | 17.14              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbed_platform-transaction                                              | OK     | 17.52              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-mbed-attributes                                              | OK     | 18.78              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-mbed-call_before_main                                        | OK     | 15.94              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-mbed-cpp                                                     | OK     | 15.9               | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-mbed-div                                                     | OK     | 15.88              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-mbed-static_assert                                           | OK     | 16.44              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-basic                                              | OK     | 28.1               | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-circularbuffer                                     | OK     | 23.01              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-condition_variable                                 | OK     | 17.07              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-event_flags                                        | OK     | 19.58              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-heap_and_stack                                     | OK     | 17.49              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-mail                                               | OK     | 21.72              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-malloc                                             | OK     | 37.71              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-memorypool                                         | OK     | 24.37              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-mutex                                              | OK     | 21.17              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-queue                                              | OK     | 19.86              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-rtostimer                                          | OK     | 19.3               | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-semaphore                                          | OK     | 21.43              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-signals                                            | OK     | 23.43              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedmicro-rtos-mbed-threads                                            | OK     | 28.19              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedtls-multi                                                          | OK     | 16.96              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | mbed-os-tests-mbedtls-selftest                                                       | OK     | 31.36              | default     |
+-------------------------+-------------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
mbedgt: test suite results: 86 OK

@ccli8
Copy link
Contributor Author

ccli8 commented Jun 22, 2018

ARMC6/M2351 CI test report

+-------------------------+-------------------+-----------------------------+--------+--------------------+-------------+
| target                  | platform_name     | test suite                  | result | elapsed_time (sec) | copy_method |
+-------------------------+-------------------+-----------------------------+--------+--------------------+-------------+
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-api-analogin          | OK     | 17.83              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-api-businout          | OK     | 33.67              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-api-digitalio         | OK     | 18.72              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-api-i2c               | OK     | 19.67              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-api-interruptin       | OK     | 18.47              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-api-pwm_fall          | OK     | 26.66              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-api-pwm_rise          | OK     | 26.74              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-api-pwm_rise_fall     | OK     | 140.68             | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-api-spi               | OK     | 19.16              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-assumptions-analogin  | OK     | 20.7               | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-assumptions-digitalio | OK     | 19.55              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-assumptions-i2c       | OK     | 17.05              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-assumptions-pwm       | OK     | 17.05              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-assumptions-pwmout    | OK     | 16.97              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-assumptions-spi       | OK     | 18.88              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-concurrent-comms      | OK     | 18.99              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-concurrent-gpio       | OK     | 20.79              | default     |
| NUMAKER_PFM_M2351-ARMC6 | NUMAKER_PFM_M2351 | tests-concurrent-mixed      | OK     | 20.22              | default     |
+-------------------------+-------------------+-----------------------------+--------+--------------------+-------------+
mbedgt: test suite results: 18 OK

@deepikabhavnani
Copy link

@ccli8 - Thanks for the PR and great work. I will test it locally and share the results soon.

Only concern is related to multiple hex files, our plan was to merge secure/non-secure hex files and flash as single image. I understand we need some changes in our tool to do that, @theotherjimmy can comment more on that.

@0xc0170 - Question will be to allow multiple binaries till we have support in tools? Please note Nuvoton firmware does support flashing of multiple hex files.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 25, 2018

@0xc0170 - Question will be to allow multiple binaries till we have support in tools? Please note Nuvoton firmware does support flashing of multiple hex files.

That is a question for @theotherjimmy

cc @bulislaw

@deepikabhavnani
Copy link

Target device entry in json file consist of NUMAKER_PFM_M2351 NUMAKER_PFM_M2351_NS for non-secure and NUMAKER_PFM_M2351_S for secure side. https://github.com/ARMmbed/mbed-os/pull/7302/files#diff-3d6b492f3b697230670ddbb26104bbfdR4221

Building test for NUMAKER_PFM_M2351_NS target was successful but execution failed with below error.

mbedgt: no platform/target matching tests were found!
mbedgt: no matching platforms were found!
mbedgt: completed in 0.14 sec
mbedgt: exited with code -110

mbedls command gives

+-------------------+----------------------+-------------+-------------+----------------------------------+-----------------+
| platform_name     | platform_name_unique | mount_point | serial_port | target_id                        | daplink_version |
+-------------------+----------------------+-------------+-------------+----------------------------------+-----------------+
| NUMAKER_PFM_M2351 | NUMAKER_PFM_M2351[0] | D:          | COM27       | 130500007640091103089E3B00000011 | 0201            |
+-------------------+----------------------+-------------+-------------+----------------------------------+-----------------+

I suspect error is because platform_name is NUMAKER_PFM_M2351. @theotherjimmy do we have any solution for this? Can we treat NUMAKER_PFM_M2351_NS and NUMAKER_PFM_M2351 as same?

@theotherjimmy
Copy link
Contributor

@ccli8 Yes please see the mbed-ls mocking documentation https://github.com/ARMmbed/mbed-ls#mocking-renaming-platforms

@deepikabhavnani
Copy link

I have verified green tea test for Version 1.0 board and it was successful. Testing with Version 1.1 / Version 1.2 is pending

"inherits": ["NUMAKER_PFM_M2351"],
"device_has_remove": ["TRNG"]
},
"NUMAKER_PFM_M2351_NS": {

Choose a reason for hiding this comment

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

Do we need NUMAKER_PFM_M2351_NS? Can we use NUMAKER_PFM_M2351 only for non-secure?

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we not have the _S variant either, and rely on the target.core override.

Choose a reason for hiding this comment

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

_S variant is required, else in secure examples we will have to suggest code change in targets.json which is not a good idea.

_NS is actually the duplicate, hence I suggested to remove that.

Copy link
Contributor

@theotherjimmy theotherjimmy Jun 26, 2018

Choose a reason for hiding this comment

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

A few things:

  • target.core is an allowed override in mbed_app.json
  • target.device_has is also override-able in mbed_app.json
  • The difference between _S and _NS is target.core and target.device_has
  • There are core-specific scan rules available

This implies that the base target can be converted into the 2 variants entirely with mbed_app.json.

I recommend that we do not have variants, default to Non-Secure, and allow users to override or create a custom target for compiler secure partitions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NUMAKER_PFM_M2351 defaults to non-secure target.
NUMAKER_PFM_M2351_S means secure target.
NUMAKER_PFM_M2351_NS means non-secure target and is duplicate of NUMAKER_PFM_M2351.

The presence of NUMAKER_PFM_M2351_S/NUMAKER_PFM_M2351_NS is to avoid ambiguous with just NUMAKER_PFM_M2351. Besides, it may not so straightforward for user to create these variants in mbed_app.json.

Copy link
Contributor

@theotherjimmy theotherjimmy Jun 27, 2018

Choose a reason for hiding this comment

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

@ccli8 This creates confusion: As a user, I have to know what variant I'm using instead of "pick my board and go". We have the same complaint with the NRF51 based targets and their variants. I would find it especially confusing if one of the variants is a duplicate!

You imply that it's complicated or difficult to add the differences between the _S and base variant changes to mbed_app.json, yet the targets differ by core and a single entry in device_has. Have you tried it? What makes you say that it would be difficult?

Choose a reason for hiding this comment

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

@ccli8 - Also we do not want user to think Mbed OS can be secure, _S variant is only to help in development of secure side, it should not be the final secure application for a target.

_S in Mbed OS code will give false impression to users. We expect target owners to place a secure binary / cmse library and any required header file in target specific folder for Nuvoton M2351 it should be TARGET_NUVOTON\TARGET_M2351\TARGET_NUMAKER_PFM_M2351

Copy link
Contributor

Choose a reason for hiding this comment

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

@deepikabhavnani - For easy hands on, Nuvoton could provide one secure binary/cmse lib. However, secure code could encapsulate algorithm and partition HW resource/IPs dependent on each domain application. For example, some system regards SPI as secure, another system regards SPI as non-secure. In echo system, some company or maker must take over both secure + non-secure code, some relies on IDH, IDH will be major on secure code development and system house could develop or customize non-secure code based on IDH's secure binary/cmse lib.

If developer needs to use multiple SDK for secure/non-secure developing, it will be more confused & difficult than proprietary SDK/BSP.
So, in IoT platform viewpoint, it seems mandatory to fulfill both of secure code and non-secure code development, especially secure code dependent on each IDH's system architecture. Thus, strongly recommend to keep _S, else I can't image how to promote.

Copy link
Contributor

@theotherjimmy theotherjimmy Jun 29, 2018

Choose a reason for hiding this comment

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

I'm going to continue to say that the _S variant is not useful, as the following mbed_app.json does the same thing:

{
    "target_overrides": {
        "NUMAKER_PFM_M2351": {
            "target.core": "Cortex-M23",
            "target.device_has_remove": ["TRNG"]
        }
    }
}

anyone that needs to switch often can add the target into custom_targets.json or create multiple application configurations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deepikabhavnani @theotherjimmy I remove NUMAKER_PFM_M2351_S/NUMAKER_PFM_M2351_NS targets from targets.json in d82c914. The secure code/non-secure code are updated accordingly.

@deepikabhavnani
Copy link

I have verified green tea test for Version 1.0 board and it was successful. Testing with Version 1.1 / Version 1.2 is pending

Greentea test on Version 1.2 was successful as well

@theotherjimmy
Copy link
Contributor

@deepikabhavnani So we have GT tests with version 1.1 remaining?

@deepikabhavnani
Copy link

@theotherjimmy - I don;t think there is version 1.1. Release is with hardware version 1.2 only. I did testing with version 1.0 with some changes as version 1.2 was not available to me at that time.

Test success with version 1.2 is only required.
@ccli8 @cyliangtw - Please correct if I am wrong.

@cyliangtw
Copy link
Contributor

@deepikabhavnani - Yes, test with board v1.2 is only required.
Sorry to confuse you. Board v1.1 is the same with v1.2 except UNO pin position a little shift, encounter daughter board not easy plug-in. So, we obsolete board v1.1, however SW v1.1 could work in both of board v1.1 and v1.2 . Moreover, we stop v1.1 board and only deliver v1.2 board.

@ccli8
Copy link
Contributor Author

ccli8 commented Jul 2, 2018

d7b0a2d and d6ec7a6 are synced from #7029.

@theotherjimmy
Copy link
Contributor

Marked as dependent on #7029

@theotherjimmy
Copy link
Contributor

Thanks for cleaning up targets.json.

deepikabhavnani
deepikabhavnani previously approved these changes Jul 2, 2018
Copy link

@deepikabhavnani deepikabhavnani left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 Great work.

Please add secure binary and library at
TARGET_NUVOTON\TARGET_M2351\TARGET_NUMAKER_PFM_M2351

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 2, 2018

@ccli8 Can you rebase? PR 7029 was merged

@deepikabhavnani
Copy link

@ccli8 - Build on linux system fails and was fixed with below change. Please add the fix.

diff --git a/targets/TARGET_NUVOTON/TARGET_M2351/pinmap.c b/targets/TARGET_NUVOTON/TARGET_M2351/pinmap.c
index 906c790a3..e80e87e26 100644
--- a/targets/TARGET_NUVOTON/TARGET_M2351/pinmap.c
+++ b/targets/TARGET_NUVOTON/TARGET_M2351/pinmap.c
@@ -19,7 +19,7 @@
 #include "pinmap.h"
 #include "PortNames.h"
 #include "mbed_error.h"
-#include "partition_m2351.h"
+#include "partition_M2351.h"

@ccli8
Copy link
Contributor Author

ccli8 commented Jul 3, 2018

Can you rebase? PR 7029 was merged

@0xc0170 I've done rebase.

@ccli8 ccli8 force-pushed the nuvoton_m2351_v1.1 branch from 5e33139 to 455f1fd Compare July 16, 2018 02:47
@ccli8
Copy link
Contributor Author

ccli8 commented Jul 16, 2018

@deepikabhavnani I change default_toolchain from GCC_ARM to ARMC6 and merge your change with supported_toolchains into one commit 455f1fd.

@theotherjimmy
Copy link
Contributor

@deepikabhavnani @studavekar Change added that fixes CI.

@studavekar
Copy link
Contributor

/morph build

@mbed-ci
Copy link

mbed-ci commented Jul 16, 2018

Build : SUCCESS

Build number : 2611
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7302/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jul 16, 2018

@deepikabhavnani
Copy link

Test logs :http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/7302/2362

NUMAKER_PFM_M2351 not present in this test

@mbed-ci
Copy link

mbed-ci commented Jul 16, 2018

@studavekar
Copy link
Contributor

Test logs :http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/7302/2362

NUMAKER_PFM_M2351 not present in this test

It's not added we need to check the stability of devices as it's not running DAPLINK, if the device doesn't have stable interface firmware it will not be added. Since it will fail other PR.

@cmonr
Copy link
Contributor

cmonr commented Jul 16, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jul 16, 2018

Build : SUCCESS

Build number : 2616
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7302/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jul 16, 2018

@mbed-ci
Copy link

mbed-ci commented Jul 16, 2018

@cmonr
Copy link
Contributor

cmonr commented Jul 17, 2018

/morph build

@deepikabhavnani
Copy link

Tested locally for ARMC6

mbedgt: test case results: 542 OK
mbedgt: completed in 1907.22 sec

@mbed-ci
Copy link

mbed-ci commented Jul 17, 2018

Build : SUCCESS

Build number : 2626
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7302/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jul 17, 2018

@mbed-ci
Copy link

mbed-ci commented Jul 17, 2018

@cmonr cmonr merged commit e9e1ff9 into ARMmbed:master Jul 18, 2018
pan- pushed a commit to pan-/mbed that referenced this pull request Aug 22, 2018
Support Nuvoton's NUMAKER_PFM_M2351 target
@cyliangtw cyliangtw deleted the nuvoton_m2351_v1.1 branch March 9, 2023 05:24
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.

8 participants