Skip to content

Support NUMAKER_PFM_NUC472 (re-raise) #103

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 1 commit into from
Feb 17, 2020

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Jan 30, 2020

This PR is re-raised to support NUMAKER_PFM_NUC472.

Note1: #39 breaks for some unknown reason. This PR is re-raised to replace it.

@iot-pdmc
Copy link
Collaborator

Thanks for your changes.
@ARMmbed/pdmc-integrators please review.

@teetak01
Copy link
Contributor

@ccli8 could you retain the PR template and provide the E2E test-results for this board as part of the PR?

@ccli8
Copy link
Contributor Author

ccli8 commented Jan 30, 2020

@teetak01 Configured PELION_CLOUD_API_KEY as documented, I run E2E test but meet error with Limit for the number of API keys exceeded (2). How can I resolve it?

2020-01-30 16:16:02.592  [   DEBUG]   Initializing Cloud API fixture    (cloud_fixtures.py:35)
2020-01-30 16:16:03.991  [   DEBUG]   Request headers: {'User-Agent': 'pelion-e2e-test-library', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-type': 'application/json', 'Authorization': 'Bearer ak_SKIPSKIPSKIPSKIPSKIPSKIP', 'Content-Length': '38'}    (rest_api.py:95)
2020-01-30 16:16:03.992  [   DEBUG]   Request body: {"name": "pelion_e2e_dynamic_api_key"}    (rest_api.py:96)
2020-01-30 16:16:03.994  [   DEBUG]   Response headers: {'Date': 'Thu, 30 Jan 2020 08:16:03 GMT', 'Content-Type': 'application/json', 'Content-Length': '248', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload', 'X-Request-ID': '00005e3290c39ec8b2b0a22000000003', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Set-Cookie': 'TS017f188d=01c6170234640cd3cdc317ae81e4c51a98f106f7ef998798894cbb592242a14b9b8c8686cc8285f7bc9d0ef040944daadb8dfc9653; Path=/'}    (rest_api.py:97)
2020-01-30 16:16:03.994  [   DEBUG]   Response: [403]  POST /v3/api-keys    (rest_api.py:98)
2020-01-30 16:16:03.994  [   DEBUG]   Response text: {"fields":[{"name":"apikey-count","message":"Limit for the number of API keys exceeded (2)."}],"object":"error","code":403,"type":"account_limit_exceeded","message":"Account limit has been exceeded.","request_id":"00005e3290c39ec8b2b0a22000000003"}    (rest_api.py:99)
2020-01-30 16:16:04.092  [   ERROR]   ERROR: create_api_key failed!
Expected result 201 -> actual response was: 403

Response body: {"fields":[{"name":"apikey-count","message":"Limit for the number of API keys exceeded (2)."}],"object":"error","code":403,"type":"account_limit_exceeded","message":"Account limit has been exceeded.","request_id":"00005e3290c39ec8b2b0a22000000003"}

Response headers: {'Date': 'Thu, 30 Jan 2020 08:16:03 GMT', 'Content-Type': 'application/json', 'Content-Length': '248', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=10886400; includeSubDomains; preload', 'X-Request-ID': '00005e3290c39ec8b2b0a22000000003', 'Access-Control-Allow-Origin': '*', 'Vary': 'Origin', 'Access-Control-Expose-Headers': 'X-Request-ID,Content-Length,Content-Disposition', 'Set-Cookie': 'TS017f188d=01c6170234640cd3cdc317ae81e4c51a98f106f7ef998798894cbb592242a14b9b8c8686cc8285f7bc9d0ef040944daadb8dfc9653; Path=/'}    (utils.py:64)
2020-01-30 16:16:04.162  [    INFO]   -----  TEST RESULTS SUMMARY  -----    (conftest.py:72)
2020-01-30 16:16:04.163  [    INFO]   [ check the complete fail reasons and code locations from this log or html report ]    (conftest.py:73)
2020-01-30 16:16:04.163  [    INFO]   [FAILED] - ::test_03_get_resource - (1.502s)    (conftest.py:78)
2020-01-30 16:16:04.163  [    INFO]   E           AssertionError: ERROR: create_api_key failed!    (conftest.py:83)
2020-01-30 16:16:04.164  [    INFO]   E           Expected result 201 -> actual response was: 403    (conftest.py:83)
2020-01-30 16:16:04.164  [    INFO]   E               (conftest.py:83)
2020-01-30 16:16:04.164  [    INFO]   E ---8<--- Error log summary cut down to few lines, check full log above or from html report ---8<---
    (conftest.py:85)

@teetak01
Copy link
Contributor

teetak01 commented Jan 30, 2020

@ccli8 currently the test-tool requires one API key to start the tests, and then it will dynamically create&delete another key to guarantee unique notification channel for the test-run.

I asked the tools-team to allow disabling this feature. If you can delete one of your API-keys on your account, the test should then work. Accounts normally have a limit of 2 API-keys.

Single API key can only have one active event notification channel in place, and this is safeguarding against that possibility, especially if account has multiple users.

@ccli8
Copy link
Contributor Author

ccli8 commented Jan 31, 2020

@teetak01 Thanks for your information. I try under my Online Compiler account, which has 4 API key space for the Pelion E2E tests. So it is resolved.

But I meet another issue on my Windows 10 environment. I've created a ticket to address it

@teetak01
Copy link
Contributor

build-only

@yogpan01
Copy link
Contributor

@teetak01 can this now be merged?

@teetak01
Copy link
Contributor

@ccli8 can you rebase this and confirm that you have verified that at least Firmware update passes on this board. I can then merge this in. We need to get the windows-issues resolved on the test-framework seperately.

1.  Support Nuvoton targets:
    -   NUMAKER_PFM_NUC472
2.  Change storage to NUSD (SD card in SDIO bus mode) from SD (SD card SPI bus mode)
    (1) Add COMPONENT_NUSD.lib.
    (2) Add component NUSD (target.components_add).
    (3) Change default BlockDevice to NUSD:
        Override BlockDevice::get_default_instance (nusd.provide-default-blockdevice).
        Required since mbed-cloud-client 2.1.0 (arm_uc_blockdevice_ext) or in:
        mbed-bootloader/modules/storage/pal-blockdevice/source/arm_uc_pal_blockdevice_mbed.cpp
    (4) Enable kvstore with blockdevice type being "other".
        i)  Override get_other_blockdevice() (nusd.provide-kvstore-other-blockdevice).
        ii) Configure storage type to "FILESYSTEM".
        iii)Configure file system type to "LITTLE".
        vi) Configure block device type to "other".
        v)  Configure external size to 64MiB, which cannot overlap with update-client.
            storage-address/update-client.storage-size.
