Commit graph

57843 commits

Author SHA1 Message Date
Jukka Laitinen
ee98106bc5 arch/risc-v/src/mpfs: Implement wrcomplete support for coremmc driver
If CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE is defined, the coremmc driver
uses SD card's dat0 line to detect whether the sd card is still busy.

This requires that the FPGA design using coremmc block wires dat0 line
to some fabric irq; and configures CONFIG_MPFS_COREMMC_WRCOMPLETE_IRQNUM
to point to that. Default for the irq number is 4. (MSS_INT_F2M_4)

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-02-23 09:49:24 +08:00
buxiasen
e072771516 binfmt/copyactions: fix comments, make the actions life cycle more clear
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-02-23 09:46:14 +08:00
buxiasen
0e5cb896c4 binfmt/copyaction: fix prev->flink did not use from kmalloc.
We should not modify the input actions, casing when kernel build,
userspace call posix_spawn touch kernel address.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-02-23 09:46:14 +08:00
Ville Juven
17a80e90bd arch/mcx-nxxx: Add support for NXP MCX-N236 CPU
This adds minimal support for NXP MCX-N236 CPU. Peripherals supported are:
- GPIO
- PINMUX
- CLOCK
- LPUART

An example board, FRDM-MCXN236 is also added, with a basic profile that
boots into nsh.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-02-22 16:12:06 -03:00
Laczen JMS
34aa17b7a0 sixlowpan: improve tcp support.
Update the handling of tcp packets over sixlowpan. `tcp_ipv6_input()`
can update the dev->d_iob. Assigning ipv6 to IPv6BUF makes sure that
the correct buffer is used.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-02-22 07:58:26 -03:00
wangjianyu3
9f85eaf3cb drivers/thermal: Fix work not queued after getting temperature fails
The work will be stopped after get_temp() fails.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-22 07:56:21 -03:00
fd6d804623 tools/nxstyle: handle case statement
fix nxstyle so it throw error if case statement is not on new line
2025-02-21 16:26:41 -05:00
lijing.ly
eadfb5a2f8 boards/Kconfig: Add ARCH_CHIP_ESP32S3WROOM1N16R8 configuration item for Espressif ESP32-S3 DevKit
Signed-off-by: lijing.ly <lijing.ly@bytedance.com>
2025-02-21 15:39:46 +01:00
simbit18
35a793ed17 [nxstyle] fix Relative files path
fix Relative file path does not match actual file.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-21 15:36:05 +01:00
Tiago Medicci Serrano
798a73ac1a Documentation/python: Fix tutorial for running Python
After https://github.com/apache/nuttx-apps/pull/2982, there is no
need to mount the modules and manually set the required environment
variables: they are all set by the new Python wrapper application.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-02-21 15:34:48 +01:00
Filipe Cavalcanti
b542be4a14 drivers/net: change format specifiers macros on lan9250 driver
This fixes build warnings when different archs are used.
Simply changes "lx" to "PRIx32" when using uint32_t.
2025-02-21 11:29:48 -03:00
Rodrigo Sim
9d8a66717c Documentation:Fix Seeed Studio XIAO nRF52840
Change XIAO nRF52840 name at Documentation to
match product name and other Seeed Studio boards.

Signed-off-by: Rodrigo Sim <rcsim10@gmail.com>
2025-02-21 11:16:23 -03:00
Eren Terzioglu
c80e69e5e5 esp32[c3|c6|h2]: Update common layer
Update common layer to prevent build errors

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-21 20:48:15 +08:00
Eren Terzioglu
3661cdeed9 esp32[c3|c6|h2]: Add I2S support
Add I2S support for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-21 20:48:15 +08:00
Eren Terzioglu
f286a63223 esp32[c3|c6|h2]: Add DMA function to have more capabilites
Add DMA function to increase DMA peripheral capabilities

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-21 20:48:15 +08:00
Eren Terzioglu
2d069231c5 esp32[s3]: Add Documentation for esp32s3-lcd-ev board 2025-02-20 14:00:58 -05:00
Eren Terzioglu
3170af2fd0 esp32[c6|h2]: Update peripheral support docs 2025-02-20 14:00:58 -05:00
Matteo Golin
a76d63646f drivers/sensors/ms56xx: Use nxsig_usleep for long delays.
Change use of `up_udelay()` to `nxsig_usleep()` on the 10ms delays for
better performance.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-02-20 11:12:13 -03:00
chao an
ff1dc9583f libc/libcxx: fix failures with GCC 14
CXX:  libcxx/libcxx/src/random.cpp In file included from nuttx/include/libcxx/__filesystem/filesystem_error.h:15,
                 from nuttx/include/libcxx/__filesystem/directory_entry.h:20,
                 from nuttx/include/libcxx/filesystem:539,
                 from nuttx/include/libcxx/fstream:192,
                 from libcxx/libcxx/src/ios.instantiations.cpp:10:
nuttx/include/libcxx/__filesystem/path.h: In instantiation of 'std::__1::__fs::filesystem::path::_EnableIfPathable<_Source> std::__1::__fs::filesystem::path::append(const _Source&) [with _Source = std::__1::basic_string<char>]':
nuttx/include/libcxx/__filesystem/path.h:623:30: error: use of built-in trait '__remove_pointer(typename std::__1::decay<_Tp>::type)' in function signature; use library traits instead
  623 |   _EnableIfPathable<_Source> append(const _Source& __src) {
      |                              ^~~~~~

Pick the change from llvm-project:

https://github.com/llvm/llvm-project/pull/92663

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-20 08:46:25 +01:00
chao an
1d383a243f libs/libnx: do not generate resource if CONFIG_NX is not enabled
To avoid generate resource if CONFIG_NX is disabled:
| $ make -j12
| Create version.h
| CPP:  nxfonts_convert.c-> nxfonts_convert_8bpp.i
| CPP:  nxfonts_convert.c-> nxfonts_convert_24bpp.i

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-20 08:45:05 +01:00
Ville Juven
ff4d461fda mpfs_irq.c: Interrupt claim must be cleared before disabling the source
From Polarfire SoC TRM:

6.5.8 Interrupt Completion

To signal the completion of executing an interrupt handler, the processor core writes the received interrupt ID to the
Claim/Complete register. The PLIC does not check whether the completion ID is the same as the last claim ID for that
target. If the completion ID does not match an interrupt source that is currently enabled for the target, the completion
is ignored.

The last paragraph clearly states that IRQ completion does not work for
sources that have been disabled -> must ACK the completion before disable.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-02-19 15:22:16 -03:00
Matteo Golin
8de9dd9515 drivers/sensors/lsm6dso32: fixed byte read command to include start.
This is required to meet the communication requirements as per the
LSM6DSO32 datasheet. It doesn't cause issues on some MCUs (RP2040), but
prevents successful reads on others (STM32).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-02-19 15:21:08 -03:00
Filipe Cavalcanti
becba7153f arch/risc-v: improve nested interrupt assertion on riscv_doirq 2025-02-19 14:55:33 -03:00
Tiago Medicci Serrano
b417495284 arch/risc-v: support backtrace dump during IRQ
Adds support for backtrace when the system crashes during IRQ for RISC-V.
Tested with SMP, no SMP and no interrupt stack.
2025-02-19 14:55:33 -03:00
lijing.ly
6bd191e7e0 drivers/rpmsg/Kconfig: Add SPI dependency for RPMSG_PORT_SPI
If SPI dependency is not set, the following warning will be generated during compilation:

[109/1450] Building C object drivers/CMakeFiles/drivers.dir/rpmsg/rpmsg_port_spi.c.o
/data/code/nuttxspace/nuttx/drivers/rpmsg/rpmsg_port_spi.c: In function ‘rpmsg_port_spi_exchange’:
/data/code/nuttxspace/nuttx/drivers/rpmsg/rpmsg_port_spi.c:233:3: warning: implicit declaration of function ‘SPI_EXCHANGE’ [-Wimplicit-function-declaration]
  233 |   SPI_EXCHANGE(rpspi->spi, txhdr, rpspi->rxhdr,
      |   ^~~~~~~~~~~~
[1450/1450] Pac SIM with dynamic libs in nuttx.tgz

Signed-off-by: lijing.ly <lijing.ly@bytedance.com>
2025-02-19 14:52:22 -03:00
Zhu Zhongjie
2ebce06b79 board/arm/rp2040: support config st7789 reset gpio pin
Signed-off-by: Zhu Zhongjie <zhongjiezhu1@gmail.com>
2025-02-19 14:50:58 -03:00
Tiago Medicci Serrano
436dbe3f0b Documentation/esp32s3: Add ESP32-S3's PSRAM entry
Add entry for the external PSRAM support on ESP32-S3 and document
how to move data to the external PSRAM to free the internal memory.
2025-02-19 11:44:18 -03:00
Tiago Medicci Serrano
97aa90570c xtensa/esp32s3: allow moving .bss data to the external PSRAM
This commit allows placing .bss data into the external PSRAM.
Previously, the PSRAM was fully allocated to the heap memory only
and now part of it can be used to allocate .bss data freeing the
internal memory.
2025-02-19 11:44:18 -03:00
wangjianyu3
32bc95182a Documentation/esp32s3-devkit: Add doc for USB Fastboot
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-19 14:25:28 +08:00
wangjianyu3
321b25f486 esp32s3-devkit: Add fastboot starting command to initialization script
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-19 14:25:28 +08:00
wangjianyu3
746db1968d esp32s3-devkit/fastboot: Initializing configuration for Fastboot
Based on configuration of usb_device.

Quick start:

    ./tools/configure.sh -l esp32s3-devkit:fastboot
    make flash -j ESPTOOL_PORT=/dev/ttyACMx

(Optional) You can get full defconfig by executing following commands after SAVING your stages if necessary:

    ./tools/configure.sh -l esp32s3-devkit:fastboot
    make savedefconfig
    cat defconfig

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-19 14:25:28 +08:00
Roy Feng
c9a8f96aac xtensa/esp32: set cpuint to initial value after deallocate
on ESP32, cpuint was allocated when register wdt handler, but not
deallocated when unregister, which cause debug assert when checking
`DEBUGASSERT((*freeints & bitmask) == 0)`, so set cpuint to initial value
after deallocate.

The same issue on ESP32s3 has been fixed by PR#15433
2025-02-18 11:32:07 -03:00
Neo Xu
05e1cb736c doc: add GDB Plugin commands table
Add a table of commands we extend using GDB python API.
Add irqinfo command documentation.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-02-18 11:16:17 -03:00
Neo Xu
504c3dddf0 doc: update GDB python plugin path
The NuttX GDB python plugin has been moved to tools/pynuttx/nxgdb.
Update all documentation including this path.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-02-18 11:16:17 -03:00
xuxingliang
1bfb42d127 nxgdb/irq: add irqinfo command
(gdb) irqinfo
IRQ  COUNT      TIME   RATE   HANDLER                                          ARGUMENT
0    0          0      N/A    mps_reserved                             0x0 <sensor_unregister>
2    0          0      N/A    mps_nmi                                  0x0 <sensor_unregister>
3    0          0      N/A    arm_hardfault                            0x0 <sensor_unregister>
4    0          0      N/A    arm_memfault                             0x0 <sensor_unregister>
5    0          0      N/A    arm_busfault                             0x0 <sensor_unregister>
6    0          0      N/A    arm_usagefault                           0x0 <sensor_unregister>
11   1          0      N/A    arm_svcall                               0x0 <sensor_unregister>
12   0          0      N/A    arm_dbgmonitor                           0x0 <up_debugpoint_remove>
14   0          0      N/A    mps_pendsv                               0x0 <up_debugpoint_remove>
15   6581421    0      N/A    systick_interrupt                        0x100010c <g_systick_lower>
49   2          0      N/A    uart_cmsdk_tx_interrupt                  0x1000010 <g_uart0port>
50   0          0      N/A    uart_cmsdk_rx_interrupt                  0x1000010 <g_uart0port>
59   2          0      N/A    uart_cmsdk_ov_interrupt                  0x1000010 <g_uart0port>
(gdb)

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-18 11:16:17 -03:00
xuxingliang
06c7e2a02e nxgdb/utils: add has_field and fix ArrayIterator
1. Add method to check if an object has specified field.
2. Fix Array iterator that walrus expression should store result of the
   function, instead of the compare result.

Note that walrus operation has lowest priority except ','.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-18 11:16:17 -03:00
chao an
27d5a1b4b7 arm/memory_barrier: fix build warning on GCC14
nuttx/include/arch/spinlock.h:66:9: warning: "UP_DSB" redefined
   66 | #define UP_DSB() __asm__ __volatile__ ("dsb sy" : : : "memory")
      |         ^~~~~~
In file included from nuttx/include/arch/barriers.h:37,
                 from nuttx/include/arch/spinlock.h:34:
nuttx/include/arch/armv8-m/barriers.h:42:9: note: this is the location of the previous definition
   42 | #define UP_DSB()  arm_dsb(15)
      |         ^~~~~~
nuttx/include/arch/spinlock.h:67:9: warning: "UP_DMB" redefined
   67 | #define UP_DMB() __asm__ __volatile__ ("dmb st" : : : "memory")
      |         ^~~~~~
nuttx/include/arch/armv8-m/barriers.h:41:9: note: this is the location of the previous definition
   41 | #define UP_DMB()  arm_dmb()
      |         ^~~~~~

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-18 09:04:54 -05:00
chao an
5a64967ce7 nuttx/compiler: fix build warning on GCC14
nuttx/include/arch/armv8-m/irq.h:496:36: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
  496 | static always_inline_function bool up_interrupt_context(void)
      |                                    ^~~~~~~~~~~~~~~~~~~~
nuttx/include/arch/armv8-m/irq.h:490:41: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
  490 | static always_inline_function uintptr_t up_getusrsp(void *regs)
      |                                         ^~~~~~~~~~~
nuttx/include/arch/armv8-m/irq.h:477:40: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
  477 | static always_inline_function uint32_t up_getsp(void)
      |                                        ^~~~~~~~
nuttx/include/arch/armv8-m/irq.h:451:40: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
  451 | static always_inline_function uint32_t getpsp(void)
      |                                        ^~~~~~
nuttx/include/arch/armv8-m/irq.h:441:36: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
  441 | static always_inline_function void setcontrol(uint32_t control)
      |                                    ^~~~~~~~~~
nuttx/include/arch/armv8-m/irq.h:428:40: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
  428 | static always_inline_function uint32_t getcontrol(void)
      |                                        ^~~~~~~~~~

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-18 09:04:54 -05:00
Filipe Cavalcanti
954081cdd8 xtensa/esp32s3: use common Espressif wireless source
Update the wireless symbols from ESP32S3_* to ESPRESSIF_* for using common layer.
Remove ESP32S3 specific WiFi files and edit build system to use common layer.
2025-02-17 12:03:57 +01:00
raiden00pl
38c348bf9a boards/b-g431b-esc1/cansock: enable SocketCAN utils
boards/b-g431b-esc1/cansock: enable SocketCAN utils, so user can easly use CAN tools

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-02-17 14:13:29 +08:00
raiden00pl
3a0870df1c boards/nucleo-f446re/cansock: enable SocketCAN utils
boards/nucleo-f446re/cansock: enable SocketCAN utils, so user can easly use CAN tools

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-02-17 14:13:29 +08:00
raiden00pl
425b2683cd boards/nucleo-f302r8/cansock: enable SocketCAN utils
boards/nucleo-f302r8/cansock: enable SocketCAN utils, so user can easly use CAN tools.

This board has only 64KB of FLASH which requires some additional optimization to fit CAN tools on it.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-02-17 14:13:29 +08:00
raiden00pl
27dd63d147 boards/nucleo-g431rb/cansock: enable SocketCAN utils
boards/nucleo-g431rb/cansock: enable SocketCAN utils, so user can easly use CAN tools

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-02-17 14:13:29 +08:00
raiden00pl
0317df5b43 boards/nucleo-f722ze/cansock: enable SocketCAN utils
boards/nucleo-f722ze/cansock: enable SocketCAN utils, so user can easly use CAN tools

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-02-17 14:13:29 +08:00
Yanfeng Liu
3fca03f23b board/qemu-armv7r: add PROTECTED mode
This adds initial bootable PROTECTED mode config `qemu-armv7r:pnsh`,
more tests are still needed. Flat mode config qemu-armv7r:nsh still
works.

- The nuttx.ld is for building nuttx ELF
- The nuttx_user.ld is for building nuttx_user ELF

They both include the memory.ld with preprocessing.

To run, use the QEMU mentioned in PR:

```sh
$ qemu-system-arm -M virt -semihosting -nographic -cpu cortex-r5f \
           -device loader,file=nuttx_user -device loader,file=nuttx
```

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-17 14:12:22 +08:00
Yanfeng Liu
64bae41c6b board/qemu-armv7r: rename dramboot.ld
This aligns linker script file name with built program name so that
nuttx.ld helps to build nuttx ELF

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-17 14:12:22 +08:00
xuxingliang
1b94d0e2cf nxgdb/mm: show pool expand queue size
nqueue has been added to output.

E.g.
(gdb) mm pool
Total 16 pools
                      total blocksize     bsize  overhead     nused     nfree    nifree   nwaiter    nqueue
 Umem@0x10048dc        4068        16        16         0         3       251         0         0         1
 Umem@0x100493c        4068        32        32         0         3       124         0         0         1
 Umem@0x100499c        4036        48        48         0        10        74         0         0         1
 Umem@0x10049fc        4036        64        64         0         1        62         0         0         1
 Umem@0x1004a5c           0        80        80         0         0         0         0         0         0
 Umem@0x1004abc           0        96        96         0         0         0         0         0         0
 Umem@0x1004b1c           0       112       112         0         0         0         0         0         0
 Umem@0x1004b7c           0       128       128         0         0         0         0         0         0
 Umem@0x1004bdc           0       144       144         0         0         0         0         0         0
 Umem@0x1004c3c           0       160       160         0         0         0         0         0         0
 Umem@0x1004c9c           0       176       176         0         0         0         0         0         0
 Umem@0x1004cfc           0       192       192         0         0         0         0         0         0
 Umem@0x1004d5c        3956       208       208         0         1        18         0         0         1
 Umem@0x1004dbc           0       224       224         0         0         0         0         0         0
 Umem@0x1004e1c           0       240       240         0         0         0         0         0         0
 Umem@0x1004e7c           0       256       256         0         0         0         0         0         0
(gdb)

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-16 11:23:38 -03:00
JianyuWang
1e7532c381 drivers/thermal: Break loop if matching active trip point
Co-authored-by: Donny(董九柱) <70748590+Donny9@users.noreply.github.com>
2025-02-16 11:22:41 -03:00
wangjianyu3
fef1a0702d drivers/thermal/dummy: Add another passive cooling device
For case that CPUFreq was not enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-16 11:22:41 -03:00
wangjianyu3
0b633946c0 drivers/thermal: Add support for passive trip point
Spliting `THERMAL_NORMAL` to `THERMAL_ACTIVE` and `THERMAL_PASSIVE`,
to support different update intervals for thermal zone.

Active/Passive from [kernel.org](https://www.kernel.org/doc/Documentation/devicetree/bindings/thermal/thermal.txt):

  * Cooling device nodes

  Cooling devices are nodes providing control on power dissipation. There
  are essentially two ways to provide control on power dissipation. First
  is by means of regulating device performance, which is known as passive
  cooling. A typical passive cooling is a CPU that has dynamic voltage and
  frequency scaling (DVFS), and uses lower frequencies as cooling states.
  Second is by means of activating devices in order to remove
  the dissipated heat, which is known as active cooling, e.g. regulating
  fan speeds. In both cases, cooling devices shall have a way to determine
  the state of cooling in which the device is.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-16 11:22:41 -03:00