Commit Graph

540 Commits (240758db42aaa42b2abd50daea5033c3cc7e80dc)

Author SHA1 Message Date
ccli8 d05ef693ac [M2351] Support analog-in 2018-07-12 17:51:51 +08:00
ccli8 1da430f1e9 [M2351] Support TRNG
To change TRNG security state, we need to:
1. Change CRPT/CRYPTO bit in NVIC/SCU in partition_M2351.h
2. Add/remove TRNG in device_has list in targets.json to match partition_M2351.h
2018-07-12 17:51:50 +08:00
ccli8 dd7fd76758 [M2351] Centralize size configuration for secure flash, secure SRAM, NSC, and bootloader 2018-07-12 17:51:48 +08:00
ccli8 ca63abae73 [M2351] Change NSC location
NSC location has the following requirements:
1. By IDAU, 0~0x4000 is secure. NSC can only locate in 0x4000~0x10000000.
2. Greentea flash IAP uses last 4 sectors for its test. Avoid this range.
3. Greentea NVSTORE uses last 2 sectors or 4KB x 2 for its test. Avoid this range.
2018-07-12 17:51:48 +08:00
ccli8 42aa7fe0c5 [M2351] Upgrade partition format
Following BSP, this upgrade makes partitioning flash/SRAM clear.
flash_api.c relies on flash partition, so it is updated accordingly.
2018-07-12 17:51:47 +08:00
ccli8 805049d80f [M2351] Fix page size in flash IAP
In Mbed OS, page size is program unit, which is different than FMC definition.
After fixing page size, we can pass NVSTORE test (mbed-os-features-nvstore-tests-nvstore-functionality).
2018-07-12 17:51:45 +08:00
ccli8 711cb64e95 [M2351] Support flash IAP 2018-07-12 17:51:44 +08:00
ccli8 fa0124ed8d [M2351] Add missing delay in lp_ticker 2018-07-12 17:51:43 +08:00
ccli8 06cb070442 [M2351] Trim HIRC48 to 48M against LXT 2018-07-12 17:51:42 +08:00
ccli8 649389a962 [M2351] Support I2C 2018-07-12 17:51:41 +08:00
ccli8 3ca24b62ff [M2351] Support SPI 2018-07-12 17:51:40 +08:00
ccli8 dcfe1d4283 [M2351] Refine UART code
1. Replace SYS_ResetModule/CLK_SetModuleClock/CLK_EnableModuleClock/CLK_DisableModuleClock with TrustZone-aware versions.
2. Configure all UART to secure
3. Support asynchronous transfer
4. Remove sleep management code, which has been replaced with Sleep Manager.
2018-07-12 17:51:38 +08:00
ccli8 ebf53b9f64 [M2351] Support PDMA 2018-07-12 17:51:38 +08:00
cyliangtw 999dd332e6 [M2351] Rework us_ticker and lp_ticker
The rework includes the following:
1. Remove ticker overflow handling because upper layer (mbed_ticker_api.c) has done with it.
   This makes us_ticker/lp_ticker implementation more succinct and avoids potential error.
