Commit graph

58031 commits

Author SHA1 Message Date
ouyangxiangzhen
2b53d5af8d arch/arm64: Increase the timer accuracy with the lower USEC_PER_TICK.
This commit increased the timer accuracy with the lower USEC_PER_TICK.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-03-26 19:26:37 +08:00
ouyangxiangzhen
a121c059c4 arch/arm64: Optimize the initialization of the timer.
This commit optimized the initialization of the ARM generic timer for each cpu core.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-03-26 19:26:37 +08:00
stbenn
c4a84e30b7 driver/mtd: ramtron multi-device spi bus support
Adds a device ID to ramtron_initialize, which is stored in the ramtron_dev_s structure.
This ID is used when calling SPI_SELECT to board specific logic to allow chip select on the SPI bus.

This change is NOT backwards compatible, as it changes the function signature of ramtron_initialize.

This implementation is based on the handling of chip select in nuttx/drivers/mtd/sst26.c:sst26_initialize_spi().

Additional Changes:
  - Add MB85RS64V to ramtron supported parts list.
2025-03-26 19:26:01 +08:00
raiden00pl
1178bf4c57 CMakeLists.txt: fix warnings when using upstream boards in out-of-tree configs
When we use upstream board as a target in out-of-tree board configurations we
should not link dummy/Kconfig with a board Kconfig otherwise this file is
included twice which cause cmake warnings.

For example, when out-of-tree configuration is like this:

  CONFIG_ARCH_BOARD_CUSTOM=y
  CONFIG_ARCH_BOARD_CUSTOM_DIR="boards/arm/stm32/b-g431b-esc1/"
  CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
  CONFIG_ARCH_BOARD_CUSTOM_NAME="b-g431b-esc1"

this results with many warnings during configuration stage:

  CMake Warning at cmake/nuttx_kconfig.cmake:171 (message):
    Kconfig Configuration Error: warning: the default selection
    BOARD_STM32_BG431BESC1_USE_HSI (defined at
    boards/arm/stm32/b-g431b-esc1/Kconfig:12,
    /home/raiden00/git/railab/dawn/build_esc1/boards/dummy/Kconfig:12) of
    <choice> (defined at boards/arm/stm32/b-g431b-esc1/Kconfig:8) is not
    contained in the choice

    warning: the choice symbol BOARD_STM32_BG431BESC1_USE_HSI (defined at
    boards/arm/stm32/b-g431b-esc1/Kconfig:12,
    /home/raiden00/git/railab/dawn/build_esc1/boards/dummy/Kconfig:12) is
    defined with a prompt outside the choice

    warning: the choice symbol BOARD_STM32_BG431BESC1_USE_HSE (defined at
    boards/arm/stm32/b-g431b-esc1/Kconfig:15,
    /home/raiden00/git/railab/dawn/build_esc1/boards/dummy/Kconfig:15) is
    defined with a prompt outside the choice

    warning: the choice symbol BOARD_STM32_BG431BESC1_USE_HSI (defined at
    boards/arm/stm32/b-g431b-esc1/Kconfig:12,
    /home/raiden00/git/railab/dawn/build_esc1/boards/dummy/Kconfig:12) is
    defined with a prompt outside the choice

    warning: the choice symbol BOARD_STM32_BG431BESC1_USE_HSE (defined at
    boards/arm/stm32/b-g431b-esc1/Kconfig:15,
    /home/raiden00/git/railab/dawn/build_esc1/boards/dummy/Kconfig:15) is
    defined with a prompt outside the choice

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-26 19:24:36 +08:00
Javier Casas
e0b221016f driver/mtd/at45db.c: write to page without built-in erase
Using the FTL driver over a MTD flash device, when writing to flash, eventually the ftl_flush function is called and it does an erase (MTD_ERASE) and then the write (MTD_BWRITE). Currently, the at45db driver (at45db.c), uses a write command 0x82 ("Main Memory Page Program through Buffer 1 with Built-In Erase") that also performs a built-in erase before the write. In summary, each time a write to flash is performed, the page is erased twice before it is written, first in the FTL driver and then in the MTD driver.

This PR is to change the page writes to not use that built-in command.

