Commit graph

60363 commits

Author SHA1 Message Date
Jari Nippula
930c4b0b0e arch/risc-v/mpfs: set GMAC_RX_UNITSIZE to max gmac frame len
Verify that GMAC RX/TX buffers are 64 byte aligned

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-03-24 20:27:52 +08:00
Jani Paalijarvi
12290d0111 arch/risc-v/src/mpfs/mpfs_ethernet.c: Remove unnecessary phyinit
mpfs_phyinit() was called twice during ifup().

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-03-24 20:27:52 +08:00
Jukka Laitinen
cc662453c1 arch/risc-v/src/mpfs/mpfs_ethernet.c: Fix compilation with CONFIG_DEBUG_NET
- Fix compilation failure "error: 'mpfs_phydump' defined but not used [-Werror=unused-function]"
- Add debug dump of phy registers.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-03-24 20:27:52 +08:00
Jukka Laitinen
ea321d86cb arch/risc-v/src/mpfs/mpfs_ethernet.c: Add RX timeout workaround for broken PHYs
If the interface is UP, and no packets are received in 30s, re-initialize the interface by calling the
already implemented mpfs_txtimeout_expiry.

This is a workaround for a bug where IF might be UP and working but packets can only
be transmitted. Receive side just doesn't work at all. The bug manifests at least in
older LAN8742A (rev A and B), for which also a silicon errata exists.

The original issue can be re-produced easily by disconnecting and reconnecting the ethernet cable while
the IF is up.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-03-24 20:27:52 +08:00
Jukka Laitinen
f3142be127 mpfs/ethernet: Move txtimeout from HPWORK to LPWORK
- Use LPWORK by default if CONFIG_MPFS_ETHMAC_HPWORK is not defined
- Always use LPWORK for timeouts; this makes very lengthy operations such as re-initializing PHY.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-03-24 20:27:52 +08:00
raiden00pl
d9ee02bc2e boards/nucleo-f302r8: add rs485 support
add rs485 support for nucleo-f302r8 based on RS485 CAN Waveshare shield.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-24 20:25:29 +08:00
raiden00pl
6443b33a39 boards/nucleo-f302r8: add ADC support
Add ADC support for nucleo-f302r8.
CN8 pins 35, 36, 37 and 38 are used.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-24 20:24:57 +08:00
raiden00pl
9394962cf6 Documentation: move debug pages to a separate top level page
Move debug related pages from Guides to a separate top level page.
This way all pages related to debugging will be in one place
which is more user friendly.

Related Github issue: https://github.com/apache/nuttx/issues/15667

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-24 20:23:47 +08:00
Rodrigo Sim
a4777f153b boards/arm/ra4 Add support to Seeed Xiao RA4M1 Board
Added initial support for Seeed Studio XIAO RA4M1 Board. Initial
support to NuttShell via Serial, gpio and userleds. Also two
configurations is available: nsh for basic NuttShell access and
combo for gpio and userleds.

Signed-off-by: Rodrigo Sim <rcsim10@gmail.com>
2025-03-24 20:21:11 +08:00
Rodrigo Sim
02937bd939 Documentation: Add XIAO RA4M1 Board
Added documentation for Seeed Studio XIAO RA4M1
Board.

Signed-off-by: Rodrigo Sim <rcsim10@gmail.com>
2025-03-24 20:20:01 +08:00
raiden00pl
f3a4011a20 arch/{rp2040|rp23xx}: remove ADC option from Kconfig
Remove duplicated "config ADC" option which is already defined in drivers/analog/Kconfig.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-23 10:41:54 -03:00
Kevin Witteveen (MartiniMarter)
6b3f7e0939 Documentation/components/drivers/character/wireless: IOCTL interface initial documentation.
Adds initial documentation to the IOCTL commands of wireless character devices.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-03-23 17:51:15 +08:00
Kevin Witteveen (MartiniMarter)
1cd3b3d01c nuttx/wireless/ioctl: Common IOCTL API for RF Modulation Technologies.
This PR is a follow-up of issue #15856 and the mailing list proposal "Proposal: Common IOCTL API for RF Modulation Technologies"