2. Refine timer register access with low-power clock source
2018-07-12 17:51:37 +08:00
ccli8 236bf657b6 [M2351] Remove peripheral sleep management from hal_sleep/hal_deepsleep
The upper layer has introduced Sleep Manager to handle the task.
2018-07-12 17:51:36 +08:00
ccli8 6bfc90dc73 [M2351] Rework RTC
The rework includes the following:
1. Support year range beyond H/W RTC 2000~2099.
2. Refine RTC register access with low-power clock source
2018-07-12 17:51:34 +08:00
ccli8 f16b971482 [M2351] Fix GPIO to be TrustZone-aware
1. Revise NU_PORT_BASE to be TrustZone-aware
2. Add TrustZone-aware NU_GET_GPIO_PIN_DATA/NU_SET_GPIO_PIN_DATA to replace GPIO_PIN_DATA
3. Revise pin_function to be TrustZone-aware
2018-07-12 17:51:33 +08:00
ccli8 2aa2b7eb00 [M2351] Fix SystemCoreClockUpdate isn't called in non-secure domain 2018-07-12 17:51:32 +08:00
ccli8 0cb7633356 [M2351] Fix HCLK clock source
There is a reset halt issue with PLL in A version.
Work around it by using HIRC48 instead of PLL as HCLK clock source.
2018-07-12 17:51:31 +08:00
ccli8 135f1279ca [M2351] Add secure BSP driver function
SYS_ResetModule_S
CLK_SetModuleClock_S
CLK_EnableModuleClock_S
CLK_DisableModuleClock_S
2018-07-12 17:51:30 +08:00
ccli8 d84a90e29d [M2351] Unify secure/non-secure peripheral base based on partition file 2018-07-12 17:51:29 +08:00
ccli8 77e45d414b [M2351] Configure most modules to non-secure
All modules are configured to non-secure except:
1. TIMER0/1 hard-wired to secure and TIMER2/3 reserved for non-secure.
2. PDMA0 hard-wired to secure and PDMA1 reserved for non-secure.
3. RTC configured to secure and shared to non-secure through NSC.
4. CRYPTO configured to secure and shared to non-secure through NSC.
2018-07-12 17:51:28 +08:00
ccli8 2da6bf6301 [M2351] Fix STDIO UART 2018-07-12 17:51:27 +08:00
cyliangtw 0c3f0f7cb7 [M2351] To fulfill _rtc_localtime one more argument 2018-07-12 17:51:24 +08:00
cyliangtw 2b44eeaef5 [M2351] Add gpio_is_connected 2018-07-12 17:51:22 +08:00
cyliangtw ef7f04808d [M2351] Set secure SRAM size as 24KB in SAU & SCU 2018-07-12 17:51:21 +08:00
cyliangtw d99fbcb166 [M2351] Set 48KB SRAM and UART0 as non-secure 2018-07-12 17:51:20 +08:00
cyliangtw 12a7830c9a [M2351] Resolve reset halt issue in MP chip A version 2018-07-12 17:51:19 +08:00
cyliangtw 6163628b1e [M2351] Sync IRQ arrangement to fulfill MP version 2018-07-12 17:51:18 +08:00
cyliangtw 331945fa08 [M2351] Remove redundant GetPC 2018-07-12 17:51:17 +08:00
cyliangtw 90fcc04596 [M2351] Migrate for MP chip version, build sucessfully 2018-07-12 17:51:16 +08:00
Deepika 94d95d34a4 [M2351] Support TrustZone in port_read/port_write 2018-07-12 17:51:14 +08:00
Deepika aec7c5441c [M2351] Add non-secure reset handler address 2018-07-12 17:51:13 +08:00
deepikabhavnani eebc6e38cb [M2351] Corrected Vector table address in scatter file 2018-07-12 17:51:12 +08:00
cyliangtw 46f948aa6f [M2351] Link register base with partition file & correct heap size in linker file 2018-07-12 17:51:11 +08:00
cyliangtw 5985dcd268 [M2351] Support secure loader invoke non-secure Mbed OS 2018-07-12 17:51:10 +08:00
deepikabhavnani 2f01120d93 [M2351] Corrected preprocess define usage in toolchain specific linker files 2018-07-12 17:51:09 +08:00
cyliangtw 18ca9b5e6c [M2351] Fix GCC linker file 'cannot move location counter backwards' issue 2018-07-12 17:51:08 +08:00
cyliangtw ba9e5fdc29 [M2351] IAR linker file support both of secure & non-secure domain 2018-07-12 17:51:07 +08:00
cyliangtw f06644a920 [M2351] Linker files support both of secure & non-secure domain 2018-07-12 17:51:06 +08:00
cyliangtw a2aac528f4 [M2351] Update GCC linker for NSC Veneer 2018-07-12 17:51:05 +08:00
Deepika f7ea847dfe [M2351] ARMC6 compiler related changes 2018-07-12 17:51:04 +08:00
Deepika d46220c7e0 [M2351] Set SAU Region present flag for M2351 device and include security header file.
As per SAU documents, SAU is always present if the security extension is
available. The functionality differs if the SAU contains SAU regions.
If SAU regions are available it is configured with the macro __SAUREGION_PRESENT
2018-07-12 17:51:02 +08:00
Deepika 11792f60fa [M2351] Added xx_ticker_fire_interrupt function for M2351 device 2018-07-12 17:51:01 +08:00
Deepika ffcc438b5a [M2351] Use Cortex M23 specific header files and interrupts
1. Update use of correct header files
2. Added missing entry of M2351 device in IAR defines.
3. Removed support of ARM toolchain in targets.json
2018-07-12 17:51:00 +08:00
cyliangtw e67ed3f86e [M2351] Revise nu_bitutil.h for M23 2018-07-12 17:50:59 +08:00
cyliangtw 6b85478730 [M2351] Modify Nuvoton common files to avoid conflicting with master 2018-07-12 17:50:58 +08:00
cyliangtw 98c8427a90 [M2351] Add partition header file for CMSE feature 2018-07-12 17:50:57 +08:00
cyliangtw 368f8eef93 [M2351] Remove mbed_sdk_init_forced
1. mbed_sdk_init is called before C++ global obj constructor in OS 5
2. Refine startup file with GCC_ARM toolchain related to this modification.
2018-07-12 17:50:56 +08:00
cyliangtw c5494eb751 [M2351] Support __vector_table instead of __vector_handlers in IAR 2018-07-12 17:50:54 +08:00
cyliangtw 1f27546480 [M2351] Support GCC & IAR toolchain 2018-07-12 17:50:53 +08:00
cyliangtw dcdd9fb56e [M2351] Sync SDH_CardDetection type to avoid GCC compiler error 2018-07-12 17:50:52 +08:00
cyliangtw 205f8dbab2 [M2351] Add one new target M2351, regard as M0+ with some V8M CPU control at first 2018-07-12 17:50:51 +08:00
ccli8 13fec628d0 [NANO130] Change PLL clock source to HIRC instead of HXT
This change is to reduce delay of wake-up from power-down to pass Greentea test.
Because HIRC's accuracy is worse than HXT's, we must switch back to HXT for e.g. USBD application.
This can be done through setting NU_CLOCK_PLL to NU_HXT_PLL.
2018-07-03 15:37:53 +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 7caec46512 [NANO130] Adjust static/dynamic memory allocation for IAR toolchain to pass Greentea test 2018-06-26 13:47:23 +08:00
ccli8 12792fde27 [NANO130] Fix CLK_Idle incorrectly enters into deep sleep mode
This can happen with CLK_PowerDown() called first and then CLK_Idle() called.
2018-06-26 13:47:22 +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
deepikabhavnani ba4aa3f3a6 Updating HEAP size
IAR 7.8 does not support dynamic heap, and some test/addition of new
feature fail on this device because of less static RAM memory.
Reducing the heap memory size for the same reason.
2018-04-27 15:48:52 -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
Jimmy Brisson 897885909d
Merge pull request #6394 from OpenNuvoton/nuvoton_fix_ticker
Nuvoton: Fix us_ticker/lp_ticker
2018-03-29 11:58:53 -05:00
Cruz Monrreal e9b234b876
Merge pull request #6424 from OpenNuvoton/m487_v3
Nuvoton: Support M487 v3.0 pin map
2018-03-26 14:26:32 -05:00
ccli8 707de87497 [Nuvoton] Refine SPI code
1. Remove dead code
2. Remove space in empty lines
3. Fix compile warnings
4. Fix some comments
2018-03-26 11:02:54 +08:00
ccli8 7275ee8626 [Nuvoton] Fix SPI DMA transfer
1. Disable unnecessary TX/RX threshold interrupts to avoid potential trap in DMA transfer
2. Start TX/RX DMA transfer simultaneously to fit H/W spec and avoid potential RX FIFO overflow issue
2018-03-26 10:58:18 +08:00
ccli8 9e72756878 [Nuvoton] Use vector rather than SPI_CTL_SPIEN_Msk to judge if asynchronous transfer is on-going (spi_active) 2018-03-26 10:50:14 +08:00
ccli8 643d772cf9 [Nuvoton] Introduce SPI_ENABLE_SYNC/SPI_DISABLE_SYNC to simplify enable/disable control 2018-03-26 10:34:22 +08:00
ccli8 ccec9d75d6 [Nuvoton] Add missing delay in lp_ticker
mbed-os-tests-mbed_drivers-lp_ticker/Test multi ticker test fails inconstantly.
This commit is mainly to fix the issue.
2018-03-26 09:45:59 +08:00
ccli8 5d453ed381 [Nuvoton] Check timer active flag after enabling timer counting in us_ticker/lp_ticker 2018-03-26 09:42:53 +08:00
ccli8 3cd8d3df9f [Nuvoton] Remove unnecessary TIMER_Start in the end of lp_ticker_set_interrupt 2018-03-26 09:27:05 +08:00
cyliangtw efe57a00b4 [M487] Support v3.0 pin map 2018-03-22 20:09:09 +08:00
ccli8 f0865f8546 [Nuvoton] Fix page size in flash IAP
In Mbed OS, page size is program unit, which is different than FMC definition.
After fixing page size, we can pass NVSTORE test (mbed-os-features-nvstore-tests-nvstore-functionality).
2018-03-22 16:45:01 +08:00
ccli8 7ed3bac85d [Nuvoton] Remove unnecessary UART INT in UART DMA transfer
In UART DMA transfer, it is PDMA INT rather than UART INT to go INT path
2018-03-19 17:52:01 +08:00
Cruz Monrreal f1d493dd0c
Merge pull request #6228 from OpenNuvoton/nuvoton_1timer_ticker
Nuvoton: Rework us_ticker/lp_ticker with one H/W timer
2018-03-05 10:19:56 -06:00
Bartek Szatkowski 4cb47df40a Add system_reset() function to Mbed OS 2018-02-28 16:42:34 +00:00
cyliangtw b6ff40e94d [M451/M480/NANO100/NUC472] Define SERIAL and I2C pin name for compatiblity 2018-02-27 11:38:29 +08:00
ccli8 1d7e7fd543 [NUC472/M453/M487/NANO130] Rework us_ticker and lp_ticker with one H/W timer
Originally, we use 2 H/W timers for us_ticker/lp_ticker, one for counting and the other for alarm.
With H/W timer running in continuous mode, we could use just one H/W timer for counting/alarm simultaneously.
2018-02-26 17:41:05 +08:00
Cruz Monrreal 817f9a569c
Merge pull request #5812 from OpenNuvoton/nuvoton_crypto
M487: Support ECP H/W accelerator
2018-02-20 11:53:23 -06:00
Cruz Monrreal aa6835a069
Merge pull request #6048 from OpenNuvoton/nuvoton_ticker
Nuvoton: Rework us_ticker and lp_ticker
2018-02-16 15:59:05 -06:00
ccli8 cfdc72d75e [NUC472/M487] Refine crypto_zeroize/crypto_zeroize32 2018-02-12 14:04:56 +08:00
ccli8 0271df1fa5 [NUC472/M453/M487/NANO130] Rework RTC
The rework includes the following:
1. Support year range beyond H/W RTC 2000~2099.
2. Refine RTC register access with low-power clock source
2018-02-09 10:47:18 +08:00
ccli8 fae160fb9f [NUC472/M453/M487/NANO130] Rework us_ticker and lp_ticker
The rework includes the following:
1. Remove ticker overflow handling because upper layer (mbed_ticker_api.c) has done with it.
   This makes us_ticker/lp_ticker implementation more succinct and avoids potential error.
