Commit Graph

516 Commits (ba7b4799f9a74797f0380226748bb1d985b358ec)

Author SHA1 Message Date
Martin Kojtal b895bf6349
Merge pull request #10401 from OpenNuvoton/nuvoton_nuc472_fix_crash_capture
NUC472: Support crash capture for no-XRAM configuration
2019-04-30 14:54:05 +01:00
Kevin Bracey 87396e0bf6 Assembler atomics
Reimplement atomic code in inline assembly. This can improve
optimisation, and avoids potential architectural problems with using
LDREX/STREX intrinsics.

API further extended:
* Bitwise operations (fetch_and/fetch_or/fetch_xor)
* fetch_add and fetch_sub (like incr/decr, but returning old value -
  aligning with C++11)
* compare_exchange_weak
* Explicit memory order specification
* Basic freestanding template overloads for C++

This gives our existing C implementation essentially all the functionality
needed by C++11.

An actual Atomic<T> template based upon these C functions could follow.
2019-04-26 13:12:35 +03:00
ccli8 61271d0df6 [NUC472] Get around unknown error with power-down
On NUC472, on wake-up from power-down mode, we may meet hard fault or some other
unknown error. Before its cause is found, we enter idle mode instead for a workaround.
To simulate power-down mode with idle mode, we also disable us_ticker during
power-down period.
2019-04-17 16:47:22 +08:00
ccli8 faa28b5280 [NUC472] Support crash capture for no-XRAM configuration 2019-04-15 13:32:53 +08:00
Martin Kojtal 4d56b94686
Merge pull request #10349 from studavekar/fix-nuvonton-crash-data
Fix crash capture feature for nuvoton
2019-04-12 14:13:58 +01:00
Shrikant Tudavekar 53ae5fea87 removed the redundant RW_IRAM1 region 2019-04-10 10:59:17 -05:00
Shrikant Tudavekar 3ee1498b57 crash data support for NUC472 with gcc_arm 2019-04-10 10:31:39 -05:00
Shrikant Tudavekar 9d5617c54a crash data support for NUC472 with armcc 2019-04-10 10:30:22 -05:00
Cruz Monrreal 73f1edd6db
Merge pull request #10004 from OpenNuvoton/nuvoton_m2351_fix-memory-partition
M2351: Support memory custom partition
2019-04-09 14:03:18 -05:00
Shrikant Tudavekar 3769ec4acc place crash data region at end of IRAM 2019-04-09 13:34:18 -05:00
Shrikant Tudavekar 4b182b92f1 enable crash capture for NUMAKER_PFM_NUC472 2019-04-08 15:36:28 -05:00
Shrikant Tudavekar 197b85e2fe create a region instead of a block for crash data 2019-04-08 15:22:59 -05:00
ccli8 be96ade527 [Nuvoton] Add button names BUTTON1/BUTTON2 2019-03-26 17:05:43 +08:00
ccli8 8ca16c4c85 [M2351] Add license header 2019-03-12 09:34:07 +08:00
ccli8 14775cb123 [M2351] Refactor for memory partittion support
Add partition_M2351_mem.h/partition_M2351_mem.icf to centralize memory partition
2019-03-08 09:48:49 +08:00
ccli8 894f71e855 [M2351] Fix preprocessor command line in ARMC6 .sct file 2019-03-07 16:28:38 +08:00
ccli8 c0bba7475f [M2351] Rename TOOLCHAIN_ARM_STD TOOLCHAIN_ARMC6
This is to express ARMC6 toolchain support more explicitly.
2019-03-07 16:28:36 +08:00
ccli8 26ff0677dc [M2351] Remove unnecessary toolchain directory TOOLCHAIN_ARM_MICRO 2019-03-07 16:28:33 +08:00
deepikabhavnani 75040535ed Addressed review comments to correct size values 2019-02-28 19:54:38 -06:00
deepikabhavnani 0dc5561991 Guard RAM start and size defines 2019-02-28 19:54:38 -06:00
deepikabhavnani 2a192509c3 Target_NUVOTON: Add ARM_LIB_STACK and ARM_LIB_HEAP section
Instead of user defined symbols in assembly files or C files,
use linker scripts to add heap and stack - this is inconsistent
with ARM std linker scripts
2019-02-28 19:54:38 -06:00
Cruz Monrreal e6caa122cb
Merge pull request #9812 from kjbracey-arm/wait_ns
Add wait_ns API
2019-02-28 18:21:46 -06:00
Kevin Bracey 66dea08c0f M2351: include core_cm23.h
Nuvoton M2351 was including generic core_armv8mbl.h from CMSIS - we
need it to be more specific to identify the specific core for
wait_ns. Change to core_cm23.h.
2019-02-26 17:30:51 +02:00
Deepika b2e189f453 Target_Nuvoton: Remove target specific implementation of _sbrk 2019-02-19 15:49:49 -06:00
Przemyslaw Stekiel e60a0f46e4 Remove duplicated _mbed_user_setup_stackheap, __rt_lib_init definitions.
Few targets already used 2-region memory model.
2019-02-19 15:46:32 -06:00
Cruz Monrreal 1712a2b76c
Merge pull request #9656 from OpenNuvoton/nuvoton_m2351_fix-crypto-ac-mgmt
M2351: Fix crypto AC management
2019-02-11 18:46:48 -06:00
ccli8 99dd189177 [Nuvoton] Remove unnecessary header files in crypto-misc.cpp 2019-02-11 18:10:51 +08:00
ccli8 8988b6e9db [M2351] Hook crypto interrupt handler without NVIC_SetVector 2019-02-11 14:21:41 +08:00
ccli8 267f62e928 [M2351] Fix crypto AC mgmt
Port of NUC472/M487 crypto AC mgmt work to M2351:
1. Choose mutex to synchronize access to crypto non-SHA AC
2. Choose atomic flag to synchronize access to crypto SHA AC
2019-02-11 13:36:15 +08:00
Russ Butler 8669417e7b Add HAL API for spi pinmap
Add the functions to get spi pinmaps to all targets.
2019-02-08 09:10:37 -06:00
Russ Butler 34c176654d Add HAL API for serial pinmap
Add the functions serial_tx_pinmap, serial_rx_pinmap, serial_cts_pinmap
and serial_rts_pinmap to all targets.
2019-02-08 09:10:28 -06:00
Russ Butler be492fe07a Add HAL API for pwmout pinmap
Add the function pwm_pinmap to all targets.
2019-02-08 09:10:19 -06:00
Russ Butler 22a89773fa Add HAL API for i2c pinmap
Add the functions i2c_master_sda_pinmap, i2c_master_scl_pinmap,
i2c_slave_sda_pinmap and i2c_slave_scl_pinmap to all targets.
2019-02-08 09:10:12 -06:00
Russ Butler 7e8695a2c5 Add HAL API for can pinmap
Add the functions can_rd_pinmap and can_td_pinmap to all targets.
2019-02-08 09:10:10 -06:00
Russ Butler 3bd3aca6db Add HAL API for analog out pinmap
Add the function analogout_pinmap to all targets.
2019-02-08 09:10:05 -06:00
Russ Butler 4818f88d73 Add HAL API for analog in pinmap
Add the function analogin_pinmap to all targets.
2019-02-08 09:09:51 -06:00
Deepika 80f6b0e002 M2351: Update code to support IAR 8.x builds 2019-01-31 16:19:24 -06:00
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
cyliangtw d5e643fd41 [Nuvoton] Fix NUC472 hard fault in SMCC tests 2018-12-20 19:42:42 +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 28b820fbf0 [NANO130] Change main thread stack size to default for stack size unification
NANO130 just has 16 KiB SRAM. User application may change it through "rtos.main-thread-stack-size"
configuration option.
2018-12-18 11:11:43 +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
Martin Kojtal 80e2c1133a
Merge pull request #8719 from deepikabhavnani/m2351_ram_rom_changes
M2351 RAM / ROM defines updated
2018-11-26 10:57:42 +01:00
Deepika c0981a358a Addressed review comments from team-nuvoton 2018-11-22 09:07:21 -06:00
Deepika 1d8c00eccb Update parition sizes in M2351 - based on #8607
RAM/ROM sizes in tools were updated to report entire device size, and in M2351
they were used earlier to report secure/non-secure partition size.

