Commit graph

59124 commits

Author SHA1 Message Date
wangchengdong
dd51d9a3fc arch/tricore: fix tricore_doirq function local var "regs" not initialized issue
In tricore_doirq, local variable regs is firstly used without initiazlied, this is a bug

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-27 21:42:47 +08:00
Jukka Laitinen
9413b6f331 sched/signal/sig_dispatch.c: Simplify the nxsig_dispatch
The nxsig_dispatch should just deliver the signal to either a
thread by pid (tid) or to the process (group) by pid.

Simplify the code so that the intent is more obvious.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-09-27 21:42:03 +08:00
Jukka Laitinen
a4c42e54f7 sched/signal/sig_dispatch.c: Correct signal dispatch to specific thread
The signal dispatch is called from interrupt handlers as well, so
this_task() is wrong. The thread to which the signal is supposed to
be delivered is known (stcb), use that.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-09-27 21:42:03 +08:00
raiden00pl
628c05acf3 arch/sim/sim_canchar.c: fix CAN flags decoding for message
fix CAN flags decoding for SIM CAN

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-09-27 21:41:55 +08:00
wangchengdong
e83012b540 arm/armv8-r: remove redundant and misleading pointer in arm_syscall()
replace **running_task with *running_task, and updated several other places
 accordingly

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-27 21:41:47 +08:00
Lars Kruse
b3dd8b2796 arch/arm/rp2040: merge conflicting definitions of hw_* functions
The functions `hw_write_masked` and `hw_xor_bits` (as defined in
pico-sdk) were defined in NuttX twice.
Additionally these definitions were in conflict (one lacked the
`volatile` modifier).

Now these functions and their dependencies are defined in a new header
file.
Its name is based on the filename of the original definition in
pico-sdk:

  src/rp2_common/hardware_base/include/hardware/address_mapped.h

This change should fix the potential issue of GPIO operations failing
due to compiler optimizations caused by the absence of `volatile`.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2025-09-27 21:41:41 +08:00
wangchengdong
ba0a5df95d arch/tricore: fix tasking compiler linking error
Add "add_link_options(--no-default-libraries)" ToolchainTasking.cmake
  Add "LDFLAGS += --no-default-libraries" in ToolchainTasking.defs

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-27 21:41:33 +08:00
chao an
cf616fd619 arch/arm/armv8-m: stack pointer should be 8-byte aligned in signal context
Since the alignment of the signal context is affected by XCPTCONTEXT_SIZE in
different Kconfig,  sometimes the stack pointer is not aligned to 8 bytes, this
is not what the software and compiler expect, for example,  if va_list() obtains
wide data of type long long, the offset will be wrong, So in this commit, we set
stack-aligned the base offset so that the correct offset will be set during context
restoration.

1. test code:
|            void signal_handler(int signo, siginfo_t *info, void *context) {
|                long long ttt = 1024000;
|                printf("%lld\n", ttt);
|            }
|
|            struct itimerspec its = {   .it_value.tv_sec  = 1,
|                .it_value.tv_nsec = 0,
|                .it_interval.tv_sec  = 1,
|                .it_interval.tv_nsec = 0
|            };
|
|            int main(int argc, FAR char *argv[])
|            {
|                struct sigevent evp;
|                timer_t timer_id;
|
|                memset(&evp, 0, sizeof(evp));
|                evp.sigev_notify          = SIGEV_SIGNAL | SIGEV_THREAD_ID;
|                evp.sigev_signo           = SIGALRM;
|                evp.sigev_notify_thread_id = gettid();
|
|                timer_create(CLOCK_REALTIME, &evp, &timer_id);
|
|
|                struct sigaction sa;
|                memset(&sa, 0, sizeof(sa));
|                sa.sa_sigaction = signal_handler;
|                sa.sa_flags = SA_SIGINFO;
|                sigemptyset(&sa.sa_mask);
|
|                sigaction(SIGALRM, &sa, NULL);
|
|                timer_settime(timer_id, 0, &its, NULL);
|
|                while (1)
|                    sleep(1);
|
|                return 0;
|            }

2. before this change:

|            NuttShell (NSH) NuttX-12.10.0
|            nsh> hello
|            4398046527890440
|            4398046527890472
|            4398046527890504
|            4398046527890536

3. after this change:

|            NuttShell (NSH) NuttX-12.10.0
|            nsh> hello
|            1024000
|            1024000
|            1024000
|            1024000

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-09-27 21:41:20 +08:00
wangchengdong
754eab4687 arch/tricore: allow user defined compiler path
prefix compiler with ${TOOLCHAIN_PREFIX}

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-27 21:41:13 +08:00
wangchengdong
a039fc7097 arch: fix stack alignment bug for arm and tricore arch
The stack alignment operation in tricore and arm porting
   only aligns the size of the stack, forget to align the start addr
   of the stack, this patch fixes it.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-27 21:41:05 +08:00
