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

Support NU_PFM_M2351_NPSA_NS #42

Closed
wants to merge 1 commit into from
Closed

Support NU_PFM_M2351_NPSA_NS #42

wants to merge 1 commit into from

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Oct 4, 2019

Description

This PR is split of #25 and to support NU_PFM_M2351_NPSA_NS.

Related PR

Relies on ARMmbed/mbed-os#11594 to integrate M2351 non-PSA default secure program into mbed-os tree which has partitioned memory for Pelion application.

@anttiylitokola
Copy link
Contributor

Can one of the admins verify this patch?

1 similar comment
@anttiylitokola
Copy link
Contributor

Can one of the admins verify this patch?

@anttiylitokola
Copy link
Contributor

build-only

@ccli8
Copy link
Contributor Author

ccli8 commented Oct 8, 2019

Remind that this PR relies on ARMmbed/mbed-os#11594

@anttiylitokola
Copy link
Contributor

Remind that this PR relies on ARMmbed/mbed-os#11594

It was a good test for the CI, it should have reported build failures :)

@anttiylitokola
Copy link
Contributor

build-only

@anttiylitokola
Copy link
Contributor

Test run: FAILED


Failed to build following targets:
NU_PFM_M2351_NPSA_NS-IAR
NU_PFM_M2351_NPSA_NS-GCC_ARM
NU_PFM_M2351_NPSA_NS-ARM
Build artifacts

posted-by-tag: https://jenkins-client.isgtesting.com/job/mbed-os-example-pelion/

@ccli8
Copy link
Contributor Author

ccli8 commented Oct 9, 2019

For ARMC6 build failure, it relies on ARMmbed/mbed-os#11594.
For GCC/IAR build failure, M2351 haven't supported these toolchains yet (ARMmbed/mbed-os#11310 (comment)).

@ccli8
Copy link
Contributor Author

ccli8 commented Oct 9, 2019

We find an issue with M2351. M2351 is a TrustZone target. When any of memory partition, IP security attribute, and secure gateway library in secure program (in mbed-os tree) is changed, bootloader needs rebuild accordingly. This increases maintenance effort in this repo. Please suspend this PR.

Based on mbed-os-pelion-example master/mbed-bootloader 4.1.0/mbed-cloud-client 4.0.0,
support Nuvoton targets:
1.  Support Nuvoton targets:
    -   NU_PFM_M2351_NPSA_NS
2.  Support M2351
    (1) Use pre-built secure image/lib
    (2) Build by running:
        $ mbed compile -m NU_PFM_M2351_NPSA_NS -t ARMC6
3.  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.
4.  Change back UARTSerial tx/rx buffer size from 1024/1024 to 256/256. This can reduce
    memory footprint by (1024 - 256) * 2 = 1.5KiB. Because this configuration influences
    both ESP8266 and default console (platfrom/mbed_retarget.cpp), memory reduction can
    achieve 1.5KiB x 2 = 3KiB.
5.  Enlarge ESP8266 'send tcp data' timeout on Nuvoton targets
    Pelion connection has some failure rate with this. Enlarging ESP8266_SEND_TIMEOUT
    can just relieve the issue. A ticket has raised to address it:
    ARMmbed/mbed-os#11544
6.  Requirements for mbed-os version:
    -   mbed-os 5.13.0 (or afterwards) to support kvstore with block device type being "other"
    -   mbed-os 5.13.1 (or afterwards) to fix 'undefined pal_plat_osEntropyInject(...)' error
    -   mbed-os 5.14.0 (or afterwards) to support NU_PFM_M2351_NPSA_NS target renaming and combined build
    -   mbed-os 5.14.? (or afterwards) to support NU_PFM_M2351_NPSA_S default secure program which has partitioned memory for Pelion application
@teetak01 teetak01 closed this Jan 9, 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.

3 participants