Commit Graph

56 Commits (f4febdcb9df0a7c52ae31e14e0856c05421f8657)

Author SHA1 Message Date
cyliangtw 5b693ff3b3 To keep proprietary BSP DutyCycle definition and rename HighDutyCycle in extend API 2021-03-10 11:53:55 +08:00
cyliangtw 045f443bb2 Support M251/M261/M453/NANO130/NUC472 PWM duty cycle range as 0 ~ 10000 2021-03-04 19:58:03 +08:00
Martin Kojtal 120b25f138
Merge pull request #14315 from hugueskamba/hk_cmake_fix_nuvonton_m261
NUVOTON: Remove CMake listing of M261 include directory that do not exist
2021-02-22 20:10:02 +00:00
Martin Kojtal 3bb8de6ea3
Merge pull request #14308 from hugueskamba/hk_cmake_create_flash_cmsis_algo
Create FLASH CMSIS ALGO target to remove dependency on MBED_TARGET_LABELS
2021-02-22 14:36:44 +00:00
Hugues Kamba 3eb5296996 NUVOTON: Remove CMake listing of M261 include directory that do not exist
Remove listing of include directory that do not exist
2021-02-22 12:53:17 +00:00
Hugues Kamba 7d49d4bce1 Create FLASH CMSIS ALGO target to remove dependency on MBED_TARGET_LABELS
This goes towards eventually removing reliance on targets.json to specify
the requirements of Mbed targets.
2021-02-19 16:56:37 +00:00
Hugues Kamba a3a36ccb92 CMake: Fix some NUVOTON build
Correct source file listings for M251, M261.
Also remove unused input source files.
2021-02-19 16:48:32 +00:00
Hugues Kamba 2a6a840903 CMake: Refactor Nuvoton targets
Refactor all Nuvoton targets to be CMake buildsystem targets. This removes
the need for checking MBED_TARGET_LABELS repeatedly and allows us to be
more flexible in the way we include MBED_TARGET source in the build.

A side effect of this is it will allow us to support custom targets
without breaking the build for 'standard' targets, as we use CMake's
standard mechanism for adding build rules to the build system, rather
than implementing our own layer of logic to exclude files not needed for
the target being built. Using this approach, if an MBED_TARGET is not
linked to using `target_link_libraries` its source files will not be
added to the build. This means custom target source can be added to the
user's application CMakeLists.txt without polluting the build system
when trying to compile for a standard MBED_TARGET.
2021-02-12 19:09:11 +00:00
Chun-Chieh Li 68df919e3f Nuvoton: Remove DISABLE/ENABLE macro definitions in BSP
These are not used on Mbed OS. Remove them to avoid name conflict with other modules.
2020-12-09 14:27:23 +08:00
Martin Kojtal 28eeee2b4c
Merge pull request #13922 from 0xc0170/cmake-nuvoton
CMake: add nuvoton targets
2020-11-27 11:02:53 +00:00
Martin Kojtal 0efffa3411 CMake nuvoton: fix ARMClang linker script command 2020-11-25 13:18:15 +00:00
Martin Kojtal 033c48dee7 CMake: fix NUMAKER_IOT_M263A name 2020-11-20 13:41:34 +00:00
Martin Kojtal 02c35fdd48 CMake: add nuvoton targets 2020-11-18 15:18:18 +00:00
pea-pod 507181d262 Change MBED_STATIC_ASSERTs version for built-in 2020-10-27 08:30:40 -05: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 1a9d8576d7 pwmout - M261 - add read methods for period and pulsewidth 2020-09-02 13:39:13 +02:00
cyliangtw dd48500cc3 Revise M263A button pin name 2020-07-21 20:50:19 +08:00
Chun-Chieh Li f5cb899413 M263: Re-organize PinNames.h
This is to support custom boards based on M261 series chips.
2020-03-20 09:16:51 +08:00
Chun-Chieh Li 15fcdb1c36 M263: Support configurability for USB/STDIO UART pins
-   STDIO_UART and STDIO_UART_TX/STDIO_UART_RX
-   USB_UART and USBTX/USBRX
2020-03-20 09:16:51 +08:00
Chun-Chieh Li edcfcf0495 M263: Enable configurability for memory specification
This is to support custom boards based on M261 series chips.
2020-03-20 09:16:50 +08:00
Chun-Chieh Li 203a9fe0ec M263: Add SERIAL_TX/SERIAL_RX pin names
Don't set SERIAL_TX/SERIAL_RX to USBTX/USBRX which should be dedicated for USB VCOM and not for other uses.
2020-03-20 09:16:49 +08: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 9aade4a816 NUMAKER_IOT_M263A: 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:57 +01:00
Chun-Chieh Li c99dc34f65 Nuvoton: 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.