wangchengdong
21e1596dff arch: fix alignment bug for archs that need stack alignment
These archs only align the size of the stack, forgeting to do the
 stack start addr alignment, this patch fixes it.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-27 21:40:58 +08:00
Jukka Laitinen
382ed6550f imx9/imx9_usbdev.c: Fix interrupt handling in SMP mode
The interrupt handler accesses the device as well as the driver's private
data. Use critical_section for mutual exclusion with drivers/usbdev, which
also protects the same data with critical_section.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-09-27 21:40:50 +08:00
Tiago Medicci Serrano
70b5aa4df0 include/nuttx/spi/spi_bitbang: Fix incompatible pointer type issue
This commit fixes the incompatible pointer type issue due to
incompatible types of the `bitexchange_t` callback.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-09-27 21:40:43 +08:00
MASZ
94ad260843 arch/arm/stm32h7: Fix and enhance WWDG (Window Watchdog) support
This patch addresses several issues and adds enhancements to the WWDG
(Window Watchdog) implementation for the STM32H7 platform. The changes
include:

- Extend the definitions of WWDG_CFR_PCLK1 macros to support dividers
  up to 128, and update the stm32_settimeout() function to consider this
  extended range.
- Fix the "elapsed" calculations in the stm32_getstatus() function to
  ensure correct time remaining calculations.
- Clear the EWIF (Early Wakeup Interrupt Flag) bit in the stm32_start()
  function, as this bit might be set by hardware before the watchdog is
  actually started.
- Initialize the WWDG clock in the RCC_APB3ENR register and set the
  RCC_GCR_WW1RSC bit as per the STM32 reference manual to ensure proper
  behavior when enabling the WWDG1.

Signed-off-by: Szymon Magrian <szymon.magrian@hexagon.com>
2025-09-27 21:40:35 +08:00
Huang Qi
3af0ab64bb arch/risc-v: espressif: temperature: Fix incorrect pointer casting
Fix bug in temperature sensor driver where direct casting of lower half
structure pointer could lead to incorrect memory access.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-09-27 21:40:28 +08:00
Huang Qi
47e4576b1c arch/xtensa: espressif: temperature: Fix incorrect pointer casting
Fix bug in temperature sensor driver where direct casting of lower half
structure pointer could lead to incorrect memory access.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-09-27 21:40:28 +08:00
Huang Qi
106058cc1f boards: esp32s3-lckfb-szpi: Remove obsolete device function prototypes
Remove function prototypes for BMP180 pressure sensor and CS4344 audio DAC
devices that were never actually present on this board configuration. This
cleans up the header file by removing declarations for non-existent hardware.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-09-27 21:40:20 +08:00
wangchengdong
80f5a06c06 arch/tricore: Align Makefile with Cmake for tasking linker script preprocessing
Provide linker script preprocessing function porting for
    tasking compiler

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-27 21:40:12 +08:00
Tiago Medicci Serrano
5e9e237868 Documentation: Add entry for ESP32-[C3|C6|H2]'s buttons defconfig
This commit adds an entry on Documentation regarding ESP32-C3,
ESP32-C6 and ESP32-H2 boards that implement the `buttons` defconfig

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-09-27 21:40:02 +08:00
Tiago Medicci Serrano
6db437e2de boards/esp32[c3|c6|h2]: Fix GPIO function used by the button
This commit fixes the function to select the GPIO behavior for the
pins associated to the board's button.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-09-27 21:40:02 +08:00
wangchengdong
3430ad2e1c sched/init/nx_bringup.c: Add support for CONFIG_INIT_NONE in a flat build
In a flat build, a separate init thread should not be mandatory,
users can create a user task in the board early initialization or late initialization hook.
2025-08-31 18:38:36 +08:00
wangchengdong
8cfb9d7053 libs/libc/semaphore: allow nxsem_init to negative value
Allow user to init semaphore value to negative value, this is needed in some use cases
2025-08-31 18:38:03 +08:00
Ari Kimari
0ded247f44 fs/fat: Fix wrong alloc used in fat_zero_cluster()
Fat_zero_cluster() use fs_heap_malloc() for buffer that
is used to call fat_hwread().
Fat_hwread() must be called with IO buffer that have proper
alingment because it might use DMA.