Before this PR, the IOCTL API for character-driven RF devices lacked a common
interface across different modulation technologies, such as LoRa, FSK, and
OOK. The result was, driver-specific IOCTL commands were created even when they
could be shared across multiple radios. This fragmentation made
application portability more difficult to maintain.

This PR will add a common API that can be shared across all new drivers.
Such as
* LoRa
* FSK
* OOK / ASK
* read() return struct

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-03-23 17:51:15 +08:00
Eren Terzioglu
141d5f8065 arch/risc-v/esp32[c3|c6|h2]: Fix I2C Slave driver write bug
Fix I2C Slave driver write bug when multiple write operation existed for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-23 17:48:18 +08:00
Eren Terzioglu
9a5a719835 arch/xtensa/esp32[-|-s2|-s3]: Fix I2C Slave driver write bug
Fix I2C Slave driver write bug when multiple write operation existed for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-23 17:48:18 +08:00
Eren Terzioglu
a11baeabc1 arch/xtensa/espressif: Fix I2C Slave driver build error
Add missing files which are causing I2C Slave driver build error for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-23 17:48:18 +08:00
yangsong8
a0a61ff345 driver/serial/cdcacm: Get the status of rx or tx buf by ioctl
In cdcacm, USB req buf is directly used as serial buf, so the getting
buf status operation in ioctl is different from the original serial.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-22 08:41:33 +08:00
wangjianyu3
a99c1839f1 boards/xtensa: Add support for szpi-esp32s3
Add configurations for nsh, adb, fastboot, etc.

Build & Burn

  ./tools/configure.sh -l lckfb-szpi-esp32s3:adb
  make flash -j8 ESPTOOL_PORT=/dev/ttyUSB0

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-22 08:40:40 +08:00
wangjianyu3
0dc3445bbd Documentation/esp32s3: Add doc for SZPI ESP32-S3
Add documentation for LCKFB SZPI ESP32-S3.

Official website: https://wiki.lckfb.com/zh-hans/szpi-esp32s3/

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-22 08:40:40 +08:00
Eren Terzioglu
453c6f75cf Documentation/esp32: Add snake defconfig docs for esp32
Add snake defconfig docs for esp32 devkitc board

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-21 10:28:45 -03:00
Eren Terzioglu
9c2b481cfe boards/esp32: Add snake defconfig
Add snake defconfig for esp32 devkitc board

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-21 10:28:45 -03:00
Eren Terzioglu
8ffc6689f4 Documentation/games: Add snake game docs
Add snake game documentation on docs

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-21 10:28:45 -03:00
wangjianyu3
e513cea6da boards/esp32s3: Merge common configurations
So that when adding new boards, duplicate content will not be copied.

Test:

  1. Refreshing board configurations

    ./tools/refresh.sh --silent arch:xtensa

  2. Check if there is anything missing

    $ git diff HEAD . | grep "^[+-]" | sed 's/^[-+]*//' | sed 's/^ [ab]*//' | grep -v "^$" | sort -u | wc -l
    66
    $ git diff HEAD . | grep "^[+-]" | sort -u | wc -l
    132

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-21 08:51:46 -03:00
raiden00pl
19a99205c2 include/nuttx/math.h: add missing HUGE_VALF and HUGE_VALL
add missing HUGE_VALF and HUGE_VALL definitions to NuttX math.h

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-21 08:57:13 +01:00
Lup Yuen Lee
cf6781efad boards/arm64/a527/avaota-a1: Add support for PINE64 Yuzuki Avaota-A1 SBC (Allwinner A527 SoC)
This PR adds support for the PINE64 Yuzuki Avaota-A1 SBC,
based on Allwinner A527 Arm64 SoC.
Most of the code was derived from NuttX for
QEMU Arm64 Kernel Build qemu-armv8a:knsh.
The modified code is explained here:
https://lupyuen.github.io/articles/avaota#appendix-port-nuttx-to-avaota-a1

Modified Files:

boards/Kconfig: Added Avaota-A1 board

