Commit Graph

166 Commits (d712568b8fca6bbae1a626532c3813a2e480b367)

Author SHA1 Message Date
Cruz Monrreal d425ec5860
Merge pull request #9197 from OpenNuvoton/nuvoton_fix_uart-flow-control
Nuvoton: Fix UART flow control CTS/RTS
2019-01-03 10:34:58 -06:00
ccli8 ad1e57bdef [Nuvoton] Refine MBED_CONF_RTOS_PRESENT check in crypto_misc.cpp 2019-01-03 09:21:05 +08:00
ccli8 39f705e033 [Nuvoton] Fix crypto_misc.cpp compile error with RTOS-absent
Replace Mutex with PlatformMutex which supports RTOS-absent
2019-01-02 15:53:31 +08:00
ccli8 388076d36d [Nuvoton] Remove unnecessary mbed_rtos_storage.h in crypto_misc.cpp 2019-01-02 14:06:03 +08:00
ccli8 17fb5b7ff2 [Nuvoton] Fix UART flow control CTS/RTS
Configure RTS pin outout to active low when RTS is disabled. This allows the peer to be able
to send data if its CTS is still enabled.
2018-12-25 18:21:11 +08:00
Cruz Monrreal 9edbcd77df
Merge pull request #9081 from OpenNuvoton/nuvoton_refine_crypto_ac
Nuvoton: Fix crypto AC management
2018-12-19 13:09:47 -06:00
ccli8 ca44675086 [Nuvoton] Fix crypto AC management
1. For SHA AC, use atomic flag to manage its ownership.
   (1) Nuvoton SHA AC doesn't support SHA context save & restore, so S/W
       SHA fallback has been supported before. To make non-blocking 'acquire'
       semantics clearer, introduce 'try_acquire' to substitute for 'acquire'.
   (2) No biting CPU due to mechanism above.
   (3) No deadlock due to mechanism above.
2. For AES/DES/ECC AC, change to mutex to manage their ownership.
   (1) Change crypto-misc.c to crypto-misc.cpp to utilize C++ SingletonPtr
       which guarantees thread-safe mutex construct-on-first-use.
   (2) With change to crypto-misc.cpp, add 'extern "C"' modifier to CRYPTO_IRQHandler()
       to avoid name mangling in C++.
   (3) No priority inversion because mutex has osMutexPrioInherit attribute
       bit set.
   (4) No deadlock because these AC are all locked for a short sequence
       of operations rather than the whole lifetime of mbedtls context.
   (5) For double mbedtls_internal_ecp_init() issue, it has been fixed in upper
       mbedtls layer. So no need to change ecc init/free flow.