Fix changes fs_heap_malloc() to fat_io_alloc() which uses
correct fat_dma_alloc() if CONFIG_FAT_DMAMEMORY is defined.

Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
2025-08-29 19:18:32 +02:00
adriendesp
8fea354a0f arch/xmc4 : fix serial buffer size for unused channel
Give the user the full control over the USIC FIFO buffer even if USIC channel 0 is disabled.
When USICx_CHAN0 is not an UART but USICx_CHAN1 is, the user can set the desired FIFO buffer offsets in CHAN1 config.
2025-08-29 12:43:52 -03:00
raiden00pl
a6305fbf55 tools/checkpath.sh: check git commit format
check git commit format:

- line length less than 80 for commit title
- affected subsystem (detecting colon in commit title ":")
- Signed-off-by line
- blacklist [VELAPLATO-*, WIP:] string in commit body

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-08-29 22:25:18 +08:00
Zik Saleeba
835c535e18 drivers/ioexpander/aw9523b: New driver for AW9523B i/o expander
This is an I2C driver for the Awinic AW9523B I/O expander. As well
as the supporting usual digital I/Os, this device features the
ability to drive LEDs directly, and can control the drive current
to each LED individually. The driver was derived from the PCA9555
driver, provides all the standard interfaces of an i/o expander
driver. It also features support for the special features of the
AW9523B through pin direction IOEXPANDER_DIRECTION_OUT_LED and
IOEXPANDER_OPTION_NONGENERIC with AW9523B_OPTION_* options.

The driver has a number of configurable features including interrupt
handling and a shadow register mode based on the PCA9555 driver,
plus new LED/dimming support.

Testing was done using an ESP32S3 host and I2C connection to the
Adafruit AW9523 breakout board.

Signed-off-by: Zik Saleeba <zik@zikzak.net>
2025-08-29 09:10:50 -03:00
michal matias
8fc63aaa10 include/net/if.h: Add mechanism for MMD access with SIOCxMIIREG ioctls
Add mdio_phy_id_c45 macro. This macro allows encoding of additional information
needed for MMD access into the phy_id field of the mii_ioctl_data_s structure.
This macro is intended for use by user applications.

Add macros for decoding the phy_id encoded with the mdio_phy_id_c45 macro.
These macros are intended for use by network drivers implementing
SIOCxMIIREG commands.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-08-29 06:45:37 +02:00
Serg Podtynnyi
52d1877e2e boards/arm/rp23xx/common: update board reset via BOOTROM functions
Update board reset with BOOTROM functions calls
 - normal reboot
 - reboot to bootloader

normal reboot and reboot bootloader now possible from nsh

Port of https://github.com/apache/nuttx/pull/16848

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-08-28 11:04:08 -03:00
Michal Lenc
92661d9e03 .editorconfig: add .editorconfig file to help maintain coding style
Adds .editorconfig file to help maintain basic coding style
such as indent style and brackets across various IDEs. Editor
scans for this file and adheres to these rules.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-08-28 21:53:16 +08:00
wangjianyu3
b9203c1747 sched/signal: Old signal action need save sa_user
For example, set sigaction after create signalfd,
the sa_sigaction was restored but sa_user not,
causing signalfd_action() get the wild private data.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-08-28 21:52:44 +08:00
Filipe Cavalcanti
c15521af91 boards/risc-v: update board and defconfigs for Wi-Fi on ESP32-C3|C6
Updates the defconfigs and board source to support driver refactor.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-08-28 21:52:03 +08:00
Filipe Cavalcanti
1f7c3a32e5 arch/risc-v: refactor Wi-Fi driver for ESP32-C3|C6
Fixes low and inconsistent bandwidth issues.
Adds new configuration options for buffer management.
Moves code around to make the implementation cleaner and easier to debug.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-08-28 21:52:03 +08:00
simbit18
9c6d502531 boards/arm/imxrt: CMake added imxrt1020-evk imxrt1050-evk boards
Added CMake build for boards:

imxrt1020-evk
imxrt1050-evk

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-28 15:34:54 +08:00
simbit18
4838d712a7 boards/arm/imxrt: CMake added imxrt1060-evk imxrt1064-evk imxrt1170-evk boards
Added CMake compilation for boards:

imxrt1060-evk
imxrt1064-evk
imxrt1170-evk

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-28 15:21:53 +08:00
wangchengdong
a3e5ae9600 arch/tricore/src/common/tricore_irq.c: add up_affinity_irq
Add up_affinity_irq to tricore arch
2025-08-28 15:21:39 +08:00
v-tangmeng
e1b442b0e8 arm/sama5: fix ld unrecognized option '-g3'
ld: unrecognized option '-g3'
ld: use the --help option for usage information