New Files in boards/arm64/a527/avaota-a1:

src/a527_appinit.c: Startup Code
src/a527_boardinit.c: Init Code
src/a527_bringup.c: Bringup Code
src/a527_power.c: Power Off and Reset
src/avaota-a1.h: Board Declarations
include/board.h: Board Definitions
include/board_memorymap.h: Memory Map
scripts/ld.script, gnu-elf.ld: Linker Scripts
Makefile, scripts/Make.defs: Makefiles
CMakeLists.txt, src/CMakeLists.txt: CMakefiles
Kconfig: Avaota-A1 Config
configs/nsh/defconfig: Build Config for avaota-a1:nsh

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2025-03-21 07:17:07 +08:00
Lup Yuen Lee
79f0f530a0 Documentation/platforms/arm64/a527/boards/avaota-a1: Add support for PINE64 Yuzuki Avaota-A1 SBC (Allwinner A527 SoC)
This PR adds support for the PINE64 Yuzuki Avaota-A1 SBC,
based on Allwinner A527 Arm64 SoC.
Most of the code was derived from NuttX for
QEMU Arm64 Kernel Build qemu-armv8a:knsh.
The modified code is explained here:
https://lupyuen.github.io/articles/avaota#appendix-port-nuttx-to-avaota-a1

platforms/arm64/a527/index.rst:
  Added Avaota-A1 to Allwinner A527 SoC

platforms/arm64/a527/boards/avaota-a1/avaota-a1.jpg:
  Photo of Avaota-A1, taken by me

platforms/arm64/a527/boards/avaota-a1/index.rst:
  Building and booting NuttX for Avaota-A1

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2025-03-21 07:17:07 +08:00
raiden00pl
35818c5f87 arch/arm: add missing itm_syslog.h include
add missing itm_syslog.h include for archs that use itm_syslog_initialize()
to fix compiler errors:

  error: implicit declaration of function 'itm_syslog_initialize'

Issue reported by rentzboy in https://github.com/apache/nuttx/issues/16017

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-19 12:17:28 -03:00
Gao Feng
4b8e19b2c7 Revert "arch/xtensa: set PS.EXCM initial value to 1 while new thread created"
This reverts commit 3194ef0e7c.

since level-2 and above interrupt, PS.EXCM is still 1.
window rotation related instruction is undefined behavior.

https://github.com/apache/nuttx/pull/15985#issuecomment-2728509964
2025-03-19 11:47:31 -03:00
Filipe Cavalcanti
e0e562360e boards/xtensa/esp32s3: modify ARCH_CHIP for psram_usrheap
Change the ESP32S3-WROOM-2-N16R8V to ESP32S3-WROOM-1-N8R2.
Reason: not testing on 16MB but successfully tested smaller flash and PSRAM.
Also updated documentation on this defconfig.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-19 15:23:04 +01:00
Filipe Cavalcanti
238e0c05ac arch/xtensa/esp32s3: add ARCH_CHIP_ESP32S3WROOM1N8R2 option to ESP32S3
Add support for module with 2MB PSRAM and 8MB flash.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-19 15:23:04 +01:00
Ville Juven
3764ed06df arch/mcx-nxxx: Add LPTMR register descriptions
Add register definitions to control LPTMR (Low Power Timer)

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-03-19 20:00:38 +08:00
Ville Juven
c1726898fa arch/mcx-nxxx: Add SYSCON_CLOCKCTRL register definition
Adds register definitions to control FRO clock

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-03-19 20:00:38 +08:00
simbit18
34c4b15b4d tools/ci: Added CI system on Windows Native
This PR adds support for the CI system for native Windows as well. It allows you to build NuttX on GitHub and test it locally for Windows users.

With these CI tools with PowerShell scripts, it is possible to build NuttX for Windows Native using (for now only) Cmake + Ninja with the same logic as the CI system with Bash scripts.

This allows the msvc job to be used not only with the simulator (currently only with Visual Studio 17 2022), but also with other architectures using the same Windows runner to get more coverage and avoid future breakage.
As with the other jobs, we use artifacts to save the compilation result at the end of the workflow execution (previously for the simulator it was not done).