Support targets:
-   NUMAKER_PFM_NUC472 w/ and w/o XRAM
-   NUMAKER_PFM_M453
-   NUMAKER_PFM_M487/NUMAKER_IOT_M487
-   NUMAKER_IOT_M263A
-   NUMAKER_M252KG
2019-12-27 09:01:07 +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
Chun-Chieh Li 4cd0332ada NUVOTON: Re-implement TRNG HAL with TRNG H/W
Targets supporting TRNG H/W:

-   NU_PFM_M2351_*
-   NUMAKER_IOT_M263A
2019-10-24 10:55:03 +08:00
Chun-Chieh Li 3f9ba9e61f NUVOTON: Fix BSP/MKROM header
Related targets:
-   NU_PFM_M2351_*
-   NUMAKER_IOT_M263A
2019-10-24 09:36:25 +08:00
Chun-Chieh Li d993c5a108 NUVOTON: Re-implement __PC() with toolchain built-in
Re-implement __PC() by replacing BSP assembly with toolchain built-in.
2019-10-24 09:36:25 +08:00
Chun-Chieh Li 254866eac1 M263: Remove redundant SPI I2S pins from pinmap
The pins suffixed with 'I2SMCLK' are for SPI I2S and cannot be used in normal SPI.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-spi.
2019-08-30 11:33:56 +08:00
Chun-Chieh Li c67a0d8bd0 M263: 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-30 11:33:55 +08:00
Chun-Chieh Li 78ae1e0c73 M263: Support GPIO input pull-high/pull-low
In Nuvoton, only new-design chips support GPIO input pull-high/pull-low modes.
Targets not supporting this feature are listed below:

- NUMAKER_PFM_NANO130
- NUMAKER_PFM_NUC472
- NUMAKER_PFM_M453
2019-08-30 11:33:54 +08:00
Chun-Chieh Li 5b7beab9da M263: 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-30 11:33:52 +08:00
Chun-Chieh Li eb435b7da0 M263: 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-30 11:33:51 +08:00
Chun-Chieh Li d15abe5171 M263: 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-30 11:33:49 +08:00
Chun-Chieh Li 9d4d99cf34 M263: 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-30 11:33:48 +08:00
Chun-Chieh Li 9aa69d03bf M263: Exclude USB UART from testing
USB UART is dedicated to USB COM and so must exclude from FPGA CI testing.
2019-08-30 11:33:47 +08:00
Chun-Chieh Li 3cb95a8baf M263: 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-30 11:33:45 +08:00
cyliangtw e57ed04252 modify acceptable license term of SDK drivres 2019-08-23 18:12:23 +08:00
cyliangtw 23267ba229 re-license files of M261 device folder to be Apache 2019-08-23 18:12:19 +08:00
cyliangtw 9d653af2cc re-license all of M261 hal files to be Apache 2019-08-23 18:12:16 +08:00
cyliangtw c9006bd422 Support InterruptIn class in ci-test/pwm_rise_fall test case 2019-08-23 18:12:13 +08:00
cyliangtw d69e7c5613 Fix UNO pin map 2019-08-23 18:12:11 +08:00