Commit Graph

540 Commits (240758db42aaa42b2abd50daea5033c3cc7e80dc)

Author SHA1 Message Date
Chun-Chieh Li aae04b2516 Nuvoton: Remove TRNG support
These targets below just support PRNG, not real TRNG. They cannot annouce TRNG.

-   NUMAKER_PFM_NUC472
-   NUMAKER_PFM_M487
-   NUMAKER_IOT_M487

On targets without TRNG, to run mbedtls applications which require entropy source,
there are two alternatives to TRNG:

-   Custom entropy source:
    Define MBEDTLS_ENTROPY_HARDWARE_ALT and provide custom mbedtls_hardware_poll(...)
-   NV seed:
    1.  Define MBEDTLS_ENTROPY_NV_SEED
    2.  Define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO/MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and provide custom mbedtls_nv_seed_read(...)/mbedtls_nv_seed_write(...).
    3.  Don't define MBEDTLS_PSA_INJECT_ENTROPY. Meet mbedtls_psa_inject_entropy(...) undefined and then provide custom one, which must be compatible with mbedtls_nv_seed_read(...)/mbedtls_nv_seed_write(...) above.
    4.  For development, simulating partial provision process, inject entropy seed via mbedtls_psa_inject_entropy(...) pre-main.
2019-11-13 18:01:24 +08:00
Martin Kojtal 5a1ccc0f2f
Merge pull request #11780 from OpenNuvoton/nuvoton_fpga_perif_free
Nuvoton: Add implementations of HAL API i2c_free and analogin_free
2019-11-04 09:49:36 +01:00
Martin Kojtal eea83007be
Merge pull request #11203 from Tharazi97/Watchdog_lower_limit_timeout_test
Add watchdog lower limit timeout test
2019-10-31 14:25:52 +01:00
Chun-Chieh Li 0260f1b3df NANO130: Remove unnecessary synchronization in analog-in HAL
Driver AnalogIn has done with it, so remove synchronization in analog-in HAL.
2019-10-31 15:23:57 +08:00
Chun-Chieh Li 72ea613a12 Nuvoton: Add i2c_free
1.  Disable interrupt
2.  Disable IP clock
3.  Free up pins

Support targets:

-   NUMAKER_PFM_NANO130
-   NUMAKER_PFM_NUC472
-   NUMAKER_PFM_M453
-   NUMAKER_PFM_M487/NUMAKER_IOT_M487
-   NU_PFM_M2351*
-   NUMAKER_IOT_M263A
-   NUMAKER_M252KG
2019-10-31 15:22:57 +08:00
Chun-Chieh Li 3abd02614a Nuvoton: Add analogin_free
1.  Deal with channel-wise and module-wise
2.  Disable IP clock
3.  Free up pin

Support targets:

-   NUMAKER_PFM_NANO130
-   NUMAKER_PFM_NUC472
-   NUMAKER_PFM_M453
-   NUMAKER_PFM_M487/NUMAKER_IOT_M487
-   NU_PFM_M2351*
-   NUMAKER_IOT_M263A
-   NUMAKER_M252KG
2019-10-31 15:19:15 +08:00
Chun-Chieh Li 8161386268 M2351: Update default secure image/gateway library
Update for change of TRNG security attribute
2019-10-24 10:55:24 +08:00
Chun-Chieh Li 4cd0332ada NUVOTON: Re-implement TRNG HAL with TRNG H/W
Targets supporting TRNG H/W:

-   NU_PFM_M2351_*
-   NUMAKER_IOT_M263A
2019-10-24 10:55:03 +08:00
Chun-Chieh Li 3f9ba9e61f NUVOTON: Fix BSP/MKROM header
Related targets:
-   NU_PFM_M2351_*
-   NUMAKER_IOT_M263A
2019-10-24 09:36:25 +08:00
Chun-Chieh Li d993c5a108 NUVOTON: Re-implement __PC() with toolchain built-in
Re-implement __PC() by replacing BSP assembly with toolchain built-in.
2019-10-24 09:36:25 +08:00
Chun-Chieh Li 3548d38a98 M2351: Change TRNG security attribute to secure 2019-10-24 09:36:24 +08:00
Chun-Chieh Li c326e07eb1 M2351: Update BSP/crypto driver 2019-10-24 09:36:24 +08:00
int_szyk d68a802f07 Add watchdog clock accuracy to Nuvoton targets. 2019-09-30 08:10:25 +02:00
Chun-Chieh Li f45ca72f11 [M252KG] Remove TRNG support
Reasons to remove TRNG support:
1.  M252 just has 32KiB SRAM and cannot afford mbedtls application.
2.  Implementing TRNG HAL with PRNG H/W has security concern.
2019-09-27 17:50:48 +08:00
Chun-Chieh Li 0168304e5b [M252KG] Add BSD-3-Clause license for BSP files 2019-09-27 17:45:57 +08:00
Chun-Chieh Li 967effe59f [M252KG] Free up peripheral pins in peripheral free-up HAL API
Without free-up of peripheral pins, peripheral pins of the same peripheral may
share by multiple ports after port iteration, and this peripheral may fail with
pin interference.
2019-09-27 17:45:56 +08:00
Chun-Chieh Li 38aaee0c1a [M252KG] Support GPIO input pull-high/pull-low
In Nuvoton, only new-design chips support GPIO input pull-high/pull-low modes.
Targets not supporting this feature are listed below:

- NUMAKER_PFM_NANO130
- NUMAKER_PFM_NUC472
- NUMAKER_PFM_M453
2019-09-27 17:45:56 +08:00
Chun-Chieh Li 1447d9049f [M252KG] Fix redundant call to UART IRQ handler
Honor RxIrq/TxIrq to avoid redundant call to UART IRQ handler.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-uart.
2019-09-27 17:45:55 +08:00
Chun-Chieh Li d9217ed77a [M252KG] Fix redundant SPI clock generation
Fix SPI clocks are generated redundantly at the end of transfer.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-spi/
SPI - async mode.
2019-09-27 17:45:55 +08:00
Chun-Chieh Li c68af32a4c [M252KG] Fix I2C NACK error
Fix logic error on replying NACK at the end of transfer.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-i2c/
i2c - test single byte read i2c API.
2019-09-27 17:45:55 +08:00
Chun-Chieh Li 0917a0d5a6 [M252KG] Fix IP initialization sequence
Better IP initialization sequence:
1. Configure IP pins
2. Select IP clock source and then enable it
3. Reset the IP (SYS_ResetModule)

NOTE1: IP reset takes effect regardless of IP clock. So it doesn't matter if
       IP clock enable is before IP reset.
NOTE2: Non-configured pins may disturb IP's state, so IP pinout first and then
       IP reset.
NOTE3: IP reset at the end of IP initialization sequence can cover unexpected
       situation.
2019-09-27 17:45:54 +08:00
Chun-Chieh Li 4bb7fde6b5 [M252KG] Exclude USB UART from testing
USB UART is dedicated to USB COM and so must exclude from FPGA CI testing.
2019-09-27 17:45:54 +08:00
Chun-Chieh Li cd73422345 [M252KG] Force enum PinName to 32-bit
NU_PINNAME_BIND(...) requires enum PinName to be 32-bit to encode module
binding information in it.
2019-09-27 17:45:54 +08:00
Chun-Chieh Li 36278618ad Support Nuvoton's NUMAKER_M252KG target 2019-09-27 17:45:52 +08:00
Chun-Chieh Li 85bb65cd56 M2351: Add pre-built secure image for non-PSA 2019-09-16 11:01:34 +08:00
Chun-Chieh Li 2471c9ea10 M2351: Remove pre-built non-PSA secure image temporarily
This will add back immediately after target renaming is done.
2019-09-16 10:20:30 +08:00
Chun-Chieh Li 254866eac1 M263: Remove redundant SPI I2S pins from pinmap
The pins suffixed with 'I2SMCLK' are for SPI I2S and cannot be used in normal SPI.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-spi.
2019-08-30 11:33:56 +08:00
Chun-Chieh Li c67a0d8bd0 M263: Free up peripheral pins in peripheral free-up HAL API
Without free-up of peripheral pins, peripheral pins of the same peripheral may
share by multiple ports after port iteration, and this peripheral may fail with
pin interference.
2019-08-30 11:33:55 +08:00
Chun-Chieh Li 78ae1e0c73 M263: Support GPIO input pull-high/pull-low
In Nuvoton, only new-design chips support GPIO input pull-high/pull-low modes.
Targets not supporting this feature are listed below:

- NUMAKER_PFM_NANO130
- NUMAKER_PFM_NUC472
- NUMAKER_PFM_M453
2019-08-30 11:33:54 +08:00
Chun-Chieh Li 5b7beab9da M263: Fix redundant call to UART IRQ handler
Honor RxIrq/TxIrq to avoid redundant call to UART IRQ handler.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-uart.
2019-08-30 11:33:52 +08:00
Chun-Chieh Li eb435b7da0 M263: Fix redundant SPI clock generation
Fix SPI clocks are generated redundantly at the end of transfer.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-spi/
SPI - async mode.
2019-08-30 11:33:51 +08:00
Chun-Chieh Li d15abe5171 M263: Fix I2C NACK error
Fix logic error on replying NACK at the end of transfer.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-i2c/
i2c - test single byte read i2c API.
2019-08-30 11:33:49 +08:00
Chun-Chieh Li 9d4d99cf34 M263: Fix IP initialization sequence
Better IP initialization sequence:
1. Configure IP pins
2. Select IP clock source and then enable it
3. Reset the IP (SYS_ResetModule)

NOTE1: IP reset takes effect regardless of IP clock. So it doesn't matter if
       IP clock enable is before IP reset.
NOTE2: Non-configured pins may disturb IP's state, so IP pinout first and then
       IP reset.
NOTE3: IP reset at the end of IP initialization sequence can cover unexpected
       situation.
2019-08-30 11:33:48 +08:00
Chun-Chieh Li 9aa69d03bf M263: Exclude USB UART from testing
USB UART is dedicated to USB COM and so must exclude from FPGA CI testing.
2019-08-30 11:33:47 +08:00
Chun-Chieh Li 3cb95a8baf M263: Force enum PinName to 32-bit
NU_PINNAME_BIND(...) requires enum PinName to be 32-bit to encode module
binding information in it.
2019-08-30 11:33:45 +08:00
cyliangtw e57ed04252 modify acceptable license term of SDK drivres 2019-08-23 18:12:23 +08:00
cyliangtw 23267ba229 re-license files of M261 device folder to be Apache 2019-08-23 18:12:19 +08:00
cyliangtw 9d653af2cc re-license all of M261 hal files to be Apache 2019-08-23 18:12:16 +08:00
cyliangtw c9006bd422 Support InterruptIn class in ci-test/pwm_rise_fall test case 2019-08-23 18:12:13 +08:00
cyliangtw d69e7c5613 Fix UNO pin map 2019-08-23 18:12:11 +08:00
cyliangtw 3164095cd6 M263: Fix channel release in analogout_free() 2019-08-23 18:12:10 +08:00
cyliangtw a62c877d0e M263: modify epwm-config-output 2019-08-23 18:12:09 +08:00
cyliangtw 2596b7c7be M263: Include cmsis core_m23.h for macro __CORTEX_M in M261.h 2019-08-23 18:12:07 +08:00
cyliangtw d52fced891 M263: Fix compile error on analogin/out & crypto-misc 2019-08-23 18:12:06 +08:00
cyliangtw b9a2e06a1a M263: delete 2 redundant files 2019-08-23 18:12:04 +08:00
cyliangtw e46cf83850 M263: Add Numaker-IoT-M263A target board 2019-08-23 18:12:02 +08:00
Chun-Chieh Li 96dac4faa7 [M487] Exclude A2/A3 from testing for NuMaker-IoT-M487 V1.3
Since NuMaker-IoT-M487 V1.3, A2/A3 are dedicated to on-board ESP8266 WiFi
module RTS/CTS pins and so must exclude from FPGA CI testing.
2019-08-20 13:12:44 +08:00
Chun-Chieh Li c99c43cacd [M2351] Fix pinmap table error with SPI clock pin 2019-08-20 13:12:44 +08:00
Chun-Chieh Li 07f39f1337 [M2351] Fix CLK_SetModuleClock_S(...) error with SPI
Fix SPI module index error in modidx_ns_tab table in CLK_SetModuleClock_S().
Need to update secure image for this bugfix.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-spi/
SPI - init/free test all pins.
2019-08-20 13:12:44 +08:00
Chun-Chieh Li bab5d27e26 [M453] Classify by M45xD/M45xC and M45xG/M45xE
M451 series can classify by M45xD/M45xC and M45xG/M45xE. To support this
classification:
1.  Create TARGET_M45xD_M45xC and TARGET_M45xG_M45xE targets.
2.  Mark NUMAKER_PFM_M453 belongs to TARGET_M45xG_M45xE by 'extra_labels_add'
    in targets.json.
3.  Fix pin name table according to the classification.
4.  Fix pinmap table according to the classification.
2019-08-20 13:12:43 +08:00