Commit Graph

53751 Commits

Author SHA1 Message Date
Huang Qi
caa4c226bd dlfcn: Fix indent issue in lib_dlclose.c
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-07-26 16:34:41 +02:00
Yanfeng Liu
c2132bb88e risc-v/rv-virt: use RAM_START in ld.script
This revises FLAT build ld.script so that to use CONFIG_RAM_START
instead of hard coded address to increase flexibility.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-26 10:28:02 +02:00
buxiasen
f5021021ae up_backtrace: fix maybe backtrace the exiting thread
when the thread to backtrace is exiting, get_tcb and up_backtrace in
different critical section may cause try to dump invalid pointer, have
to ensure the nxsched_get_tcb and up_backtrace inside same critical
section procedure.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-07-26 12:03:43 +08:00
Yanfeng Liu
4038abd3ab riscv/virt: add virt_nsh with docs
This adds `rv-virt:virt_nsh` config w/ docs for using virtio serial
as NuttX console.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-26 12:01:29 +08:00
Yanfeng Liu
4f66b188cd riscv/virt: probe virtio earlier
This allows virtio devices to be probed upon board_early_init, thus
making virito-serial ready earlier for console use.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-26 12:01:29 +08:00
Yanfeng Liu
9e59b0b43b riscv/qemu: guard u16550 uses
This guards the uses for u16550 serial initialization, just in case
that no u16550 is configured.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-26 12:01:29 +08:00
Yanfeng Liu
3fecf46097 virtio/serial: initial CONSOLE support
This adds DRIVERS_VIRTIO_SERIAL_CONSOLE config and related logic to
virtio serial so that it can be used as console device. Note that
due to its dependency on OS services, this console is available late
so it is not proper for debugging too early booting issues.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-26 12:01:29 +08:00
Rushabh Gala
76bf6285c1 risc-v/qemu-rv: Add LED Driver for QEMU RISC-V 32-bit and 64-bit
- This PR adds the LED Driver for QEMU RISC-V 32-bit and 64-bit (User LEDs and Auto LEDs)
- QEMU RISC-V LED Driver will be used by the Rust Blinky App for Google Summer of Code
- Blinking the LED is probably the most common Embedded Demo, and now it's supported by QEMU RISC-V
- We added NuttX Configs `rv-virt:leds` and `rv-virt:leds64` to support User LEDs for 32-bit and 64-bit RISC-V
- Turning on/off a Simulated User LED will print a log message: "LED 1 set to 1"
- The code is derived from NuttX PinePhone LED Driver
2024-07-25 17:56:46 -03:00
Yanfeng Liu
cde13a74b1 boards/imx93-evk: add sdimage cleanup
This adds clean of imx9-sdimage.img upon distclean so that to unblock CI
checks.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-25 18:42:15 +08:00
Alin Jerpelea
f6400303df doc: improve commit log examples
The releasenotes tools can use proper commit titles and
automate commit sorting

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-07-24 21:54:09 +08:00
Henry Rovner
049a6da098 risc-v/bl808: Add timer driver
This change implements a driver for the hardware timer blocks on the BL808, as well as a config with the timer example enabled.
2024-07-24 10:06:54 +08:00
Alan Carvalho de Assis
42c9a829da doc: Include commit log examples
The Documentation was missing the commit log message examples

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-07-24 09:52:40 +08:00
nuttxs
a83a569652 arch/xtensa/esp32s3: Add qspi/spi_slave/lcd DMA request return value.
Optimize DMA initialization for duplicate calls.
2024-07-23 22:48:24 +08:00
simbit18
6edd1e3f7d doc.yml: Updated the workflow to use version v4 of the actions/upload-artifact 2024-07-23 22:38:43 +08:00
simbit18
5f75c0ad84 buildyml: Updated the workflow to use version v4 of the actions/upload-artifact and actions/download-artifact. 2024-07-23 01:30:34 +08:00
Matteo Golin
1fba2ec0df Add support for the Sensirion SHT4x temperature and humidity sensor family.
This driver implements `read`, `write`, `open`, `close` and `ioctl`
interfaces to the SHT4X temperature and humidity sensor on an I2C bus.
The read implementation is that of a character driver for easy
debugging, while `ioctl` provides an interface to the sensor's raw data
collection and heating functionality.
2024-07-22 14:24:20 -03:00
Yanfeng Liu
8c2dd0152c riscv/k230: revise nuttsbi config
This revises canmv230:nsbi to enable debug symbols for easier use purposes.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-22 23:46:43 +08:00
Yanfeng Liu
3d162781ba riscv/k230: revise amp configs
This adjusts canmv230 `master` and `remote` configs to support both
k230 and k230d devices and drop unused items.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-22 23:46:43 +08:00
Yanfeng Liu
607948949c riscv/k230: drop ld-rptun.script
This drops the ld-rptun.script as the it can be replaced by
ld-nuttsbi.script now.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-22 23:46:43 +08:00
Yanfeng Liu
3b9a346fe7 riscv/nsbi: unblock up_udelay
This fixes the always zero time in NuttSBI case as the `error` field
contains the correct timestamp. This in turn also fixes the block of
`up_udelay()` which further leads to boot failure of `canmv230:master`
config.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-22 23:46:43 +08:00
zhaoxingyu1
fa31c1c21b usbdev: delete unsigned comparison with 0
The unsigned type is always greater than or equal to 0

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2024-07-22 23:44:18 +08:00
Rodrigo Sim
17aec1328a board/stm32f401rc-rs485: Add support to MAX7219 8x8 LED Matrix
Signed-off-by: Rodrigo Sim rcsim10@gmail.com
2024-07-22 09:25:12 +08:00
Nathan Hartman
b8561558e7 sched: Improve Kconfig help of INIT_ENTRYPOINT
* sched/Kconfig
  (INIT_ENTRYPOINT): Document that the signature of "main" must take
   "argc" and "argv" or else compilation error results, as discussed in
   the email thread below [1].

