This patch adds support for PWM generation using CTIMER on MCXN devices.
Each CTIMER provides 4 PWM channels, channels sharing the same
CTIMER instance will have the same period settings, and the duty
cycle will be maintained if period is changed through one of the four
channels.
The period channel is automatically assigned and will be transferred
to one of the other available channels if that channel is used for PWM
generation, no glitches should be expected during the transition.
The patch also provides a sample PWM output configuration connected to
the on-board green LED which can be enabled through Kconfig.
Signed-off-by: Yilin Sun <imi415@imi.moe>
This patch adds support for hwtimer using MRT0 instance which simulates
4 independent timers. The frequency is fixed to AHB bus frequency and
not adjustable.
Signed-off-by: Yilin Sun <imi415@imi.moe>
1 - The current linker flags undefines `Reset_Handler' and uses `entry()' as
default entry point (specified by `-e'), which will cause a invalid reset
vector in the image without proper crt0 init assembly routine.
2 - The default startup files provided by NXP violate the crt0 assumption
that bss section will be filled with zero unless macro `__STARTUP_CLEAR_BSS'
is defined. This will cause RTT hook funtion pointers set to non-NULL values at
kernel start, thus successfully passes the `RT_nnnn_HOOK_CALL` checks
and jumps to an invalid pointer.
3 - The default heap size used by TCB and kernel objects are set by
linker file macros, which is 0x400 (1024 bytes). The size is too small
for main task and the allocation will fail before the first task being created.
This patch restores Reset_Handler as default reset vector and executes
entry by replacing __START from newlib, defines the
`__STARTUP_CLEAR_BSS` macro to forcibly zeroize the bss section to avoid
unexpected hard faults, set proper heap sizes based on the SRAM sizes.
Some unused compiler/linker flags are also removed or replaced to avoid
future confusion.
The heap sizes for different devices are:
* LPC55(S)69/LPC55(S)28: 64kB
* LPC55(S)06/LPC55(S)16/LPC55(S)36: 32kB
Signed-off-by: Yilin Sun <imi415@imi.moe>