The proposed solution is based on the following additions and modified:

Modified Files
buildyml -> only CI Jobs MSVC

New Files in tools/
ci/cibuild.ps1 -> Added Powershell script for Run the CI Builds
ci/platforms/windows.ps1 -> Added Powershell script for installing toolchains and tools.
testlist/windows.dat -> Target (Add sim (msvc), risc-v arm)
tools/testbuild.ps1

We tested the NuttX build on GitHub and locally.

How we build on GitHub and test locally.

Locally
cd .\nuttx\tools\ci\

.\cibuild.ps1 -n -i -A -C -N .\testlist\windows.dat

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-19 19:59:44 +08:00
Inochi Amaoto
f0f54be9f9 arch/risc-v: Fix wrong source name in make script
AIA releted source files in the Make.defs are not right.
Replace them with the right source.

Fixes: 5f70307111 ("arch/risc-v: introduce AIA support")
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
2025-03-19 09:19:37 +01:00
Tomasz 'CeDeROM' CEDRO
5ad4667a63 tools/checkpatch: Use gmake on BSD, make otherwise.
* BSD has its own BSD Make that is incompatible with GNU Make.
* When BSD is detected use (gnu) gmake in place of (bsd) make.
* This fixes nxstyle build inside tools/checkpatch.sh.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-19 09:09:32 +01:00
Angus Jull
c7d72bc95c drivers/sensors/fakesensor: Add baro sensor type
Add a function `fakesensor_read_baro` that allows barometric data to be
read and published by fakesensor

Signed-off-by: Angus Jull <angusjull1@gmail.com>
2025-03-19 09:08:06 +01:00
Tomasz 'CeDeROM' CEDRO
3eddfe51fa tools/bdf-converter: Fix loop termination condition.
Changing readingbitmap from bool to int, initializing it to the number
of bitmaps allocated, decrementing it each time a bitmap is consumed,
and using it as the termination condition for the while loop,
ensures that loop termination does not depend on data from the file.

Note: Patch provided by Nathan Hartman.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-18 10:12:23 -03:00
Tiago Medicci Serrano
b1bab5c783 fs/vfs/fs_poll: Add noinstrument_function to poll_notify function
Add the noinstrument_function attribute to the poll_notify function
to avoid it being looped if -finstrument-functions is set to the
fs/vfs files.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-03-18 09:17:52 +08:00
chao an
bf73fbe774 sched: simplify call of get current tcb
Replace get current tcb method from nxsched_get_tcb(nxsched_gettid()) to this_task(),
change two function calls with inline function to improve performance:

FAR struct tcb_s *tcb = nxsched_get_tcb(nxsched_gettid());
FAR struct tcb_s *tcb = this_task();

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-18 00:22:37 +02:00
Ari Kimari
4bfbe82a3e arch/arm64/imx9: Support for imx9 edgelock enclave
Moved imx9 edgelock enclave (ELE) handling from imx9_trdc.c to own imx9_ele.c file.
Add some new messages to ele API.
Updated ele fw version to 1.3.0.
Fix channel bug on imx9_ele_sendmsg() and imx9_ele_receivemsg()

Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
2025-03-17 21:35:25 +02:00
Filipe Cavalcanti
034917e972 documentation/risc-v: update ESP32C3|C6|H2 documentation
Improve esptool installation docs.
Update supported peripheral list.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-17 11:31:31 -03:00
Filipe Cavalcanti
6b6247b10e documentation/xtensa: update ESP32|S2|S3 documentation
Improve esptool installation docs.
Update supported peripheral list.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-17 11:31:31 -03:00
Tomasz 'CeDeROM' CEDRO
b37a5277ac 202503 Apache NuttX RTOS Contributing Guidelines update.
* This change comes from vast mailing list discussions on low PR/COMMIT
  quality, breaking changes, code quality, long term self-compatibility
  and maintenance, review problems, and how to improve things.