References:

[1] dev@nuttx.apache.org email thread:
    "basically, I get an error when I do make" started 18 Jul 2024,
    archived:
    https://lists.apache.org/thread/9j2s3647ysdhy204g4ombn4o09bn11c1
    and elsewhere.
2024-07-21 19:53:27 -03:00
Alan Carvalho de Assis
e2aeb5cd11 Fix pin LTDC_B0, should be PJ12 instead of PF0
Fix a small issue found on Linum-STM32H753BI Documentation.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-07-22 02:19:09 +08:00
Alan Carvalho de Assis
8acca7c40a stm32f777zit6-meadow: Add support for two USB CDC/ACM
This modification adds support for two USB Composite CDC/ACM for
meadow board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-07-21 10:31:12 +08:00
Jorge Guzman
cb64096da6 board/linum-stm32h753bi: Add support to external sdram
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-07-20 19:53:19 -03:00
Alan Carvalho de Assis
a1a0315b9c Doc: Fix CustomApps/CustomHello example
NuttX generates the app main name from Kconfig symbol
xxxx_PROGNAME. The documentation was defining manually
the entry point as custom_hello(int char, char *argv[])
and pointing CONFIG_INIT_ENTRYPOINT="custom_hello".

The right thing to do is creating the application entry
point as "int main(int char, char *argv[])" and the build
system will add "_main" to the PROGNAME.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-07-20 13:17:48 +08:00
hujun5
d708edab76 fix compile error
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h: In function 'bool spin_trylock_wo_note(volatile spinlock_t*)':
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:401:22: error: 'atomic_ushort' was not declared in this scope; did you mean 'std::__1::atomic_ushort'?
  401 |     atomic_load((FAR atomic_ushort *)&lock->tickets.next);
      |                      ^~~~~~~~~~~~~
      |                      std::__1::atomic_ushort
