Commit Graph

162 Commits (58c0319b287bfcc785ab832788290ee05109d9c9)

Author SHA1 Message Date
pea-pod 507181d262 Change MBED_STATIC_ASSERTs version for built-in 2020-10-27 08:30:40 -05:00
cyliangtw 3916026dd7 Commit M451/NANO100 i2c_api again to resolve abnormal gitattribute 2020-09-30 10:27:16 +08:00
cyliangtw ffee35a5c8 Fix NuMaker I2C timeout,
some H/W timer count is 24 bits only, hardcode 0xffffffff causing
  wrong judgement of timeout as while H/W timer counting overflow.
2020-09-29 21:01:18 +08:00
Martin Kojtal 468372e759
Merge pull request #13492 from talorion/fix-PwmOut-resets-after-suspend
Fix pwm out resets after suspend
2020-09-10 12:40:18 +01:00
Jaeden Amero 612b148fd4 stack: armc: Workaround config passing bug
Workaround a bug where the boot stack size configuration option is not
passed on to armlink, the Arm Compiler's linker. Prefer
MBED_CONF_TARGET_BOOT_STACK_SIZE if present, as this is what the
configuration system should provide. Fall back to MBED_BOOT_STACK_SIZE
if MBED_CONF_TARGET_BOOT_STACK_SIZE is not defined, as in the case of
buggy tools. If both MBED_CONF_TARGET_BOOT_STACK_SIZE and
MBED_BOOT_STACK_SIZE are not defined, then we fall back to a hard-coded
value provided by the linkerscript. See
https://github.com/ARMmbed/mbed-os/issues/13474 for more information.
2020-09-10 10:08:38 +01:00
Jaeden Amero 39e69d328d Use boot stack size from config system
To allow overriding of the boot stack size from the Mbed configuration
system, consistently use MBED_CONF_TARGET_BOOT_STACK_SIZE rather than
MBED_BOOT_STACK_SIZE.

Fixes #10319
2020-09-10 10:08:38 +01:00
talorion b03d80fd08 pwmout - fixed compile errors 2020-09-02 13:39:17 +02:00
talorion 20dce73257 pwmout - NANO100 - add read methods for period and pulsewidth 2020-09-02 13:39:14 +02:00
Martin Kojtal 8a254a9cc6
Merge pull request #12923 from OpenNuvoton/nuvoton_watchdog_lxt
Nuvoton: Refine more on watchdog HAL
2020-05-12 14:31:26 +02:00
Martin Kojtal b376ee1c7c
Merge pull request #12896 from OpenNuvoton/nuvoton_watchdog_hardfault
Nuvoton: Fix watchdog reset failure on meeting Hard Fault
2020-05-12 14:18:18 +02:00
Chun-Chieh Li f6485cf92f Nuvoton: Fix failure to change WDT clock source
WDT clock source selection and its enablement bits are protected. Add unlock sequence before write to them.
2020-05-05 17:50:15 +08:00
Chun-Chieh Li d121ea89d1 Nuvoton: Fix WDT feature report with clock frequency 2020-05-05 17:50:10 +08:00
Chun-Chieh Li d823756cb7 Nuvoton: Enlarge WDT reset delay to avoid premature WDT reset
Consider the following factors to define WDT reset delay:
1. Cannot be too small. This is to avoid premature WDT reset in pieces of timeout cascading.
2. Cannot be too large. This is to pass Greentea reset_reason/watchdog_reset tests, which have e.g. 50~100 reset delay tolerance.
2020-05-05 17:50:05 +08:00
Chun-Chieh Li 73824f0c4d Nuvoton: Fix watchdog reset failure on meeting Hard Fault
Original implementation doesn't enable watchdog reset in pieces of cascaded timeout, except the last one. This is to guarantee re-configuration can be in time, but in interrupt disabled scenario e.g. Hard Fault, watchdog reset can cease to be effective.