2. Refine timer register access with low-power clock source
2018-02-07 09:09:39 +08:00
ccli8 160f75d536 [NUC472/M487] Fix warning in crypto 2018-01-22 10:51:12 +08:00
ccli8 f61d9d48c8 [NUC472/M453/M487/NANO130] Add gpio_is_connected 2018-01-18 17:33:03 +08:00
ccli8 a68750473c [M487] Support ECP H/W accelerator 2018-01-09 16:20:41 +08:00
ccli8 67386b9ebd [NUC472/M487] Fix DMA input/output buffers are overlapped in AES alter. 2018-01-05 09:18:26 +08:00
ccli8 d96bcda606 [NUC472/M487] Fix indefinite loop in SHA alter. 2018-01-05 09:18:25 +08:00
ccli8 a00f8d0e8b [NUC472/M487] Guard from reordering DMA wait and post-wait for crypto modules 2018-01-05 09:18:25 +08:00
ccli8 3a8c1aa687 [NUC472/M487] Use interrupt signal rather than polling to check operation completion in DES alter.
This is to be consistent with PRNG/AES.
2018-01-05 09:18:24 +08:00
ccli8 0c1098483f [NUC472/M487] Refine flow control code between crypto start and crypto ISR 2018-01-05 09:18:24 +08:00
ccli8 e1fbf0f6a7 [NUC472/M487] Add comment for crypto_zeroize 2018-01-05 09:18:24 +08:00
ccli8 9edda18b0f [NUC472] Update BSP crypto driver 2018-01-05 09:18:23 +08:00
ccli8 a0a8a955a9 [NUC472/M487] Strengthen crypto DMA buffer check
1. Catch incompatible buffer range, where buffer base = 0xffffff00 and buffer size = 0x100.
2. Add buffer size alignment check.
2018-01-05 09:18:21 +08:00
ccli8 b0228d020d [NUC472/M487] Fix compile error as mbedtls is not included
Currently, trng_api.c is located in targets/ and AES/DES/SHA alter. are located in mbedtls/.
They have shared crypto code.
If they could locate at same location e.g. mbedtls/, the shared crypto code placement would be more reasonable.
2018-01-05 09:18:20 +08:00
ccli8 6464649c41 [NUC472/M487] Coordinate crypto interrupt handler among AES/PRNG 2018-01-05 09:18:20 +08:00
ccli8 d66074fecc [NUC472/M487] Coordinate crypto init among AES/DES/SHA/PRNG
Add counter to track crypto init among crypto sub-modules. It includes:
1. Enable crypto clock
2. Enable crypto interrupt

