- Remove the redundant holder, as nxsem now manages hoder TID
- Remove DEBUGASSERTIONS which are managed in nxsem
- Remove the "reset" handling logic, as it is now managed in nxsem
- Inline the simplest functions
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This enables the mutex fast path for nxsem_wait, nxsem_trywait and nxsem_post also when
the priority inheritance is enabled.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This puts the mutex support fully inside nxsem, allowing
locking the mutex and setting the holder with single atomic
operation.
This enables fast mutex locking from userspace, avoiding taking
critical_sections, which may be heavy in SMP and cleanup
of nxmutex library in the future.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
The task which is deleted should be removed from the semaphores waitlist,
if the task happens to be blocked.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
The board has got only 64KB of flash, and is on the limit. Removing printf floating point
support frees up ~3kB of flash.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This patch adds definitions for listed chips. No other changes are needed
as the chips are similar to the previously supported AVR128DA28 and all
that is needed is some definitions for extra peripherals.
AVR DA/DB family chips have single interrupt vector for all changes
on an I/O port. This poses problem when multiple drivers want to claim
the same interrupt (might happen for example with button and discrete
joystick drivers using pins on the same port.)
The I/O multiplexer solves it by providing interface similar
to irq_attach. However, it allows registration of multiple handlers
for the same interrupt vector with additional information recording
which pins should be serviced by each handler.
Only handler for pins that triggered the interrupt is then called.
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>