Signed-off-by: Javier Casas <javiercasas@geotab.com>
2025-03-26 10:29:12 +08:00
wangjianyu3
fbf1ccae0e Documentation/szpi-esp32s3: Add doc for PCA9557
Add basic NuttShell configuration console and I/O expander driver PCA9557 enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-25 15:46:09 -03:00
wangjianyu3
dd1e31b22c boards/szpi-esp32s3: Init config for PCA9557
Build & Burn

  ./tools/configure.sh -l lckfb-szpi-esp32s3:pca9557
  make flash -j$(nproc) ESPTOOL_PORT=/dev/ttyUSB0

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-25 15:46:09 -03:00
wangjianyu3
ce6d6b4602 boards/szpi-esp32s3: Add support for PCA9557
https://wiki.lckfb.com/zh-hans/szpi-esp32s3/open-source-hardware/

| PCA9557 | ESP32S3 |
|---------|---------|
| SCL     | IO2     |
| SDA     | IO1     |
| A0      | 3V3     |
| A1      | GND     |
| A2      | GND     |

| PCA9557 | Peripherals |
|---------|-------------|
| IO0     | LCD_CS      |
| IO1     | PA_EN       |
| IO2     | DVP_PWDW    |

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-25 15:46:09 -03:00
wangjianyu3
b73d7f2922 drivers/ioexpander: Add support for PCA9557
Datasheet: https://www.ti.com/lit/ds/symlink/pca9557.pdf

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-25 15:46:09 -03:00
wangjianyu3
5c2cfe8bac boards/esp32s3: Fix esp32s3_gpio_init undefined
When enable both `DEV_GPIO` and `GPIO_LOWER_HALF` for a GPIO pin device for an I/O expander pin.
See esp32s3_gpio.c for more details.

Log

  xtensa-esp32s3-elf-ld: /workspace/nuttx/staging/libboard.a(esp32s3_bringup.o):(.literal.esp32s3_bringup+0x14): undefined reference to `esp32s3_gpio_init'
  xtensa-esp32s3-elf-ld: /workspace/nuttx/staging/libboard.a(esp32s3_bringup.o): in function `esp32s3_bringup':
  /workspace/nuttx/boards/xtensa/esp32s3/common/board/esp32s3_bringup.c:409: undefined reference to `esp32s3_gpio_init'

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-25 15:46:09 -03:00
Ville Juven
25e7b48c7e mpfs/mpfs_rcc: Add stub driver for FPGA clock and reset controller
This patch adds a driver framework to control individual FPGA reset and
clock gates.

For FPGA devices, only the fabric (FIC0/FIC1/FIC3) clock and reset can be
controlled, which affects the whole fabric / domain. This is problematic
for obvious reasons.

For MSS peripherals, clocks and reset are controlled individually for each
peripheral via MSS memory mapped registers (MPFS_SYSREG). To get the same
capability for FPGA peripherals, the same controller needs to be
fabricated on the FPGA.

However, the FPGA clock/reset controller is entirely user dependent, so a
generic implementation is not possible. However, a generic driver is
needed in order to build the current FPGA peripheral drivers. A stub
implementation of the driver is provided in order to achieve this.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-03-25 11:59:47 -03:00
Tony Lin
10d46929b9 Documentation/drivers/analog/adc/ads1115: Add documentation for the Texas Instrument ADS1115 driver
This commit adds the documentation for the Texas Instruments ADS1115 Driver.

Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
2025-03-25 09:49:51 +01:00
Tony Lin
1f2f910ccd drivers/analog/ads1115: Add support for the Texas Instruments ADS1115
This patch adds initial support for the Texas Instruments ADS1115 ADC.
Please read the documentation for more details.

Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
2025-03-25 09:49:51 +01:00
Tiago Medicci Serrano
85d9078a98 Documentation/testing: Add MTD transfer rate test app docs
Add documentation entry for the `mtd` test/benchmark application.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-03-24 16:08:42 -03:00
SPRESENSE
64b97bda5d drivers/sensors: Add CXD5602PWBIMU driver for IMU Add-on board
Add CXD5602PWBIMU driver for IMU Add-on board.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-03-24 16:07:45 -03:00
Eren Terzioglu
0bbdeb4b22 boards/esp32s3/esp32s3-box: Normalize esp32s3-box defconfigs
Normalize esp32s3-box defconfigs to fix CI issues

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-24 21:28:04 +08:00
Eren Terzioglu
43f982db1a arch/xtensa/esp32s3: Change default pins for esp32s3-lcd-ev-board v1.5
Change default pins for esp32s3-lcd-ev-board to prevent pin changes between boards

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-24 21:28:04 +08:00
Eren Terzioglu
fdfa589ce1 boards/xtensa/esp32s3: Add version support for esp32s3-lcd-ev boards
Add version support for esp32s3-lcd-ev boards to prevent pin changes

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-24 21:28:04 +08:00
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