As counter gets zero, crypto clock is disabled to save power.
2018-01-05 09:18:18 +08:00
Martin Kojtal be52ba2156
Merge pull request #5363 from mprse/extended_rtc
Add support and tests for extended RTC
2017-12-12 17:36:44 +00:00
Przemyslaw Stekiel 106561669f Update RTC drivers for extended RTC. 2017-12-05 07:54:02 +01:00
Jimmy Brisson ab1b3ae8d3
Merge pull request #5454 from OpenNuvoton/trng_get_unalignment
Nuvoton: TRNG_Get support 32 bytes unalignment
2017-11-22 10:21:39 -06:00
ccli8 bc9c9ca1e2 [M487] Remove trailing space in lp_ticker/us_ticker 2017-11-22 08:55:58 +00:00
ccli8 8b86d44867 [M487] Fix premature lp_ticker interrupt
Old lp_ticker handles past event, but it has a bug with premature go-off.
The bug can re-produce on mbed-os-tests-mbed_drivers-lp_timeout/mbed-os-tests-mbed_hal-lp_us_tickers (mbed-os commit: 9c1fd48529).
Because upper layer (mbed-os/hal/mbed_ticker_api.c) has handled past event, this code can be removed from lp_ticker.

The similar fix also applies to us_ticker.
2017-11-22 08:55:58 +00:00
cyliangtw 288094568c [M487/NUC472/NANO130] fix TRUE/FALSE redefinition 2017-11-16 11:21:20 +00:00
cyliangtw d8a9e35a0c [M487/NUC472] Refine trng_get_bytes for consistency and readability 2017-11-13 12:11:08 +08:00
cyliangtw 2ee058be53 [M487/NUC472] Refine for correctness control 2017-11-10 16:22:35 +08:00
cyliangtw e252b10148 [M487/NUC472] zeroize random data on the stack memory 2017-11-09 16:01:14 +08:00
cyliangtw 76c2c19853 [M487/NUC472] Unified code-path for remaining bytes of TRNG_Get 2017-11-08 19:56:12 +08:00
cyliangtw 4118afa259 [M487/NUC472] TRN_Get support 32 bytes unalignment 2017-11-08 14:23:05 +08:00
ccli8 bf426b0771 [NUC472/M453/M487/NANO130] Remove dead power-down code with mbed OS 3
These power-down code are stale and would be superseded by sleep manager.
2017-09-22 09:42:51 +08:00
ccli8 4040211f9e [NANO130] Refine sleep code
1. Remove stale code with mbed OS 3.
2. Remove check for busy peripherals unorganizedly. This would be supported by e.g. official sleep manager.
2017-09-22 09:33:53 +08:00
ccli8 785413aa1e [NANO130] Fix RTC hour error with AM/PM 2017-09-21 16:42:00 +08:00
ccli8 33070988de [NANO130] Fix lp_ticker wake-up is incorrectly disabled 2017-09-20 16:56:37 +08:00
ccli8 f553277198 [NANO130] Fix lp_ticker typo 2017-09-20 16:56:36 +08:00
ccli8 c4c902289f [NANO130] Change SW2/SW3 to SW1/SW2 to match target board 2017-09-20 16:56:35 +08:00
ccli8 443d18a18c [NANO130] Move target configuration from mbed_lib.json to targets.json 2017-09-20 16:56:34 +08:00
ccli8 d4af4ba3a7 [NUC472/M453/M487] Fix RTC hour error with AM/PM 2017-09-20 16:56:34 +08:00
ccli8 83fc132b97 [NUC472] Fix RTC macro function with no arguments in BSP 2017-09-20 16:56:33 +08:00
ccli8 6eb4e11b37 [NUC472/M453/M487] Refine sleep code
1. Remove stale code with mbed OS 3.
2. Remove check for busy peripherals unorganizedly. This would be supported by e.g. official sleep manager.
2017-09-20 16:56:32 +08:00
ccli8 52733fe7f6 [M487] Replace mktime/localtime with interrupt-safe version in rtc
The use of mktime was causing a fault when called in interrupt handler because on GCC it lock the mutex protecting the environment, To overcome this issue, this patch add dedicated routine to convert a time_t into a tm and vice versa.
In the process mktime has been optimized and is now an order of magnitude faster than the routines present in the C library.
2017-09-20 16:56:31 +08:00
Jimmy Brisson 91afbce18a Correct Nuvoton compiler detection logic 2017-09-11 13:20:33 -05:00
Jimmy Brisson 15a9a0382b Enable Compiling with ARMC6 across all targets
remove duplicate sys.cpp
2017-09-11 13:20:32 -05:00
ccli8 cacc444b73 [M487] Support USB device/host 2017-08-22 09:27:31 +08:00
Jimmy Brisson 0f0a461209 Merge pull request #4832 from OpenNuvoton/nuvoton
NUC472/M453: Fix several startup and hal bugs
2017-08-14 11:38:18 -05:00
Jimmy Brisson 097720670e Merge pull request #4631 from OpenNuvoton/nuvoton_nano130
Add new target NUMAKER_PFM_NANO130
2017-08-14 11:35:58 -05:00
MS30 CCChang12 346209ed2f [NANO130] Adjust the stack size in IAR toolchains 2017-08-10 15:35:02 +08:00
ccli8 f8af225dda [M487] Remove support for uVisor core debug message via STDIO
This is necessary. Otherwise, program will hang in uninitialized STDIO UART because uVisor core doesn't enable it.
2017-08-03 18:48:31 +08:00
ccli8 9ac0d90937 [M487] Move target configuration from mbed_lib.json to targets.json 2017-08-03 13:40:32 +08:00
ccli8 afb5aba8d9 [M487] Fix compile warnings with IAR toolchain 2017-08-03 13:33:17 +08:00
ccli8 99d12b1eb8 [M487] Fix compile warnings with GCC_ARM toolchain 2017-08-03 11:10:15 +08:00
ccli8 b31d6f6eaa [M487] Fix compile warnings with ARM toolchain 2017-08-03 09:24:05 +08:00
cyliangtw 6b8724b27d [NUC472] Sync SPI mode with NUC472 BSP V3.02.001 2017-08-01 14:40:54 +08:00
ccli8 d885de6ec5 [NUC472/M453] Move target configuration from mbed_lib.json to targets.json 2017-08-01 14:40:48 +08:00
ccli8 8092c3611b [NUC472/M453] Add comment for Receive Time-out IF in SPI HAL 2017-08-01 14:40:42 +08:00
ccli8 c7fcd071e9 [NUC472/M453] Add sanity check for serial format 2017-08-01 14:40:37 +08:00
ccli8 5e335de67e [NUC472/M453] Set LED4 to LED1
No real LED4. Just for passing ATS.
2017-08-01 14:40:31 +08:00
ccli8 ea1de8c9a8 [NUC472/M453] Remove mbed_sdk_init_forced()
1. With mbed OS 5, mbed_sdk_init() is ensured to call before C++ global object constructor.
2. Refine startup file with GCC_ARM toolchain related to this modification.
2017-08-01 14:40:25 +08:00
ccli8 6c9fda4e3e [NUC472/M453] Fix lp_ticker typo 2017-08-01 14:40:20 +08:00
ccli8 ea7a0fdf74 [NUC472/M453] Add comment in gpio_irq_init() 2017-08-01 14:40:14 +08:00
ccli8 46cb684a32 [NUC472] Conform to mbed TLS H/W acceleration support 2017-08-01 14:40:08 +08:00
ccli8 8067f9ac91 [NUC472/M453] Move SystemInit() to register unlock range for perhaps future protected register access 2017-08-01 14:40:02 +08:00
ccli8 2844be6434 [NUC472/M453] Fix RTC time doesn't continue across reset cycle 2017-08-01 14:39:57 +08:00
ccli8 c4df35d1b5 [NUC472/M453] Fix region end address error with IAR toolchain 2017-08-01 14:39:50 +08:00
ccli8 306d8449b3 [M487] Remove NVIC_SetVector/NVIC_GetVector to match updated boot flow 2017-08-01 10:53:40 +08:00
ccli8 670822a581 [M487] Update spi_master_block_write() API 2017-08-01 10:47:39 +08:00
ccli8 bc7193508e [M487] Fix GCC linker script with uVisor 2017-08-01 10:37:28 +08:00
ccli8 52d5a61e29 [M487] Fix include file error in case-sensitive environment 2017-08-01 10:37:27 +08:00
ccli8 0803267eab [M487] Add ticker API us_ticker_fire_interrupt and lp_ticker_fire_interrupt 2017-08-01 10:37:26 +08:00
ccli8 b54e7e9639 [M487] Remove debug code in I2C HAL 2017-08-01 10:37:25 +08:00
ccli8 ed5ef0cc54 [M487] Refine coding style 2017-08-01 10:37:16 +08:00
ccli8 7b564c7f52 [M487] Add comment for Receive Time-out IF in SPI HAL 2017-08-01 10:32:50 +08:00
ccli8 7cfb7ae8f8 [M487] Add sanity check for serial format 2017-08-01 10:32:48 +08:00
ccli8 7a60b35d52 [M487] Set LED4 to LED1
No real LED4. Just for passing ATS.
2017-08-01 10:32:46 +08:00
ccli8 355b4336d6 [M487] Remove dead code 2017-08-01 10:32:43 +08:00
ccli8 8c76476929 [M487] Remove mbed_sdk_init_forced()
1. With mbed OS 5, mbed_sdk_init() is ensured to call before C++ global object constructor.
2. Refine startup file with GCC_ARM toolchain related to this modification.
2017-08-01 10:32:41 +08:00
ccli8 e99dc63d1b [M487] Fix lp_ticker typo 2017-08-01 10:32:38 +08:00
ccli8 642a2acb92 [Nuvoton] Give universal rtx configuration for all Nuvoton targets 2017-08-01 10:32:34 +08:00
ccli8 77ea786c04 [M487] Fix abnormal pulse on re-configuring pwmout
The issue is met in ARM mbed CI test tests-api-pwm.
2017-08-01 10:31:52 +08:00
ccli8 39a9f05491 [M487] Fix ARM mbed CI pwm test failed 2017-08-01 10:31:50 +08:00
ccli8 f182d7fcae [M487] Add internal configuration control_01 2017-08-01 10:31:48 +08:00
ccli8 9c90cfd304 [M487] Add Arduino UNO pins D14 and D15 2017-08-01 10:31:45 +08:00
ccli8 d709deffc6 [M487] Fix emitting uvisor core debug message through USB VCOM 2017-08-01 10:31:43 +08:00
ccli8 e49ceb173e [M487] Support initial stack allocated on SPIM CCM memory 2017-08-01 10:31:41 +08:00
ccli8 694838b706 [M487] Guard from initial stack allocated on SPIM CCM memory not initialized yet
Not add this guard in IAR toolchain due to its unsupported ILINK syntax
2017-08-01 10:31:38 +08:00
cyliangtw aa47503435 [M487] Revise CAN & AES to fulfill real-chip 2017-08-01 10:31:36 +08:00
ccli8 b516019b12 [M487] Add comment in gpio_irq_init() 2017-08-01 10:24:07 +08:00
ccli8 b7dedbe917 [M487] Align with BSP 2017-08-01 10:24:04 +08:00
ccli8 23672b09a2 [M487] Support bootloader 2017-08-01 10:23:58 +08:00
ccli8 cc2ab31d2c [M487] Divert SRAM bank2 (32 KB) to CCM from SPIM cache
Extend SRAM from 128 KB to 160 KB
2017-08-01 10:23:56 +08:00
ccli8 30ab1007e4 [M487] Support one-to-many mapping in the same pin map 2017-08-01 10:23:55 +08:00
ccli8 bcb96a12e1 [M487] Add SPI MOSI0/MISO0 into pin map
SPI MOSI0/MISO0 can use as SPI standard MOSI/MISO pins
2017-08-01 10:23:54 +08:00
ccli8 ef50c180fc [M487] Add LED4 to pass ATS 2017-08-01 10:23:52 +08:00
ccli8 280d767700 [M487] Update startup files
1. Add SYS_DISABLE_POR() in startup_M480.c
2. Fix FMC_T::CYCCTL access is not unlocked
3. Sync system_M480.c with BSP
2017-08-01 10:23:51 +08:00
ccli8 82a5b5dd34 [M487] Fix board header for real chip 2017-08-01 10:23:50 +08:00
ccli8 12536436f8 [M487] Conform to mbed TLS H/W acceleration support released with mbed OS 5.3 2017-08-01 10:23:48 +08:00
ccli8 7578541021 [M487] Fix some compile warnings 2017-08-01 10:23:47 +08:00
ccli8 4d4d1a89f9 [M487] Change OS_CLOCK to 192 MHz 2017-08-01 10:23:45 +08:00
ccli8 aaf26a12e1 [M487] Fix compile error with GCC_ARM toolchain 2017-08-01 10:23:44 +08:00
ccli8 90e35febc1 [M487] Alpha support for real chip
Real chip is incompatible with test chip due to change of pinout. From this on, test chip is unsupported.
2017-08-01 10:23:43 +08:00
ccli8 59acfb3a47 [M487] Correct comment for RTC time error in 1 sec after boot 2017-08-01 10:23:40 +08:00
ccli8 2fc3d1721b [M487] Fix RTC time doesn't continue across reset cycle 2017-08-01 10:23:39 +08:00
ccli8 00b69c7ddd [M487] Change comment for serial_getc/serial_putc 2017-08-01 10:23:38 +08:00
ccli8 e3fb76f0d9 [M487] Fix region end address error with IAR toolchain 2017-08-01 10:23:37 +08:00
ccli8 3f97ad3cdd [M487] Rename sleep/deepsleep to hal_sleep/hal_deepsleep 2017-08-01 10:23:36 +08:00
ccli8 4cc90e54d5 [M487] Fix serial error with sync/async calls interlaced 2017-08-01 10:23:34 +08:00
ccli8 3f650566d9 [M487] Fix pwmout power-down condition 2017-08-01 10:23:33 +08:00
ccli8 bea7548717 [M487] Fix DMA channel over-allocate 2017-08-01 10:23:32 +08:00
ccli8 5e9999424a [M487] Fix flash algorithm
1. Remove setting of not released register ICPCON
2. Enable FMC_APUEN to update APROM
2017-08-01 10:23:31 +08:00
ccli8 3a8be6c711 [M487] Remove 'FIXME' comment in flash_api.c 2017-08-01 10:23:29 +08:00
ccli8 bced49325a [M487] Support flash 2017-08-01 10:19:54 +08:00
ccli8 898a4bb4bd [M487] Refine serial PDMA code 2017-08-01 10:19:50 +08:00
ccli8 422871ab4d [M487] Refine SPI PDMA code 2017-08-01 10:19:48 +08:00
ccli8 a76d55a555 [M487] Add dma_modbase() to get PDMA base address 2017-08-01 10:19:45 +08:00
ccli8 aeee0e8b57 [M487] Fix pwmout power-down condition 2017-08-01 10:19:42 +08:00
ccli8 ae33f9eed7 [M487] Fix PDMA error on timeout 2017-08-01 10:19:39 +08:00
ccli8 65de13454e [M487] Prepare support for one-to-many mappings in the same pin map
Also fix bumped bug which doesn't call NU_MODBASE() to retrieve module base address
2017-08-01 10:19:33 +08:00
ccli8 04bd652a56 [M487] Add configuration option MBED_CONF_M480_USB_DEVICE_HSUSBD 2017-08-01 10:19:30 +08:00
cyliangtw d32607294f [M487] Support CAN feature 2017-08-01 10:19:25 +08:00
ccli8 95e0bc094a [M487] Change sbrk() allocation to be 32-byte aligned 2017-08-01 10:19:22 +08:00
ccli8 acee0379c7 [M487] Remove power-down support from us_ticker 2017-08-01 10:19:19 +08:00
ccli8 3dc5f2da34 [M487] Support uvisor debug message through stdio uart 2017-08-01 10:19:16 +08:00
ccli8 ebe56466cc [M487] Fix us_ticker drift error > 5% 2017-08-01 10:19:14 +08:00
ccli8 44572cf1a8 [M487] Fix link error in uvisor-enabled application 2017-08-01 10:19:11 +08:00
ccli8 ee622a0c51 [M487] Fix compile error with Travis CI
Use MBED_CONF_RTOS_PRESENT to filter out des/sha alternative for mbed OS 2.
2017-08-01 10:19:09 +08:00
cyliangtw b91f064be7 [M487] Add CAN, AES and Eth 2017-08-01 10:18:54 +08:00
ccli8 98a79c872b [M487] Support NuMaker-PFM-M487 board 2017-08-01 10:14:24 +08:00
MS30 CCChang12 38e78fa8b3 [NANO130] Ticker: add fire interrupt now function 2017-07-25 18:07:47 +08:00
MS30 CCChang12 c7cd9b607c [NANO130] Change dummy to spi_fill in spi_api.c 2017-07-25 18:03:27 +08:00
Jimmy Brisson 1f94ede86c Merge pull request #4744 from deepikabhavnani/spi_issue_4743
Allow user to set default transfer byte for block read
2017-07-24 14:45:30 -05:00
Deepika 1b797e9081 Closed review comments
1. Doxygen and Grammar related
2. Change dummy to spi_fill
3. Remove NXP driver and add default loop in spi block read (same as all
other drivers)
2017-07-21 09:46:22 -05:00
MS30 CCChang12 5f58104640 [NANO130] Fix the file name case problem, verified on Ubuntu Linux 2017-07-18 20:00:08 +08:00
MS30 CCChang12 4f66d2d809 [NANO130] Fix the file name case problem for building code in Linux system 2017-07-14 09:39:08 +08:00
Martin Kojtal 10ea63b8e7 Ticker: add fire interrupt now function
fire_interrupt function should be used for events in the past. As we have now
64bit timestamp, we can figure out what is in the past, and ask a target to invoke
an interrupt immediately. The previous attemps in the target HAL tickers were not ideal, as it can wrap around easily (16 or 32 bit counters). This new
functionality should solve this problem.