/home/hujun5/downloads1/vela_sim/nuttx/include/libcxx/__atomic/aliases.h:33:7: note: 'std::__1::atomic_ushort' declared here
   33 | using atomic_ushort = atomic<unsigned short>;
      |       ^~~~~~~~~~~~~
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:401:37: error: expected primary-expression before ')' token
  401 |     atomic_load((FAR atomic_ushort *)&lock->tickets.next);
      |                                     ^
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:410:14: error: expected unqualified-id before 'new'
  410 |   spinlock_t new =
      |              ^~~
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:417:44: error: 'atomic_uint' was not declared in this scope; did you mean 'std::__1::atomic_uint'?
  417 |   if (!atomic_compare_exchange_strong((FAR atomic_uint *)&lock->value,
      |                                            ^~~~~~~~~~~
      |                                            std::__1::atomic_uint
/home/hujun5/downloads1/vela_sim/nuttx/include/libcxx/__atomic/aliases.h:35:7: note: 'std::__1::atomic_uint' declared here
   35 | using atomic_uint   = atomic<unsigned int>;
      |       ^~~~~~~~~~~
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:417:57: error: expected primary-expression before ')' token
  417 |   if (!atomic_compare_exchange_strong((FAR atomic_uint *)&lock->value,
      |                                                         ^
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:418:54: error: expected type-specifier before '.' token
  418 |                                       &old.value, new.value))

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-07-19 09:54:21 +02:00
zhaoxingyu1
b706891fc7 NVS: fix align size
when update for powerloss data write, data_wra should move NVS_ALIGN_SIZE

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2024-07-18 16:36:23 -03:00
Inochi Amaoto
0ddcbe62ec arch/risc-v: does not clear IPI address in S mode
According to the riscv-aclint doc, writing 0 to SSWI address
has no effect. Remove this unnecessary write for S mode.

Link: https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-07-18 22:59:29 +08:00
YAMAMOTO Takashi
985d395b02 esp32s3_textheap.c: fix a build error w/o CONFIG_ESP32S3_SPIRAM 2024-07-18 16:42:52 +08:00
nuttxs
de3737cd90 arch/xtensa/esp32s3: Deinitialize ESP32-S3 QSPI GDMA engine.
Correctly releasing channels after using QSPI is crucial
to prevent issues caused by multiple requests that may lead
to DMA channel resource conflicts.
2024-07-18 13:41:04 +08:00
chao an
7780cfc5a6 tricore/cmake: add support of cmake build for tricore
Toolchain Upstream:
https://github.com/EEESlab/tricore-gcc-toolchain-11.3.0

CMake command:
$ cmake -B build -DBOARD_CONFIG=tc397/nsh -GNinja
$ cmake --build build

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-18 13:40:49 +08:00
chao an
cab82e0a02 cmake/linker: replace --script= with -T to enhance compatibility
Some niche toolchains do not support the "--script=" option, such as tricore-elf-gcc

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-18 13:40:49 +08:00
Inochi Amaoto
000b0ec4a1 arch/risc-v: make common up_allocate_heap weak symbol
The common `up_allocate_heap` is a strong symbol, which leads to
error when building with CONFIG_DEBUG_LINK_WHOLE_ARCHIVE. Make
`up_allocate_heap` weak function to mitigate this problem.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-07-18 13:40:37 +08:00
simbit18
1540dc2d67 tools/testbuild.sh: add option -N use CMake with Ninja
tools/testbuild.sh
     added option -N Use CMake with Ninja as the backend.

    updated help.

    added date to print startup board

   added HOST=Msys

github/workflows/build.yml

   added option -N job docker
2024-07-18 13:40:20 +08:00
Lup Yuen Lee
bdf60d7966 risc-v/bl808, sg2000: Configure MMU to cache Kernel Text, Data and Heap (T-Head C906)
This PR configures the BL808 and SG2000 MMU (inside T-Head C906) to cache the the Kernel Text, Data and Heap.  We set the MMU Flags (Shareable, Bufferable and Cacheable) as explained in this article: https://lupyuen.github.io/articles/plic3#appendix-mmu-caching-for-t-head-c906

This PR fixes the Slow Memory Access for NuttX Kernel in BL808 and SG2000: https://github.com/apache/nuttx/issues/12696

In the next PR, we will fix the Slow Memory Access for NuttX Apps, by caching the User Text and Data.

arch/risc-v/src/bl808/bl808_mm_init.c: Added MMU Flags (Shareable, Bufferable and Cacheable) for BL808 Kernel Text, Data and Heap

arch/risc-v/src/sg2000/sg2000_mm_init.c: Added MMU Flags (Shareable, Bufferable and Cacheable) for SG2000 Kernel Text, Data and Heap
2024-07-17 12:08:04 -03:00
Yanfeng Liu
d6c67c555f riscv/trap: fix sp restore logic
This fixes stack pointer restore logic to avoid parent stack corruption
by forked child in PROTECTED build.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-17 17:20:00 +08:00
Yanfeng Liu
08c4686f47 riscv/fork: fix tp for PROTECTED
This fixes `tp` value of forked child in PROTECTED build to support
vfork. Why? the optimized `dispatch_syscall` requires `tp` to hold
the task TCB since commit e6973c764c.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-17 17:20:00 +08:00
Yanfeng Liu
70c5c94507 docs/cmake: add out-of-tree usage
This adds out-of-tree usage guide of CMake for FLAT, PROTECTED and KERNEL
configs so that more kernel developers can enjoy cmake for their daily
work.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-17 17:19:41 +08:00
chao an
4db1169e6f arch/tricore: fix compiler warning on GCC toolchain
tc3xx/tc3xx_timerisr.c: In function ‘up_timer_initialize’:
tc3xx/tc3xx_timerisr.c:58:39: warning: passing argument 1 of ‘tricore_systimer_initialize’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   58 |   lower = tricore_systimer_initialize(&MODULE_STM0, 192, SCU_FREQUENCY);
In file included from tc3xx/tc3xx_timerisr.c:31:
nuttx/arch/tricore/src/common/tricore_internal.h:252:35: note: expected ‘void *’ but argument is of type ‘volatile Ifx_STM *’ {aka ‘volatile struct _Ifx_STM *’}
  252 | tricore_systimer_initialize(void *tbase, int irq, uint64_t freq);
      |                             ~~~~~~^~~~~
tc3xx/tc3xx_serial.c:177:16: warning: initialization discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  177 |   .uartbase  = &MODULE_ASCLIN0,
      |                ^
tc3xx/tc3xx_serial.c:178:16: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  178 |   .pins      = &g_uart0_pins,
      |                ^
common/tricore_trapcall.c: In function ‘tricore_trapcall’:
common/tricore_trapcall.c:66:3: warning: passing argument 4 of ‘_assert’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   66 |   PANIC_WITH_REGS("Trap", CURRENT_REGS);
      |   ^~~~~~~~~~~~~~~
In file included from common/tricore_trapcall.c:29:
nuttx/include/assert.h:189:45: note: expected ‘void *’ but argument is of type ‘volatile uintptr_t *’ {aka ‘volatile long unsigned int *’}
  189 |              FAR const char *msg, FAR void *regs);

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-17 17:18:02 +08:00
chao an
8e20b8d862 arch/tricore: add support of tricore gcc toolchain
Toolchain Upstream:
https://github.com/EEESlab/tricore-gcc-toolchain-11.3.0

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-17 17:18:02 +08:00
chao an
7e2b25d45e cmake/boards: fix build break on custom board
Special string filters can be ignored normally

Loaded configuration '.config'
Minimal configuration saved to 'defconfig.tmp'
gmake[3]: *** [CMakeFiles/savedefconfig.dir/build.make:73: CMakeFiles/savedefconfig] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:17869: CMakeFiles/savedefconfig.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:17876: CMakeFiles/savedefconfig.dir/rule] Error 2
gmake: *** [Makefile:208: savedefconfig] Error 2

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-17 15:09:07 +08:00
Huang Qi
f555b3de91 boards/esp32s3: Increse the default stack size for usbnsh
Fix https://github.com/apache/nuttx/issues/12712