2018-12-19 10:17:39 +08:00
ccli8 244d4b6405 [Nuvoton] Support boot stack size configuration option 2018-12-14 17:29:55 +08:00
Cruz Monrreal 0f0e63aaac
Merge pull request #8900 from OpenNuvoton/nuvoton_refine_uart
Nuvoton: Refine UART init/deinit
2018-12-04 11:51:16 -06:00
Martin Kojtal 179098d0f1
Merge pull request #8828 from OpenNuvoton/nuvoton_analogout
Nuvoton: Support DAC HAL
2018-12-03 13:18:57 +01:00
ccli8 a2c70f2ca4 [Nuvoton] Fix time to init/deinit stdio_uart
With support for checking H/W UART initialized or not, we can simplify stdio management:
1. When serial_init(&stdio_uart) calls in, just set the 'stdio_uart_inited' flag.
2. When serial_free(&stdio_uart) calls in, just clear the 'stdio_uart_inited' flag.
Except above, we needn't make special handling with 'stdio_uart'.
2018-11-29 10:23:22 +08:00
ccli8 a937a62bff [Nuvoton] Check configuration option for default UART baudrate setting 2018-11-28 16:59:15 +08:00
ccli8 ae98b94a10 [Nuvoton] Avoid re-configuring UART in serial_init() for the same H/W UART
The same H/W UART may be shared by multiple serial_t objects. This fix tries to avoid
re-configuring the same H/W UART in serial_init() when there are multiple serial_t
objects constructed. To re-configure UART, call serial_baud() and serial_format()
explicitly. This can avoid confusion when e.g. a newly constructed serial_t object
changes baudrate unexpectedly in serial_init().
2018-11-28 16:26:21 +08:00
ccli8 6b16112962 [Nuvoton] Remove unused pin_tx/pin_rx fields from serial_s struct 2018-11-28 16:17:39 +08:00
ccli8 e24a3c09d7 [Nuvoton] Fix license description for analog-out HAL files
1. Fix copyright year
2. Add SPDX
2018-11-27 09:44:27 +08:00
ccli8 e36c074359 [Nuvoton] Support DAC 2018-11-21 17:09:35 +08:00
Senthil Ramakrishnan f1926c0ea9 Fix linker script errors 2018-11-16 14:00:00 -06:00
Senthil Ramakrishnan ef8c1c3cb6 Linker script modifications for crash data region 2018-11-16 13:59:59 -06:00
ccli8 9d27b72950 [M487] Fix SW2/SW3 interchange error in NUMAKER_IOT_M487 2018-10-15 15:47:16 +08:00
Deepika e1ecce85ba Nuvoton: Fix alignment of execute region to 8-byte boundary
--legacyalign, --no_legacyalign are deprecated from ARMC6 compiler, in order to
remove deprecated flags all linker files (GCC and IAR as well to have uniformity)
should strictly align to 8-byte boundary
2018-10-09 10:15:07 -05:00
Martin Kojtal 59ce41f255
Merge pull request #8049 from OpenNuvoton/nuvoton_fix_hal_sleep
Nuvoton: Fix mbed_hal-sleep test failed
2018-10-01 11:48:25 +02:00
Cruz Monrreal 815683c2bd
Merge pull request #7941 from OpenNuvoton/nuvoton_fix_gpio_mode_mapping
Nuvoton: Fix GPIO mode mapping
2018-09-25 13:15:09 -05:00
Cruz Monrreal 5eb314f65f
Merge pull request #8164 from OpenNuvoton/nuvoton_iot_m487
Support Nuvoton's new target NUMAKER_IOT_M487
2018-09-21 21:31:22 -05:00
ccli8 6ac163088a Support Nuvoton's NuMaker-IoT-M487 board 2018-09-10 11:32:54 +08:00
ccli8 beb04a82dc [Nuvoton] Fix serial corruption due to deep sleep
Prevent deep sleep when there is still any character being transmitted on the UART.
This allows tickless to be safely enabled.
2018-09-10 10:55:44 +08:00
ccli8 310b12a235 [Nuvoton] Fix HAL sleep test failure with lp_ticker
Replace wait_us with nu_busy_wait_us in lp_ticker since wait_us is not allowed in sleep test
which would suspend us ticker layer on which wait_us relies. nu_busy_wait_us is implemented
by calling us ticker HAL API directly rather than relying on us ticker layer.
2018-09-10 10:55:44 +08:00
ccli8 ab7b93ca58 [Nuvoton] Synchronize us_ticker to lp_ticker
This is to make implementations of us_ticker/lp_ticker consistent.
2018-09-10 10:50:22 +08:00
ccli8 6639a92bcd [Nuvoton] Fix lp_ticker_free cannot pass speed test 2018-09-10 10:50:22 +08:00
ccli8 9ee83f575a [Nuvoton] Fix spurious us_ticker/lp_ticker interrupts
If us_ticker/lp_ticker is scheduled and then the interrupt is disabled, the originally scheduled
interrupt may still become pending. If this occurs, then an interrupt will fire twice on the next
call to us_ticker_set_interrupt/lp_ticker_set_interrupt - once immediately and then a second time
at the appropriate time.

This patch prevents the first interrupt by clearing interrupts in
us_ticker_set_interrupt/lp_ticker_set_interrupt before calling NVIC_EnableIRQ.
2018-09-10 10:50:21 +08:00
Yossi Levy acfda5895e Changes in PR #7774 of PinNames.h should be reverted. This commit reverts those files excpet for K82F and K64F which are left as an example 2018-09-05 14:13:05 +03:00
ccli8 55328ebdd5 [Nuvoton] Fix pin mode mapping between input pull mode/direction and I/O mode
1. Modify PinMode enum to fully support GPIO I/O modes.
2. Translate input pull mode/direction to I/O mode, where H/W doesn't support
   separate configuration for input pull mode/direction.