set_interrupt for tickers in HAL code should not handle anything but the next match interrupt. If it was in the past is handled by the upper layer.

It is possible that we are setting next event to the close future, so once it is set it is already in the past. Therefore we add a check after set interrupt to verify it is in future.
If it is not, we fire interrupt immediately. This results in
two events - first one immediate, correct one. The second one might be scheduled in far future (almost entire ticker range),
that should be discarded.

The specification for the fire_interrupts are:
- should set pending bit for the ticker interrupt (as soon as possible),
the event we are scheduling is already in the past, and we do not want to skip
any events
- no arguments are provided, neither return value, not needed
- ticker should be initialized prior calling this function (no need to check if it is already initialized)

All our targets provide this new functionality, removing old misleading if (timestamp is in the past) checks.
2017-07-13 12:23:25 +01:00
MS30 CCChang12 2050095b0f [NANO130] remove usage of mktime/localtime in rtc_api.c 2017-07-12 13:53:59 +08:00
MS30 CCChang12 83f395c07c [NANO130] Fix symbol of IAR toolchain 2017-07-12 11:01:03 +08:00
MS30 CCChang12 00fa0f64c1 [NANO130] Remove dead code 2017-07-12 10:49:40 +08:00
MS30 CCChang12 3bbacad6a7 [NANO130] Remove mbed_sdk_init_forced()
1. With mbed OS 5, mbed_sdk_init() is ensured to call before C++ global object constructor.
2. Refine startup file with GCC_ARM toolchain related to this modification.
2017-07-11 17:50:20 +08:00
cyliangtw 2f8e3fbfff [NANO130] remove dead code 2017-07-05 11:11:43 +08:00
MS30 CCChang12 6c870ca65f [NANO130] Fix issues in OS 5.5 Greentea test
1. Support CMSIS_VECTAB_VIRTUAL feature
2. Reduce the register sync waiting time in LP ticker
3. Adjust the stack and heap size in GCC and IAR toolchains
2017-06-23 17:24:22 +08:00
cyliangtw bc0fc2ea4e [NANO130] Align with mbed master
1. Remove RTX_CM_lib.h modification for NANO130 platform
2. Remove semaphore test code's speific modification for NANO130 platform
3. Fix duplicate definitions of __NVIC_SetVector/__NVIC_GetVector
4. Add spi_master_block_write()
2017-06-19 20:06:23 +08:00
MS30 CCChang12 80b74f3139 [NANO130] Modify pin names for mbed board 2017-06-12 15:45:47 +08:00
MS30 CCChang12 a2d0b021a6 [NANO130] Fix first PWM pulse may not be correct issue 2017-06-12 14:24:28 +08:00
Sam Grove 547320e99c Rename function st_rtc_localtime with _rtc_localtime 2017-06-07 23:24:48 -05:00
Vincent Coubard f880e44145 remove usage of mktime/localtime in favor of dedicated functions.
The use of mktime was causing a fault when called in interrupt handler because on GCC it lock the mutex protecting the environment, To overcome this issue, this patch add dedicated routine to convert a time_t into a tm and vice versa.
In the process mktime has been optimized and is now an order of magnitude faster than the routines present in the C library.
2017-06-07 22:06:22 -05:00
Sam Grove 5f138810a9 Merge pull request #4294 from ARMmbed/feature_cmsis5
Update CMSIS-Core and RTX to version 5
2017-06-02 23:44:32 -05:00
Martin Kojtal e229a49182 Merge pull request #4207 from geky/spi-remove-byte-locking
spi: Add SPI block-write to C++ and HAL for performance
2017-06-01 14:03:36 +02:00
Bartek Szatkowski 85cc9c8381 Remove deprecated RTX4 config options 2017-05-30 18:55:55 +01:00
Bartek Szatkowski b793a3fb89 Update codebase for CMSIS5/RTX5
Update all of mbed-os to use RTX5.
2017-05-30 18:55:52 +01:00
Bartek Szatkowski b97ffe8fdc CMSIS5: Replace target defined NVIC_Set/GetVector with CMSIS implementation 2017-05-30 18:55:51 +01:00
Sam Grove d11289b576 Merge pull request #4165 from adustm/can_init
fix #3863 Add an mbed API that allows the init of the CAN at the bus frequency
2017-05-26 10:45:19 -05:00
Christopher Haster c1de19e49e spi: Added default spi_master_block_write implementation to all targets
There is an easy default implementation of spi_master_block_write that
just calls spi_master_write in a loop, so the default implementation
of spi_master_block_write has been added to all targets.
2017-05-25 12:04:58 -05:00
MS30 CCChang12 369d65fd0d [NANO130] Fix issues in ci-test 2017-05-25 14:29:38 +08:00
adustm 3d44a3fcc3 add can_init_freq for NUVOTON platforms 2017-05-15 14:27:22 +02:00
MS30 CCChang12 9dcd7256cb [NANO130] Fix compile warnings in all toolchains 2017-05-11 10:48:52 +08:00
MS30 CCChang12 c5c7f3c2e2 [NANO130] Fix RTC incorrect time issue after system reset 2017-05-11 10:21:59 +08:00
MS30 CCChang12 e1af4657e9 [NANO130] Fix issues in Greentea test 2017-05-09 10:24:05 +08:00
ccli8 08c778d18d [NUC472/M453] Change comment for serial_getc/serial_putc 2017-05-09 09:22:41 +08:00
ccli8 e7b737ddad [NUC472/M453] Fix serial error with sync/async calls interlaced
Serial implementation uses different vector handlers for sync/async calls respectively. The issue can be reproduced with the following flow:
1. Register sync mode callback with Serial.attach().
2. Sync call with Serial.putc()/getc().
3. Change to async call with Serial.write()/read().
4. Change back to sync call with Serial.putc()/getc().
Now, vector handller is still for async mode, not for sync mode.

To fix it:
1. Introduce internal function serial_enable_interrupt() for both sync/async vector handler enable/disable.
   Original HAL function serial_irq_set() is reduced to call it for sync mode vector handler enable/disable.
2. Introduce internal function serial_rollback_interrupt() to roll back sync mode vector handler at end of async transfer.
2017-05-02 09:31:09 +08:00
MS30 CCChang12 4753787293 [NANO130] Support IAR toolchain 2017-04-28 15:30:16 +08:00
MS30 CCChang12 8d581bbc27 [NANO130] Support Serial async mode 2017-04-28 09:59:30 +08:00
MS30 CCChang12 ac9f59fda5 [NANO130] Fix LP_TICKER and RTC sometimes test fail issue 2017-04-27 10:05:49 +08:00
MS30 CCChang12 a96bea8631 [NANO130] Support ADC 2017-04-26 14:11:47 +08:00
MS30 CCChang12 3be0aaf8aa [NANO130] Support PWM 2017-04-21 13:21:46 +08:00