Add crc8rohcincr() function to support byte-by-byte CRC8 calculation
using the ROHC polynomial (0x07) without XOR inversions. This is
useful for protocols that require incremental CRC accumulation,
such as GSM 07.10 (CMUX), where the CRC must be computed as frames
are parsed from circular buffers.
Changes include:
- New crc8rohcincr() function for single-byte incremental CRC
- Function takes current CRC value and returns updated CRC
- Uses same g_crc8_tab table as other ROHC functions
- No XOR inversions applied for proper accumulation
This allows protocols like CMUX to replace local CRC table
implementations with standard libc CRC functions while maintaining
correct incremental calculation behavior.
Signed-off-by: Halysson <halysson1007@gmail.com>
increase stack size for ostest configuration.
The default value is too small for x86 arch.
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
mmap() should return EBADF errno when fd is not valid.
We can just return error code from file_get().
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Previously sigpending() returned all pending signals in the group, which is not
POSIX compliant. It should return signals pending only for the caller, so
a signal send with pthread_kill() intended for another thread should not be
returned (it's not pending for a caller).
This fixes the pthread_create.c/test9 test case from
PSE52 Open Group Threads Test Suite.
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Added CMake build for Waveshare RP2040-LCD-1.28
Fix: The relative path of the file does not match the
actual file
- waveshare-rp2040-lcd-1-28-flash.ld
- waveshare-rp2040-lcd-1-28-sram.ld
Signed-off-by: simbit18 <simbit18@gmail.com>
changes should not be flushed to the underlying file if memory mapping is
marked as MAP_PRIVATE.
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Merge suspend and resume into one switch to optimize performance
Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
move both suspned and resume logic to nxsched_switch_context
Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
Updates the common source code for the PCNT peripheral used by
Espressif's RISC-Vs SoCs. This enables newer SoCs to be supported
in the future while maintaining backwards compatibility.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
Updates the common source code for the MCPWM peripheral used by
Espressif's RISC-Vs SoCs. This enables newer SoCs to be supported
in the future while maintaining backwards compatibility.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
Fix tricore running issue introduced by PR17060.
The bug is that when irq returns, the running_task was not
updated to the current task with highest priority from
the scheduler readytorun_list
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
After irq_dispatch finished, the interrupt stack will be checked to
determine whether overflow occurs.
The relevant configuration reuses the configuration of stack overflow
detection during context switching.
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
Many different architectures re-implemented the exact same code for
`up_*delay` because it was originally written as architecture dependent
code. Busy-waiting can be done regardless of architecture, so this
commit moves that duplicated implementation to a common file with weak
definitions so that individual architectures (see tc32) are still able
to override the definition if needed/desired.
Default implementation is not included if ARCH_TIMER is enabled, since
it is more accurate and provides its own weak definitions to override.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Added autoled implementation for the Pi4B. Status LED is used as NuttX
start indicator, while power LED is used for panic/assert indication.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
A basic implementation of mailbox API with some helpers for accessing
properties implemented. Uses busy-wait due to documentation challenges
with mailbox API.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Update the parameter names of the macro `list_for_every_entry_continue()`
to maintain consistent naming:
- list => entry
- head => list
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Updates the common source code for the I2C peripheral used by
Espressif's RISC-Vs SoCs. This enables newer SoCs to be supported
in the future while maintaining backwards compatibility.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
Introduce a new CI test to validate out-of-tree builds
and prevent regressions in the `make export` workflow.
Specifically, this change adds `test-oot-build.sh` that:
* Builds NuttX using a selected configuration.
* Runs `make export` to generate the export package.
* Copies the `nuttx-export` to the OOT build project.
* Verifies that compilation and linking succeed.
Signed-off-by: trns1997 <trns1997@gmail.com>
Updated documentation to explain how to enable detection during context switching.
Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
Many times, context switching does not occur when the thread stack
memory is almost exhausted, so we need to mofify up_check_tcbstack to
accurately detect it.
Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
Added two detection methods:
1. Determine by detecting the number of bytes specified at the bottom of the stack.
2. Check if the `sp` register is out of bounds.
Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
Added CMake build for pimoroni-tiny2040 board
Removed old file rp2040_tiny2040.h to use the existing rp2040_pico.h to align with other boards.
Signed-off-by: simbit18 <simbit18@gmail.com>
The custom implementation of obtaining a timestamp for this driver
returned an unsigned long, which limited the amount of time the driver
could run before roll-over quite significantly (since timestamps are in
microseconds). This change standardizes the driver to use the sensor
driver implementation for timestamps.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Added ioctls and functions for watchdogs 2 & 3. Modifed wdog1 functions. Needs testing.
Fixed issues with started variable.
Change to add only 3 ioctls, a config for each watchdog. Created cfg structures for watchdog1 and watchdog23. Added code to set difsel register. stop conversions before changing watchdog configs. Other logic changes.
Define AN_STM32H5_FIRST and AN_STM32H5_NCMDS in nuttx/analog/ioctl.h
Remove hardcoded AN_STM32H5_FIRST.
Style fixes.
Fix thershold for watchdog1
Got working watchdog driver with queue and signal. Needs polish.
Refined isr for watchdogs. Added value back to event. value is more accurate, but not guaranteed. It accomdates dma.
Used stm32_adc_sigcfg_s structure inside stm32_adc_sig_s structure. Used common naming for ioctls.
Added stopifstarted and startifstopped for setting watchdogs and other bits. Added adc_reset_dma, which must be run after stopping conversions in circular mode, because buffer and conversions become misaligned. Other refinements.
Added guard around adc_reset_dma, added comment blocks to new functions
NuttX style fixes.
Add return value to wdog configure functions.
Correct number of stm32h5 adc ioctls.
Minor style fix.
Reduce watchdog commit to fit NuttX standards. Remove Queue and Signal aspects. Added Kconfig to initialize watchdog.
Signed-off-by: kywwilson11 <kwilson@2g-eng.com>
Added guard around code referencing priv->circular. Added adc_watchdog config for testing watchdog1 with adc1. Added documentation about adc_watchdog config.
Adjusted documentation for adc_watchdog config. Added detailed test procedure.
Longer underline under adc_watchdog title.
Add code for differential adc calibration. Need to calibrate both single-ended and differential if a given adc has both single-ended and differential channels.
Fixed typo.
Initialize watchdog1 parameters at compile time when configured. Added comments to new elements in stm32_dev_s. Confirmed style is good.
Add proper guards around ADC WDG1 variables and functions.
Implemented feedback per raiden00. 1. Changed to use old chanlist type uint8_t. 2. Added smpr1, smpr2, and difsel variables to stm32_dev_s structure. 2. smpr1 and smpr2 are initialized to board defined values if BOARD_ADCx_SMPRx is defined, otherwise initialized to default. 3. difsel initialized to BOARD_ADCx_DIFSEL if defined, otherwise use default (0) for all single-ended.
Global compiler flags setting should be placed before add_executable(),
otherwise they will not take effect
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Complete the missing scheduling information in some architectures
In these architectures (riscv, avr, tricor) context switching
can occur in both up_switch_context and xx_doirq
Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
The arm-m architecture svc call will trigger an interrupt,
and the actual context switch is executed after doirq is completed,
so only the scheduling information needs to be updated in doirq.
In the arm-a/r architecture, interrupts and syscalls are independent,
and scheduling information needs to be updated in both locations
Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
Replace all nxsched_suspend/resume_*** with nxsched_switch_context
Delete nxsched_resume_scheduler in up_exit and call it uniformly in task_exit
Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
Currently the mdio communication is part of the monolithic 'full netdevs'.
This commit serves as an way to add modularity for the netdevs drivers.
A new upperhalf/lowerhalf mdio device comes with this commit that manages the data transfer ofer mdio interface.
Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
Updates the common source code for the UART peripheral used by
Espressif's RISC-Vs SoCs. This enables newer SoCs to be supported
in the future while maintaining backwards compatibility.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>