3. Allow for configuring I/O mode in addition to input pull mode.
2018-08-31 10:06:30 +08:00
Yossi Levy ed8e170d15 Moving SD, SPIF and FLASHIAP into mbedos and refactoring features storage directory structure. 2018-08-29 12:01:11 +03:00
Oren Cohen 787317b7eb Remove uVisor from mbed-os 2018-08-22 16:36:59 +03:00
ccli8 6909159420 [Nuvoton] Organize file structure
This re-organization is to avoid duplicates regarding targets of the same MCU series.
2018-08-01 18:00:16 +08:00
Cruz Monrreal cf84b05473
Merge pull request #6985 from OpenNuvoton/nuvoton_fix_rtosless_heap
Fix heap base/limit error with ARM_LIB_STACK/ARM_LIB_HEAP in RTOS-less
2018-07-31 11:36:42 -05:00
ccli8 313f322cf7 [Nuvoton] Replace __wrap__sbrk with overriding _sbrk
With _sbrk being weak, we can override it directly rather than #if to support heap with
two-region model.
2018-07-26 15:47:25 +08:00
ccli8 d6ae30a728 [Nuvoton] Merge multiple ARM/ARMC6 sys.cpp into one 2018-07-25 10:04:31 +08:00
ccli8 4f04ae489e [Nuvoton] Synchronize lp_ticker code to us_ticker
This is to make us_ticker/lp_ticker code consistent.
2018-06-28 16:34:45 +08:00
ccli8 1fa3374310 [Nuvoton] Remove special handling for dummy interrupt in lp_ticker
It is because dummy interrupt is very rare or pending time caused by it
is very short.
2018-06-28 16:27:37 +08:00
ccli8 310a1fe318 [Nuvoton] Synchronize lp_ticker code to us_ticker
This is to make us_ticker/lp_ticker code consistent.
2018-06-26 13:47:30 +08:00
ccli8 8e11ddf3b6 [Nuvoton] Fix trap in lp_ticker ISR with non-blocking "clear interrupt flag" 2018-06-26 13:47:29 +08:00
ccli8 fe627cb722 [Nuvoton] Synchronize lp_ticker code to us_ticker
This is to make us_ticker/lp_ticker code consistent.
2018-06-26 13:47:27 +08:00
ccli8 86e194d075 [Nuvoton] Reduce blocking code in lp_ticker
1. Introduce S/W interrupt enable/disable to reduce calls to TIMER_EnableInt/TIMER_DisableInt.
2. Allow dummy interrupt because clear interrupt flag is not synchronized.
3. Enable LPTICKER_DELAY_TICKS to make lp_ticker_set_interrupt non-blocking.
2018-06-26 13:47:26 +08:00
ccli8 3f861425da [Nuvoton] Meet new lp_ticker HAL spec (Mbed OS 5.9)
1. Add LPTICKER in device_has option of targets.json file.
2. Disable ticker interrupt in lp_ticker_init
3. Add lp_ticker_free
4. Enable interrupt in lp_ticker_set_interrupt
2018-06-26 13:47:17 +08:00
ccli8 ebd93ba753 [Nuvoton] Meet new us_ticker HAL spec (Mbed OS 5.9)
1. Add USTICKER in device_has option of targets.json file.
2. Disable ticker interrupt in us_ticker_init
3. Add us_ticker_free
4. Enable interrupt in us_ticker_set_interrupt
2018-06-26 13:45:33 +08:00
ccli8 6065e3a943 [Nuvoton] Fix RTC cannot cross reset cycle 2018-05-29 17:22:02 +08:00
ccli8 2cefe7d8d5 [Nuvoton] Power down RTC access from CPU domain in rtc_free
After rtc_free, RTC gets inaccessible from CPU domain but keeps counting.
2018-05-29 10:33:01 +08:00
Bartek Szatkowski 6e9f04bf2f Rename DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER
That's to match DEVICE_USTICKER.
2018-05-25 12:20:09 -05:00
Cruz Monrreal f73415e9f8
Merge pull request #6466 from OpenNuvoton/nuvoton_fix_spi
Nuvoton: Fix issues with SPI
2018-04-16 10:47:51 -05:00
ccli8 571e89048f [Nuvoton] Remove dead code with '#if 0' in SPI 2018-04-09 09:33:52 +08:00