This change enables watchdog reset all the way of cascaded timeout. With trade-off, guaranteed watchdog reset function is more significant than re-configuration in time.
2020-04-30 14:22:30 +08:00
Chun-Chieh Li 226d86b304 NANO130: Support bare metal
Relevant modifications to make TOOLCHAIN_* directories clear:
1. Remove TOOLCHAIN_ARM_STD
2. Rename TOOLCHAIN_ARM_MICRO to TOOLCHAIN_ARM
2020-04-27 11:24:13 +08:00
Chun-Chieh Li 188c6d9a4a NANO130: Make memory specification configurable 2020-04-27 11:24:11 +08:00
Chun-Chieh Li dbd34ed63e NANO130: Enlarge timeout in CLK_WaitClockReady(...)
Most code doesn't check return code of CLK_WaitClockReady(...). Enlarge timeout to meet most cases.

lp_ticker initialization fails with this issue. Steps for reproducing:
1.  System runs in tickless from lp_ticker mode.
2.  Arm WDT reset.
3.  In next reset cycle, lp_ticker initialization fails (active flag doesn't become active).
2020-03-20 10:26:39 +08:00
Martin Kojtal dc733d8883
Merge pull request #12477 from fkjagodzinski/hal-gpio-get_capabilities
HAL: Add a get_capabilities() function to GPIO API
2020-02-24 07:47:39 +00:00
Filip Jagodzinski 09ecd2fdc0 Nuvoton: Add gpio_get_capabilities()
TARGET_NANO100, TARGET_NUC472 & TARGET_M451 do not support input pull
mode configuration.
2020-02-19 18:58:47 +01:00
Chun-Chieh Li 8df96ec50a Nuvoton: Make SPI inter-frame (delay match configured suspend interval
In no MISO case, skip SPI read so that no more write/read delay contribute to SPI inter-frame delay when data is written successively.

Update targets:
-   NUMAKER_PFM_NANO130
-   NUMAKER_PFM_NUC472
-   NUMAKER_PFM_M453
-   NUMAKER_PFM_M487/NUMAKER_IOT_M487
-   NU_PFM_M2351_*
-   NUMAKER_IOT_M263A
-   NUMAKER_M252KG
2020-02-17 15:00:09 +08:00
Chun-Chieh Li 4a1d612e90 Nuvoton: Fix delay code with RTC clock source
Explicitly configure RTC clock source to LXT

Update targets:

-   NUMAKER_PFM_NANO130
-   NUMAKER_PFM_NUC472
-   NUMAKER_PFM_M453
-   NUMAKER_PFM_M487/NUMAKER_IOT_M487
-   NUMAKER_M252KG
-   NUMAKER_IOT_M263A
2020-02-13 11:24:01 +08:00
Chun-Chieh Li 86fcae5b03 Nuvoton: Fix GPIO rising/falling edge interrupts cannot exist simultaneously
This is to pass mbed_hal_fpga_ci_test_shield-gpio_irq test.

Update targets:

-   NUMAKER_PFM_NANO130
-   NUMAKER_PFM_NUC472
-   NUMAKER_PFM_M453
-   NUMAKER_PFM_M487/NUMAKER_IOT_M487
-   NUMAKER_M252KG
-   NUMAKER_IOT_M263A
2020-02-13 11:24:01 +08:00
Przemyslaw Stekiel a4e1354769 Remove pinmap_restricted_peripherals() function from Nuvoton (STDIO uart is restricted by default) 2020-02-07 10:45:02 +01:00
Maciej Bocianski ad7f27bf77 NUMAKER_PFM_NANO130: keep __vector_handlers symbol in LTO builds
Add a "used" attribute to __vector_handlers to fix ARMC6 build with
the "-flto" flag.
(Error: L6236E: No section matches selector - no section to be FIRST/LAST.)

This attribute, attached to a function/variable, means that code must be emitted
for the function even if it appears that the function is not referenced.
2020-02-04 12:29:59 +01:00
cyliangtw 6612ee8460 Set NANO130 CLK as 48 MHz for USBD support 2020-01-03 20:40:44 +08:00
cyliangtw a5aaabff5d NANO130 add extern C into nano100_usbd.h for C++ caller 2020-01-03 20:40:42 +08:00
Chun-Chieh Li f90b6c9cb0 NANO130: Support dynamic heap configuration on IAR
On IAR, configure heap to 1KiB at a minimum and expandable, dependent on available SRAM. This requires IAR 8.x.
2019-12-10 10:00:05 +08:00
Chun-Chieh Li 3e4e0629dc NANO130: Decrease heap to 2.75KiB to spare SRAM for static allocation
This adjustment is to pass compile on IAR on which heap configuration is hard-coded and cannot be adjusted according to staic SRAM usage.
2019-12-09 18:56:42 +08:00
Chun-Chieh Li 6df5eea841 NANO130: Fix OOM with packing algorithm at IAR linking
At IAR linking, the default method of 'initialize by copy' is 'auto', which will estimate
different packing algorithms, including complex 'lz77', for smallest memory footprint. But
the algorithm itself can consume some SRAM and cause OOM at linking time for NANO130, which
just has 16KiB SRAM. To avoid this error, always choose 'none' packing algorithm.
2019-12-09 13:48:31 +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
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
int_szyk d68a802f07 Add watchdog clock accuracy to Nuvoton targets. 2019-09-30 08:10:25 +02:00
Chun-Chieh Li 6f1bd325cd [NANO130] Remove SPI MOSI1/MISO1 pins from pinmap
MOSI1/MISO1 are used in second bit of 2-bit transfer mode and cannot be used
for normal MOSI/MISO. Remove them from pinmap.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-spi/
SPI - basic test.
2019-08-20 13:12:43 +08:00
Chun-Chieh Li c3d7ef8341 [Nuvoton] 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-20 13:12:43 +08:00
Chun-Chieh Li 09bf844d76 [Nuvoton] 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-20 13:12:42 +08:00
Chun-Chieh Li d46c6fea47 [Nuvoton] 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-20 13:12:42 +08:00
Chun-Chieh Li 80c21aeff5 [Nuvoton] 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-20 13:12:42 +08:00
Chun-Chieh Li fef138a3cd [Nuvoton] 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-20 13:12:41 +08:00
Chun-Chieh Li 560fe33ed8 [Nuvoton] Exclude USB UART from testing
USB UART is dedicated to USB COM and so must exclude from FPGA CI testing.
2019-08-20 13:12:41 +08:00
Chun-Chieh Li f88bd72c19 [Nuvoton] 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-20 13:12:41 +08:00
Chun-Chieh Li 2b9ee2a93f [NANO130] Override wait_ns(...) to provide more accurate implementation
NANO100 series doesn't support cache and so cannot provide zero-wait state
flash performance.
2019-07-08 17:52:26 +08:00
Martin Kojtal ccb63d771e
Merge pull request #10857 from ARMmbed/feature-watchdog
Add Watchdog and ResetReason
2019-07-03 11:43:52 +01:00
Chun-Chieh Li 016ab2a417 [Nuvoton] Fix channel release in analogout_free() 2019-06-13 18:11:50 +08:00
ccli8 84440531f1 [Nuvoton] Support watchdog timer 2019-05-24 12:20:01 +02:00
ccli8 6e514b6e08 [Nuvoton] Support reset reason 2019-05-24 11:35:44 +02:00
ccli8 fcab482357 [NANO130] Fix optimization error with NVIC_SetVector/NVIC_GetVector on ARMC6
On ARMC6 with optimization level "-Os", the two functions NVIC_SetVector/NVIC_GetVector
will be translated to illegal instruction for trapping due to NVIC_FLASH_VECTOR_ADDRESS
defined as direct 0. Fixed by defining NVIC_FLASH_VECTOR_ADDRESS as a symbol instead to
avoid such optimization error.
2019-05-08 10:25:36 +08:00
ccli8 be96ade527 [Nuvoton] Add button names BUTTON1/BUTTON2 2019-03-26 17:05:43 +08:00
deepikabhavnani 75040535ed Addressed review comments to correct size values 2019-02-28 19:54:38 -06:00