@ccli8 ccli8 force-pushed the nuvoton_initial_support_nuc472 branch from da81a26 to 07ac3b3 Compare February 17, 2020 09:37
@ccli8
Copy link
Contributor Author

ccli8 commented Feb 17, 2020

@teetak01 Do rebase. The firmware update process is OK.

Update progress = 99%
Update progress = 100%

Mbed Bootloader
[DBG ] Update active firmware
[DBG ] Erase active application
[DBG ] Write header
[DBG ] Copy application
[DBG ] Verify application
[DBG ] New active firmware is valid
booting...

Application ready
Connect to network
mac address ee-87-00-28-70-66
PHY ID 1:0x243
PHY ID 2:0xc54
Network initialized, connected with IP 192.168.0.100

Start developer flow
Create resources
Register Pelion Device Management Client

Counter 1
Client registered.
Account ID: 016ff984f7634a68f16ae84400000000
Endpoint name: 0170527c25360000000000010012bdb9
Device ID: 0170527c25360000000000010012bdb9

Counter 2

@teetak01
Copy link
Contributor

build-only

@teetak01
Copy link
Contributor

Thank you @ccli8

@iot-pdmc
Copy link
Collaborator

@teetak01 teetak01 merged commit 30e1576 into ARMmbed:master Feb 17, 2020
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.

4 participants