M2351 files are updated to take full RAM/ROM device size and derive secure
and non-secure partition size based on that.
2018-11-22 09:07:21 -06: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
Deepika 4e7cbd4d4c Add library and secure application for FlashIAP change 2018-11-09 15:12:25 -06:00
Deepika 049b5f533f Revert flash_get_value for M2351 done in PR#8589
`flash_get_erase_value` is added in hal/TARGET_FLASH_CMSIS_ALGO/flash_common_algo.c
duplicate copy of same function in targets/TARGET_NUVOTON/TARGET_M2351/flash_api.c
resulted in build issues with secure build
2018-11-09 14:17:49 -06:00
David Saada 542744d03c Support erase value in Flash HAL drivers, FlashIAP and block devices 2018-11-07 14:23:07 +02:00
Cruz Monrreal c37dc5fea8
Merge pull request #8425 from OpenNuvoton/nuvoton_m487_fix_button
M487: Fix SW2/SW3 interchange error in NUMAKER_IOT_M487
2018-10-17 08:35:46 -05:00
ccli8 67e0b7faf0 [M2351] Fix LED_GREEN naming error 2018-10-15 16:34:18 +08:00
ccli8 9d27b72950 [M487] Fix SW2/SW3 interchange error in NUMAKER_IOT_M487 2018-10-15 15:47:16 +08:00
Anna Bridge 24857d0f91
Merge pull request #5285 from c1728p9/minimum_requirements_test
Update devices to have minimum 2K RAM and heap, also added test
2018-10-12 11:04:57 +01: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
Deepika f24ac501a8 Set main thread stack size as 3K for constrained targets 2018-10-08 13:27:35 -05:00
Cruz Monrreal b81c8a99d7
Merge pull request #8193 from OpenNuvoton/nuvoton_m2351_license
M2351: Add license file for default secure library/executable
2018-10-08 10:14:05 -05:00
Deepika f549f14a0a Set ISR stack and heap sizes for low end devices
Set the ISR stack to be 1KB. https://github.com/ARMmbed/mbed-os/pull/7238
Set the heap size to 3KB(2KB + overhead + spare) so that atleast 2KB free ram is
available for testing.
With dynamic heap size, explicit size is not required. IAR 7.8 supports
static heap, hence the change is needed in IAR linker files.
2018-10-05 12:09:46 -05:00
Amanda Butler cd996cd4c8
Copy edit REAMDE.md
Copy edit file, mostly for active voice and consistent spelling.
2018-10-04 16:55:36 -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
ccli8 96ce8ae6e3 [M2351] Add README.md for secure library/executable 2018-09-28 11:48:10 +08:00
ccli8 744f150402 [M2351] Add license file for secure library/executable 2018-09-28 11:47:50 +08: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
Martin Kojtal 9d78650fcc
Merge pull request #7989 from OpenNuvoton/nuvoton_fix_m2351_stdiouart
M2351: Fix STDIO_UART error
2018-09-24 09:06:52 +02: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
Martin Kojtal ab882c3416
Merge pull request #8030 from OpenNuvoton/nuvoton_fix_common_tickers_fail
Nuvoton: Fix Greentea test common_tickers failed
2018-09-21 14:55:28 +02:00
Cruz Monrreal 9f3437aaec
Merge pull request #7987 from OpenNuvoton/nuvoton_m2351_v1.3
M2351: Update to NuMaker-PFM-M2351 V1.3 board
2018-09-20 13:41:03 -05:00
deepikabhavnani ff80e298d2 Align to CMSIS defines for Non-secure
CMSIS updated the __DOMAIN_NS define to DOMAIN_NS. Update the define
in existing code for non-secure part.
2018-09-10 09:25:27 -05:00
ccli8 6ac163088a Support Nuvoton's NuMaker-IoT-M487 board 2018-09-10 11:32:54 +08:00
ccli8 a65e3d42e5 [M2351] Update secure library/executable
1. Remove hal_sleep/hal_deepsleep from secure library
2. Add CLK_Idle_S/CLK_PowerDown_S
2018-09-10 11:09:40 +08:00
ccli8 0550de72f5 [M2351] Fix hal_deepsleep with serial_can_deep_sleep
Add secure functions CLK_PowerDown_S/CLK_Idle_S
2018-09-10 10:55:45 +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 26c0444cc3 [Nuvoton] Add nu_delay_cycle_x4
nu_delay_cycle_x4 is a replacement for wait_us when us ticker is not available.
2018-09-10 10:55:43 +08:00
ccli8 88b9f20ec4 [Nuvoton] Add nu_busy_wait_us
nu_busy_wait_us is a replacement for wait_us when intermediary us ticker layer is disabled.
2018-09-10 10:55:43 +08:00
ccli8 2b632b9eb0 [Nuvoton] Move nu_countdown_init/expired/free implementations to nu_timer.c from nu_timer.h 2018-09-10 10:55:42 +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 2da75c860c [M2351] Fix STDIO_UART error 2018-09-05 11:52:40 +08:00
ccli8 958c7fe564 [M2351] Update to NuMaker-PFM-M2351 V1.3 board
1. Update UNO pin A4/A5
2. Update UNO pin D2/D3
2018-09-04 15:19:33 +08: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 63f62165d8
Merge pull request #7565 from OpenNuvoton/nuc472_emac_rst
Nuvoton: Fix NUC472 SD-Host HW IP reset definition
2018-07-31 11:44:01 -05:00