Because `arch/arm/src/common/Toolchain.defs` already contains
`ARCHOPTIMIZATION += $(CONFIG_DEBUG_SYMBOLS_LEVEL)`, so
`boards/arm/sama5/jupiter-nano/scripts/Make.defs` here directly
delete `ARCHOPTIMIZATION += $(CONFIG_DEBUG_SYMBOLS_LEVEL)`.

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2025-08-28 15:21:05 +08:00
v-tangmeng
fec6e248b9 fix ld unrecognized option '-g3'
ld: unrecognized option '-g3'
ld: use the --help option for usage information

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2025-08-28 15:21:05 +08:00
Côme VINCENT
c36d067603 tools/nix: move nix flakes to tools/
This commit moves the flake.lock and flake.nix files from root and
Documentation/ to the tools/ directory, according to @anchao's
suggestion in PR #16763.
Updates documentation to reflect this change.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-28 10:04:01 +08:00
Tiago Medicci Serrano
585c25bac0 drivers/i2s/i2schar: Implement blocking read/write operations
This commit implements simple (blocking) read and write operations
for the i2schar driver. Although it already contained such methods,
the read/write operation was not being properly handled by the
`i2schar_[rx|tx]callback` (called when the operation has finished).
A semaphore is used to ensure that read data was received by the
receiver and another semaphore ensures that data was written by the
transmitter.

Please note that the already-existing mutex for the I2S peripheral
was replaced by two mutexes, one for the receiver and other for the
transmitter to allow full-duplex communication.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-08-27 11:07:05 +08:00
Tiago Medicci Serrano
6f5a8c6b25 drivers/i2s/i2schar: Implement ioctl commands for i2schar
This commit implements a set of commands to the i2s character
driver. The implemented commands allows getting and setting
parameters like data width, sample rate and number of channels for
both receiver and transmitter. If no ioctl is found, the command
is redirected to the lower driver implementation if it has the
ioctl callback registered.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-08-27 11:07:05 +08:00
simbit18
aadb929526 drivers/net/CMakeLists.txt: Aligned Cmake with Make
Add KSZ9477 driver #10503

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-27 11:05:32 +08:00
Jukka Laitinen
f4142626b9 net/can/can_recvmsg.c: Cleanup can_readahead
It is better to remove the iob from the readahead queue first,
and only after that work on the iob.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-08-26 20:42:01 +08:00
haitomatic
144ac23647 net/can/can_recvmsg.c: Remove IOB trimming as useless, can frames can always fit in one IOB
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-08-26 20:42:01 +08:00
haitomatic
8fc2ad20a7 net/can/can_callback.c: Take the timestamp size into account in "buflen"
In case CONFIG_NET_TIMESTAMP is enabled, subtract the timestamp size from the buflen

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-08-26 20:42:01 +08:00
Jani Paalijarvi
e2b1d186d7 drivers/net/ksz9477.c: Errata 16, reset SGMII always on init 2025-08-26 09:10:43 -03:00
Jari Nippula
56870fb0ea ksz9477: MMD indirect access check fix
Instead of verifying MMD indirect access by checking
EEE ADVERTISEMENT register has value 0x6 (which may be changed),
the verification is done by write and check LED MODE register.
1. Backup current LED_MODE register value
2. Write value Single-LED mode (0x10) to LED_MODE
3. Read LED_MODE register and verify it returns value 0x10
4. Write original (backup) value to LED_MODE
2025-08-26 09:10:43 -03:00
Jani Paalijarvi
fcab00d3a8 drivers/net/ksz9477: Implement errata fixes
From the ksz9477 errata, setup the configuration which is tested to work.

- Improve PHY receive performance
- Disable EEE for ports 1-5
- Fix supply current values

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-08-26 09:10:43 -03:00
Michal Lenc
47cd5ba279 arch/arm/src/samv7/sam_emac.c: fix compile warning
The following warning occurred if ARCH_CHIP_PIC32CZCA70 option was
selected. The variable is not used in case of PIC32CZ CA70 series.

CC:  task/task_getgroup.c chip/sam_emac.c: In function ‘sam_emac_initialize’:
chip/sam_emac.c:4758:12: warning: unused variable ‘regval’ [-Wunused-variable]
 4758 |   uint32_t regval;
      |

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-08-26 14:02:13 +02:00
Jukka Laitinen
5c7c7f8ca3 arch/arm/src/stm32f7/stm32_ethernet.c: Fix "unused variable" warning
Fix build warning when CONFIG_STM32F7_AUTONEG is not set

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-08-26 14:01:47 +02:00
wangchengdong
28206007e0 board/tricore: rename tc397 chip board name
"tc397" is a chip name which is not appropriate to act as a board name.
 the board supported here is actually "a2g-tc397-5v-tft".
 The correct definition is : tricore is arch name, tc3xx is arch family
 name, tc397 is chip name and the borad name is a2g-tc397-5v-tft
2025-08-26 16:09:34 +08:00