Initial support adds chip specific files like Kconfig, flags for the compiler,
and basic functionality like system timer. Some files are stubs derived
from corresponding ATmega files but without the functionality they are
supposed to add (to be done in later patches)
Part of the work is altered copies of corresponding files for ATMega MCUs.
Initially supported is AVR128DA28.
This patch marks host GCC toolchain option with ARCH_TOOLCHAIN_GCC,
enabling various other settings depending on it. One of the enabled
settings is DEBUG_OPT_UNUSED_SECTIONS.
This patch also adjusts compiler and linker flags based on the value
of DEBUG_OPT_UNUSED_SECTIONS so unused sections are removed
Newer AVR chips (DA/DB family) use mixed-case constants in header
file defining constants for I/O register values (provided
by manufacturer.)
Based on mailing list discussion, this patch adds some
of the lowercase suffixes used (the less prevalent constants
are then redefined in NuttX.)
The .progmem section in the .text section contains data marked
to not be copied into RAM and instead used directly from program
memory. Unlike other sections that naturally align to 2 byte words,
this section may be odd in length.
If this happens, following sections will end up misaligned
and the compilation will fail. This patch forces correct alignment
after the .progmem section end.
On SMP systems we should enable FPU on each core
FPU extenstion support must be enabled on each core as stated on 4.6.5
arm m33 devices generic user guide
Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
RP2350 datasheet and upstream pico-sdk suggests higher VCO freq to
better output stability.
Increase the VCO and update PLL divs according to specs and calculation.
Higher VCO freq is more stable, lower VCO freq is more power friendly.
Also it's possible to use 120/6/5 with VCO 1440MHz for USB PLL to even
higher output stability.
USB setup changes from rp2040
Must clear the MAIN_CTRL.PHY_ISO bit at startup and after power down
events.
Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
* We do not have "Settings" tab in the Apache's owned repository,
thus we need to update .asf.yaml file with repository settings.
* No direct push to master branch is possible.
* Require status checks to pass before merge.
* Setup reviews parameters.
* Require signatures.
* Require conversation resolution.
* Require linear history.
Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
This adds the ability to use USART2 as a console if wanting to use
a console without going through the ST-Link VCOM port. This required when
using an external debugger or trace with this board.
Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
This adds the necessary code and function to allow a board to determine the reason for a reset. This is useful in NXboot, for example.
Signed-off-by: Tim Hardisty <timh@jti.uk.com>
For the watchdog list and the workqueue list, we wonder whether the list head has changed after the insertion. In the original implementation, we have to access the list->next field and compare the result to the currently inserted node. In this commit, we mark the list head before the insertion and comparing the current traversed node with the list head we marked, which can avoid accessing the list->next and is more cache-friendly.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit refactors the logic of workqueue processing delayed and periodic work, and changes the timer to be set in `work_thread`. The improvements of this change are as follows:
- Fixed the memory reuse problem of the original periodic workqueue implementation.
- By removing the `wdog_s` structure in the `work_s` structure, the memory overhead of each `work_s` structure is reduced by about 30 bytes.
- Set the timer for each workqueue instead of each work, which improves system performance.
- Simplified the workqueue cancel logic.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
In NuttX, the dq and the list are two different implementations of the double-linked list. Comparing to the dq, the list implementation has less branch conditions such as checking whether the head or tail is NULL. In theory and practice, the list is more friendly to the CPU pipeline. This commit changed the dq to the list in the wqueue implementation.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
struct work_s
{
union
{
struct
{
struct dq_entry_s dq; /* Implements a double linked list */
clock_t qtime; /* Time work queued */
} s;
struct wdog_s timer; /* Delay expiry timer */
struct wdog_period_s ptimer; /* Period expiry timer */
} u;
worker_t worker; /* Work callback */
FAR void *arg; /* Callback argument */
FAR struct kwork_wqueue_s *wq; /* Work queue */
};
work_cancel() should determine whether the current work is
in the timer or has already entered the queue.
This judgment is indispensable because the structure is a union.
Whether it is interpreted as a timer or as a dq needs to be determined.
But this judgment seriously depends on the order of struct wdog_s and
struct dq_entry_s, once someone change the order of any, there is a bug.
So we decide remove the union, to improve the robustness.
For the work_s structure size will grow bigger, then we will provide a
another optimization patch
Signed-off-by: ligd <liguiding1@xiaomi.com>
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
The version and the git repository of Espressif's MCUboot port can
be changed by setting the `MCUBOOT_VERSION` and `MCUBOOT_URL`
environment variables before running the `make bootloader` command.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
This commit introduces the tagging system into the STM32 family of chips
by tagging all chips with their appropriate chip type/family.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Before this patch, the board nucleo-767zi had just one button available for the
user, which one was not working (there was no /dev/buttons on stm32_bringup.c).
Aditionally, I have changed the stm32_buttons.c to support not only the
built-in button but as well as to another four external buttons.
On the RP2350, the watchdog receives its tick input from the
system-level ticks block, unlike the RP2040, where the watchdog includes
its own tick generator. Enable the TICK blocks, update the watchdog
routines.
Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
Modify rtc_data_seg to rtc_slow_seg to fix RTC problems.
The proper location for those is in RTC slow memory.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
The RP2040 chip supports 4 different GPIO interrupt modes. They can be
configured to be used simultaneously, although previously the NuttX
support only allowed one type of interrupt to be enabled per GPIO pin.
This allows up to all four to be selected without changing previous
behaviour.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>