If run nsh over usb based serial port, the default stack size is too small,
for example simple `ps` command will use more than 2208 bytes stack.

Then the stack overflow will happen and the system will hang here.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-07-17 15:08:17 +08:00
zouboan
85e8536fbe zcu111: add support for board led 2024-07-16 18:50:52 -03:00
zouboan
b817db86b8 zynq-mpsoc: add support for mio/emio 2024-07-16 18:50:52 -03:00
chao an
532c437dc9 compiler/tasking: fix build break after inline spinlock change
Regression by:
| commit a4fece3450
| Author: hujun5 <hujun5@xiaomi.com>
| Date:   Wed Jul 3 15:10:49 2024 +0800
|
|     spin_lock: inline spin_lock

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-16 21:13:13 +08:00
chao an
bc7791e079 arch/tricore: synchronize instruction/data following MTCR/MFCR
Some barrier are necessary to avoid compiler optimizations

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-16 21:13:13 +08:00
GC2020
8f243d3eb7 /rp2040 Rename the RP2040-specific PWM_MULTICHAN definition to avoid confusion with the global PWM_MULTICHAN 2024-07-16 20:09:10 +08:00
Huang Qi
ae0ef94438 doc: Add a simple guide for thread local storage
Explain the basic concept of thread local storage and
the usage, limits of CONFIG_SCHED_THREAD_LOCAL.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-07-16 08:34:55 -03:00