Commit Graph

101 Commits (5bb3ede8904d2488c60b1d7539dff2edcce87062)

Author SHA1 Message Date
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
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
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
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 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 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 f61d9d48c8 [NUC472/M453/M487/NANO130] Add gpio_is_connected 2018-01-18 17:33:03 +08:00
Przemyslaw Stekiel 106561669f Update RTC drivers for extended RTC. 2017-12-05 07:54:02 +01: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 d4af4ba3a7 [NUC472/M453/M487] Fix RTC hour error with AM/PM 2017-09-20 16:56:34 +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
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 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 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
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
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
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 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
adustm 3d44a3fcc3 add can_init_freq for NUVOTON platforms 2017-05-15 14:27:22 +02: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
ccli8 32a7e6ba5e [NUC472/M453] Fix pwmout power-down condition 2017-04-20 16:13:37 +08:00
ccli8 e55553e749 [NUC472/M453] Fix DMA channel over-allocate 2017-04-20 14:57:09 +08:00