Commit graph

57858 commits

Author SHA1 Message Date
chao an
c782131c5f syslog/rpmsg_server: fix build break if enable SYSLOG_RPMSG/SYSLOG_RPMSG_SERVER
syslog/syslog_rpmsg_server.c:66:13: error: conflicting types for 'syslog_rpmsg_write';
      have 'void(const char *, size_t,  const char *, size_t)' {aka 'void(const char *, unsigned int,  const char *, unsigned int)'}
   66 | static void syslog_rpmsg_write(FAR const char *buf1, size_t len1,
      |             ^~~~~~~~~~~~~~~~~~
In file included from syslog/syslog_rpmsg_server.c:36:
nuttx/include/nuttx/syslog/syslog_rpmsg.h:51:9: note: previous declaration of
  'syslog_rpmsg_write' with type 'ssize_t(const syslog_channel_t *, const char *, size_t)' {aka 'int(const struct syslog_channel_s *, const char *, unsigned int)'}
   51 | ssize_t syslog_rpmsg_write(FAR syslog_channel_t *channel,
      |         ^~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-25 10:51:37 +01:00
Alan Carvalho de Assis
8b5a45cee6 stm32l4r9ai-disco: Add support to bringup
Many STM32L4 boards are missing stm32_bringup.c. That confusion
was created when stm32_appinit.c was created. It introduced a new
way to do the board initialization without depending on NSH arch
specific initialization.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-25 09:32:25 +01:00
Alan Carvalho de Assis
5040272505 stm32l476vg-disco: Add support to bringup
Many STM32L4 boards are missing stm32_bringup.c. That confusion
was created when stm32_appinit.c was created. It introduced a new
way to do the board initialization without depending on NSH arch
specific initialization.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-25 09:32:25 +01:00
Alan Carvalho de Assis
e2a85dd2db nucleo-l496zg: Add support to bringup
Many STM32L4 boards are missing stm32_bringup.c. That confusion
was created when stm32_appinit.c was created. It introduced a new
way to do the board initialization without depending on NSH arch
specific initialization.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-25 09:32:25 +01:00
Alan Carvalho de Assis
cfd05250fa nucleo-l476rg: Add support to bringup
Many STM32L4 boards are missing stm32_bringup.c. That confusion
was created when stm32_appinit.c was created. It introduced a new
way to do the board initialization without depending on NSH arch
specific initialization.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-25 09:32:25 +01:00
Alan Carvalho de Assis
7e5d1ec7d7 nucleo-l432kc: Add support to bringup
Many STM32L4 boards are missing stm32_bringup.c. That confusion
was created when stm32_appinit.c was created. It introduced a new
way to do the board initialization without depending on NSH arch
specific initialization.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-25 09:32:25 +01:00
SPRESENSE
eef122260b arch: cxd56xx: Update delay value for subcore
Update delay value for subcore referred by up_mdelay function.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-02-25 14:46:10 +08:00
Felipe Moura
70f070fa1c riscv/esp32c6: Fix issue related esp32c6 usbserial driver.
This commit disables optimization that alters ESP32C6 interrupt registers.
Without this optimization, the USB serial driver does not work properly.
This is a temporary workaround until a proper fix is found.

Signed-off-by: Felipe Moura de Oliveira <moura.fmo@gmail.com>
2025-02-24 15:17:46 +01:00
Eren Terzioglu
713c10717c esp32[s2|s3|c3|c6|h2]: Update common layer
Update common layer to prevent build errors

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-24 10:35:11 -03:00
Eren Terzioglu
5865d2a8ff esp32[s2|s3]: Enhance SPIRAM/PSRAM support
Add esp_spiram_writeback_range function to flush some areas of spiram cache

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-24 10:35:11 -03:00
Michal Lenc
425ddc7f72 lcd/st7789: fix incorrect buffer count for 3 wire RAM write
If st7789_wrram is called with count = 1, then the entire buffer should
be sent. However, in 3 wire mode, the driver has to send the buffer
row by row because of additional data flag. The number of rows (count)
can't be ST7789_YRES in this case, but only the number of rows in
the buffer (this is write size / row size , where row size is
ST7789_XRES * ST7789_BYTESPP). This also applies only if we want to
write size larger than row size, because st7789_putrun allows to
write just a part of a row.

This fixes the incorrect behavior of the display in 3 wire mode if
the display is split into more buffer writes (as in LCD driver for
example, FB driver did not face this issue).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Martin Krasula <krasula@atlas.cz>
2025-02-24 09:51:13 +01:00
Michal Lenc
54954e55b5 samv7/pwm: fix incorrect write of CMRx register
DTE (dead time enable) is the 17th bit in CMRx (channel mode) register.
Function pwm_set_polarity did however read and write this register as
16 bit large, therefore dead time generation was always disabled.
This fixes the issue, pwm_set_polarity now reads the register as 32
large.

Also set the initial value of CMRx correctly in pwm_setup().

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-23 23:21:44 +01:00
Tiago Medicci Serrano
8956fc440f xtensa/esp32[|s3]: re-enable cache during exception handler
This commit implements re-enabling the cache before the exception
handler for ESP32-S3 and removes unnecessary checks (cache should
always be re-enabled during an exception handler and disabled again
after processed, except for ESP32-S3 that implements no recoverable
exceptions).

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-02-23 07:51:14 -03:00
Michal Lenc
7ccd6e9041 samv7/pwm: add support for latched fault inputs
This adds configuration option for every fault input, that can be
latched (kept even after the input value is below the threshold) or
volatile (PWM is automatically enabled once the output polarity goes
back to the normal state).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-23 07:49:34 -03:00
Jukka Laitinen
824dd70617 arch/risc-v/src/mpfs: Move PLIC interrupt enable/disable to mpfs_plic.c and handle pending interrupts
- Move PLIC interrupt enable and disable functions into mpfs_plic.c
- When enabling interrupts, always clear pending interrupt
- Remove race conditions between irq enable/disable by adding spinlock
  - An interrupt may trigger on one hart in the middle of enabling the interrupts - then the interrupt
    handler might call up_disable_irq.

A pending interrupt would trigger immediately when enabling the interrupt source,
but this is not expected. The interrupt source is level sensitive, so it should
only trigger if the source is active at the time when it is enabled. Not if it
was active sometime in the past.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-02-23 09:51:37 +08:00
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