* Contributing Guidelines updates vote history:
  1. https://www.mail-archive.com/dev@nuttx.apache.org/msg12584.html
  2. https://www.mail-archive.com/dev@nuttx.apache.org/msg12723.html

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-17 08:30:37 -03:00
chenwen@espressif.com
b60b54b476 esp32[s2|s3]: Add number of IRQ status lists for PHY initialization configuration
The current default number of IRQ state lists for PHY initialization is 3 (i.e. NR_IRQSTATE_FLAGS).
When calling in a nested manner, the number of times the concurrent behavior enters the critical section exceeds 3, which will trigger an assert crash.
Therefore, the size of NR_IRQSTATE_FLAGS needs to be increased, this PR makes NR_IRQSTATE_FLAGS configurable.
Please refer to the changes of esp-hal-3rdparty: 5d4868f08b

Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2025-03-17 12:22:04 +01:00
dongjiuzhu1
cfd359141f fs/drivers: Avoid causing a busy loop in the program due to context switching induced by sem_post.
examples:
There are two threads involved: thread A with a priority of 100 and
thread B with a priority of 101. Here's how they interact:

When thread A releases a semaphore, thread B is scheduled to execute
some code and may reacquire the semaphore. If no other tasks are ready,
thread A will be scheduled to run.
This continuous process can lead to a busy loop.

Thread A:                                                   Thread B:

while (nxsem_get_value(&priv->wait, &semcount) >= 0 &&  <---
       semcount <= 0)                                      |  2)context switch
  {                                  1)contex switch       |
    nxsem_post(&priv->wait);         ------------->     run some code and nxsem_wait again
  }

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-03-17 10:44:26 +01:00
chao an
7a96bee46f audio/composite: merge composite instance allocate to one times
here is not need to allocate two times

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-17 10:26:54 +01:00
Laczen JMS
e83d31bee9 net/udp: correct icmp(v6) response from udp_input
Ensure that the correct icmp(v6) response is generated from udb_input.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-03-17 09:57:50 +01:00
Laczen JMS
24221b611f arch/xtensa/esp32:espnow pktradio simplify addressing
Modify addressing to allow only 2 byte node address.
Allow modifying the node address by modifying the ipv6 address
(the ipv6 address has a direct relation with the node address)
Introduce the option to add a 4 byte random number to the mac header
as a preparation for ciphered data exchange.
Introduce a FCB (frame control byte) as a replacement for the INFO
field in the mac header.
Update esp32-devkitc:espnow config to reflect address size change.
Update the documentation to reflect address size changes.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-03-17 09:15:09 +01:00
Laczen JMS
4ffedf4ec8 arch/xtensa/esp32: espnow pktradio improvements
Split handling of receive and transmit in their own work queue.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-03-17 09:15:09 +01:00
Lup Yuen Lee
9d80d6bb4f arch/arm64/a527: Add support for Allwinner A527 SoC
This PR adds support for the Allwinner A527 Arm64 SoC.
This will be used by the upcoming port of NuttX for
PINE64 Yuzuki Avaota-A1 SBC.

Most of the code was derived from NuttX for
QEMU Arm64 Kernel Build qemu-armv8a:knsh.
The modified code is explained here:
https://lupyuen.github.io/articles/avaota#appendix-port-nuttx-to-avaota-a1

Modified Files in arch/arm64:

Kconfig: Added ARCH_CHIP_SUNXI for Allwinner 64-bit SoCs.
Added ARCH_CHIP_SUNXI_A527 for A527 SoC.

New Files in arch/arm64:

include/a527/chip.h: A527 Definitions
include/a527/irq.h: External Interrupts
src/a527/chip.h: Memory Map
src/a527/a527_boot.c, a527_boot.h: Startup Code
src/a527/a527_initialize.c: Power Management
src/a527/a527_lowputc.S: UART Output
src/a527/a527_serial.c: Serial Driver
src/a527/a527_textheap.c: Text Heap
src/a527/a527_timer.c: A527 Timer
src/a527/Kconfig: A527 Config
src/a527/Make.defs, CMakeLists.txt: Makefiles

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2025-03-17 08:58:29 +01:00