Replace the spinlock/sched_lock pair in arm/stm32 with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Replace the spinlock/sched_lock pair in arm/sam34 with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Replace the spinlock/sched_lock pair in arm/s32k3xx with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Replace the spinlock/sched_lock pair in arm/s32k1xx with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Replace the spinlock/sched_lock pair in arm/kinetis with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Replace the spinlock/sched_lock pair in arm/imx9 with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Enable the event module on pcduino-a10 and smartl-c906 boards
to allow event tests to be executed on both ARM and RISC-V
architectures.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
The `need_switch` flag was not initialized in `event_post()`. Since it is
a local variable, it could contain a random non-zero value, leading to
incorrect behavior.
In addition, this patch also fixes an issue where the event clearing
operation in `event_post()` was not performed correctly.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
The Nuttx MSS CAN driver has an exclusive interface to the integrated MSS CAN peripheral residing in Polarfire SoC FPGAs. There are two CAN block 0 and 1 that can be configured for use. In normal mode (non AMP), CAN0 and CAN1 block base register addresses are 0x2010C000UL and 0x2010D000UL.
Signed-off-by: Hai To <hai.to@tii.ae>
The DEBUGASSERT is wrong in two cases;
1) In SIM, which does sim_timer_update from the idle task, and the sim timer runs on signals
2) If signal is dispatched from within an interrupt
In these cases, if there are not available items for pending signals, return
the nxsig_tcbdispatch with -EAGAIN instead of asserting.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This flag can be used to store the filename of a loaded module or
executable in binfmt. The filename is useful for example in debugging.
For example, gdb or a jtag debugger can be configured to automatically
fetch the symbols for the currently executing module.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Remove the nxevent_tickwait_wait() description from events.rst,
since this API was removed during the event module refactoring.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
The current event implementation relies on a dedicated wait object,
which introduces several issues:
1. Increases memory usage
2. Complicates the event logic
3. Makes the API design less clean, as it requires a separate
nxevent_tickwait_wait() function
This patch removes the event’s dependency on the wait object
and eliminates the nxevent_tickwait_wait() API accordingly.
BREAKING CHANGE: this commit removed the nxevent_tickwait_wait function
so the related docs should be updated accordingly
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
If the thread is blocked waiting on a event, then the
thread must be unblocked from the evnet to handle
the task cancellation.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
The current event implementation uses semaphores for wait and post
operations. Since semaphores are relatively heavy-weight and intended
for resource-based synchronization, this is suboptimal.
So this patch replaced the semaphore-based mechanism with direct
scheduler operations to improve performance and reduce memory footprint.
This patch also introduce a new task state TSTATE_WAIT_EVENT to indicate
the task is waiting for a event.
BREAKING CHANGE: This commit introduced a new task state TSTATE_WAIT_EVENT
so apps/nshlib/, procfs/ and tools/pynuttx/nxgdb/ are needed to be updated accordingly.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Restore the use of critical sections to provide mutual exclusion
between event wait and post operations. This allows replacing the
heavier semaphore-based mechanism with direct scheduler operations
for synchronization.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Add documentation describing the purpose and behavior of early_syslog(),
which provides a minimal logging facility available during early system
initialization or system down.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Introduce early_syslog() to enable basic logging during the very early
boot or system down stages, when the full syslog subsystem is not yet
available.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Replace the spinlock/sched_lock pair in the sched wqueue module with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Replace the spinlock/sched_lock pair in the sched clock module with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
By default, the full configured DTCM region is assigned to the heap for
dynamic allocation. In scenarios requiring deterministic memory regions
for static buffers or control structures, you can reduce the heap
allocation to reserve part of DTCM for manual/static use.
This kconfig symbol allows to limit the size.
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
Increase LCD PWM frequency from 100Hz to 10kHz to eliminate visible flicker
on the lckfb-szpi ESP32S3 board. The higher frequency provides smoother
backlight control and improves display visual quality.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Updates the SPI Flash driver used for user storage MTD.
Moves ESP32 and ESP32S3 to use common driver.
Updates KConfig options to keep backwards compatibility.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Updates the SPI Flash driver used for user storage MTD.
Updates board linker script and bring up.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
The adc_dmaconvcallback routine was far too slow and inefficient. This was not caught until recently when I was testing faster sample rates. When in circular mode for the adc (dma and constant conversions), the adc_dmaconvcallback function would overwhelm the OS and lock it up. I looked into this and did a lot of testing. First I tried minimally improving the dma callback by removing the % operator from the algorithm, this was slow and inefficient. I also tried increasing the batch size considerably as well as the fifo size. This helped but the OS would still lockup with the fastest sample rate (5 Msps). au_receive_batch was the solution. In order to use this, I needed to change the dmabuffer to be of type uint32_t to match the data pointer in au_receive_batch. I also needed to create a channel buffer, which is initialized once in adc_setup. stm32_gpdma_cfg_s->tr1 needed to be updated for the uint32_t dmabuffer. Once I made changes to use au_receive_batch, I could reliably use the fastest sample rate without locking up the OS. Calling au_receive for every single conversion in a batch is far less efficient than calling au_receive_batch. I also snuck in some changes for the ADC watchdog defines and guards. These were fixes that were tested while testing these changes.
Signed-off-by: kywwilson11 <kwilson@2g-eng.com>
The documentation is now updated to reflect the new EMMC support. I have
also improved the format to match the standard board documentation
template, and included better support descriptions for features that
have varying levels of implementation.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This initial implementation sets up support for the EMMC interfaces on
the BCM2711. Only EMMC2 is tested since it is the interface of interest
(connects to uSD card). MMCSD communication is functional and the boot
partition of the SD card can be mounted and interacted with.
Insertion/removal interrupts do not fire after initial boot, and
sdstress fails with any byte size larger than 1023. 32GB card works
perfectly, while 64GB card exhibits strange behaviour when interacting
with VFAT filesystem.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Refactor nxsched_timeout() to use nxsched_wakeup() in order to
eliminate code duplication and improve maintainability.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Add a new function nxsched_wakeup() to the scheduler,
which allows waking up a sleeping task before its timeout.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Currently, there is duplicated code in nxsig_wait_irq() and nxsig_timeout().
This patch updates the input parameters of nxsig_wait_irq() so that it can
be reused in nxsig_timeout(), reducing code duplication and improving
maintainability.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
nxsig_wait_irq() is always invoked within an existing critical section,
and the task state is already verified, similar to nxsem_wait_irq().
Therefore, the additional critical section protection and task state
check inside the function are redundant and have been removed.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This is the case for USB2517 USB HUB. Also improved the driver to
avoid mistakes: initially I changed g_id[3], but the in register
there is another field where we need to pass this size again. So
it is better to use ARRAY_SIZE() macro to avoid mistakes.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
This function can identify (during the runtime) whether the chip
is revB or revA. Bear in mind PIC32CZ2051CA70 is always revB.
Allows to have one binary compatible with SAMV7 and PIC32.
Thanks to Pavel Pisa and Michal Lenc for the suggested code.
Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
Previously the function "up_cpu_pause" was used for preventing all other
CPUs from executing code from flash.
The above function was removed in d8cb7759.
Now flash operations work on rp2040 in SMP mode by blocking all but the
current CPU for the duration of the critical function (write or erase).
Closes: #16203
Signed-off-by: Lars Kruse <devel@sumpfralle.de>
Adding the stm32h5 pwm driver. This is almost an exact copy of the stm32h7 pwm driver. I confirmed the timers for the h5 are version v2 and added the preprocessor definition. This commit was tested on a stm32h5 nucleo-h563zi development board. Necessary board files and a pwm config have been added. Added pin mappings for all timer outputs.
Signed-off-by: kywwilson11 <kwilson@2g-eng.com>
Added documentation regarding nucleo-h563zi:pwm config.
Removed CONFIG_STM32H5_PWM guard at the top. Fixed IRQs for tim1 and tim8. Added H5 to list of Timer IP v2 timers.
Conditionally compile stm32_serial.c.
Add stm32_pwm.c to CMakeLists.txt