1
0
Fork 0
forked from nuttx/nuttx-update

Compare commits

...

201 commits

Author SHA1 Message Date
hujun5
5f4a15b690 pthread: remove enter_critical_section in pthread_mutex
reason:
We would like to replace the critical section with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-12 22:30:35 +08:00
hujun5
19bca74c7c clock_adjtime: use small lock to protect g_adjtime_ppb g_adjtime_wdog
reason:
We would like to replace the critical section with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-12 22:07:15 +08:00
hujun5
a2d4d74af7 clock_timekeeping: remove enter_critical_section in sched/clock/clock_timekeeping.c
reason:
We would like to replace the critical section with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-12 16:51:40 +08:00
wangmingrong1
2149d89336 macro/align: Use ALIGN_UP and ALIGN_DOWN uniformly
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-12 16:48:35 +08:00
Yanfeng Liu
71a4e86718 risc-v/Toolchain.defs: guard -r in LDELFFLAGS
This guards use of `-r` in LDELFFLAGS in risc-v common/Toolchain.defs so
that it is only used when BINFMT_ELF_RELOCATABLE is selected.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2025-01-12 16:47:54 +08:00
Leo Chung
63c8de5f03 sim: Fixes the linker 'noexecstack' warning
Signed-off-by: Leo Chung <gewalalb@gmail.com>
2025-01-12 16:17:52 +08:00
yaojiaqi
43797ea6cc drivers/timers/watchdog: add watchdog timer notifier chain
Add support for watchdog timer notifer chain so that users
can customize the callback function when the watchdog timer
times out which enabled by Auto-monitor

Signed-off-by: yaojiaqi <yaojiaqi@lixiang.com>
2025-01-12 11:15:42 +08:00
wangmingrong1
aa0aecbd80 mempool: addbacktrace should be before kasan_unpoison
If thread 1 is executing kasan_unpoison but a scheduling occurs and the block is trampled upon, the displayed backtracking may still be from the previously allocated backtracking

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-12 01:29:14 +08:00
rongyichang
39780fdae1 drivers/vhost-rng: fix compile error in vhost-rng.
vhost/vhost-rng.c:154:9: error: too few arguments to function 'virtio_create_virtqueues'
  154 |   ret = vhost_create_virtqueues(hdev, 0, 1, vqnames, callback);

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-01-12 00:06:12 +08:00
rongyichang
ee2f3df2ff drivers/vhost: fix compile error while get vhost status.
vhost/vhost.c: In function 'vhost_status_driver_ok':
vhost/vhost.c:86:20: error: too few arguments to function 'virtio_get_status'
   86 |   uint8_t status = vhost_get_status(hdev);

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-01-12 00:06:12 +08:00
Yanfeng Liu
ff488133c9 qemu-armv7a: allows ELF_EXECUTABLE
This allows using BINFMT_ELF_EXECUTABLE for qemu-armv7a target.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-11 18:54:36 +08:00
Yanfeng Liu
48846954d8 arm/Toolchain.defs: skip -r for ELF_EXECUTABLE
This avoids using `-r` option when linking executable programs.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-11 18:54:36 +08:00
Yanfeng Liu
657247bda8 libc/modlib: preprocess gnu-elf.ld
This generates gnu-elf.ld via preprocessing of gnu-elf.ld.in so
that to reduce board specific app linker scripts in kernel mode
when BINFMT_ELF_EXECUTABLE is enabled.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-11 18:54:36 +08:00
Yanfeng Liu
be40c01ddd nuttx/addrenv.h: revise assembly guard
This allows the header file to be useful from non-C sources such as
assembly code or linker scripts.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-11 18:54:36 +08:00
wangmingrong1
91c71ed00a mm: Add mm_lock_irq, mm_unlock_iq
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-11 12:28:30 +08:00
wangmingrong1
1d8ce18d7f macro/align: Fix ALIGN_UP and ALIGN_DOWN
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-11 12:13:10 +08:00
Kyle Wilson
558fe83f6d Add Timer Support to STM32H5 ADC Driver
Added support for using timers with ADCs. Updated Kconfig to support TRGO2, although driver support for TRGO and TRGO2 not developed yet. Updated hardware/stm32_tim.h with missing CCER bits needed for compilation.
2025-01-11 12:04:48 +08:00
wangmingrong1
7c7a64c84c kconfiglib/mark: It should use pip instead of apt install
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-10 15:27:06 -03:00
Huang Qi
f2a88059e7 tools/nxstyle.c: Add missing zlib function names to white list
The zlib compression functions are used in network utilities
for compression/decompression. These functions need to be added to
the nxstyle white list to prevent style checking errors since they
follow the zlib naming convention rather than NuttX's style guide.

Specifically, these functions are used in:
- apps/netutils/telnetc/telnetc.c for compressed data handling

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 15:26:39 -03:00
hujun5
4bd8d9eac7 sched: remove spin_lock_irqsave(NULL) support
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-10 22:35:14 +08:00
hujun5
69ee240b45 rp2040_pio: remove spin_lock_irqsave(NULL) in arch/arm/src/rp2040/rp2040_pio.c
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-10 22:35:14 +08:00
wangzhi16
b9837bed08 use small lock to protect g_ram_vectors, involving armv6-m, armv7-m, armv8-m.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-10 21:33:23 +08:00
wangzhi16
d84ba608a1 use small lock in following files:
arch/arm/src/am335x/am335x_can.c
    arch/arm/src/am335x/am335x_gpio.c
    arch/arm/src/am335x/am335x_i2c.c
    arch/arm/src/am335x/am335x_irq.c
    arch/arm/src/am335x/am335x_serial.c
    arch/arm64/src/imx9/imx9_gpio.c
    arch/arm64/src/imx9/imx9_lpi2c.c
    arch/arm64/src/imx9/imx9_lpspi.c
    arch/arm64/src/imx9/imx9_usbdev.c
    arch/x86_64/src/intel64/intel64_tsc_tickless.c

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-10 21:32:23 +08:00
Huang Qi
58c95f5d85 armv7-a/Toolchain.defs: Update LLVM arch type to thumbv7a
Changed the LLVM architecture type from thumbv7 to thumbv7a in
Toolchain.defs to better match the ARMv7-A architecture specification.

This change ensures proper code generation and optimization for
Cortex-A series processors when using the Thumb instruction set.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 21:21:26 +08:00
wangzhi16
f179cb81b5 use small lock to protect register about l2cc, involving the following files:
arch/arm/src/armv7-a/arm_l2cc_pl310.c
arch/arm/src/armv7-r/arm_l2cc_pl310.c
arch/arm/src/armv8-r/arm_l2cc_pl310.c

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-10 21:20:52 +08:00
Jukka Laitinen
575c608be8 drivers/usbdev/cdcacm.c: Fix a crash in cdcacm if usbdev gets unregistered while client calls close for the tty
Make sure that the cdcacm is disconnected before the usbdev gets unregistered.

Also, check if the device is connected or not in cdcuart_txempty (uart_txempty). Otherwise there may be a crash during uart_tcdrain, called in tty close path, if the usbdev unregistration happens during the loop.

This issue can be triggered by monitoring the cable connection status in one thread, sending BOARDIOC_USBDEV_DISCONNECT if the usb cable is detached. In another thread close the ttyACM.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-01-10 21:14:55 +08:00
Eren Terzioglu
af6147fb2c esp32[c6]: Fix misconfigured pin functions for esp32c6-devkitm 2025-01-10 21:13:26 +08:00
YAMAMOTO Takashi
b2735751d1 rv-virt:citest64: Bump CONFIG_SYSTEM_POPEN_STACKSIZE
With today's master, according to up_check_tcbstack(),
the thread consumes 2432 bytes with examples/popen.
2025-01-10 21:12:12 +08:00
Huang Qi
6dbdfb3cd5 arch/arm: Add LLVM configuration to CMake
Added LLVM-specific configuration variables to ARM architecture CMake files:
- LLVM_ARCHTYPE for architecture variant (thumbv6m, thumbv7a, etc)
- LLVM_CPUTYPE for CPU target (cortex-m0, cortex-a5, etc)
- LLVM_ABITYPE for ABI (eabi/eabihf)

These changes enable LLVM/Clang toolchain support while maintaining
compatibility with existing GCC configurations. The LLVM variables
are set based on the same architecture/CPU/FPU configurations used
for GCC flags.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 16:58:01 +08:00
Huang Qi
f2934935d0 armv7-a.cmake: Improve FPU options table formatting and readability
Reformatted the FPU options table to use a clearer markdown-style table format
with proper alignment and column headers. Added visual separators (~~~) to make
the table stand out from surrounding code. Improved consistency in column widths
and fixed line wrapping for better readability.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 16:58:01 +08:00
Kyle Wilson
9783c88425 Initial STM32H5 Timers Commit
Used the STM32H7 as a reference.

Removed APB enabling from stm32h5xx_rcc.c. This is done in timer initialization, like STM32H7.

Also removed LPTIM. Will add later.

tim_lowerhalf: Timers 9, 10, and 11 removed. Timers 15,16, and 17 added.

Removed low-power timers from Kconfig. Not implemented yet.

Style Updates

Added stm32_tim_enable and stm32_tim_disable to Timer operations.
2025-01-10 09:40:10 +01:00
wangmingrong1
e5e9032ea0 arm64/vector: Reduce two useless instructions
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-10 14:59:20 +08:00
wangmingrong1
d22e6d7489 arm64/sctlr: Allows thread to independent control the switch of sctlr
The method is the same as the method of saving the current DAIF state of the thread
It will pave the way for the future implementation of hwasan's memory management
Allows each thread to independently control the mte switch function

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-10 14:59:20 +08:00
chenzihan1
724797e05c goldfish_sensor_uorb.c: add set_interval for goldfish sensor
Added the ability to set sampling rate for goldfish

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-01-10 04:31:29 +08:00
Eren Terzioglu
8c9162ef8c esp32[c3|c6|h2]: Fix misconfigured gpio issue 2025-01-10 02:13:41 +08:00
Huang Qi
1b8d5a4367 arch/risc-v: Refactor LLVM CPU type handling in Toolchain.cmake
- Replace direct string comparisons with regex pattern matching for ARCHCPUEXTFLAGS
- Change from using LLVM_CPUFLAGS list to setting LLVM_CPUTYPE directly
- Simplify CPU type detection logic while maintaining same functionality
- Use more consistent string variable naming convention

This change makes the CPU type detection more flexible and maintainable
while keeping the same behavior for supported RISC-V configurations.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 02:06:19 +08:00
zhanghongyu
70489fe56b net/tcp_timer: remove tcp_callback(TIMEOUT) when accept conn timeout
when accept conn timeout, only accept conn itself should handle the event
(send TCP_RESET), and there is no need to notify the listening conn.
otherwise, the server's poll will return with POLLERR and POLLHUP.
this may cause some applications to execute incorrect logic in the future.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-01-10 02:04:37 +08:00
YAMAMOTO Takashi
a76cdfda47 rv-virt:citest64: bump CONFIG_INIT_STACKSIZE
Fix crashes with "popen" example.

```
dump_tasks:    PID GROUP PRI POLICY   TYPE    NPX STATE   EVENT      SIGMASK          STACKBASE  STACKSIZE      USED   FILLED    COMMAND
dump_tasks:   ----   --- --- -------- ------- --- ------- ---------- ---------------- 0x800525e0      2048      1016    49.6%    irq
dump_task:       0     0   0 FIFO     Kthread -   Ready              0000000000000000 0x80056550      2032      1168    57.4%    Idle_Task
dump_task:       1     0 224 RR       Kthread -   Waiting Semaphore  0000000000000000 0x80057500      1968       768    39.0%    hpwork 0x80051470 0x800514b8
dump_task:       2     0 100 RR       Kthread -   Waiting Semaphore  0000000000000000 0x80057e48      1960       720    36.7%    lpwork 0x80051400 0x80051448
dump_task:       3     3 100 RR       Task    -   Waiting Semaphore  0000000000000000 0x80058ca0      3024      3008    99.4%!   nsh_main
dump_task:       4     4 100 RR       Task    -   Ready              0000000000000000 0x8005a2f0      2000      1376    68.8%    popen
riscv_exception: EXCEPTION: Load access fault. MCAUSE: 0000000000000005, EPC: 000000008000594e, MTVAL: fffffffffffffffc
riscv_exception: PANIC!!! Exception = 0000000000000005
```
2025-01-10 02:01:21 +08:00
hujun5
8fd4bea2ba segger: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-09 23:52:55 +08:00
Huang Qi
cfd0cc0d1a Remove duplicate includes across multiple files
This commit cleans up redundant header file includes throughout the codebase.
 The changes include:

 - Removing duplicate #include directives that were present in the same file
 - Consolidating includes that were split across multiple lines unnecessarily
 - Removing unused includes that were no longer needed
 - Fixing some formatting issues with includes

 The changes improve code organization and maintainability by:
 - Reducing unnecessary dependencies
 - Making include dependencies more explicit
 - Following consistent include patterns
 - Removing dead code

 No functional changes are made - this is purely a code cleanup commit.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-09 23:30:23 +08:00
jerryslhao
bb4eb12fa3 arch/arm/stm32:add stm32g4 spi driver.
Signed-off-by: jerryslhao <jerryslhao@gmail.com>
2025-01-09 09:25:10 +01:00
Huang Qi
a8ba833cde Documentation: Add Rust integration guide for NuttX
Add a new guide documenting how to integrate Rust with NuttX, including:
- Prerequisites and supported platforms
- Setup instructions for Rust toolchain
- Required NuttX configurations
- Example build and run instructions for RISCV32 target

The guide provides an experimental but working example of running
a Rust application on NuttX using the rv-virt:nsh board.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-09 15:43:10 +08:00
nuttxs
cb980cc977 arch/esp32s3_partition: Read data from SPI Flash
at designated address (with decryption)
2025-01-09 07:52:40 +08:00
raiden00pl
b3120e535b arch/arm/stm32{|f0l0g0|f7|h5|h7}/i2c: raise compilation error when configuration is invalid
Raise compilation error when I2C configuration is invalid.
It's better to catch invalid clock configuration during compilation instead of
producing binary that doesn't work as expected anyway.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-01-09 07:49:39 +08:00
wangmingrong1
11d54b34a7 Revert "mm_heap: double malloced memory default alignment (4 -> 8, 8 -> 16)"
This reverts commit 3e971d2e6d.
2025-01-09 00:00:11 +08:00
Huang Qi
00794b92c4 arch/risc-v: Improve LLVM CPU type detection with findstring
Use findstring instead of direct equality checks for LLVM_CPUTYPE
conditions to better handle ARCHCPUEXTFLAGS that may contain additional
ISA extensions. This makes the CPU type detection more robust when
dealing with extended instruction sets while still ensuring the required
base ISA extensions are present.

For example, ARCHCPUEXTFLAGS="imc_zicsr_zifencei" will now correctly
match as sifive-e20 rather than failing the exact match check.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-08 23:58:19 +08:00
Ville Juven
ae9815a888 riscv_cpustart.c: Change CPU start related traces to sinfo
Like all other platforms do.
2025-01-08 23:57:34 +08:00
YAMAMOTO Takashi
c0eaf12661 esp32s3_wifi_adapter.c: Fix a deadlock
Fixes: https://github.com/apache/nuttx/issues/15314
2025-01-08 23:56:43 +08:00
wangjianyu3
8282ed9ab0 drivers/sensors/gnss: Macro UINT8_MAX for maximum value of uint8_t crefs
libs/libc/gnssutils/minmea/minmea.h:17:#include <stdint.h>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-08 22:50:03 +08:00
hujun5
428c2bfb91 Remove duplicate code
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-08 22:48:12 +08:00
YAMAMOTO Takashi
0b960de1e0 sim:citest: Bump the nsh line length
One of the test scripts tries to send a very long command
(166 characters, [1]), which is immediately truncated by NSH.
I guess it isn't the intention of the test.

[1] 1bcaacd5cc/tools/ci/testrun/script/test_framework/test_cmocka.py (L50-L55)
2025-01-08 21:13:54 +08:00
Huang Qi
40bd8f9ad4 arch/risc-v: Make CPU index handling based on ARCH_RV_CPUID_MAP
This patch refactors the CPU index handling in the RISC-V architecture to be based on the ARCH_RV_CPUID_MAP configuration.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-08 13:48:00 +02:00
cd83dc1317 CI: Increase CI Jobs to 100% for Complex PRs
This PR increases the CI Jobs for Complex PRs from 50% to 100%, as explained here:
- https://github.com/apache/nuttx/issues/15451#issuecomment-2576576664
2025-01-08 15:05:18 +08:00
jerryslhao
1bcaacd5cc arch/arm/stm32: fix stm32g4 enable pll code.
In the file stm32g474xxxx_rcc.c, the enable PLL
code, according to the intent of the comment,
wants to keep the reserved bit, but the code
clears the reserved bit.

Signed-off-by: jerryslhao <jerryslhao@gmail.com>
2025-01-08 10:41:22 +08:00
hujun5
fabf4a5142 fix compile error
Error: /github/workspace/sources/nuttx/include/nuttx/spinlock_type.h:57:3: error: unknown type name 'atomic_t'
368   57 |   atomic_t owner;
369      |   ^~~~~~~~
370Error: /github/workspace/sources/nuttx/include/nuttx/spinlock_type.h:58:3: error: unknown type name 'atomic_t'
371   58 |   atomic_t next;
372      |   ^~~~~~~~

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-08 09:28:58 +08:00
hujun5
9d5ecc29d0 Revert "SEGGER_RTT_Conf.h: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h"
This reverts commit 5e7c640976f7fdd77c2230909bf24eafcff26d12.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-08 09:28:58 +08:00
Tiago Medicci Serrano
154a91c323 Documentation: Update Python documentation for socket module
Update Python documentation after supporting Python's socket module
to reflect the commands used to run the RISC-V QEMU.
2025-01-08 09:27:25 +08:00
Tiago Medicci Serrano
6469e30671 rv-virt/python: Enable Python's socket module on defconfig
Enables the Python's socket module. This allows applications to be
built to interact with POSIX-compatible sockets.
2025-01-08 09:27:25 +08:00
Daniel P. Carvalho
ba32b61d2e arch/arm/stm32/: Fix I2C driver for STM32G4 devices. 2025-01-07 23:45:59 +08:00
Daniel P. Carvalho
3f3e6dd9b8 arch/arm/stm32/: Added enable/disable to timer low level ops. 2025-01-07 23:32:06 +08:00
YAMAMOTO Takashi
e5ac1c620e sim: Disable chained fixups for sim_macho_init.c
This is a workaround for https://github.com/apache/nuttx/issues/15208

Tested with:
    macOS 15.2
    x86-64
    Xcode 16.2
2025-01-07 23:28:30 +08:00
Zhe Weng
3e62be8361 net: Enable dynamic allocation of tcp/udp/ipfwd buffer by default
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-07 22:00:21 +08:00
Zhe Weng
50b3ab7671 net/bufpool: Call init automatically on alloc
Note: Initialize function of protocols (tcp, udp, pkt, etc.) are kept empty.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-07 22:00:21 +08:00
Zhe Weng
f702f1705f net/bufpool: Use SEM_INITIALIZER to init sem
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-07 22:00:21 +08:00
Filipe Cavalcanti
407a62a33a boards/xtensa: update Make.defs for linker scripts on ESP32|S2 2025-01-07 21:58:09 +08:00
Filipe Cavalcanti
91511ae280 boards/xtensa: merge MCUBoot and Simple Boot linker scripts on ESP32|S2 2025-01-07 21:58:09 +08:00
zhangshoukui
aef24f5f3c rename lib_pathbuffer to lib_tempbuffer
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-07 21:54:33 +08:00
rongyichang
553406e801 drivers/video: add BRGA8888 support for goldfish gpu fb
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-01-07 21:47:56 +08:00
Gao Feng
f64a48f4e5 cxx: size and un-size functions should be defined in one file
fix error when "-Werror=sized-deallocation" is enabled.

refer to https://timsong-cpp.github.io/cppwp/n4861/new.delete,
displace the default versions defined by the C++ standard library.
2025-01-07 21:45:59 +08:00
wangmingrong1
c5655d5a11 arm64/tbi: Unified TBI flags for MTE and software kasan
The TCMA flag is not critical, it will be set separately in "arm64_mte.c"

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-07 21:44:18 +08:00
Jani Paalijarvi
dd4ee256c3 arch/risc-v/src/mpfs/mpfs_ethernet.c: Set correct return value
Return error in case of mpfs_i2cbus_initialize() failure.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-01-07 21:42:00 +08:00
Jani Paalijarvi
e1fb0b30c4 drivers/net/ksz9477.c: Check return values in init
Check that writes to configuration registers success.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-01-07 21:42:00 +08:00
simbit18
0641e6f287 [DOC] implementation/simulation.rst: Removed the execute permissions. 2025-01-07 21:40:40 +08:00
simbit18
aaef87e5b6 Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2025-01-07 21:39:50 +08:00
wangjianyu3
350f396aa5 drivers/sensors/gnss: Fix integer overflow error
CID 1309501: (#1 of 1): Overflow constant (INTEGER_OVERFLOW)
overflow_const: Expression upper->crefs, which is equal to 255, where enable ? 1 : -1 is known to be equal to -1, overflows the type that receives it, an unsigned integer 8 bits wide.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-07 21:38:17 +08:00
buxiasen
7e0e4dea75 arm/irq.h: fix ARCH_ARM7TDMI missing up_getusrsp after move to irq.h
Causing c5471evm/httpd ci break.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-07 14:29:32 +08:00
Gao Feng
55da7d89b5 xtensa/esp32s3: porting of spi_flash_chip_generic_write_encrypted from ESP-IDF 2025-01-07 12:18:43 +08:00
Kyle Wilson
4bd2c0443b Preliminary add of fdcan source files.
Adding source files to the fdcan branch based on identical register set. These files should mostly just work.

Removed references to FDCAN3. H5 only has 2 FDCAN interfaces.

Add basic FDCAN Kconfig

FDCAN Kconfig options

Added various options for FDCAN mode, FDCAN bitrate, clock selection and division, and timing.

Added bit timing config options (nominal and data). Added stm32h56xxx pin mappings.

Fixed Data Bit Timing. Pulled in STM32H5_FDCAN_PDIV_VALUE. Added stm32_fdcan.c to Make.defs. Added DBITRATE to Kconfig

Clock source changes to FDCAN

Moved the setting of the clock source to the stm32h5xx_rcc.c file. Added notes to stm32_fdcan.c that STM32_FDCAN_FREQUENCY and STM32_FDCAN_PDIV should be set in board.h

Change STM32H5_FDCAN_PDIV to STM32_FDCAN_PDIV

Updated Kconfig to match G4 implementation. Removed stm32_fdcan_sock for now.

Removed FDCAN3 from stm32_fdcan.h

incomplete changes for bit timning

Set NBRP and DBRP registers based on STM32H7 FDCAN socket algorithm.

Added board file for initializing 1 can device. Will update later to initialize second device.

Fixed ifdefs. Changed STM32 to STM32H5.

Add some can testing changes.

Added option to configure bit timing, with automatic bit timing set as default.

Style fixes

Fixed FDCAN2 and memory access issues

FDCAN2 msgram offset was wrong by 1 word (4 bytes). I removed the + 4 at the end of the definition. This fixed the issues with fdcan2. Also changed ifdefs when setting ESI, FDF, and BRS bits. When CAN FD was used, this resulted in the first command after the endif (the setting of dest at line 2325) being skipped because it was included in the else block when it shouldn't have. This resulted in exceptions. Adjust ifdefs fixes this problem. Other minor fixes.

Restoring board files to upstream versions. These files will be pulled in later in a separate pull request. stm32h5_fdcan_test branch created for this.

Fixed Queue Mode Transmit

The can driver checks the TFFL bits in the TXFQS register. In Queue mode, this always returns 0. As a result, fdcan_txempty was always returning false, which resulted in no transmissions. This code fixes that.

Add stm32h5 fdcan chardriver to Make.defs
2025-01-07 01:05:23 +08:00
Eren Terzioglu
6eabe35a60 esp32[h2]: Fix esp32h2 get mac address issue 2025-01-07 01:03:44 +08:00
Eren Terzioglu
5e2fc181c2 tools/Unix.mk: Add host_info target to print nxdiag output
Nxdiag examples scripts  modified to print system information
without building and flashing nxdiag application to get report
about system without reflash or reconfigure.
2025-01-07 01:03:44 +08:00
hujun5
57e54b399b sched: remove all spin_lock_irqsave(NULL)
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-06 23:11:44 +08:00
hujun5
4e563e3a86 SEGGER_RTT_Conf.h: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-06 23:07:58 +08:00
hujun5
62566734a4 rp23xx_pio.c: rm spin_lock_irqsave(NULL) in arch/arm/src/rp23xx/rp23xx_pio.c
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-06 23:07:58 +08:00
hujun5
57ca4e1789 up_rtc_gettime: add spinlock to protect up_rtc_gettime
reason:
We have removed the critical section protection
for the up_rtc_gettime function in common code.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-06 23:07:58 +08:00
buxiasen
89455bc9a1 arch: up_getusrsp change to inline and implement in irq.h
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-06 23:03:05 +08:00
buxiasen
1358942132 arch/tricore: move tricore_csa2addr from internal.h to arch.h
Make up_getusrsp possible move to irq as depends on tricore_csa2addr

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-06 23:03:05 +08:00
buxiasen
7a0ea108f6 arch/arm-m: add api getpsp, for exception direct case
For exception_direct causing unwind to read NULL and breaks thread backtrace.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-06 23:03:05 +08:00
buxiasen
9bdcc4dc4b arch/irq.h: update all inline to inline_function
Inline & inline_function both used make confuze, let's modify all inline
in irq.h to inline_function, also clear the always_inline_funcion
declaration.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-06 23:03:05 +08:00
Kevin Zhou
1bc2e1a175 xtensa/esp32s3: set cpuint to initial value after deallocate 2025-01-06 22:57:14 +08:00
Yanfeng Liu
ae26129e6e stm32ldiscovery/chrono: add CONFIG_SLCD
This is to unblock CI check,
https://github.com/apache/nuttx/actions/runs/12628628318/job/35185115826

following suggestion per:
https://github.com/apache/nuttx/pull/15423#pullrequestreview-2530760373

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-06 22:11:54 +08:00
Yanfeng Liu
5f1a2696b3 board/qemu-armv7a: add board_power_off
This allows to power off qemu-armv7a target via NSH `quit` command.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-06 22:11:54 +08:00
Ritvik
3e6649856b Fix Overlap Handling in sim_copyfullstate to Prevent Undefined Behavior 2025-01-06 08:19:04 +08:00
hujun5
4d63921f0a use atomic operation for g_system_ticks
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-05 12:01:16 +08:00
wangzhi16
bbaf1ff9fd use small lock in following files:
arch/arm64/src/a64/a64_twi.c
arch/arm64/src/imx9/imx9_gpioirq.c
arch/arm64/src/imx9/imx9_lpi2c.c
arch/arm64/src/imx9/imx9_usbdev.c
arch/arm64/src/imx9/imx9_usdhc.c

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-04 22:43:20 -03:00
Tiago Medicci Serrano
7c24ef438e risc-v/qemu-rv: Initialize the userleds without late initialization
If CONFIG_BOARD_LATE_INITIALIZE is not selected, the userleds will
not be initialized. The userled initialization is not required to
be done within board_late_initialize(), thus this commit enables
initializing it in board_app_initialize() too.
2025-01-04 01:30:41 +08:00
wangmingrong1
2c5d849e01 gcov.py: Supports parsing multiple sets of gcov outputs at the same time and merging the results
Use the "-a" parameter to pass in gcda files exported by multiple devices

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-03 21:15:28 +08:00
wangmingrong1
66e074ed97 gcov: add reboot gcov storage coverage info
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-03 21:15:04 +08:00
cuiziwei
781c27a98e sim/oneshot: Remove redundant variables.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2025-01-03 21:12:41 +08:00
wangjianyu3
6020cdb816 esp32s3-devkit/adb: ADB shell service depends on SCHED_CHILD_STATUS
Log

  $ adb -s 1234 shell
  error: closed

  # BULK out
  0000   4f 50 45 4e cb 71 06 00 00 00 00 00 07 00 00 00   OPEN.q..........
  0010   52 02 00 00 b0 af ba b1                           R.......

  # BULK out
  0000   73 68 65 6c 6c 3a 00                              shell:.

  # BULK in
  0000   43 4c 53 45 00 00 00 00 cb 71 06 00 00 00 00 00   CLSE.....q......
  0010   00 00 00 00 bc b3 ac ba                           ........

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-03 21:12:20 +08:00
p-szafonimateusz
f0137d51a3 drivers/serial: simplify 16550_PCI_UARTx_CLOCK config
drivers/serial: simplify 16550_PCI_UARTx_CLOCK config

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-03 08:52:43 +08:00
p-szafonimateusz
9f93621b90 libs/libc/gdbstub/lib_gdbstub.c: fix warning
libs/libc/gdbstub/lib_gdbstub.c: fix warning

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-03 08:52:32 +08:00
p-szafonimateusz
6f9d0c97d2 libs/libc/gdbstub/lib_gdbstub.c: fix format for trap response
fix gdb crash after a few step breakpoints because trap is not correctly reported

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-03 08:52:32 +08:00
Tiago Medicci Serrano
6b1be7c66c virtio-rng: Register /dev/urandom driver if CONFIG_DEV_URANDOM=y
Virtio RNG support (CONFIG_DRIVERS_VIRTIO_RNG=y) selects
CONFIG_ARCH_HAVE_RNG. On the other hand, if CONFIG_DEV_URANDOM=y,
it defaults to CONFIG_DEV_URANDOM_ARCH if CONFIG_ARCH_HAVE_RNG=y.
DEV_URANDOM_ARCH definition states that the implementation of the
/dev/urandom should be provided by the architecture-specifig logic,
including the function devurandom_register(). In this case, the
/dev/urandom may refer to the same driver as /dev/random that is
provided by the Virtio RNG driver, which is implemented by this
commit.
2025-01-03 08:52:20 +08:00
wangzhi16
893c5e92c2 Reduce the size of tcb by four bytes.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-02 23:18:42 +08:00
Zhe Weng
3b26c6df51 net/udp: Let cansend return EWOULDBLOCK when send buffer is full
Notes:
1. This commit do the same thing as TCP did: https://github.com/apache/nuttx/pull/10627
2. UDP uses `iob_navail(false)` but TCP uses `iob_navail(true)`, this is because of a problem related to TCP recv window (https://github.com/apache/nuttx/pull/4142), so we don't need to change UDP now.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-02 23:13:39 +08:00
Yanfeng Liu
6fb12b0284 arch/qemu-armv7a: kernel mode cmake support
This allows to build kernel mode NuttX with cmake.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-02 23:13:07 +08:00
Filipe Cavalcanti
75aa80dba8 arch/xtensa: enable SPIRAM test during boot of ESP32|S3 2025-01-02 23:12:39 +08:00
p-szafonimateusz
eeef185558 arch/x86_64/include/intel64/irq.h: align definitions
align all definitions in intel64/irq.h

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-02 23:11:38 +08:00
p-szafonimateusz
cfaeb74dd3 arch/intel64: allow to attach handlers to ISR
arch/intel64: allow to attach handlers to ISR

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-01-02 23:10:14 +08:00
chenrun1
6f4f50e2fe v9fs/client.c:Use int ret as the return value to avoid uint32_t not supporting negative values
Summary:
 iModify the return variable in the v9fs_client_walk

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-02 22:34:35 +08:00
chenrun1
1f540a93d2 v9fs/client.c:add check response.nwqid == nwname
Summary:
  There are differences in different server implementations, so it is necessary to check whether the returned nwqid satisfies the requested number.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-02 22:34:35 +08:00
chenrun1
2ac2d5d511 v9fs/client.c:fix struct attach wrong parameter size
Summary:
  Change uint16_t afid -> uint32_t afid in struct v9fs_attach_s
  See: https://github.com/chaos/diod/blob/master/protocol.md

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-02 22:34:35 +08:00
chenrun1
928656f3cb v9fs/client.c:count should be assigned a value before being used
Summary:
  move request.count = buflen > fidp->iounit ? fidp->iounit : buflen
before request.header.size

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-02 22:34:35 +08:00
liwenxiang1
1fad0f1654 arch/x86_64: this_task is stored in the CPU private data
By default in SMP, obtaining this_task requires disabling interrupts, obtaining the current CPU index, accessing a global variable, and re-enabling interrupts. Storing this_task in percpu makes retrieval faster.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2025-01-02 15:19:25 +08:00
Bowen Wang
6485093277 rpproxy_virtio/rpserver_virtio: fix the compile error
1. Change the CONFIG_RPMSG_VIRTIO to CONFIG_RPMSG_VIRTIO_LITE
2. fix the error when modify the sim_rpmsg_virtio to port to
rpsmg_virtio_lite;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-12-31 18:01:47 +08:00
Huang Qi
6eb2f33278 arch/risc-v: inline up_cpu_index if RISCV_PERCPU_SCRATCH is not enabled
Inline the short function to provide better performance.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-12-31 04:02:22 -03:00
cd92e2d6e7 boards/risc-v, xtensa: Remove CONFIG_DEV_ZERO
CONFIG_DEV_ZERO is no longer needed in some defconfig files due to
- https://github.com/apache/nuttx/pull/15223

This PR removes CONFIG_DEV_ZERO from the affected defconfig files:
```bash
make distclean ; tools/refresh.sh --silent canmv230:knsh
make distclean ; tools/refresh.sh --silent canmv230:master
make distclean ; tools/refresh.sh --silent canmv230:nsbi
...
```

The failed builds above were extracted from [nuttx-prometheus-to-mastodon.json](https://lupyuen.org/articles/mastodon.html#appendix-post-nuttx-builds-to-mastodon)
2024-12-31 04:01:32 -03:00
liwenxiang1
c748047e25 arch/x86_64: The interrupt context flag is stored in the CPU private data
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-12-31 13:43:38 +08:00
zhanghongyu
f344a422e8 tcp_input: remove tcp_callback(ABORT) when accept conn recv TCP_RESET
when accept conn receives TCP_RESET, only accept conn itself should handle
the event, and there is no need to notify the listening conn. otherwise,
the server's poll will return with POLLERR and POLLHUP. this may cause
some applications to execute incorrect logic in the future.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-12-31 09:43:35 +08:00
Tiago Medicci Serrano
a4fd1b3a6a netpacket/sockaddr_ll: Add valid packet types for sll_pkttype
Add valid packet types for the sll_pkttype member of the struct
sockaddr_ll. These definitions are commonly used by third-party
libraries.
2024-12-31 09:41:39 +08:00
liwenxiang1
4612185cd6 arch/x86_64:g_current_regs is only used to determine if we are in irq,
with other functionalities removed.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-12-30 22:59:15 +08:00
ce920f9e93 arm/gd32f4: Remove extra lock from gd32f4xx_serial
An extra `lock` appears in gd32f4xx_serial due to 2 conflicting PRs:
- https://github.com/apache/nuttx/pull/7011
- https://github.com/apache/nuttx/pull/15352

This PR removes the extra `lock` in gd32f4xx_serial.
2024-12-30 22:57:10 +08:00
9b9869158a arm/imxrt: Remove extra lock from imxrt_edma
An extra `lock` appears in imxrt_edma due to 2 conflicting PRs:
- https://github.com/apache/nuttx/pull/15352
- https://github.com/apache/nuttx/pull/15353

This PR removes the extra `lock` in imxrt_edma.
2024-12-30 22:56:51 +08:00
mazhuang
60683d7495 nuttx/boards/XXX/defconfig:DEV_ZERO is not set
Signed-off-by: mazhuang <mazhuang@xiaomi.com>
2024-12-30 22:22:29 +08:00
Bowen Wang
812613fabc drivers/misc/Kconfig: change DEV_ZERO deafult to !DEFAULT_SMALL.
/dev/zero is a very commonly used config, for example use
/dev/zero to test the filesystem, mtd or block devices performance.
So let's default enable it when not enable DEFAULT_SMALL

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-12-30 22:22:29 +08:00
wangmingrong1
b27dc9ee7f mm: Unified memory management alignment length
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-30 19:49:00 +08:00
Gao Feng
da845163a3 xtensa/esp32: add lock for async operation work
g_work as singleton can be changed by context switching,
but previous one async operation have not finished yet.

adapt based on: 10a1d17a85
2024-12-30 18:14:32 +08:00
Ludovic Vanasse
c55c2511ad Doc: improve and add documentations for the guide section of the wiki
* Add a migration warning to the update release system and the elf
programs documentation pages. This is just to add a papertrail from
where the documentation originate in case of error during the migration
process.
* Improve the building nuttx with app out of source tree
* Add new guide pages
	* Building uclibc++
	* Custom app directories
	* Debugging ELF loadable modules
	* Multiple NSH sessions
	* NSH network link management
	* RAM & ROM disks
	* Reading CAN messages
	* Remove device drivers with NSH
2024-12-30 12:32:42 +08:00
chao an
dc82a296f7 libc/semaphore: remove unused hander file
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-30 12:02:34 +08:00
chao an
27a03b8278 sched/semaphore: tick wait 0 timeout should be safe in interrupt context
1. remove up_interrupt_context() check, which should be safe in interrupt context
2. remove sem instance check will be handle in nxsem_trywait()

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-30 12:02:34 +08:00
YAMAMOTO Takashi
a393f7fbd3 littlefs: fix EINVAL on path operations with littlefs 2.10.0
littlefs 2.10.0 and later rejects empty paths.  use "/" instead.

tested with esp32s3-devkit:toywasm.
2024-12-29 20:43:33 -03:00
Ludovic Vanasse
b02a0758a7 Doc: add migration warning to updating release system and elf programs
Add a migration warning to the update release system and the elf
programs documentation pages. This is just to add a papertrail from
where the documentation originate in case of error during the migration
process. Also fix a bit of formatting in the pages
2024-12-29 23:40:57 +08:00
Ludovic Vanasse
04c7391162 Doc: loading ELF program
Migrate the Updating a release System with ELF programs with child pages
to official wiki
2024-12-29 14:23:27 +08:00
Bowen Wang
f0a3c43a54 rpmsg/rpmsg_virtio_lite: rename rpmsg_virtio to rpmsg_virtio_lite
Because rpmsg_virtio_lite is a better name to inform user that the
rpmsg virtio (original name) is a lite implementation of rpmsg virtio.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-12-28 22:43:20 -03:00
Alin Jerpelea
db1ebe0095 Documentation: add NuttX-12.8.0 release notes
Add release notes for 12.8.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-28 23:03:40 +08:00
Alin Jerpelea
48f80bf41e Documentation: add NuttX-12.7.0 release notes
Add release notes for 12.7.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-28 23:03:40 +08:00
Kyle Wilson
1cfab89e65 Added incomplete octospi hardware defintions.
Register addresses are defined. Bit defintions are still needed.

Bitmaps for OCTOSPI peripheral register

Incremental updates to qspi files

Redefined QSPI/OCTOSPI registers for STM32H5

Fixed register definitions for the STM32H5. However, more work still needs to be done. Some bits that shared registers on the STM32H7 have different register locations on the H5. This still needs to be accounted for.

Fixed more differences vs STM32H7 qspi

Added ifdef for including stm32_dma.h in stm32_qspi.c. Added stm32_qspi.c to Make.defs.

Register fixes. SPI activity but not able to format device yet.

Fixed DCYC mask

Set HCLK frequency to correct value. Undid ccrconfig debug.

Tested Interrupt Mode (single SPI). Added alternate bytes to meminfo and cmdinfo structures. Updated Kconfig variables for STM32H5.

Fixed base register in hardware/stm32_qspi.h. Updated qspi_dumpregs.

The base register was previously set to STM32_QUADSPI_BASE, changed to the correctly named STM32_OCTOSPI1_BASE. However, these defines for the OCTOSPI registers are not even used. Instead qspi_putreg and qspi_getreg utilize the priv->base value to access OCTOSPI registers.

Removed altbytes code, left as before. Moved QSPI clock selection to stm32h5xx_rcc.c

Changed STM32H5_QUADSPI to STM32H5_QSPI1

Added hook to define QSPI_CLK_FREQUENCY as STM32_QSPI_FREQUENCY from board.h

Removed changes to nuttx qspi.h

style fixes
2024-12-28 11:46:49 +08:00
zhangyuan29
ca4fd09275 arch_atomic: change atomic_fetch_x interface to inline function
When CONFIG_LIBC_ARCH_ATOMIC is defined, the atomic_fetch_x
interface conflicts with the atomic_fetch_x interface in libcxx.
Therefore, it has been changed to a inline function.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-28 11:46:04 +08:00
hujun5
4627a087f0 fix compile error
chip/efm32_leserial.c: In function 'efm32_restoreuartint':
Error: chip/efm32_leserial.c:329:37: error: 'len' undeclared (first use in this function); did you mean 'ien'?
  329 |   efm32_restoreuartint_nolock(priv, len);
      |                                     ^~~
      |                                     ien

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-28 11:42:59 +08:00
Kyle Wilson
96fa400c3d Fixed errors in CI build tests for pull request #15351
There were two simple errors when running ci tests on pull #15351. These errors were unrelated to that pull. After investigating I found two simple errors. 1. The len variable was likely a typo that should have been the function argument, ien. 2. The spinlock_t lock was defined in a section dependent on CONFIG_SERIAL_TERMIOS. However, the spinlock_t lock was used in code that did not require the SERIAL_TERMIOS config. Therefore errors resulted.

imxrt_edma_s missing lock variable

CI build tests noted that the variable g_edma was referencing a lock variable that did not exist in the structure. This change adds that missing lock as a spinlock_t type.

Remove unused flags variable from imxrt_dmach_stop

Removed extra =
2024-12-28 11:14:42 +08:00
Matteo Golin
b15cd35bb0 docs/porting: Create a porting guide for the BCM2711 and organize porting case studies into their own directory. 2024-12-27 21:50:19 -03:00
Ville Juven
e19e1a8532 nxsem_destroyholder: Use critical section when destroying holder(s)
Otherwise the free holder list will leak, causing either a crash due to
holder->htcb = NULL, or the free holder list becomes (erroneously) empty
even though most of the holder entries are free.
2024-12-27 00:28:34 +08:00
chenxiaoyi
ad8902a33e esp32[|s2|s3]: adapt to new syscall implementation
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2024-12-27 00:25:55 +08:00
chenxiaoyi
aa426d1edb xtensa: change write intset register to syscall instruction
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2024-12-27 00:25:55 +08:00
chenxiaoyi
1757ecc5c1 xtensa: add backtrace link from syscall exception
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2024-12-27 00:25:55 +08:00
Peter van der Perk
430c79ff89 imxrt: FlexSPI allow RWW 2024-12-27 00:16:47 +08:00
hujun5
2886fddc0f arm64: fix tpidr maybe null
Before the MPU initialization, the up_update_task(this_cpu()) function is called at a time when hardware cache coherency is not yet enabled.
In certain critical scenarios, Core 1 reads a zero value for tcb from the global variable g_assignedtask and stores this zero value into the tpidr
register. This results in subsequent interrupt handlers reading a zero tcb, causing an exception.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-27 00:16:35 +08:00
Jorge Guzman
d4acd6949f stm32h7/linum-stm32h753bi: fix fdcan configuration
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-12-27 00:14:39 +08:00
wangjianyu3
3093b28860 drivers/sensors/gnss: Fix deactivate failure when using both topic and device
Deactivate lower driver fails when both uORB topic and driver device are subscribed and opened.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-27 00:13:47 +08:00
hujun5
c0f7dd979e fix compile error
CC:  pthread/pthread_exit.c common/espressif/esp_lowputc.c: In function 'esp_lowputc_disable_all_uart_int':
common/espressif/esp_lowputc.c:215:29: error: passing argument 1 of 'spin_lock_irqsave' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  215 |   flags = spin_lock_irqsave(&priv->lock);
      |                             ^~~~~~~~~~~
In file included from common/espressif/esp_lowputc.c:40:
/home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:511:55: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned int *'} but argument is of type 'const spinlock_t *' {aka 'const unsigned int *'}
  511 | irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~
common/espressif/esp_lowputc.c:232:26: error: passing argument 1 of 'spin_unlock_irqrestore' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  232 |   spin_unlock_irqrestore(&priv->lock, flags);
      |                          ^~~~~~~~~~~
/home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:674:54: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned int *'} but argument is of type 'const spinlock_t *' {aka 'const unsigned int *'}
  674 | void spin_unlock_irqrestore(FAR volatile spinlock_t *lock,

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-26 23:43:49 +08:00
yangsen5
15c1c9d42e sim_alsa: set paused to false when executing close
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2024-12-26 23:31:55 +08:00
zhanghongyu
05f7b7ac97 include/netinet/arp.h: change the type of arp_dev from uint8_t to char
the same variable type in linux is char, in order to avoid modifying
the third-party library code when porting the third-party library code.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-12-26 23:29:23 +08:00
chao an
54e85075c4 sched/event: init deleted node to avoid null pointer reference
nxevent_tickwait() will remove the node in failure case(EINTR). If the node
has been deleted in the nxevent_post(), NULL pointer reference will
be triggered after semaphore wait.

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-26 23:28:37 +08:00
wangmingrong1
500d193096 drivers/e1000: malloc size error
priv->mta is uint32_t

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-26 23:26:18 +08:00
zhangshoukui
ebf1ab5392 lib_get_pathbuffer: Modify size to the maximum value of PATH_MAX and CONFIG_LINE_MAX
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-26 13:25:19 +08:00
zhangshoukui
f8377f8666 Add LINE_MAX configuration
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-26 13:25:19 +08:00
wangjianyu3
c6c89ac262 Thermal/step_wise: Fix that hysteresis takes no effect
Test command

  nsh> cat /proc/thermal/cpu-thermal

Trips

  /* Copy from drivers/thermal/thermal_dummy.c */

  {.name = "cpu_crit",   .temp = 90, .hyst = 5, .type = THERMAL_CRITICAL},
  {.name = "cpu_alert1", .temp = 70, .hyst = 5, .type = THERMAL_HOT},
  {.name = "cpu_alert0", .temp = 60, .hyst = 5, .type = THERMAL_NORMAL},

Without this patch

  # Error occured when temperature jump to 69.

  z:cpu-thermal t:67 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:72 t:1 h:16 l:0 c:fan0 s:1|1
  z:cpu-thermal t:69 t:1 h:16 l:0 c:fan0 s:0|0
  z:cpu-thermal t:74 t:1 h:16 l:0 c:fan0 s:1|1

With this patch

  z:cpu-thermal t:67 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:72 t:1 h:16 l:0 c:fan0 s:1|1
  z:cpu-thermal t:69 t:1 h:16 l:0 c:fan0 s:1|1
  z:cpu-thermal t:74 t:1 h:16 l:0 c:fan0 s:2|2

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-26 09:23:10 +08:00
wangjianyu3
9899acf20b sim:thermal: Enable command line history
Make it easier to debug.
e.g. execute some commands frequently, like:
  cat /proc/thermal/cpu-thermal

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-26 09:23:10 +08:00
wangjianyu3
975eddaac5 Thermal/procfs: Do not print invalid target cooling state directly
Diff
  - z:cpu-thermal t:48 t:1 h:16 l:0 c:fan0 s:0|4294967295
  + z:cpu-thermal t:48 t:1 h:16 l:0 c:fan0 s:0|(invalid)

The invalid value 4294967295(THERMAL_NO_TARGET, defined as UINT_MAX(0xffffffff)) may bother users.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-26 09:23:10 +08:00
wangjianyu3
e06ff62063 Thermal/dummy: Add temperature jump to test hysteresis
Log

  z:cpu-thermal t:50 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:47 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:52 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:49 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:54 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:51 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:56 t:1 h:16 l:0 c:fan0 s:0|(invalid)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-26 09:23:10 +08:00
wangjianyu3
8c5a61d93c Thermal: The thermal core depends on LPWORK
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-26 09:23:10 +08:00
wangjianyu3
77630ea6d9 sim:thermal: The thermal core depends on LPWORK
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-26 09:23:10 +08:00
wangjianyu3
3ea7796ef2 sim:thermal: The sim:thermal is based on sim:nsh
Coverting to including sim:nsh.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-26 09:23:10 +08:00
yangsen5
94c0f71db9 v4l2m2m: modify return value of g_bufsize to uint32_t
CID 1578530: (#1 of 1): INTEGER_OVERFLOW

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2024-12-25 17:06:48 +08:00
Zhe Weng
286de7df01 netdev/upper: Fix wrong CPU when RSS is disabled
When `CONFIG_NETDEV_RSS` is disabled, `NETDEV_THREAD_COUNT` will be 1,
and we should not access `upper->sem[cpu]` with `cpu > 0`.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-12-25 15:58:42 +08:00
hujun5
233e175f28 fix a deadlock
0  up_testset (lock=0x404241c0 <g_uart1priv+32>) at /home/hujun5/下载/vela_sim/nuttx/include/arch/spinlock.h:96
1  spin_lock_wo_note (lock=<optimized out>) at /home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:207
2  spin_lock_irqsave_wo_note (lock=0x404241c0 <g_uart1priv+32>) at /home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:467
3  spin_lock_irqsave (lock=0x404241c0 <g_uart1priv+32>) at /home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:521
4  pl011_txint (dev=0x404240b0 <g_uart1port>, enable=false) at serial/uart_pl011.c:746
5  0x00000000402a3f1c in uart_xmitchars (dev=0x404240b0 <g_uart1port>) at serial/serial_io.c:118
6  0x00000000402a10f8 in pl011_txint (dev=<optimized out>, enable=<optimized out>) at serial/uart_pl011.c:756
7  0x00000000402a2ca0 in uart_write (filep=<optimized out>, buffer=<optimized out>, buflen=0) at serial/serial.c:1493
8  0x000000004028c464 in file_writev_compat (filep=0x4046cda0, uio=<optimized out>) at vfs/fs_write.c:81
9  0x000000004028c588 in file_writev (filep=<optimized out>, uio=uio@entry=0x40470dc0) at vfs/fs_write.c:161
10 0x000000004028c5fc in nx_writev (fd=<optimized out>, iov=iov@entry=0x40470e10, iovcnt=iovcnt@entry=1) at vfs/fs_write.c:257
11 0x000000004028c660 in writev (fd=<optimized out>, iov=iov@entry=0x40470e10, iovcnt=iovcnt@entry=1) at vfs/fs_write.c:356
12 0x000000004028c6dc in write (fd=<optimized out>, buf=buf@entry=0x404090b2 <g_nshgreeting>, nbytes=<optimized out>) at vfs/fs_write.c:421
13 0x00000000402adb10 in nsh_session (pstate=pstate@entry=0x40471080, login=login@entry=1, argc=argc@entry=1, argv=argv@entry=0x4046cf40) at nsh_session.c:108
14 0x00000000402ad94c in nsh_consolemain (argc=argc@entry=1, argv=argv@entry=0x4046cf40) at nsh_consolemain.c:75
15 0x00000000402ad894 in nsh_main (argc=argc@entry=1, argv=argv@entry=0x4046cf40) at nsh_main.c:74
16 0x00000000402a5880 in nxtask_startup (entrypt=0x402ad7fc <nsh_main>, argc=1, argv=0x4046cf40) at sched/task_startup.c:72
17 0x000000004029d444 in nxtask_start () at task/task_start.c:116
18 0x0000000000000000 in ?? ()

fix regresion from https://github.com/apache/nuttx/pull/15301

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-25 04:22:49 -03:00
YAMAMOTO Takashi
c0c04cf6ba bump littlefs to 2.10.1 where 2.10.0 was used
2.10.1 contains a fix for a long-standing wrong-data issue.
https://github.com/littlefs-project/littlefs/pull/1058
2024-12-25 03:40:43 -03:00
YAMAMOTO Takashi
958e30b3e2 Add some clarification comments on the mutex api 2024-12-25 11:11:41 +08:00
Laczen JMS
28937fed4d Documentation: add (nim)ble on esp32c3
Modify documentation of esp32c3 and add nimble section to
esp32c3-generic.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2024-12-25 11:09:38 +08:00
Laczen JMS
57bdeb86d4 boards: add nimble defconfig to esp32c3-generic
Add a configuration for ble using nimble on esp32c3-generic

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2024-12-25 11:09:38 +08:00
Henry Rovner
923dc37a3b risc-v/bl808: Add I2C driver
This change implements a driver with support for all four I2C blocks on the BL808.
2024-12-25 11:03:26 +08:00
41c0fc01b9 risc-v/rv-virt: Remove SCANFTEST from rv-virt:citest
`CONFIG_TESTING_SCANFTEST` is no longer needed in `rv-virt:citest` defconfig because of https://github.com/apache/nuttx-apps/pull/2914

This PR excludes `CONFIG_TESTING_SCANFTEST` from `rv-virt:citest` so that CI Job `risc-v-05` will complete successfully.
2024-12-25 02:32:33 +08:00
Javier Alonso
4ada30b8f7 Revert "[POSIX][Bug] syslog: Add support for %m modifier"
This reverts commit badb5c5ac6.
2024-12-24 11:02:04 -05:00
wangmingrong1
e3a733ae96 libc/machine: fix config error
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-24 21:18:12 +08:00
Filipe Cavalcanti
293a87a5e1 boards/xtensa/esp32s3: increase stack size of buttons defconfig 2024-12-24 10:49:39 +08:00
Filipe Cavalcanti
acd0031362 boards/xtensa/esp32s3: set 16MB flash on qemu_debug defconfig 2024-12-24 10:49:39 +08:00
Filipe Cavalcanti
1ae7efd388 tools/espressif: add fill-flash-size to build if MERGEBIN selected 2024-12-24 10:49:39 +08:00
Zhe Weng
84d261e3be net: Optimize ipfwd and wrbuffer by buffer pool
To allow dynamic allocation of these structs, performance keeps the same
as the previous implementation.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-12-23 16:57:19 -03:00
Zhe Weng
1fe07d0838 net: Add buffer pool to replace connection allocation
Our net socket connection allocations are powerful but redundant
because they're implemented once in each protocol.  This is not good for
further optimizing and extending to other allocations, so maybe we can
add a common implementation for the usage.

Impact:
1. We add a `struct net_bufpool_s` as pool descriptor, which may use a
   little bit more memory than previous implementation (~28Bytes).
2. We share same functions between pools, so code size may shrink under
   some scenarios.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-12-23 16:57:19 -03:00
Javier Alonso
badb5c5ac6 [POSIX][Bug] syslog: Add support for %m modifier
The POSIX standard states that the `syslog()` function generates
the body from the message and arguments the same way as `printf()`,

> except that the additional conversion specification `%m` shall be
> recognized;

*https://pubs.opengroup.org/onlinepubs/009695399/functions/syslog.html*

What most of the implementations do is to leverage the processing to
`vsprintf` internals, to reduce code duplicity. This means the `%m`
modifier is present on almost all `printf` implementations. Take
the following code snippet as an example: https://onlinegdb.com/YdR9pU6KS.

Therefore, for `syslog` to support such a specification, the underlying
library shall be updated to support it too.
2024-12-23 16:54:41 -03:00
hujun5
50fd02c789 use small lock in following files:
arch/arm/src/kinetis/kinetis_serial.c
arch/arm/src/kl/kl_serial.c
arch/arm/src/lc823450/lc823450_irq.c
arch/arm/src/lc823450/lc823450_syscontrol.c
arch/arm/src/lpc54xx/lpc54_serial.c
arch/arm/src/max326xx/max32660/max32660_dma.c
arch/arm/src/max326xx/max32660/max32660_gpio.c
arch/arm/src/max326xx/max32660/max32660_lowputc.c
arch/arm/src/max326xx/max32660/max32660_serial.c
arch/arm/src/mx8mp/mx8mp_serial.c
arch/arm/src/nrf52/nrf52_gpio.c
arch/arm/src/nrf53/nrf53_gpio.c
arch/arm/src/nrf91/nrf91_gpio.c
arch/arm/src/rp2040/rp2040_uart.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 23:02:26 +08:00
hujun5
9aa5eda649 use small lock in following file
arch/arm/src/efm32/efm32_leserial.c
arch/arm/src/efm32/efm32_serial.c
arch/arm/src/gd32f4/gd32f4xx_serial.c
arch/arm/src/imx9/imx9_edma.c
arch/arm/src/imxrt/imxrt_edma.c
arch/arm/src/imxrt/imxrt_hprtc.c
arch/arm/src/kinetis/kinetis_lpserial.c
arch/arm/src/lc823450/lc823450_gpio.c
arch/arm/src/s32k1xx/s32k1xx_edma.c
arch/arm/src/s32k3xx/s32k3xx_edma.c
arch/arm64/src/imx9/imx9_edma.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 23:01:01 +08:00
hujun5
b66c1b94ce use small lock in following files:
arch/arm/src/rp2040/rp2040_usbdev.c
arch/arm/src/rp23xx/rp23xx_uart.c
arch/arm/src/s32k1xx/s32k1xx_enet.c
arch/arm/src/sam34/sam_lowputc.c
arch/arm/src/sama5/sam_lowputc.c
arch/arm/src/samd2l2/sam_serial.c
arch/arm/src/samd5e5/sam_serial.c
arch/arm/src/samv7/sam_lowputc.c
arch/arm/src/stm32/stm32_hciuart.c
arch/arm/src/stm32/stm32_qencoder.c
arch/arm/src/stm32/stm32_serial.c
arch/arm/src/stm32f0l0g0/stm32_serial_v1.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 22:56:43 +08:00
hujun5
c96b8cdfdd use small lock in following files:
arch/arm/src/stm32f0l0g0/stm32_serial_v2.c
arch/arm/src/stm32f7/stm32_qencoder.c
arch/arm/src/stm32f7/stm32_serial.c
arch/arm/src/stm32h5/stm32_serial.c
arch/arm/src/stm32h7/stm32_qencoder.c
arch/arm/src/stm32h7/stm32_serial.c
arch/arm/src/stm32l4/stm32l4_qencoder.c
arch/arm/src/stm32l4/stm32l4_serial.c
arch/arm/src/stm32l5/stm32l5_serial.c
arch/arm/src/stm32u5/stm32_serial.c
arch/arm/src/stm32wb/stm32wb_serial.c
arch/arm/src/stm32wl5/stm32wl5_serial.c
arch/arm/src/tiva/cc13xx/cc13xx_enablepwr.c
arch/risc-v/src/rv32m1/rv32m1_serial.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 22:53:19 +08:00
hujun5
798695a4f7 use small lock in following files:
arch/arm/src/tiva/common/tiva_hciuart.c
arch/arm/src/tms570/tms570_lowputc.c
arch/arm/src/xmc4/xmc4_serial.c
arch/arm64/src/a64/a64_serial.c
arch/mips/src/pic32mx/pic32mx_serial.c
arch/mips/src/pic32mz/pic32mz_serial.c
arch/risc-v/src/c906/c906_serial.c
arch/risc-v/src/fe310/fe310_serial.c
arch/risc-v/src/hpm6750/hpm6750_serial.c
arch/risc-v/src/k210/k210_serial.c
arch/sparc/src/bm3803/bm3803-serial.c
arch/sparc/src/bm3823/bm3823-serial.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 22:48:35 +08:00
Jorge Guzman
4d7be17d40 stm32h7/linum-stm32h753bi: add tone support
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-12-23 22:45:01 +08:00
liqinhui
88a300d2e6 net: Remove the DEBUGASSERT of the same event of the same fd in tcp_pollsetup.
In libuv, if the real_timeout in the uv__io_poll is less than 0, the poll logic will be entered directly by the uv__run_timers, which will trigger the ASSERT.
It seems that the situation of first epoll and then poll for the same fd is used in libuv.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-12-23 19:41:13 +08:00
hujun5
46c2d46a6b use small lock in:
arch/arm/src/imxrt/imxrt_wdog.c
arch/arm/src/kinetis/kinetis_edma.c
arch/arm/src/lc823450/lc823450_dvfs2.c
arch/arm/src/lc823450/lc823450_timer.c
arch/arm/src/lpc54xx/lpc54_lowputc.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 15:01:08 +08:00
wangmingrong1
b3813bd450 gcov: Solve the problem of incorrect report generation caused by different compilation and test environments
Due to the makefile, the relative paths of the files are different, and
it is impossible to use existing tools such as gcov and lcov to specify
a base compilation path for them.
The solution for Linux is to copy a copy of the source code from
the compilation environment to the test environment,
and there is a place that is consistent with the absolute
path of the compilation environment.
This solution is to pass in the "-b" parameter to directly
modify the info file generated by lcov. The search path will be
executed in the next step of genhtml

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-23 14:53:58 +08:00
Matteo Golin
1cbb7183ad wireless/ieee82011: Used definitions from existing NuttX includes where possible, and otherwise defined macros using built-ins to allow the 802.11 header to compile on Arch Linux where cpu_to_le16, le32_to_cpu and hweight8 definitions were missing. 2024-12-23 14:50:13 +08:00
hujun5
eb587d72e0 fix compile error
Configuration/Tool: esp32s2-kaluga-1/audio
Error: chip/esp32s2_lowputc.c:102:22: error: expected '}' before ';' token
  102 |   .lock = SP_UNLOCKED;
      |                      ^
chip/esp32s2_lowputc.c:62:1: note: to match this '{'
   62 | {

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 14:48:35 +08:00
wangchen
8ea31668ca tcp_recvfrom.c:malloc a new iob to handle psock_send_eventhandler when tcp_recvhandler calls tcp_newdata to clear dev->d_iob
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-12-22 19:26:04 +08:00
hujun5
97eef351dc use small lock in following file
arch/or1k/src/mor1kx/mor1kx_serial.c
arch/risc-v/src/bl602/bl602_serial.c
arch/risc-v/src/common/espressif/esp_lowputc.c
arch/risc-v/src/common/espressif/esp_lowputc.h
arch/risc-v/src/common/espressif/esp_tickless.c
arch/risc-v/src/esp32c3-legacy/esp32c3_idle.c
arch/risc-v/src/esp32c3-legacy/esp32c3_lowputc.c
arch/risc-v/src/esp32c3-legacy/esp32c3_lowputc.h
arch/risc-v/src/esp32c3-legacy/esp32c3_rtc_lowerhalf.c
arch/risc-v/src/fe310/fe310_gpio.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-22 18:59:44 +08:00
Kyle Wilson
d59b8f25b8 Added hardware defines for stm32h5_qspi driver and octospi GPIOs (used by stm32h5_qspi driver).
Fixed comments and indent

Add commit log to OCTOSPI HW PR

Summary

hardware/stm32_qspi.h - Defines for the STM32H5 QSPI driver. The peripheral on the STM32H5 is actually an OCTOSPI peripheral, however it was decided to use it as a QSPI peripheral for the following reasons:

    There is currently support for QSPI within Nuttx.
    The STM32H7 QSPI register set is very similar to the STM32H5 OCTOSPI register set and the STM32H7 series has an existing QSPI driver.
    OCTOSPI devices are rare as of now and are not part of our use case.

hardware/stm32h56xxx_pinmap.h - Added pin mappings for OCTOSPI GPIOs.
Impact

This change will not impact any architectures outside of the STM32H5 series. Even for the STM32H5 series, these changes will only have an impact if they are utilized.
Testing

No testing yet for these files other than ensuring that we can still build Nuttx. Further testing will be documented in a future pull request when the STM32H5 QSPI driver is added.
2024-12-22 18:54:18 +08:00
hujun5
f25e3d2324 use small lock in following files
arch/risc-v/src/litex/litex_emac.c
arch/risc-v/src/mpfs/mpfs_coremmc.c
arch/risc-v/src/mpfs/mpfs_usb.c
arch/xtensa/src/esp32/esp32_idle.c
arch/xtensa/src/esp32/esp32_rtc_lowerhalf.c
arch/xtensa/src/esp32s2/esp32s2_idle.c
arch/xtensa/src/esp32s2/esp32s2_lowputc.c
arch/xtensa/src/esp32s2/esp32s2_lowputc.h
arch/xtensa/src/esp32s2/esp32s2_rtc_lowerhalf.c
arch/xtensa/src/esp32s3/esp32s3_idle.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-22 18:53:15 +08:00
Alan Carvalho de Assis
2d062a9529 drivers/sensors: Add support to Renesas FS3000 Air Velocity Flow
This driver add uORB sensor support to Renesas FS3000 sensor.

Thanks Xiang Xiao for review and suggestions.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-12-22 18:49:50 +08:00
hujun5
8411a97b85 use small lock in following files
arch/xtensa/src/esp32s3/esp32s3_rtc_lowerhalf.c
arch/z16/src/z16f/z16f_serial.c
arch/z80/src/z8/z8_serial.c
boards/arm/max326xx/max32660-evsys/src/max326_button.c
boards/arm/stm32/stm32f4discovery/src/stm32_gs2200m.c
drivers/i2c/i2c_bitbang.c
drivers/power/supply/act8945a.c
drivers/serial/uart_pci_16550.c
drivers/serial/uart_pl011.c
drivers/wireless/bluetooth/bt_uart_shim.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-22 18:43:26 +08:00
Jorge Guzman
e55966d3dc arm/stm32h753bi: Add support to lvgl
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-12-22 05:44:14 -03:00
wangmingrong1
e26e8bda0e gcov: gcov.py, gcov_convert.py scripts merged
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-21 20:49:37 +08:00
wangmingrong1
7d6b2e4804 gcov/script: gcov.sh is implemented using Python
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-21 20:49:37 +08:00
Tiago Medicci Serrano
7548db1980 arch/xtensa: Support __thread and thread_local keywords
Enable architecture-specific support for those keywords. This is a
"gcc-based" thread local storage implementation.
2024-12-21 20:49:07 +08:00
1176 changed files with 29852 additions and 6759 deletions

View file

@ -173,21 +173,14 @@ jobs:
# If Not a Simple PR: Build all targets
if [[ "$quit" == "1" ]]; then
# If PR was Created or Modified: Exclude some boards
# If PR was Created or Modified: Include all boards
pr=${{github.event.pull_request.number}}
if [[ "$pr" != "" ]]; then
echo "Excluding arm-0[1249], arm-1[124-9], risc-v-04..06, sim-03, xtensa-02"
echo "Include all boards"
boards=$(
echo '${{ inputs.boards }}' |
jq --compact-output \
'map(
select(
test("arm-0[1249]") == false and test("arm-1[124-9]") == false and
test("risc-v-0[4-9]") == false and
test("sim-0[3-9]") == false and
test("xtensa-0[2-9]") == false
)
)'
'.'
)
fi
echo "selected_builds=$boards" | tee -a $GITHUB_OUTPUT

View file

@ -87,7 +87,7 @@ find_program(KCONFIGLIB olddefconfig)
if(NOT KCONFIGLIB)
message(
FATAL_ERROR "Kconfig environment depends on kconfiglib, Please install:
$ sudo apt install python3-kconfiglib")
$ sudo pip3 install kconfiglib")
endif()
# BOARD CONFIG can be set to directory path, or <board-name>[/:]<config-name>
@ -727,6 +727,7 @@ else()
OUTPUT nuttx.rel
COMMAND
${CMAKE_C_COMPILER} ARGS -r $<$<BOOL:${CONFIG_SIM_M32}>:-m32>
$<$<BOOL:${CONFIG_HOST_LINUX}>:-Wl,-z,noexecstack>
$<TARGET_OBJECTS:sim_head> $<$<NOT:$<BOOL:${APPLE}>>:-Wl,--start-group>
${nuttx_libs_paths} $<$<NOT:$<BOOL:${APPLE}>>:-Wl,--end-group> -o
nuttx.rel

View file

@ -0,0 +1,771 @@
NuttX-12.7.0
------------
What's New In This Release
Core OS
Sched
* [#13395](https://github.com/apache/nuttx/pull/13395) Critmon optimize, make possible open cpuload based on critmon and disable critical section & sched_lock to save cost.
* [#12691](https://github.com/apache/nuttx/pull/12691) sched.h: add SCHED_BATCH and SCHED_IDLE definition
* [#12584](https://github.com/apache/nuttx/pull/12584) sched.h: CPU_XXX macros can also be used without CONFIG_SMP
* [#12703](https://github.com/apache/nuttx/pull/12703) sched.h: Update doc link for tcbinfo_s
* [#13274](https://github.com/apache/nuttx/pull/13274) sched: add DEBUGASSERT to assure that affinity not zero
* [#13341](https://github.com/apache/nuttx/pull/13341) sched: adjust the scheduling strategy
* [#13105](https://github.com/apache/nuttx/pull/13105) sched: change pthread_mutex implementation from sem to mutex
* [#12742](https://github.com/apache/nuttx/pull/12742) sched: Improve Kconfig help of INIT_ENTRYPOINT
* [#13525](https://github.com/apache/nuttx/pull/13525) sched: move DUMP_ON_EXIT to sched
* [#13211](https://github.com/apache/nuttx/pull/13211) sched: replace up_cpu_index with this_cpu
* [#13271](https://github.com/apache/nuttx/pull/13271) sched: use this_task replace nxsched_self
* [#13263](https://github.com/apache/nuttx/pull/13263) sched/event: clear pending events before enable the scheduler
* [#13329](https://github.com/apache/nuttx/pull/13329) sched/group/setuptask_file: duplicate idle task fd for kernel thread
* [#13083](https://github.com/apache/nuttx/pull/13083) sched/irq: correct critical section to spin lock
* [#12802](https://github.com/apache/nuttx/pull/12802) sched/nxevent: add support of kernel event group
* [#13264](https://github.com/apache/nuttx/pull/13264) sched/policy: move g_policy from data to rodata
* [#13017](https://github.com/apache/nuttx/pull/13017) sched/sched: simplify the implementation of the function nxsched_readytorun_setpriority
* [#13134](https://github.com/apache/nuttx/pull/13134) sched/signal: fix pthread_kill use after free
* [#13530](https://github.com/apache/nuttx/pull/13530) sched/signal: Simplified Implementation for SIGEV_THREAD_TID
* [#12283](https://github.com/apache/nuttx/pull/12283) sched/signal: There is no need to use sched_[un]lock
* [#12553](https://github.com/apache/nuttx/pull/12553) sched/tcb: amend pull/12320
MM
* [#12550](https://github.com/apache/nuttx/pull/12550) mm: add mm_initialize_pool, make pool more flexible
* [#12556](https://github.com/apache/nuttx/pull/12556) mm: mm_threshold perfer from init
* [#12501](https://github.com/apache/nuttx/pull/12501) mm/iob: Simplify IOB alloc/free logic
* [#12923](https://github.com/apache/nuttx/pull/12923) mm/map/vm_region.c: Fix usage of void* arithmetics
* [#12946](https://github.com/apache/nuttx/pull/12946) mm/mempool: rename the mempool_alloc and mempool_free function
* [#12659](https://github.com/apache/nuttx/pull/12659) mm_ubsan: add dummy to bypass runtime actions
* [#12646](https://github.com/apache/nuttx/pull/12646) mm_ubsan: add implement for dynamic_type_cache_miss
libc
* [#12672](https://github.com/apache/nuttx/pull/12672) add rint and expm1 function to cmath from libm
* [#13420](https://github.com/apache/nuttx/pull/13420) Add dummy implementations for `shm_open` `pthread_setaffinity_np` and `RLIMIT_RTPRIO`
* [#13429](https://github.com/apache/nuttx/pull/13429) arm64_task/pthread_start: Convert the C / inline ASM code to assembly
* [#13366](https://github.com/apache/nuttx/pull/13366) arm64/task/pthread_start: Fix rare issue with context register location
* [#13011](https://github.com/apache/nuttx/pull/13011) lib_getcwd:Fix the Name in the function description.
* [#12966](https://github.com/apache/nuttx/pull/12966) lib_remove:Repair the logical judgment
* [#12890](https://github.com/apache/nuttx/pull/12890) libc: Add macro restrictions to code that uses floating point numbers
* [#13111](https://github.com/apache/nuttx/pull/13111) libc: compile stackchk function by default
* [#12953](https://github.com/apache/nuttx/pull/12953) libs: fix the default value of process-shared attribute
* [#12975](https://github.com/apache/nuttx/pull/12975) libs: fix the default value of process-shared attribute
* [#12605](https://github.com/apache/nuttx/pull/12605) libc: scanf, printf %z change switch const to if
* [#12585](https://github.com/apache/nuttx/pull/12585) libc/execinfo: extract a common backtrace format function
* [#13013](https://github.com/apache/nuttx/pull/13013) libc/msic: Implement get_nprocs API
* [#13381](https://github.com/apache/nuttx/pull/13381) libc/misc/crc32: crc32 add slow mode, optional decrease size
* [#13441](https://github.com/apache/nuttx/pull/13441) libc/netdb: Remove unnecessary CONFIG_LIBC_NETDB checks
* [#13025](https://github.com/apache/nuttx/pull/13025) libc/netdb: Separate IPv4 and IPv6 cache size limit
* [#13220](https://github.com/apache/nuttx/pull/13220) libc/sysconf: add _SC_GETPW_R_SIZE_MAX
* [#13479](https://github.com/apache/nuttx/pull/13479) libc/time: add g_lcl_lock to protect local context in localsub
* [#13080](https://github.com/apache/nuttx/pull/13080) libc/time: remove lib_strptime
* [#12693](https://github.com/apache/nuttx/pull/12693) libc/unistd: added an implementation of the lib_flock function
* [#12609](https://github.com/apache/nuttx/pull/12609) libc/x86_64: port string functions from bionic
* [#13110](https://github.com/apache/nuttx/pull/13110) libcxxabi: libcxxabi enables exceptions by default
* [#13079](https://github.com/apache/nuttx/pull/13079) libs/libc/obstack: correctly append null byte at the end of string
* [#13482](https://github.com/apache/nuttx/pull/13482) libs/libc/obstack: implement ptr and int growing functions
* [#13495](https://github.com/apache/nuttx/pull/13495) libs/libc/obstack: revert invalid null byte append to obstack_vprintf
* [#13185](https://github.com/apache/nuttx/pull/13185) libs/libc/stdio/*printf *scanf:Add string serialization and deserialization functions
* [#13294](https://github.com/apache/nuttx/pull/13294) libs/libm: fix epsilon relaxation in log and logf
* [#13307](https://github.com/apache/nuttx/pull/13307) libs/libm/libm: apply epsilon relax factor only if epsilon is small
* [#12568](https://github.com/apache/nuttx/pull/12568) libm{libm|newlib}: fix broken sincos optimization for GCC
* [#12811](https://github.com/apache/nuttx/pull/12811) libm/copysign: respect signed zero/NaN handling in copysign
* [#13174](https://github.com/apache/nuttx/pull/13174) syscall: delete getrandom in syscall because it have moved to lib
* [#13428](https://github.com/apache/nuttx/pull/13428) gdb plugin: Encapsulate the gdb native command gcore as nxgcore
* [#12557](https://github.com/apache/nuttx/pull/12557) gdbstub: fix typo
* [#12549](https://github.com/apache/nuttx/pull/12549) gdbstub: support gdbstub_debugpoint_add/remove smp call
* [#13339](https://github.com/apache/nuttx/pull/13339) nuttx/pthread: export priority protect in pthread with ceiling priority in semaphore
* [#12561](https://github.com/apache/nuttx/pull/12561) pthread: add pthread_self/pthread_gettid_np function
* [#13462](https://github.com/apache/nuttx/pull/13462) pthread_mutx: remove unused critical_secton lock
* [#13456](https://github.com/apache/nuttx/pull/13456) pthread_mutex: add deadlock assert
tools
* [#12701](https://github.com/apache/nuttx/pull/12701) Feature/mcuboot toolchain support
* [#13021](https://github.com/apache/nuttx/pull/13021) tools: add improved pre-commit tool
* [#12794](https://github.com/apache/nuttx/pull/12794) tools: nxstyle if statement check
* [#12651](https://github.com/apache/nuttx/pull/12651) tools/imx9: prepare bootable bootloader image
* [#12838](https://github.com/apache/nuttx/pull/12838) tools/[Rust|D]: Fix build break for RISC-V
* [#12854](https://github.com/apache/nuttx/pull/12854) tools/[Rust|D]: Fix the Rust and D Builds for QEMU RISC-V
* [#12983](https://github.com/apache/nuttx/pull/12983) tools/parsetrace.py:fix parsetrace script error
* [#13321](https://github.com/apache/nuttx/pull/13321) greenhills support: add ghs linker script for mps2-an500 platform
* [#12884](https://github.com/apache/nuttx/pull/12884) greenhills support: add Kconfig, makefile, make.defs support for ghs compiler
* [#12887](https://github.com/apache/nuttx/pull/12887) greenhills support: add new platform of qemu cortex-m7
* [#13146](https://github.com/apache/nuttx/pull/13146) greenhills support: add the "__sync_synchronize" func impl
* [#12877](https://github.com/apache/nuttx/pull/12877) greenhills support: add up_getsp() implementation to adapting greenhills compiler
* [#12883](https://github.com/apache/nuttx/pull/12883) greenhills support: fix the asm build error for adapting to greenhills compiler
* [#12885](https://github.com/apache/nuttx/pull/12885) greenhills support: fix the build and link error specific to ghs platform
* [#13144](https://github.com/apache/nuttx/pull/13144) greenhills support: fix the build options warning
* [#13207](https://github.com/apache/nuttx/pull/13207) greenhills support: fix the build option warning
* [#13145](https://github.com/apache/nuttx/pull/13145) greenhills support: fix the build warning while support greenhills build
* [#12886](https://github.com/apache/nuttx/pull/12886) greenhills support: fix the build warning for ghs platform
* [#13533](https://github.com/apache/nuttx/pull/13533) greenhills support: fix the enumerated type mixed using warning
* [#13322](https://github.com/apache/nuttx/pull/13322) greenhills support: fix the ghs build warning
* [#13502](https://github.com/apache/nuttx/pull/13502) greenhills support: fix the greenhills compile warning on sizeof operand
* [#13195](https://github.com/apache/nuttx/pull/13195) greenhills support: fix the pointless comparison build warning
various
* [#12552](https://github.com/apache/nuttx/pull/12552) compiler.h: rename CMSE extension attribute macros
* [#12874](https://github.com/apache/nuttx/pull/12874) fix stm32wl5_rcc.h: Add the missing argument to RCC_PLLCFG_PLLP define.
* [#13148](https://github.com/apache/nuttx/pull/13148) include/fcntl.h: add O_LARGEFILE flags
* [#13324](https://github.com/apache/nuttx/pull/13324) include/sensors: import public definitions types and to uorb.h
* [#12690](https://github.com/apache/nuttx/pull/12690) ioctl.h: add SIOCATMARK definition to resolve compilation errors
* [#13314](https://github.com/apache/nuttx/pull/13314) ip6_tables.h: fix gcc 14 errors
* [#13257](https://github.com/apache/nuttx/pull/13257) socketlin : add lin.h and lin bus-type
* [#12692](https://github.com/apache/nuttx/pull/12692) sysinfo.h: add get_nprocs_conf/get_nprocs definition
* [#13149](https://github.com/apache/nuttx/pull/13149) sys/shm.h: add macro define for posix
* [#12594](https://github.com/apache/nuttx/pull/12594) x86_64/irq.h: use 32bit operations in up_cpu_index(
Build System
New Features
* [#12904](https://github.com/apache/nuttx/pull/12904) [Cross-Platform] Remove Unix-specific code in savedefconfig and replace it with cmake script
* [#12910](https://github.com/apache/nuttx/pull/12910) [cmake] add_application supports only registration but not compilation
* [#12964](https://github.com/apache/nuttx/pull/12964) [cmake] split the archive process to avoid parameter too long problems
* [#13019](https://github.com/apache/nuttx/pull/13019) [cmake] add nuttx_post and app_context inter targets for timing control
* [#12908](https://github.com/apache/nuttx/pull/12908) [Win32 sim] enable win32 native platfrom sim compilation by CMake fix compilation error
* [#12900](https://github.com/apache/nuttx/pull/12900) arch/sim/src/cmake/Toolchain.cmake: macOS fix unknown options: --gc-sections
* [#12856](https://github.com/apache/nuttx/pull/12856) build: Fix libc/pwd CMakeLists.txt
* [#13347](https://github.com/apache/nuttx/pull/13347) build: fix memory manager compile options for CMake
* [#12859](https://github.com/apache/nuttx/pull/12859) build: Fix Toolchain.cmake for CONFIG_SIM_ASAN enabled
* [#12880](https://github.com/apache/nuttx/pull/12880) build: set CMake policy to allow FetchContent_Populate
* [#12784](https://github.com/apache/nuttx/pull/12784) build/cmake: add user_ldscript preprocessing
* [#12866](https://github.com/apache/nuttx/pull/12866) build/cmake: fix system include dir for PROTECTED mode
* [#13143](https://github.com/apache/nuttx/pull/13143) board/maix-bit: initial cmake support
* [#13090](https://github.com/apache/nuttx/pull/13090) board/qemu-armv7a: add CMake support
* [#12868](https://github.com/apache/nuttx/pull/12868) boards/rv-virt: cmake for pnsh and nsbi
* [#13175](https://github.com/apache/nuttx/pull/13175) Cmake: [arch arm] added initial support for MSYS2
* [#13389](https://github.com/apache/nuttx/pull/13389) cmake: add support for PCI
* [#12516](https://github.com/apache/nuttx/pull/12516) cmake: reuse OpenAMP own CMake script for CMake build
* [#12592](https://github.com/apache/nuttx/pull/12592) cmake: refine sim cmake redefine symbols
* [#13449](https://github.com/apache/nuttx/pull/13449) cmake: Refactor extra_lib tagert,build include_arch path,refine sim link script target
* [#12667](https://github.com/apache/nuttx/pull/12667) cmake: strip file full path to save the code size
* [#13451](https://github.com/apache/nuttx/pull/13451) cmake: support openlibm,dhara,libmcs,lic regex CMake build scripts
* [#12608](https://github.com/apache/nuttx/pull/12608) cmake/add_library: enable library install by default
* [#12714](https://github.com/apache/nuttx/pull/12714) cmake/boards: fix build break on custom board
* [#13085](https://github.com/apache/nuttx/pull/13085) CMakeLists.txt: warning D9002 on Windows + msvc
* [#13253](https://github.com/apache/nuttx/pull/13253) cmake/nuttx_kconfig.cmake: fixed the correct .config path in the buid folder
* [#13276](https://github.com/apache/nuttx/pull/13276) cmake/tricore: filter out nostdlib in linker phase to avoid build break
* [#13499](https://github.com/apache/nuttx/pull/13499) libc: add missing preadv/pwritev in CMakeLists.txt
* [#12700](https://github.com/apache/nuttx/pull/12700) riscv/cmake: fix Toolchain.cmake
* [#12694](https://github.com/apache/nuttx/pull/12694) riscv/k230: fix apps ROMFS cmake
* [#12996](https://github.com/apache/nuttx/pull/12996) riscv/qemu-rv: add RPTUN cmake
* [#12634](https://github.com/apache/nuttx/pull/12634) sim/cmake: enable garbage collection of unused input sections
* [#12721](https://github.com/apache/nuttx/pull/12721) tools/testbuild.sh: add option -N use CMake with Ninja
* [#12805](https://github.com/apache/nuttx/pull/12805) tools/testbuild.sh: added store compilation artifacts for cmake
* [#12724](https://github.com/apache/nuttx/pull/12724) tricore/cmake: add support of cmake build for tricore
Bug Fixes
* [#12558](https://github.com/apache/nuttx/pull/12558) [bugfix] cmake:fix a few issues during CMake build
* [#12915](https://github.com/apache/nuttx/pull/12915) [bugfix] fix CMake build block when enable LTO
* [#12582](https://github.com/apache/nuttx/pull/12582) Fix cmake for cxd56xx
* [#12581](https://github.com/apache/nuttx/pull/12581) cmake: Fix build failure when -DNUTTX_APPS_DIR is specified
* [#13171](https://github.com/apache/nuttx/pull/13171) CMake: fix CMake compile errors during the protected build mode
* [#13081](https://github.com/apache/nuttx/pull/13081) cmake: fix invalid syntax when generating version.h from tags
Architectural Support
unsorted
* [#12827](https://github.com/apache/nuttx/pull/12827) Additional encoder for F7 and added functions for TimerHook for F745 …
* [#12924](https://github.com/apache/nuttx/pull/12924) Bugfix/esp spi fix
* [#12770](https://github.com/apache/nuttx/pull/12770) Enable SMPS for STM32H745I-DISCO by default
* [#12574](https://github.com/apache/nuttx/pull/12574) arch: Add --whole-archive linker option for some of architectures
* [#13200](https://github.com/apache/nuttx/pull/13200) arch: cxd56xx: Add logic for i2c reset
* [#13496](https://github.com/apache/nuttx/pull/13496) arch: cxd56xx: Fix issue by update of inode reference
* [#13201](https://github.com/apache/nuttx/pull/13201) arch: cxd56xx: Fix SCU sensor data format
* [#12962](https://github.com/apache/nuttx/pull/12962) arch: inline this_task to improve performence
* [#13270](https://github.com/apache/nuttx/pull/13270) arch: remove unused up_cpu_pausereq waiting
* [#13423](https://github.com/apache/nuttx/pull/13423) arch: use up_current_regs/up_set_current_regs replace CURRENT_REGS
* [#13041](https://github.com/apache/nuttx/pull/13041) arch/EXTRA_LIBS: link all staging library.
* [#12624](https://github.com/apache/nuttx/pull/12624) arch/sim: add custom data section support
* [#12909](https://github.com/apache/nuttx/pull/12909) arch/sim/Kconfig: set SIM_FBBPP to 32 by default
* [#12845](https://github.com/apache/nuttx/pull/12845) arch/stm32h7: add defines for USART clock selection
* [#13292](https://github.com/apache/nuttx/pull/13292) arch/xmc4 : Add input pin DX0 selection for multiple SPI channel
* [#12823](https://github.com/apache/nuttx/pull/12823) arch/xmc4 : Fixed critical section in i2c_transfer
* [#12761](https://github.com/apache/nuttx/pull/12761) arch/xmc4 : i2c master lower-half driver
* [#12545](https://github.com/apache/nuttx/pull/12545) BL808: Add support for UARTs 0-2 and serial configuration
* [#12575](https://github.com/apache/nuttx/pull/12575) BL808: Replace courier with M0 interrupt controller
* [#12795](https://github.com/apache/nuttx/pull/12795) elf: Enable ELF loader if text heap read is word-aligned and enable ELF loader for ESP32-S3
* [#12620](https://github.com/apache/nuttx/pull/12620) esp32: add simple boot support
* [#12616](https://github.com/apache/nuttx/pull/12616) ESP32: emac initialization adding cpu id
* [#13249](https://github.com/apache/nuttx/pull/13249) esp32: enable APP_CPU cache earlier
* [#13244](https://github.com/apache/nuttx/pull/13244) esp32: cache_sram_mmu_set: update the correct register bits
* [#13222](https://github.com/apache/nuttx/pull/13222) esp32: fix a crash with PSRAM + SMP
* [#13243](https://github.com/apache/nuttx/pull/13243) esp32: fix seemingly wrong calculations
* [#13250](https://github.com/apache/nuttx/pull/13250) esp32: psram_set_cs_timing: sync with esp-idf
* [#13311](https://github.com/apache/nuttx/pull/13311) esp32: Port the bootloader patch
* [#12572](https://github.com/apache/nuttx/pull/12572) esp32[c3|c6|h2]: Add I2C master support
* [#12573](https://github.com/apache/nuttx/pull/12573) esp32[c3|c6|h2]: Add GDMA support
* [#13298](https://github.com/apache/nuttx/pull/13298) esp32c6: PCNT Quadrature Encoder driver
* [#13269](https://github.com/apache/nuttx/pull/13269) esp32s2: fix SPI flash and file system mounting
* [#12647](https://github.com/apache/nuttx/pull/12647) esp32s3-devkit: add a config for qemu
* [#12851](https://github.com/apache/nuttx/pull/12851) esp32s3-devkit/toywasm: enable ESP32S3_SPI_FLASH_SUPPORT_PSRAM_STACK
* [#12725](https://github.com/apache/nuttx/pull/12725) esp32s3_textheap.c: fix a build error w/o CONFIG_ESP32S3_SPIRAM
* [#12565](https://github.com/apache/nuttx/pull/12565) esp32s3/wifi: Fix bug related to IOB off-loading with SMP
* [#12789](https://github.com/apache/nuttx/pull/12789) esp32s3/i2s: Fix faulty initialization when SMP is enabled
* [#13265](https://github.com/apache/nuttx/pull/13265) esp32_psram.c: Remove a seemingly stale comment
* [#12669](https://github.com/apache/nuttx/pull/12669) Feature/esp mcuboot support
* [#12776](https://github.com/apache/nuttx/pull/12776) Feature/esp spi dma
* [#12775](https://github.com/apache/nuttx/pull/12775) Feature/esp temperature sensor
* [#12604](https://github.com/apache/nuttx/pull/12604) fix(esp32-qemu-openeth): allocate buffers in internal memory
* [#13193](https://github.com/apache/nuttx/pull/13193) gd32f4xx_at24: Fix uninitialized use of local variables i2c and at24
* [#13401](https://github.com/apache/nuttx/pull/13401) Imx9 ethernet fixes
* [#12632](https://github.com/apache/nuttx/pull/12632) Imx9 support flexspi m25p nor
* [#13399](https://github.com/apache/nuttx/pull/13399) imx9/edma: Fix function prototypes
* [#13400](https://github.com/apache/nuttx/pull/13400) imx9/LPUART fixes
* [#12921](https://github.com/apache/nuttx/pull/12921) imx93: Add more base addresses
* [#12623](https://github.com/apache/nuttx/pull/12623) imxrt: Correctly update PLL, bit has to toggled instead of being set
* [#12562](https://github.com/apache/nuttx/pull/12562) imxrt: imxrt11xx set core clock to 1p15v regardless of ocotp
* [#12821](https://github.com/apache/nuttx/pull/12821) k230_start.c: Fix condition for k230_copy_init_data()
* [#12894](https://github.com/apache/nuttx/pull/12894) mps3-an547:support mps3-an547 reset
* [#12989](https://github.com/apache/nuttx/pull/12989) nuttx/sim:By default, stack-use-after-return is not checked when enabling SIM_ASAN.
* [#13043](https://github.com/apache/nuttx/pull/13043) nuttx/sim:By default, stack-use-after-return is not checked when enabling SIM_ASAN.
* [#13548](https://github.com/apache/nuttx/pull/13548) nrf91: Update GPS to GNSS
* [#12612](https://github.com/apache/nuttx/pull/12612) refactor(esp32-qemu-openeth): use lower half driver interface
* [#12660](https://github.com/apache/nuttx/pull/12660) refresh esp32s3-devkit:qemu_debug
* [#12707](https://github.com/apache/nuttx/pull/12707) rp2040 Rename the RP2040-specific PWM_MULTICHAN definition
* [#12610](https://github.com/apache/nuttx/pull/12610) rp2040: Add support to MAX6675
* [#13318](https://github.com/apache/nuttx/pull/13318) rp2040: Support pico-sdk 2.0.0
* [#13070](https://github.com/apache/nuttx/pull/13070) Sync the modifications of the WiFi function in simulator.
* [#12697](https://github.com/apache/nuttx/pull/12697) s32k1xx: FlexIO i2c driver
* [#12678](https://github.com/apache/nuttx/pull/12678) samv7: fix compile warning in PWM driver
* [#12627](https://github.com/apache/nuttx/pull/12627) samv7/sam_mcan.c: fix TSEG1, TSEG2 and SJW compile warnings for MCAN1
* [#12622](https://github.com/apache/nuttx/pull/12622) sim: make possible keep ubsan and bypass feature
* [#13034](https://github.com/apache/nuttx/pull/13034) sim: read the second buffer
* [#13097](https://github.com/apache/nuttx/pull/13097) sim: Support to use of non-consecutive framebuffers
* [#13355](https://github.com/apache/nuttx/pull/13355) sim_offload: add lame library to apps/audioutils/lame
* [#12870](https://github.com/apache/nuttx/pull/12870) sim/login: remove login restrictions to improve the experience for green hands
* [#13534](https://github.com/apache/nuttx/pull/13534) sim/minmea: Fix defconfig warning
* [#13042](https://github.com/apache/nuttx/pull/13042) simwifi: Add the netlink event of connect/disconnect.
* [#12778](https://github.com/apache/nuttx/pull/12778) Small improvements to nrf91
* [#13282](https://github.com/apache/nuttx/pull/13282) smp: enable smp_call in all smp arch
* [#12566](https://github.com/apache/nuttx/pull/12566) STM32G47XXX: Added basic HRTIM support.
* [#12600](https://github.com/apache/nuttx/pull/12600) tee smp support
* [#12640](https://github.com/apache/nuttx/pull/12640) Userleds support to seed-xiao-rp2040
* [#13032](https://github.com/apache/nuttx/pull/13032) wifi_sim.c:fix compile warning
Architecture Improvements
arm
* [#12626](https://github.com/apache/nuttx/pull/12626) arch/arm/stm32: Fix EXTI lines definitions for STM32G47XX.
* [#12664](https://github.com/apache/nuttx/pull/12664) arch/armv8-r: new config to set SPIs Configuration to edge-triggered
* [#12666](https://github.com/apache/nuttx/pull/12666) arch/armv8-r: update g_running_tasks before context switch
* [#13472](https://github.com/apache/nuttx/pull/13472) arch/arm-m: Clear lr before jump to __start
* [#13284](https://github.com/apache/nuttx/pull/13284) arch/arm: support kernel heap in BUILD_FLAT mode
* [#13416](https://github.com/apache/nuttx/pull/13416) arm generate busfault & recursive bug fix
* [#13268](https://github.com/apache/nuttx/pull/13268) arm: armv7-a/r and armv8-r up_cpu_index inline
* [#13024](https://github.com/apache/nuttx/pull/13024) arm: Fix DS1307 initialization for common STM32 logic
* [#12888](https://github.com/apache/nuttx/pull/12888) arm: Select ram vector on armv6m
* [#13505](https://github.com/apache/nuttx/pull/13505) arm_addrenv:fix app crash when enable shm in kernel mode
* [#12787](https://github.com/apache/nuttx/pull/12787) arm_backtrace_unwind:Make the backtrace search the entire stack as much as possible
* [#12954](https://github.com/apache/nuttx/pull/12954) arm/armv[7|8]-m: add syn barrier for MPU ops
* [#12925](https://github.com/apache/nuttx/pull/12925) arm/armv8-r: invalidate d-cache on boot
* [#12928](https://github.com/apache/nuttx/pull/12928) arm/armv8-r: add cp15 ops for mpu
* [#13529](https://github.com/apache/nuttx/pull/13529) arm/cortex-a,r: replace cp15 instruct to macros to align operation
* [#13239](https://github.com/apache/nuttx/pull/13239) arm/giv3: add g_ prefix to some global variables
* [#13262](https://github.com/apache/nuttx/pull/13262) arm/gicv3: set routing affinity before enable IRQ
* [#13240](https://github.com/apache/nuttx/pull/13240) arm/linum-stm32h753bi: Add support to RFID MFRC522
* [#12873](https://github.com/apache/nuttx/pull/12873) arm/lm3s6965-ek: Disable NTPC for lm3s6965 to fix maximum flash space…
* [#13557](https://github.com/apache/nuttx/pull/13557) arm/qemu: Add mounting of tmpfs
* [#13117](https://github.com/apache/nuttx/pull/13117) arm/qemu: enable WFI in `up_idle`
* [#13131](https://github.com/apache/nuttx/pull/13131) arm/spinlock: up_testset() sould not depends on SMP
* [#12879](https://github.com/apache/nuttx/pull/12879) arm/stm32f401rc-rs485: Add support to BMP280 sensor
* [#13565](https://github.com/apache/nuttx/pull/13565) arm/stm32f401rc-rs485: Add support to LCD 16x2 with I2C Backpack
* [#12839](https://github.com/apache/nuttx/pull/12839) arm/stm32f401rc-rs485: Add support to RFID MFRC522
* [#12860](https://github.com/apache/nuttx/pull/12860) arm/stm32h7/stm32h745i-disco: Add STM32H745I-DISCO Per Core Support
* [#12902](https://github.com/apache/nuttx/pull/12902) arm/stm32h7x3x_rcc.c: Add External Power Supply option to stm32h7x3x …
* [#12679](https://github.com/apache/nuttx/pull/12679) arm/xmc4: pwm driver
* [#13466](https://github.com/apache/nuttx/pull/13466) armv7-a gic related update
* [#13176](https://github.com/apache/nuttx/pull/13176) armv7-a timer:fix timer overflow.
* [#12956](https://github.com/apache/nuttx/pull/12956) armv7a/irq: enable fiq in tee, enable irq in ap
* [#13453](https://github.com/apache/nuttx/pull/13453) armv8-m:arch libc function need save ip register use pacbti
* [#13237](https://github.com/apache/nuttx/pull/13237) armv8-r/gicv3: correct cpu index of irouter
* [#13275](https://github.com/apache/nuttx/pull/13275) armv8-r/r52: add neon support into compiler lin
arm64
* [#12633](https://github.com/apache/nuttx/pull/12633) arch/arm64/src/imx9/imx9_lowputc.c: Fix an arithmetic sign error in d…
* [#12648](https://github.com/apache/nuttx/pull/12648) arch/arm64: allow to use custom up_idle
* [#13397](https://github.com/apache/nuttx/pull/13397) arch/arm64/src/imx9/imx9_lpi2c.c: Cleanups and error fixes
* [#13402](https://github.com/apache/nuttx/pull/13402) arch/arm64/imx9: Change Kconfig logic
* [#13403](https://github.com/apache/nuttx/pull/13403) arch/arm64/imx9: Add system reset controller
* [#13427](https://github.com/apache/nuttx/pull/13427) arch/arm64/src/imx9/imx9_lpi2c.c: Ignore spurious RX interrupts
* [#13218](https://github.com/apache/nuttx/pull/13218) arch/arm64: Move ELF_64BIT selection to arch/Kconfig
* [#12681](https://github.com/apache/nuttx/pull/12681) arm64: add initial support for ZYNQ MPSOC and ZCU111 Evaluation Kit
* [#12580](https://github.com/apache/nuttx/pull/12580) arm64: inline up_cpu_index
* [#13560](https://github.com/apache/nuttx/pull/13560) arm64_addrenv: Add support for 4 level MMU translations
* [#13363](https://github.com/apache/nuttx/pull/13363) arm64_addrenv_pgmap.c: Revoke user execution access to kernel mmap'd pages
* [#13364](https://github.com/apache/nuttx/pull/13364) arm64_addrenv.c: Flush kernel page table copy to user mappings
* [#13204](https://github.com/apache/nuttx/pull/13204) arm64_checkstack.c: Fix traversing of user stack when ARCH_ADDRENV=Y
* [#13361](https://github.com/apache/nuttx/pull/13361) arm64_syscall.c: Don't need to set register context during syscall
* [#13365](https://github.com/apache/nuttx/pull/13365) arm64_vector_table.S: Remove unnecessary instruction
* [#12695](https://github.com/apache/nuttx/pull/12695) arm64/arm64_boot.c: Fix exception caused by accesses to ICC_SRE_EL3 when GICv3 was not implemented
* [#13373](https://github.com/apache/nuttx/pull/13373) arm64/crt0.c: Fix stack alignment when executing signal trampoline
* [#12649](https://github.com/apache/nuttx/pull/12649) arm64/imx9: ccm: add default clk init
* [#13205](https://github.com/apache/nuttx/pull/13205) arm64/imx9: Force 64-bit ELF format
* [#13360](https://github.com/apache/nuttx/pull/13360) arm64/mmu: Fixes for MMU driver
* [#13362](https://github.com/apache/nuttx/pull/13362) arm64/syscall: (Re-)enable interrupts only if they were previously enable
tricore
* [#12682](https://github.com/apache/nuttx/pull/12682) arch/tricore: add support of tricore gcc toolchain
* [#12706](https://github.com/apache/nuttx/pull/12706) arch/tricore: synchronize instruction/data following MTCR/MFC
risc-v
* [#12961](https://github.com/apache/nuttx/pull/12961) arch: inline up_testset in arm arm64 riscv xtensa
* [#12579](https://github.com/apache/nuttx/pull/12579) arch/riscv: add all region in NAPOT
* [#12881](https://github.com/apache/nuttx/pull/12881) arch/riscv: add cluster local hartid
* [#12906](https://github.com/apache/nuttx/pull/12906) arch/riscv: fix IRQ_SOFT for non-SMP
* [#12546](https://github.com/apache/nuttx/pull/12546) arch/riscv: fix NuttSBI PMP config
* [#12717](https://github.com/apache/nuttx/pull/12717) arch/riscv: fix trap sp restore logic
* [#13430](https://github.com/apache/nuttx/pull/13430) arch/riscv: Fixed hardware timer warps-around issue
* [#13278](https://github.com/apache/nuttx/pull/13278) arch/riscv: revert pull#12864
* [#12864](https://github.com/apache/nuttx/pull/12864) arch/riscv: unify in-kernel syscall
* [#12619](https://github.com/apache/nuttx/pull/12619) arch/risc-v: add support for capture driver on ESP32C6 and ESP32H2.
* [#12726](https://github.com/apache/nuttx/pull/12726) arch/risc-v: make common up_allocate_heap weak symbol
* [#12732](https://github.com/apache/nuttx/pull/12732) arch/risc-v: does not clear IPI address in S mode
* [#12460](https://github.com/apache/nuttx/pull/12460) arch/risc-v/common: provide architecture specific perfmon bindings.
* [#13353](https://github.com/apache/nuttx/pull/13353) arch/risc-v/litex: Fix the litex arty_a7 build
* [#13382](https://github.com/apache/nuttx/pull/13382) arch/risc-v/src/litex: Claim all pending PLIC interrupts.
* [#13547](https://github.com/apache/nuttx/pull/13547) arch/risc-v/src/litex_ticked: Set initial tick count to known value.
* [#12804](https://github.com/apache/nuttx/pull/12804) arch/risc-v: introduce AIA support
* [#12843](https://github.com/apache/nuttx/pull/12843) arch/risc-v: add support for DC motor control on ESP32|C6|H2|
* [#12586](https://github.com/apache/nuttx/pull/12586) riscv_exception.c: Add missing comma in exception reasons array
* [#13408](https://github.com/apache/nuttx/pull/13408) riscv_mtimer: modify riscv_mtimer_current to reduce precision lost
* [#12643](https://github.com/apache/nuttx/pull/12643) riscv_tcbinfo: Fix register ordering for PC
* [#13564](https://github.com/apache/nuttx/pull/13564) riscv: add a return value to riscv_swint
* [#13561](https://github.com/apache/nuttx/pull/13561) riscv: g_current_regs is only used to determine if we are in irq
* [#12812](https://github.com/apache/nuttx/pull/12812) riscv: Fix fork() system call
* [#13354](https://github.com/apache/nuttx/pull/13354) riscv: Unify the extended context save/restore
* [#12554](https://github.com/apache/nuttx/pull/12554) riscv: Initial support for debug trigger module
* [#12559](https://github.com/apache/nuttx/pull/12559) riscv: Improve exception and irq mapping
* [#12809](https://github.com/apache/nuttx/pull/12809) riscv/debug: Add support for steppoint
* [#12819](https://github.com/apache/nuttx/pull/12819) riscv/espressif: Mark private data as static in esp_spi.c
* [#12861](https://github.com/apache/nuttx/pull/12861) riscv/fork: fix fp/gp handling
* [#12589](https://github.com/apache/nuttx/pull/12589) riscv/k230: revise canmv230:nsbi
* [#12677](https://github.com/apache/nuttx/pull/12677) riscv/k230: updates for nsh and pnsh
* [#12744](https://github.com/apache/nuttx/pull/12744) riscv/nsbi: fix k230 AMP confs
* [#12799](https://github.com/apache/nuttx/pull/12799) riscv/qemu-rv: skip reloading mhartid
* [#12807](https://github.com/apache/nuttx/pull/12807) riscv/qemu-rv: Add BUILD_PROTECTED target for rv-virt
* [#12944](https://github.com/apache/nuttx/pull/12944) riscv/qemu-rv: add RPTUN support
* [#12772](https://github.com/apache/nuttx/pull/12772) riscv/rv-virt: use RAM_START in ld.script
* [#12816](https://github.com/apache/nuttx/pull/12816) riscv/qemu-rv: add NuttSBI target for rv-virt
* [#12831](https://github.com/apache/nuttx/pull/12831) riscv/qemu-rv: revise PROTECTED mode
* [#12840](https://github.com/apache/nuttx/pull/12840) riscv/nsbi: fix up_udelay for rv32
* [#13510](https://github.com/apache/nuttx/pull/13510) risc-v: Add a new option to control exception reason
* [#12722](https://github.com/apache/nuttx/pull/12722) risc-v/bl808, sg2000: Configure MMU to cache Kernel Text, Data and Heap (T-Head C906)
* [#12571](https://github.com/apache/nuttx/pull/12571) risc-v/bl808: Add GPIO Driver
* [#12621](https://github.com/apache/nuttx/pull/12621) risc-v/bl808: Add GPADC character driver
* [#12663](https://github.com/apache/nuttx/pull/12663) risc-v/bl808: Add SPI driver
* [#12771](https://github.com/apache/nuttx/pull/12771) risc-v/bl808: Add watchdog driver
* [#12752](https://github.com/apache/nuttx/pull/12752) risc-v/bl808: Add timer driver
* [#12614](https://github.com/apache/nuttx/pull/12614) risc-v/ox64: Add LED Driver
* [#12762](https://github.com/apache/nuttx/pull/12762) risc-v/qemu-rv: Add LED Driver for QEMU RISC-V 32-bit and 64-bit
xtensa
* [#13223](https://github.com/apache/nuttx/pull/13223) Add spi slave dev to esp32 xtensa
* [#13225](https://github.com/apache/nuttx/pull/13225) espressif: Fix build with RTC
* [#13255](https://github.com/apache/nuttx/pull/13255) espressif: Fix deadlock in RT timer caused by critical section
* [#12560](https://github.com/apache/nuttx/pull/12560) espressif: Fix error while evaluating Wi-Fi task ID
* [#13368](https://github.com/apache/nuttx/pull/13368) espressif: Update external libraries to fix GPIO interrupt bug
* [#13236](https://github.com/apache/nuttx/pull/13236) espressif: Update HAL library reference to include debug assert
* [#13022](https://github.com/apache/nuttx/pull/13022) espressif: Update internal libraries reference
* [#12551](https://github.com/apache/nuttx/pull/12551) xtensa: add support for capture driver on ESP32 and ESP32|S3|
* [#12781](https://github.com/apache/nuttx/pull/12781) xtensa: add support for motor control driver
* [#12967](https://github.com/apache/nuttx/pull/12967) xtensa_cache:add up_get_cachesize api
* [#12865](https://github.com/apache/nuttx/pull/12865) xtensa/esp32: replace nxsig_usleep() with up_udelay()
* [#12750](https://github.com/apache/nuttx/pull/12750) xtensa/esp32s3: Add peripheral DMA request return value and optimize DMA initialization
* [#13277](https://github.com/apache/nuttx/pull/13277) xtensa/esp32s3: Add timing delay set interface for QSPI
* [#13291](https://github.com/apache/nuttx/pull/13291) xtensa/esp32s2: add WiFi support
* [#13454](https://github.com/apache/nuttx/pull/13454) xtensa/esp32s3: Adjust I2C clock timing
* [#12720](https://github.com/apache/nuttx/pull/12720) xtensa/esp32s3: Deinitialize ESP32-S3 QSPI GDMA engine.
* [#12871](https://github.com/apache/nuttx/pull/12871) xtensa/esp32s3: Update the rtc code to fix system blocking issue
* [#12919](https://github.com/apache/nuttx/pull/12919) xtensa/esp32s3: partition name duplicate and free
* [#12918](https://github.com/apache/nuttx/pull/12918) xtensa/esp32s3: reserve memory for a mutex struct depending on the OS
* [#12932](https://github.com/apache/nuttx/pull/12932) xtensa/esp32s3: Separate address and command flag for QSPI DMA transfer
* [#13165](https://github.com/apache/nuttx/pull/13165) xtensa/esp32s3/esp32s3_sdmmc.c: wait for command done event also on error response
x86_64
* [#13391](https://github.com/apache/nuttx/pull/13391) Add MSI/MSI-X support for intel64
* [#12583](https://github.com/apache/nuttx/pull/12583) arch/intel64: add cpu specific data and per-cpu interrupt stacks
* [#12803](https://github.com/apache/nuttx/pull/12803) arch/intel64: add support for HPET as system clock
* [#12588](https://github.com/apache/nuttx/pull/12588) arch/intel64: add support for inter-processor signaling
* [#12570](https://github.com/apache/nuttx/pull/12570) arch/intel64: get TSC frequency only when not provided from Kconfig
* [#12801](https://github.com/apache/nuttx/pull/12801) arch/intel64/irq.h: rename rdtsc macros
* [#13392](https://github.com/apache/nuttx/pull/13392) intel64: Improvements for HPET
* [#12567](https://github.com/apache/nuttx/pull/12567) arch/x86_64: addrenv should add offset only for RAM region
* [#12577](https://github.com/apache/nuttx/pull/12577) arch/x86_64/intel64/intel64_rtc.c: fix compilation
* [#12591](https://github.com/apache/nuttx/pull/12591) arch/x86_64: add SMP support
* [#13417](https://github.com/apache/nuttx/pull/13417) arch/x86_64: Add ARCH_INTEL64_DISABLE_CET
* [#13409](https://github.com/apache/nuttx/pull/13409) arch/x86_64: Add ARCH_X86_64_IDLE_NOP and ARCH_X86_64_IDLE_MWAIT
* [#13436](https://github.com/apache/nuttx/pull/13436) arch/x86_64: add basic support for R_X86_64_REX_GOTPCRELX relocation
* [#13422](https://github.com/apache/nuttx/pull/13422) arch/x86_64: Add elf32 multiboot1 wrapper for NuttX binary
* [#13313](https://github.com/apache/nuttx/pull/13313) arch/x86_64: convert all asm() to __asm__
* [#13317](https://github.com/apache/nuttx/pull/13317) arch/x86_64: Fix wrong RDTSCP implementation
* [#13316](https://github.com/apache/nuttx/pull/13316) arch/x86_64: Support QEMU PVH ELF loader
* [#13426](https://github.com/apache/nuttx/pull/13426) arch/x86_64/intel64: fix compilation errors in intel64_oneshot_lower.c
* [#12800](https://github.com/apache/nuttx/pull/12800) arch/x86_64/intel64/intel64_cpu.c: remove workaround for spin_lock
* [#13390](https://github.com/apache/nuttx/pull/13390) qemu-intel64: restore functionality of PCI test configs
* [#13315](https://github.com/apache/nuttx/pull/13315) qemu-intel64: simplify linker script
* [#12597](https://github.com/apache/nuttx/pull/12597) x86_64: add AVX support
* [#12613](https://github.com/apache/nuttx/pull/12613) x86_64: addrenv support
* [#12569](https://github.com/apache/nuttx/pull/12569) x86_64: hide --whole-archive behind Kconfig option
Driver Support
New Driver Support
* [#12829](https://github.com/apache/nuttx/pull/12829) Add amg88xx driver
* [#13396](https://github.com/apache/nuttx/pull/13396) Add Intel e1000 and igc support
* [#13393](https://github.com/apache/nuttx/pull/13393) Add support for 16550 compatible PCI serial cards
* [#12715](https://github.com/apache/nuttx/pull/12715) Add support for the Sensirion SHT4x temperature and humidity sensor
* [#12824](https://github.com/apache/nuttx/pull/12824) Add thermal framework
* [#11605](https://github.com/apache/nuttx/pull/11605) Coresight: add init coresight driver framework
* [#13082](https://github.com/apache/nuttx/pull/13082) driver/mem: add Mem Driver.
* [#12834](https://github.com/apache/nuttx/pull/12834) driver/ssd1680: Add support for 1.54 inch e-paper display
* [#12938](https://github.com/apache/nuttx/pull/12938) drivers/video: add goldfish gpu fb
* [#13470](https://github.com/apache/nuttx/pull/13470) drivers/pinctl: add pinctrl framework
* [#13471](https://github.com/apache/nuttx/pull/13471) drivers/goldfish-pipe: implement goldfish pipe
* [#13553](https://github.com/apache/nuttx/pull/13553) Pci ep framework
Drivers Improvements
* [#12998](https://github.com/apache/nuttx/pull/12998) [driver][bcm43xxx] reset tx_seq of sido-bus when ifdown wlan-if
* [#13154](https://github.com/apache/nuttx/pull/13154) can/sja1000: drop driver dependency on __builtin functions
* [#13524](https://github.com/apache/nuttx/pull/13524) can: Add g_ prefix to can_dlc_to_len and len_to_can_dlc.
* [#13141](https://github.com/apache/nuttx/pull/13141) can: Merge netpacket/can.h into nuttx/can.h
* [#12676](https://github.com/apache/nuttx/pull/12676) driver/net/lan9250: Add lan9250_ioctl and lan9250_uninitialize APIs
* [#13464](https://github.com/apache/nuttx/pull/13464) driver/ftl: Read the consecutive eraseblocks
* [#13320](https://github.com/apache/nuttx/pull/13320) driver/usbdev: support userspace to access ep0
* [#12641](https://github.com/apache/nuttx/pull/12641) drivers: add API for drivers early initialization
* [#13492](https://github.com/apache/nuttx/pull/13492) drivers: fix gcc14 errors for virtio
* [#13107](https://github.com/apache/nuttx/pull/13107) drivers/audio: fix samp rate conversion issue
* [#13323](https://github.com/apache/nuttx/pull/13323) drivers/bch: fix uint32 overflow issue
* [#12564](https://github.com/apache/nuttx/pull/12564) drivers/net/ksz9477: Add port mirroring support
* [#12765](https://github.com/apache/nuttx/pull/12765) drivers/drivers_initialize.c: check if only one console is selected
* [#13411](https://github.com/apache/nuttx/pull/13411) drivers/fb: add panbuffer clear ioctl
* [#13468](https://github.com/apache/nuttx/pull/13468) drivers/gpio: support poll gpio device and optimize code to save memory
* [#12976](https://github.com/apache/nuttx/pull/12976) drivers/input: enable touch/kbd/mouse for virtio input
* [#13060](https://github.com/apache/nuttx/pull/13060) drivers/modem/alt1250: Disable the PIN feature in ALT1250
* [#13327](https://github.com/apache/nuttx/pull/13327) drivers/mtd/bch: fix size_t overflow when offset > 4GB
* [#13480](https://github.com/apache/nuttx/pull/13480) drivers/pty: support pty write to kill signal, like serial driver
* [#12830](https://github.com/apache/nuttx/pull/12830) drivers/serial: Make the 16550 rx trigger level configurable
* [#13202](https://github.com/apache/nuttx/pull/13202) drivers/regmap: add exit function interface.
* [#13469](https://github.com/apache/nuttx/pull/13469) drivers/reset: support rpmsg reset
* [#13328](https://github.com/apache/nuttx/pull/13328) drivers/rwbuffer: Bug fix: Set nblocks 0 after direct using wrflush
* [#13434](https://github.com/apache/nuttx/pull/13434) drivers/serial
* [#13576](https://github.com/apache/nuttx/pull/13576) drivers/syslog: compile syslog_device.c if console/char/file channel enabled
* [#12857](https://github.com/apache/nuttx/pull/12857) drivers/touchscreen: add grab for touchscreen
* [#13481](https://github.com/apache/nuttx/pull/13481) drivers/usbdev: minor update for cdcacm
* [#12930](https://github.com/apache/nuttx/pull/12930) drivers/virtio-net: Support VIRTIO_F_ANY_LAYOUT
* [#13170](https://github.com/apache/nuttx/pull/13170) drivers: Fix goldfish events x64 unresponsive interrupt issue
* [#13531](https://github.com/apache/nuttx/pull/13531) Fix build error of drivers/sensors/usensor.c
* [#13325](https://github.com/apache/nuttx/pull/13325) Input/ff: new driver frameworks for vibrator(haptic)
* [#13078](https://github.com/apache/nuttx/pull/13078) video: fix warning & update sim camera
* [#12760](https://github.com/apache/nuttx/pull/12760) virtio/serial: initial CONSOLE support
* [#12971](https://github.com/apache/nuttx/pull/12971) mmcsd_sdio:Fix performing read and write in irq
* [#12949](https://github.com/apache/nuttx/pull/12949) mmcsd: add support of getting ext_csd reg data
* [#13157](https://github.com/apache/nuttx/pull/13157) mmcsd: add write ext csd reg support
* [#13528](https://github.com/apache/nuttx/pull/13528) mmcsd: fix a logic error
* [#13215](https://github.com/apache/nuttx/pull/13215) mmcsd: make a compatibility change for cmd12 and cmd23
* [#13380](https://github.com/apache/nuttx/pull/13380) mtd:ramtron MB85RS256B address length is 2
* [#13136](https://github.com/apache/nuttx/pull/13136) mtd:use part->name as partition name when CONFIG_MTD_PARTITION_NAMES set
* [#12796](https://github.com/apache/nuttx/pull/12796) mtd/Kconfig: fix W25_SLOWREAD menu item.
* [#13252](https://github.com/apache/nuttx/pull/13252) mtd/nvs: fix align size
* [#13219](https://github.com/apache/nuttx/pull/13219) nuttx/drivers:Modify errcode returned by relay_ioctl
* [#12848](https://github.com/apache/nuttx/pull/12848) Optimize iic and spi parts and add iic slave drivers
* [#13344](https://github.com/apache/nuttx/pull/13344) pci ivshmem related driveres support
* [#13337](https://github.com/apache/nuttx/pull/13337) Revert "Fix unwanted flush in the SPI slave driver"
* [#13251](https://github.com/apache/nuttx/pull/13251) rndis: correct usb descriptor
* [#13538](https://github.com/apache/nuttx/pull/13538) sensor:Fixed the problem of user information lag in cross-core communication "stublist".
* [#13539](https://github.com/apache/nuttx/pull/13539) sensor_rpmsg.c:Fix that "stub" will be created when local core only has subscribers.
* [#12927](https://github.com/apache/nuttx/pull/12927) serial/uart_16550: include stdint.h in uart_16550.h
* [#13383](https://github.com/apache/nuttx/pull/13383) serial/uart_16550: remove up_putc spinlock
* [#13384](https://github.com/apache/nuttx/pull/13384) serial/uart_pl011: default syslog needs to check flow control in up_putc
* [#13509](https://github.com/apache/nuttx/pull/13509) serial/pci_16550: make sure that interrupts are disabled during init
* [#13102](https://github.com/apache/nuttx/pull/13102) syslog_rpmsg: Ensure the syslog ept is ready when rpmsg_send
* [#13184](https://github.com/apache/nuttx/pull/13184) timer driver:support poll.
* [#13075](https://github.com/apache/nuttx/pull/13075) usb_cdcmbim: add mbim device driver
* [#13367](https://github.com/apache/nuttx/pull/13367) usbdev: Add fastboot boardctl
* [#12914](https://github.com/apache/nuttx/pull/12914) usbdev: add USB cdcncm device driver
* [#12745](https://github.com/apache/nuttx/pull/12745) usbdev: delete unsigned comparison with 0
* [#13216](https://github.com/apache/nuttx/pull/13216) usbdev: extend the usb req len to unit32_t
* [#13190](https://github.com/apache/nuttx/pull/13190) USB 3.0 device side suppor
Board Support
New Boards
* [#13248](https://github.com/apache/nuttx/pull/13248) arm: Add support for CSK6011A SOC and CSK6011A-NANO board
* [#11709](https://github.com/apache/nuttx/pull/11709) at32uc3a0: Initial work for SimpleMachines' Mizar32-A
* [#12813](https://github.com/apache/nuttx/pull/12813) boards/esp32s3: Add initial support to the ESP32-S3-Korvo-2 board
* [#13467](https://github.com/apache/nuttx/pull/13467) boards/esp32s3: add support to esp32s3-lhcbit board
Boards Improvements
* [#13532](https://github.com/apache/nuttx/pull/13532) [Bugfix]Kconfig:ensure compatibility between kconfig-frontend and kconfiglib in kernel build
* [#12698](https://github.com/apache/nuttx/pull/12698) Add defconfig to use the ws2812 driver
* [#12878](https://github.com/apache/nuttx/pull/12878) arm/stm32f103-minimum: Use common board MFRC522
* [#12922](https://github.com/apache/nuttx/pull/12922) arm64: Initial implementation of CONFIG_BUILD_KERNEL
* [#13376](https://github.com/apache/nuttx/pull/13376) arm64/Kconfig: Make the ARM64_PA/VA_BITS a true Kconfig variable
* [#12973](https://github.com/apache/nuttx/pull/12973) board/arm/rp2040/seeed-xiao-studio-rp2040 GPIO configuration
* [#12738](https://github.com/apache/nuttx/pull/12738) board/linum-stm32h753bi: Add support to external sdram
* [#12882](https://github.com/apache/nuttx/pull/12882) board/lm3s6965-ek: restore 128K kflash
* [#12699](https://github.com/apache/nuttx/pull/12699) board/stm32f401rc-rs485: Add support to Device Configuration over Telnet
* [#12737](https://github.com/apache/nuttx/pull/12737) board/stm32f401rc-rs485: Add support to MAX7219 8x8 LED Matrix
* [#13516](https://github.com/apache/nuttx/pull/13516) boards: Update EXAMPLES_SOTEST_DEVMINOR to EXAMPLES_SOTEST_DEVMINOR_MAX
* [#12743](https://github.com/apache/nuttx/pull/12743) boards/arm/rp2040: Userled configuration to Seeed-Stdio RP2040
* [#13142](https://github.com/apache/nuttx/pull/13142) boards/arm/stm32/stm32f4discovery: Add support to RFID MFRC522
* [#13440](https://github.com/apache/nuttx/pull/13440) boards/arm/stm32h7/stm32h745i-disco: Add RPTUN support
* [#12825](https://github.com/apache/nuttx/pull/12825) boards/armv5: Make ARMv5 boards work again
* [#12593](https://github.com/apache/nuttx/pull/12593) boards/stm32: DRV8825 driver
* [#12673](https://github.com/apache/nuttx/pull/12673) boards/esp32[c3|c6|h2|s2|s3]: Ignore etctmp in common board
* [#13124](https://github.com/apache/nuttx/pull/13124) boards/esp32s3_lan9250: deinitialize the ethernet device lan9250
* [#12716](https://github.com/apache/nuttx/pull/12716) boards/esp32s3: Increse the default stack size for usbnsh
* [#12763](https://github.com/apache/nuttx/pull/12763) boards/imx93-evk: add sdimage cleanup
* [#12876](https://github.com/apache/nuttx/pull/12876) boards/lm3s6965-ek: fix memory.ld for PROTECTED
* [#12598](https://github.com/apache/nuttx/pull/12598) boards/MIMXRT1020-EVK: Fix board I2C code to adapt to last IMXRT I2C/pi…
* [#13137](https://github.com/apache/nuttx/pull/13137) boards/risc-v/esp32c6/esp32c6-devkitm: Add support to RFID MFRC522
* [#12869](https://github.com/apache/nuttx/pull/12869) boards/rv-virt: unify RV32 config names
* [#13226](https://github.com/apache/nuttx/pull/13226) boards/sim: Defconfigs for nand and mnemofs
* [#12898](https://github.com/apache/nuttx/pull/12898) boards/xtensa/esp32s3: ESP32S3 Emmc Support
* [#13478](https://github.com/apache/nuttx/pull/13478) boardctl: add board control api to start slave core
* [#13273](https://github.com/apache/nuttx/pull/13273) boardcrtl: change BOARDCTL_TESTSET to BOARDIOC_SPINLOCK
* [#12747](https://github.com/apache/nuttx/pull/12747) Change nucleof429zi nsh defconfig
* [#13059](https://github.com/apache/nuttx/pull/13059) defconfig: add SYSTEM_TELNETD related config
* [#13334](https://github.com/apache/nuttx/pull/13334) esp32: fix a way to test a config
* [#13563](https://github.com/apache/nuttx/pull/13563) esp32s3: Fix faulty `esp32s3-devkit:stack` example
* [#13234](https://github.com/apache/nuttx/pull/13234) imx9_usdhc.c: Fix build error when CONFIG_ARM64_DCACHE_DISABLE=y
* [#12867](https://github.com/apache/nuttx/pull/12867) LTDC for Linum board
* [#12780](https://github.com/apache/nuttx/pull/12780) nrf9160-dk: disable FPU for modem example
* [#13476](https://github.com/apache/nuttx/pull/13476) nucleo-h745zi: fix potential bl jump to app failed issue
* [#13069](https://github.com/apache/nuttx/pull/13069) nucleo-l432kc: Revert the USART2 config to be use by virtual COM port
* [#12987](https://github.com/apache/nuttx/pull/12987) nuttx/boards:Uniform initialization format for init_array.
* [#13208](https://github.com/apache/nuttx/pull/13208) risc-v/bl808: Configure MMU to cache User Text, Data and Heap
* [#13199](https://github.com/apache/nuttx/pull/13199) risc-v/mmu: Configure T-Head MMU to cache User Text, Data and Heap
* [#12862](https://github.com/apache/nuttx/pull/12862) risc-v/qemu-rv: Add Build Config for leds64_rust
* [#13186](https://github.com/apache/nuttx/pull/13186) risc-v/qemu-rv: Add Build Config for leds64_zig
* [#12896](https://github.com/apache/nuttx/pull/12896) risc-v/qemu-rv: add cluster PLIC/CLINT configs
* [#12544](https://github.com/apache/nuttx/pull/12544) riscv/nuttsbi: add MTVAL argument
* [#12645](https://github.com/apache/nuttx/pull/12645) stm32h7/linum-stm32h753bi: add support to qencoder
* [#12739](https://github.com/apache/nuttx/pull/12739) stm32f777zit6-meadow: Add support for two USB CDC/ACM
* [#12637](https://github.com/apache/nuttx/pull/12637) Usbnsh to seed-xiao-rp2040 board
* [#12713](https://github.com/apache/nuttx/pull/12713) zynq_mpsoc/zcu111: add support for gpio and board auto led
* [#12806](https://github.com/apache/nuttx/pull/12806) zynq-mpsoc/zcu111: independent JTAG configs from normal nsh configs
* [#12797](https://github.com/apache/nuttx/pull/12797) w25c: add W25_DEBUG sub-menu config option and update debug traces.
File System
New FS
* [#13001](https://github.com/apache/nuttx/pull/13001) V9FS For NuttX
FS Improvements
* [#13514](https://github.com/apache/nuttx/pull/13514) add sched note for littlefs/romfs/rpmsgfs
* [#12863](https://github.com/apache/nuttx/pull/12863) Fix the location of tmpfs pwrite write and Fixed some code check warnings
* [#13500](https://github.com/apache/nuttx/pull/13500) fs.h: fix a comment in file_operations
* [#12532](https://github.com/apache/nuttx/pull/12532) fs: add backtrace to where file opens
* [#13150](https://github.com/apache/nuttx/pull/13150) fs: add fs_heap, support shm/tmpfs/pseudofile with indepent heap
* [#12587](https://github.com/apache/nuttx/pull/12587) Fs: backtrace tweak
* [#13512](https://github.com/apache/nuttx/pull/13512) fs: Dump the list of files when the file description runs out
* [#13194](https://github.com/apache/nuttx/pull/13194) fs: nfs: Fix nfsmount error
* [#12978](https://github.com/apache/nuttx/pull/12978) fs: Rename node with inode.
* [#12969](https://github.com/apache/nuttx/pull/12969) Fslock optimize
* [#12937](https://github.com/apache/nuttx/pull/12937) fs/mnemofs: Fix journal log rw issue, rw size issue
* [#12945](https://github.com/apache/nuttx/pull/12945) fs/hostfs: Replace strcpy with memcpy
* [#13443](https://github.com/apache/nuttx/pull/13443) fs_inode:Change the type of i_crefs to atomic_int
* [#13458](https://github.com/apache/nuttx/pull/13458) fs_dup2 bug fix, memleak
* [#13573](https://github.com/apache/nuttx/pull/13573) fs/chmod/fchmod/lchmod: only set permissions by mode_t and ignore othjer bits
* [#12931](https://github.com/apache/nuttx/pull/12931) fs/epoll: Optimize implementation details
* [#12615](https://github.com/apache/nuttx/pull/12615) fs/fat: Fix Fseek Bug When File Size Is Multiple of Cluster Size
* [#12548](https://github.com/apache/nuttx/pull/12548) fs/fat/fs_fat32.c Return EOF when reading past the end of the file.
* [#13521](https://github.com/apache/nuttx/pull/13521) fs/dump: correct SCHED_DUMP_ON_EXIT to DUMP_ON_EXIT
* [#12990](https://github.com/apache/nuttx/pull/12990) fs/mmap: Fix build warning with [-Wmaybe-uninitialized].
* [#13132](https://github.com/apache/nuttx/pull/13132) fs/procfs: Supports any number of thread displays
* [#13123](https://github.com/apache/nuttx/pull/13123) fs/shmfs:Avoid an integer overflow
* [#12790](https://github.com/apache/nuttx/pull/12790) fs/spiffs: Return OK on `spiffs_fstat` success
* [#13407](https://github.com/apache/nuttx/pull/13407) fs/mmap: Add MADV_HUGEPAGE definitions
* [#13406](https://github.com/apache/nuttx/pull/13406) fs/mmap: Ensure anonymous pages are initialized to zero
* [#12661](https://github.com/apache/nuttx/pull/12661) fs/mnemofs: Adds Block Allocator
* [#12668](https://github.com/apache/nuttx/pull/12668) fs/mnemofs: Add parent iterator and path methods.
* [#12680](https://github.com/apache/nuttx/pull/12680) fs/mnemofs: Add LRU and CTZ methods
* [#12683](https://github.com/apache/nuttx/pull/12683) fs/mnemofs: Add journal methods.
* [#12702](https://github.com/apache/nuttx/pull/12702) fs/mnemofs: Add master node and r/w methods
* [#12943](https://github.com/apache/nuttx/pull/12943) fs/mnemofs: Autoformat
* [#12808](https://github.com/apache/nuttx/pull/12808) fs/mnemofs: Refactoring path logic, direntry size bug fix, open free bug fix
* [#12658](https://github.com/apache/nuttx/pull/12658) fs/mnemofs: Setup and VFS methods
* [#13475](https://github.com/apache/nuttx/pull/13475) fs/mount: add ftl proxy to mount block filesystem on mtd device
* [#13258](https://github.com/apache/nuttx/pull/13258) fs/mq_open: revise comments
* [#13326](https://github.com/apache/nuttx/pull/13326) fs/files_extend: Bug Fix
* [#13331](https://github.com/apache/nuttx/pull/13331) fs/inode: using inode reference to indicate unlink and simply code
* [#13077](https://github.com/apache/nuttx/pull/13077) Fsnotify
* [#12942](https://github.com/apache/nuttx/pull/12942) Hostfs support get filepath by ioctl
* [#12817](https://github.com/apache/nuttx/pull/12817) procfs/meminfo: free delaylist before reporting
* [#13058](https://github.com/apache/nuttx/pull/13058) procfs/mempool: fix did not remove when pool not enabled
* [#13092](https://github.com/apache/nuttx/pull/13092) rpmsgfs: fix out of bounds access caused by data transmission farmat
* [#13063](https://github.com/apache/nuttx/pull/13063) rpmsgfs: set fs type to rpmsgfs when mount through rpmsgfs
* [#13348](https://github.com/apache/nuttx/pull/13348) smartfs procfs: fix double declare g_smartfs_operations
* [#12939](https://github.com/apache/nuttx/pull/12939) rpmsgfs_client:Fix error return exception
* [#12941](https://github.com/apache/nuttx/pull/12941) rpmsgfs: support filelock
* [#13098](https://github.com/apache/nuttx/pull/13098) tmpfs: old data was loaded when SEEK_SET beyond end of the file
* [#13490](https://github.com/apache/nuttx/pull/13490) vfs:fix a type mismatch issue and a typo
Networking
Improvements
* [#13385](https://github.com/apache/nuttx/pull/13385) Fix the bug that netlink receive wait does not hang up
* [#13053](https://github.com/apache/nuttx/pull/13053) icmp:add net_lock to protect icmp connection
* [#13336](https://github.com/apache/nuttx/pull/13336) local_socket: add SO_SNDBUF & SO_RCVBUF support
* [#13045](https://github.com/apache/nuttx/pull/13045) localsocket improvment
* [#12639](https://github.com/apache/nuttx/pull/12639) net: Enable ICMP by default if IPv4 is enabled
* [#13028](https://github.com/apache/nuttx/pull/13028) net_chksum.c:mod process of generating sum to solve checksum error
* [#12991](https://github.com/apache/nuttx/pull/12991) net/icmpv6/icmpv6_input.c: fix undefined build error
* [#13093](https://github.com/apache/nuttx/pull/13093) net/netdev: Add periodic log for netdev statistics
* [#12689](https://github.com/apache/nuttx/pull/12689) net/netfilter: fix windows compile error
* [#12688](https://github.com/apache/nuttx/pull/12688) net/pkt: correct PF_PACKET family sending errors
* [#12995](https://github.com/apache/nuttx/pull/12995) net/pkt: fix issue that set nonblock by fcntl does not take effect
* [#13010](https://github.com/apache/nuttx/pull/13010) net/pkt: fix raw socket send data length is insufficient
* [#13120](https://github.com/apache/nuttx/pull/13120) net/tcp_timer: fix tcp_timer idle loop and retransmission bug
* [#13051](https://github.com/apache/nuttx/pull/13051) net/tcp: reset the dupack counter.
* [#12899](https://github.com/apache/nuttx/pull/12899) net/tun: Remove unused variables in read & write
* [#13191](https://github.com/apache/nuttx/pull/13191) net/tun: Support changing carrier state of TUN/TAP
* [#13350](https://github.com/apache/nuttx/pull/13350) net/udp: Fixed the issue of sending ICMP error when the destination address is broadcast/multicast.
* [#13037](https://github.com/apache/nuttx/pull/13037) netdev_upperhalf: add polling mode support for tx/rx
* [#13046](https://github.com/apache/nuttx/pull/13046) netdev/ioctl: Setting log level to warning on SIOCGIFHWADDR failure
* [#13007](https://github.com/apache/nuttx/pull/13007) netdev/lower: Add reclaim callback and use it in virtio-net
* [#13343](https://github.com/apache/nuttx/pull/13343) netdev/statistics: Add bytes for netdev statistics
* [#13008](https://github.com/apache/nuttx/pull/13008) netdev/upper: Delay replied packets to prevent TX quota become negated
* [#12992](https://github.com/apache/nuttx/pull/12992) netinet/in.h: add macro definitions to resolve compilation errors
* [#12994](https://github.com/apache/nuttx/pull/12994) netlib/route: add length for add/del route-func to reduce caller stack usage
* [#13335](https://github.com/apache/nuttx/pull/13335) netdb: Make NETDB_DNSSERVER_NAMESERVERS effective for NETDB_RESOLVCONF
* [#13038](https://github.com/apache/nuttx/pull/13038) netdb: netdb code support ffmpeg rtsp(getaddrinfo & getnameinfo)
* [#13049](https://github.com/apache/nuttx/pull/13049) Modify the IPV6 address acquisition method and the gateway settings.
* [#13125](https://github.com/apache/nuttx/pull/13125) modify for offload checksum and add macro with tcp/icmp/icmpv6/igmp checksum
* [#13026](https://github.com/apache/nuttx/pull/13026) modify the type of the ipv6 parameters to solve runtime error
* [#13029](https://github.com/apache/nuttx/pull/13029) solve Problem of tcp parameter calculation exceeding the boundary
* [#13156](https://github.com/apache/nuttx/pull/13156) sys/socket: implement compiler agnostic sockaddr_storage alignment
* [#13158](https://github.com/apache/nuttx/pull/13158) tcp_close.c:when tcp socket stays in TCP_FIN_WAIT_1 or TCP_FIN_WAIT_2,calling tcp_close_eventhandler releases received packets
* [#12999](https://github.com/apache/nuttx/pull/12999) tcp_input: if tcp->req > recvreq, send ack only when state is TCP_ESTABLISHED
Unsorted
Improvements
* [#13448](https://github.com/apache/nuttx/pull/13448) [Bug-Fix] Resource leaks
* [#13100](https://github.com/apache/nuttx/pull/13100) [BugFix]Command "critmon" error
* [#13002](https://github.com/apache/nuttx/pull/13002) 12K sample rate support
* [#13486](https://github.com/apache/nuttx/pull/13486) Accelerate access to interrupt status
* [#12980](https://github.com/apache/nuttx/pull/12980) add fb_vsync_pollnotify
* [#12959](https://github.com/apache/nuttx/pull/12959) Add goldfish events
* [#12951](https://github.com/apache/nuttx/pull/12951) Add irq disable func
* [#13130](https://github.com/apache/nuttx/pull/13130) Add memory pressure monitoring
* [#13089](https://github.com/apache/nuttx/pull/13089) api:add lib_realpath function
* [#12947](https://github.com/apache/nuttx/pull/12947) assert: add compile_assert macro
* [#13020](https://github.com/apache/nuttx/pull/13020) assert: check COMPILE_TIME_ASSERT before define
* [#13087](https://github.com/apache/nuttx/pull/13087) Audio upstream
* [#13044](https://github.com/apache/nuttx/pull/13044) Basic Atomic for NuttX
* [#13099](https://github.com/apache/nuttx/pull/13099) bch: alloc bch->buffer when offset not aligned
* [#13513](https://github.com/apache/nuttx/pull/13513) BCH: Add readonly configuration for BCH devices
* [#12853](https://github.com/apache/nuttx/pull/12853) binfmt/elf_loadfile: Set sh_addr even if SHF_ALLOC == 0
* [#12965](https://github.com/apache/nuttx/pull/12965) boot: fix potential bl jump to app failed issue
* [#13094](https://github.com/apache/nuttx/pull/13094) Bugfix hcreate
* [#13300](https://github.com/apache/nuttx/pull/13300) can: Before we use pstate, we should check if it is NULL.
* [#13570](https://github.com/apache/nuttx/pull/13570) can: Add g_ prefix to can_dlc_to_len and len_to_can_dlc.
* [#13048](https://github.com/apache/nuttx/pull/13048) can: CAN code optimization
* [#12656](https://github.com/apache/nuttx/pull/12656) can: fixes and tweaks for CAN FD support
* [#13126](https://github.com/apache/nuttx/pull/13126) Capture adds the function of edges counting
* [#12934](https://github.com/apache/nuttx/pull/12934) clk: fix reg operation not compatible with 64bit
* [#13210](https://github.com/apache/nuttx/pull/13210) cdcacm: align cdcacm_epconfigure function parameters
* [#13189](https://github.com/apache/nuttx/pull/13189) Controlling rgb led bp
* [#12889](https://github.com/apache/nuttx/pull/12889) Coredump enhancement, optimized prompt statements
* [#13474](https://github.com/apache/nuttx/pull/13474) coredump: just save latest core file
* [#12958](https://github.com/apache/nuttx/pull/12958) coredump: refine coredump info analyse
* [#13066](https://github.com/apache/nuttx/pull/13066) crypto: import the ability to clone session
* [#13109](https://github.com/apache/nuttx/pull/13109) crypto/bn: Provide software algorithms to calculate inverse elements and greatest common divisor
* [#13431](https://github.com/apache/nuttx/pull/13431) crypto/rsa: add exp mod in software crypto
* [#12970](https://github.com/apache/nuttx/pull/12970) Disable clean/flush optimization in case of SMP restriction
* [#12777](https://github.com/apache/nuttx/pull/12777) dlfcn: Add stub for dladdr
* [#12779](https://github.com/apache/nuttx/pull/12779) dlfcn: Fix indent issue in lib_dlclose.c
* [#13159](https://github.com/apache/nuttx/pull/13159) dynamically create work queues
* [#13489](https://github.com/apache/nuttx/pull/13489) enable O_CLOEXEC explicitly to avoid fd leak
* [#13118](https://github.com/apache/nuttx/pull/13118) Enhance ASSERT
* [#13424](https://github.com/apache/nuttx/pull/13424) Enhance Kasan
* [#13559](https://github.com/apache/nuttx/pull/13559) Enhance Kasan's global variable out of bounds detection
* [#13388](https://github.com/apache/nuttx/pull/13388) Expose IPTOS_xxx to the application layer
* [#12963](https://github.com/apache/nuttx/pull/12963) fdcheck: fix race condition in fdcheck
* [#13096](https://github.com/apache/nuttx/pull/13096) fb:add select overlay FB_NO_OVERLAY
* [#13296](https://github.com/apache/nuttx/pull/13296) filep Reference count
* [#12578](https://github.com/apache/nuttx/pull/12578) Fix allocated memory test
* [#13461](https://github.com/apache/nuttx/pull/13461) Fix dev_mem related
* [#13555](https://github.com/apache/nuttx/pull/13555) Fix greater-than-or-equal-to-zero issue
* [#12741](https://github.com/apache/nuttx/pull/12741) Fix pin LTDC_B0, should be PJ12 instead of PF0
* [#13129](https://github.com/apache/nuttx/pull/13129) Fix task_setup race condition
* [#13054](https://github.com/apache/nuttx/pull/13054) Fix the compilation warnings
* [#12955](https://github.com/apache/nuttx/pull/12955) fix the potential bug of putwc, fgetwc, ungetwc, wcsstr, fputwc
* [#13095](https://github.com/apache/nuttx/pull/13095) fix:uart_rpmsg_dmareceive
* [#13477](https://github.com/apache/nuttx/pull/13477) ftl: should pre-allocate eblock for car case
* [#13000](https://github.com/apache/nuttx/pull/13000) getrlimit: implement RLIMIT_STACK return limit stack size
* [#13459](https://github.com/apache/nuttx/pull/13459) GNSS: Add support for constellation, measurement, clock and geofence
* [#13504](https://github.com/apache/nuttx/pull/13504) goldfish:add kernel mode support
* [#13330](https://github.com/apache/nuttx/pull/13330) group/filelist: add reference to protect filelist of group
* [#13554](https://github.com/apache/nuttx/pull/13554) i2c: Optimize access to private data
* [#13233](https://github.com/apache/nuttx/pull/13233) Increase the chance for _assert to work early in the boot
* [#13306](https://github.com/apache/nuttx/pull/13306) init: add OSINIT_TASK_READY
* [#13228](https://github.com/apache/nuttx/pull/13228) inline restore_critical_section and add parameters to restore_critical_section
* [#12981](https://github.com/apache/nuttx/pull/12981) input: fix goldfish input and lvgl input device name mismatch problem
* [#13108](https://github.com/apache/nuttx/pull/13108) input: fix touchevent race condition
* [#13073](https://github.com/apache/nuttx/pull/13073) inode: call inode_release when close success
* [#13198](https://github.com/apache/nuttx/pull/13198) Introduce new PCI framework
* [#13442](https://github.com/apache/nuttx/pull/13442) input/ff: modify FF_MAX to support 64-bit machine
* [#13387](https://github.com/apache/nuttx/pull/13387) ipfrag: fix warnig
* [#13163](https://github.com/apache/nuttx/pull/13163) ipfrag: remove assert for actual product reasons
* [#13012](https://github.com/apache/nuttx/pull/13012) irq: add [enter|leave]_critical_section_nonirq
* [#13018](https://github.com/apache/nuttx/pull/13018) irq: add isr thread
* [#13242](https://github.com/apache/nuttx/pull/13242) irq: dynaminc create g_irqmap
* [#13256](https://github.com/apache/nuttx/pull/13256) irq: irq with the same priority share the same wqueue
* [#12595](https://github.com/apache/nuttx/pull/12595) irq: remove g_cpu_nestcount in restore_critical_section
* [#12935](https://github.com/apache/nuttx/pull/12935) irq: remove restore_critical_section in irq
* [#12596](https://github.com/apache/nuttx/pull/12596) irq: remove restore_critical_section in irq
* [#13369](https://github.com/apache/nuttx/pull/13369) irq: simplify code by using OSINIT_TASK_READY
* [#13119](https://github.com/apache/nuttx/pull/13119) Kasan enhance
* [#12893](https://github.com/apache/nuttx/pull/12893) kasan:fix bug write error is recognized as read error
* [#13133](https://github.com/apache/nuttx/pull/13133) Keep the log level consistent with assert
* [#12590](https://github.com/apache/nuttx/pull/12590) libmetal/atomic: enable 64-bit atomic by toolchain builtin flags
* [#13543](https://github.com/apache/nuttx/pull/13543) lilygo_tbeam_lora_gps/gps: Enable GNSSUTILS_MINMEA_LIB for EXAMPLES_GPS
* [#13549](https://github.com/apache/nuttx/pull/13549) lzf:Add macro judgment to header file reference.
* [#12929](https://github.com/apache/nuttx/pull/12929) make/disassembly: generate disassembly file
* [#13179](https://github.com/apache/nuttx/pull/13179) memset:optimizate speed.
* [#12985](https://github.com/apache/nuttx/pull/12985) minidumpserver: fix parsing bug
* [#13287](https://github.com/apache/nuttx/pull/13287) mksymtab.c support for structure
* [#13452](https://github.com/apache/nuttx/pull/13452) modify BUILD_LOADABLE to MODULES which backwards-compatible Kernel
* [#12968](https://github.com/apache/nuttx/pull/12968) MPU update
* [#13460](https://github.com/apache/nuttx/pull/13460) New Rpmsg Transports: Rpmsg Port SPI, Rpmsg Port Uart and Rpmsg Router Transport Support
* [#13104](https://github.com/apache/nuttx/pull/13104) nxmutex api enhance
* [#13047](https://github.com/apache/nuttx/pull/13047) nuttx-names.in:add popen & pclose assign to glibc interface
* [#13006](https://github.com/apache/nuttx/pull/13006) nuttx/audio: add AUDIOIOC_GETPOSITION ioctl
* [#13005](https://github.com/apache/nuttx/pull/13005) nuttx/audio: add offload buffer size config
* [#13340](https://github.com/apache/nuttx/pull/13340) nuttx/crypto: export asymmetric algorithms about ecdh and ecc256 via /dev/crypto
* [#13138](https://github.com/apache/nuttx/pull/13138) nuttx/crypto: fix wrong implementation in crypto module
* [#13173](https://github.com/apache/nuttx/pull/13173) nuttx/crypto: support new algorithm about crc32 and aes-cmac
* [#13084](https://github.com/apache/nuttx/pull/13084) nuttx/crypto: support poly1305 and ripemd160 algorithm
* [#12986](https://github.com/apache/nuttx/pull/12986) nuttx/note: fix missing the last character when printing custom labels.
* [#12730](https://github.com/apache/nuttx/pull/12730) NVS: fix align size
* [#13187](https://github.com/apache/nuttx/pull/13187) nvs: modify nvs block size and block numbers
* [#12601](https://github.com/apache/nuttx/pull/12601) queue: inline queue
* [#13435](https://github.com/apache/nuttx/pull/13435) pci/pci_uio_ivshmem: pci uio ivshmem msix interrupt support
* [#13178](https://github.com/apache/nuttx/pull/13178) pl031:change mktime to timegm.
* [#13057](https://github.com/apache/nuttx/pull/13057) pm_runtime: fix missing header
* [#13064](https://github.com/apache/nuttx/pull/13064) pm_activity: fix deadlock with spinlock and critcal_section
* [#13055](https://github.com/apache/nuttx/pull/13055) pm: add pm_idle, up_idle only handle pm state execution
* [#12933](https://github.com/apache/nuttx/pull/12933) pm: add debug_assert for cb register/unregister api
* [#13072](https://github.com/apache/nuttx/pull/13072) pm: update document, add pm_idle interface for not-smp case
* [#13279](https://github.com/apache/nuttx/pull/13279) poll: fix thread_cancel() caused poll used after free
* [#13074](https://github.com/apache/nuttx/pull/13074) Private requirement for wapi
* [#13168](https://github.com/apache/nuttx/pull/13168) protected build: userspace threads will unexpectly work in privileged mode after syscall
* [#13153](https://github.com/apache/nuttx/pull/13153) pty: use mutex to protect alloc minor
* [#13295](https://github.com/apache/nuttx/pull/13295) psram_cache_init: remove cosmetic differences between PRO/APP
* [#13438](https://github.com/apache/nuttx/pull/13438) ramlog bug fix
* [#13283](https://github.com/apache/nuttx/pull/13283) Refactor wdog module
* [#12891](https://github.com/apache/nuttx/pull/12891) Reimplemented the mempool traversal function and fixed some existing bugs in the mempool
* [#13463](https://github.com/apache/nuttx/pull/13463) rename, strtoul & sscanf
* [#13309](https://github.com/apache/nuttx/pull/13309) Restore ASSERT/VERIFY semantics
* [#13485](https://github.com/apache/nuttx/pull/13485) Revert "irq: add [enter|leave]_critical_section_nonirq"
* [#12607](https://github.com/apache/nuttx/pull/12607) Revert "irq: remove restore_critical_section in irq"
* [#13432](https://github.com/apache/nuttx/pull/13432) Rpmsg VirtIO Transport support and releated patches
* [#13183](https://github.com/apache/nuttx/pull/13183) rpmsg_rtc:Update g_basetime from rpmsg.
* [#13169](https://github.com/apache/nuttx/pull/13169) rpmsg.c: move onceinit judge logic to common part
* [#13404](https://github.com/apache/nuttx/pull/13404) rpmsgblk: split multi_cmd only when it is too large to be placed into…
* [#13465](https://github.com/apache/nuttx/pull/13465) rpmsgdev: Support server export and oneway polling
* [#13172](https://github.com/apache/nuttx/pull/13172) rptun.c: fix rptun.c format follow rpmsg virtio
* [#13203](https://github.com/apache/nuttx/pull/13203) rtc alarm:fix doesn't call nxsig_notification
* [#13515](https://github.com/apache/nuttx/pull/13515) shm: remove useless macro
* [#13280](https://github.com/apache/nuttx/pull/13280) smp: smp call handler add up_cpu_paused_[save|restore]
* [#13405](https://github.com/apache/nuttx/pull/13405) spi_slave: change length to nwords
* [#12599](https://github.com/apache/nuttx/pull/12599) spin_lock: inline spin_lock
* [#12837](https://github.com/apache/nuttx/pull/12837) spinlock: add support of spin_trylock_irqsave()
* [#12836](https://github.com/apache/nuttx/pull/12836) spinlock: inline no trace implement to remove duplicate logic
* [#13272](https://github.com/apache/nuttx/pull/13272) spinlock: spin_initialize should add memory barrier
* [#13457](https://github.com/apache/nuttx/pull/13457) stack recored bug fix
* [#13386](https://github.com/apache/nuttx/pull/13386) stream/syslograw: remove support for iob buffer in syslog
* [#13511](https://github.com/apache/nuttx/pull/13511) Support msync
* [#13196](https://github.com/apache/nuttx/pull/13196) support rss/arfs with device
* [#13106](https://github.com/apache/nuttx/pull/13106) suppress libasan checks
* [#13031](https://github.com/apache/nuttx/pull/13031) Synchronize the modification of the WiFi problems in QEMU.
* [#13113](https://github.com/apache/nuttx/pull/13113) Swift embedded support
* [#12820](https://github.com/apache/nuttx/pull/12820) task_fork.c: Fix vfork for BUILD_KERNEL
* [#12754](https://github.com/apache/nuttx/pull/12754) up_backtrace: fix maybe backtrace the exiting thread
* [#13293](https://github.com/apache/nuttx/pull/13293) Update clock speed
* [#13410](https://github.com/apache/nuttx/pull/13410) Update posix timer
* [#12611](https://github.com/apache/nuttx/pull/12611) Upgrade Segger SystemView to V3.54
* [#12705](https://github.com/apache/nuttx/pull/12705) V4l2m2m openh264 x264 to builtin
* [#13030](https://github.com/apache/nuttx/pull/13030) video/fb: changed circbuf_write assert to warning
* [#13433](https://github.com/apache/nuttx/pull/13433) VirtIO PCI Transport Support for NuttX
* [#13338](https://github.com/apache/nuttx/pull/13338) virtio-blk: support called read/write in interrupt
* [#13437](https://github.com/apache/nuttx/pull/13437) wqueue bug fix
* [#13241](https://github.com/apache/nuttx/pull/13241) wqueue: add interface work_queue_priority_wq and work_queue_priority

View file

@ -0,0 +1,930 @@
NuttX-12.8.0
------------
What's New In This Release
Major Changes to Core OS
Sched
* [#14080](https://github.com/apache/nuttx/pull/14080) Revert "sched/group/setuptask_file: duplicate idle task fd for kernelthreads
* [#14190](https://github.com/apache/nuttx/pull/14190) Revert "sched/spinlock: remove nesting spinlock support"
* [#14804](https://github.com/apache/nuttx/pull/14804) Revert "sem: change sem wait to atomic operation"
* [#14497](https://github.com/apache/nuttx/pull/14497) Revert "shced:sem: replace mutex with spinlock"
* [#14203](https://github.com/apache/nuttx/pull/14203) Reapply "sched/spinlock: remove nesting spinlock support"
* [#14761](https://github.com/apache/nuttx/pull/14761) Reapply "SYSLOG_DEFAULT: wrap up_putc/up_nputs calls with critical section" with a fix
* [#13950](https://github.com/apache/nuttx/pull/13950) sched note enhance
* [#13901](https://github.com/apache/nuttx/pull/13901) Sched note wdog
* [#14164](https://github.com/apache/nuttx/pull/14164) sched_backtrace: fix when dump running thread in other-core
* [#14875](https://github.com/apache/nuttx/pull/14875) sched_unlock: remove redundant/stale logic and comment
* [#14631](https://github.com/apache/nuttx/pull/14631) sched: add header irq.h to exit.c
* [#14183](https://github.com/apache/nuttx/pull/14183) sched: delete the dump file list when the thread exits
* [#13962](https://github.com/apache/nuttx/pull/13962) sched: export sched_getcpu API in AMP mode
* [#14243](https://github.com/apache/nuttx/pull/14243) sched: fix nxsched_process_delivered did not call hook
* [#14083](https://github.com/apache/nuttx/pull/14083) sched: fix nxsched_suspend_scheduler regression
* [#14026](https://github.com/apache/nuttx/pull/14026) sched: fix omitted merging the pending queue regression
* [#14059](https://github.com/apache/nuttx/pull/14059) sched: inline nxsched_select_cpu nxsched_add_prioritized 
* [#14272](https://github.com/apache/nuttx/pull/14272) sched: modify CONFIG_DUMP_ON_EXIT to CONFIG_SCHED_DUMP_ON_EXIT
* [#14286](https://github.com/apache/nuttx/pull/14286) sched: remove duplicate functions
* [#13995](https://github.com/apache/nuttx/pull/13995) sched: remove param in nxsched_remove_readytorun
* [#14954](https://github.com/apache/nuttx/pull/14954) sched: replace up_cpu_index with this_cpu
* [#14051](https://github.com/apache/nuttx/pull/14051) sched: support backtrace record
* [#14048](https://github.com/apache/nuttx/pull/14048) sched: There is no need to use sched_[un]lock
* [#14340](https://github.com/apache/nuttx/pull/14340) sched: Use spinlock repalce sched_[un]lock in some place
* [#14863](https://github.com/apache/nuttx/pull/14863) sched/addrenv.c: Fix usage of atomic_fetch_sub
* [#14061](https://github.com/apache/nuttx/pull/14061) sched/cpuload: fix SMP situation CPULOAD statistics are inaccurate
* [#14504](https://github.com/apache/nuttx/pull/14504) sched/cpuload: move g_cpuload_wdog to private chapter
* [#14069](https://github.com/apache/nuttx/pull/14069) sched/group: clear tcb group after group_release
* [#13957](https://github.com/apache/nuttx/pull/13957) sched/group: There is no need to use sched_[un]lock
* [#14186](https://github.com/apache/nuttx/pull/14186) sched/instrument: rename stack_record.c to stack_monitor.c
* [#14941](https://github.com/apache/nuttx/pull/14941) sched/lockcount: replace all lockcount check to nxsched_islocked_tcb()
* [#14815](https://github.com/apache/nuttx/pull/14815) sched/misc/assert.c: don't compile dump_assert_info logic if CONFIG_DEBUG_ALERT=n
* [#14614](https://github.com/apache/nuttx/pull/14614) sched/misc/assert.c: don't compile dump_task logic if CONFIG_DEBUG_ALERT=n
* [#14191](https://github.com/apache/nuttx/pull/14191) sched/pthread: Remove unused pthread_sem_xxx functions
* [#14032](https://github.com/apache/nuttx/pull/14032) sched/pthread: save pid before task activate
* [#14089](https://github.com/apache/nuttx/pull/14089) sched/pthread: There is no need to use sched_[un]lock
* [#14627](https://github.com/apache/nuttx/pull/14627) sched/sched: change the judgment condition for nxsched_set_affinity
* [#13896](https://github.com/apache/nuttx/pull/13896) sched/signal: change pthread_exit to nx_pthread_exit
* [#13934](https://github.com/apache/nuttx/pull/13934) sched/signal: Fix compilation errors for MSVC.
* [#14079](https://github.com/apache/nuttx/pull/14079) sched/spinlock: remove nesting spinlock support
* [#14454](https://github.com/apache/nuttx/pull/14454) sched/task_exit.c: Refresh current CPU instead of relying on stale value
* [#14402](https://github.com/apache/nuttx/pull/14402) sched/timer: Simplify setitimer implementation.
* [#14013](https://github.com/apache/nuttx/pull/14013) sched/wdog: Fix code style
* [#14003](https://github.com/apache/nuttx/pull/14003) sched/wdog: Revert wd_cancel semantics
* [#14629](https://github.com/apache/nuttx/pull/14629) sched/wqueue: fix work_notifier_setup() false failure
* [#14569](https://github.com/apache/nuttx/pull/14569) nuttx/semaphore: Move define CONFIG_SEM_PREALLOCHOLDERS to include/semaphore.h
* [#14129](https://github.com/apache/nuttx/pull/14129) nuttx/syscall: export nxsem_getprioceiling and nxsem_setprioceiling v…
* [#14581](https://github.com/apache/nuttx/pull/14581) pthread_cond remove csection  and sched_lock
* [#14786](https://github.com/apache/nuttx/pull/14786) pthread_cond_broadcast use wait_count for judement
* [#14626](https://github.com/apache/nuttx/pull/14626) pthread: remove enter_critical_section in pthread_barrier_wait
* [#14161](https://github.com/apache/nuttx/pull/14161) pthread: We should not directly include arch/spinlock.h
MM
* [#14314](https://github.com/apache/nuttx/pull/14314) Revert "mm/iob: Replace the critical section with spin lock"
* [#14370](https://github.com/apache/nuttx/pull/14370) `mempool` backtrace fix and de-init fix
* [#15060](https://github.com/apache/nuttx/pull/15060) mm_grantable.c: Fix infinite loop due to memory fragmentation
* [#14572](https://github.com/apache/nuttx/pull/14572) mm: Complete remaining unused macros instead of memory to fill tags
* [#14588](https://github.com/apache/nuttx/pull/14588) mm: fix tlsf compiler error
* [#13893](https://github.com/apache/nuttx/pull/13893) mm: Resolve a series of issues caused by opening the software tag kasan
* [#14858](https://github.com/apache/nuttx/pull/14858) mm/gran: Speed optimize gran_match
* [#13849](https://github.com/apache/nuttx/pull/13849) mm/heap: hold heap lock before access mm_nregions
* [#14054](https://github.com/apache/nuttx/pull/14054) mm/heap: memory alignment before executing kasan_register
* [#14764](https://github.com/apache/nuttx/pull/14764) mm/iob: remove csection
* [#14506](https://github.com/apache/nuttx/pull/14506) mm/kasan: extern kasan API only MM_KASAN is enabled
* [#14294](https://github.com/apache/nuttx/pull/14294) mm/Kconfig: adjust config options order and fix typos
* [#14105](https://github.com/apache/nuttx/pull/14105) mm/Kconfig: fix build error when MM_BACKTRACE > 0 and disable mempool
* [#14091](https://github.com/apache/nuttx/pull/14091) mm/kconfig: Remove unnecessary dependencies
* [#13891](https://github.com/apache/nuttx/pull/13891) mm/kconfig: set the default alignment of global variable out-of-bounds detection is 1
* [#14575](https://github.com/apache/nuttx/pull/14575) mm/mm_gran: fix compile warnings
* [#14144](https://github.com/apache/nuttx/pull/14144) mm/mm_heap: Optimizing heap performance changing the mm_size2ndx and…
* [#14547](https://github.com/apache/nuttx/pull/14547) mm/mm_memalign: add debugging log
* [#14114](https://github.com/apache/nuttx/pull/14114) mm/sw_tags: add config for no longer checking for tags 0
Libc
* [#14218](https://github.com/apache/nuttx/pull/14218) Revert "libc/atomic: decoupling atomic and spinlock to avoid recursion"
* [#14313](https://github.com/apache/nuttx/pull/14313) Revert "libs/libc:Openlibm adds exp10 and exp10f function implementat…
* [#14153](https://github.com/apache/nuttx/pull/14153) lib_memoryregion: fix the comments about the memory flags
* [#14799](https://github.com/apache/nuttx/pull/14799) lib_pathbuffer: change nxmutex -> spinlock
* [#14316](https://github.com/apache/nuttx/pull/14316) lib_stdoutstream:need return write size
* [#14148](https://github.com/apache/nuttx/pull/14148) lib_uuid_create: try use hardware random number generators first
* [#14292](https://github.com/apache/nuttx/pull/14292) lib/stdatomic: include stddef.h in atomic.h
* [#14661](https://github.com/apache/nuttx/pull/14661) libbuiltin: Simplify makefile writing
* [#14782](https://github.com/apache/nuttx/pull/14782) libbuiltin/kconfig: Modify coverage function dependencies
* [#14679](https://github.com/apache/nuttx/pull/14679) libbuiltin/Makefile: Modify the libbuiltin makefile to standard
* [#14715](https://github.com/apache/nuttx/pull/14715) libbuitin/compiler_rt: Supports separate builtin rt.builtins or rt.profile
* [#14451](https://github.com/apache/nuttx/pull/14451) libc string:Separate code.
* [#13969](https://github.com/apache/nuttx/pull/13969) libc: add CRC-8-ROHC support
* [#14296](https://github.com/apache/nuttx/pull/14296) libc: Add debug assert to prevent tls allocation failure
* [#14523](https://github.com/apache/nuttx/pull/14523) libc: Fix lib_arc4random.c:111:(.text.arc4random_buf+0x26): undefined reference to `clock_systime_ticks'
* [#14388](https://github.com/apache/nuttx/pull/14388) libc: Fix typo in libc/string/Kconfig.
* [#14365](https://github.com/apache/nuttx/pull/14365) libc: Make getcwd() work even CONFIG_DISABLE_ENVIRON is enabled
* [#14509](https://github.com/apache/nuttx/pull/14509) libc: Refine the arc4random_buf implementation
* [#14198](https://github.com/apache/nuttx/pull/14198) libc/atomic: decoupling atomic and spinlock to avoid recursion
* [#14057](https://github.com/apache/nuttx/pull/14057) libc/lib_utsname: Store version number for debugging and preventing optimization
* [#14753](https://github.com/apache/nuttx/pull/14753) libc/libc.csv: Fix signature of getpass
* [#14050](https://github.com/apache/nuttx/pull/14050) libc/machine: Fix the error caused by tag kasan
* [#14605](https://github.com/apache/nuttx/pull/14605) libc/machine/CMakeLists: should alaways build arch_atomic.c
* [#14798](https://github.com/apache/nuttx/pull/14798) libc/misc: do not sanitize backtrace_format
* [#14297](https://github.com/apache/nuttx/pull/14297) libc/modlib: Make modlib selectable from defconfig
* [#14154](https://github.com/apache/nuttx/pull/14154) libc/newlib:Declaration of adding depth
* [#15000](https://github.com/apache/nuttx/pull/15000) libc/puts: newline was omitted for empty string
* [#14589](https://github.com/apache/nuttx/pull/14589) libc/unistd: fixed tasking build issue
* [#14459](https://github.com/apache/nuttx/pull/14459) libcxx: fix compile error
* [#14431](https://github.com/apache/nuttx/pull/14431) libcxx: Ignore compile warnings.
* [#14244](https://github.com/apache/nuttx/pull/14244) libcxx: optional localization.
* [#15017](https://github.com/apache/nuttx/pull/15017) libcxx/CMakeLists.txt: Remove unnecessary flags.
* [#15057](https://github.com/apache/nuttx/pull/15057) libcxxabi: Soft link the libcxxabi header file to nuttx/include
* [#14884](https://github.com/apache/nuttx/pull/14884) libcxxmini: Add missing runtime related classes.
* [#15036](https://github.com/apache/nuttx/pull/15036) libm: Do not link the toolchain's libm unless explicitly selected
* [#15037](https://github.com/apache/nuttx/pull/15037) libm: Do not link the toolchain's libm unless explicitly selected [2]
* [#14783](https://github.com/apache/nuttx/pull/14783) libm: fix typo caused compile failed
* [#15022](https://github.com/apache/nuttx/pull/15022) libm/newlib: Add arch-specific source code first to CSRCS
* [#14101](https://github.com/apache/nuttx/pull/14101) libm/newlib: remove -Wno-maybe-uninitialized
* [#14838](https://github.com/apache/nuttx/pull/14838) libs: add gcov framework support
* [#14291](https://github.com/apache/nuttx/pull/14291) libs: remove lib_libbsprintf automatic line wrapping
* [#14570](https://github.com/apache/nuttx/pull/14570) libs/arch_libc:Add kasan protection for memset and other mm api
* [#14136](https://github.com/apache/nuttx/pull/14136) libs/libc: Optimize the stack space of lib_vsprintf by splitting argl…
* [#14142](https://github.com/apache/nuttx/pull/14142) libs/libc:Openlibm adds exp10 and exp10f function implementations
* [#13961](https://github.com/apache/nuttx/pull/13961) libs/libc/fdt/Make.defs: cannot move due to directory not empty bugfix
* [#14559](https://github.com/apache/nuttx/pull/14559) libs/libc/obstack: fix allocated chunk overrun due to invalid limit
* [#14328](https://github.com/apache/nuttx/pull/14328) libs/libxx: uClibc depends on CONFIG_ALLOW_GPL_COMPONENTS=y
* [#14284](https://github.com/apache/nuttx/pull/14284) libs/misc/memoryregion: remove unused memory_region
* [#14600](https://github.com/apache/nuttx/pull/14600) libs/modlib: Load data using `up_textheap_data_address`
* [#14364](https://github.com/apache/nuttx/pull/14364) libs/modlib.c: Set VMA for empty and unallocated sections
* [#14705](https://github.com/apache/nuttx/pull/14705) libs/uClibc++: Fix the Download URL for uClibc++
* [#14706](https://github.com/apache/nuttx/pull/14706) libs/uClibc++: Fix the Download URL for uClibc++ (CMake)
* [#13988](https://github.com/apache/nuttx/pull/13988) libs/x86_64:Add the setjmp/longjmp function
* [#14145](https://github.com/apache/nuttx/pull/14145) libs/xxx/CMakeLists.txt: add cmake compile support
* [#14668](https://github.com/apache/nuttx/pull/14668) libxx: All cxx libraries move down one level
* [#14471](https://github.com/apache/nuttx/pull/14471) libxx: C++ low level library select LIBSUPCXX by default.
* [#14250](https://github.com/apache/nuttx/pull/14250) libxx: Globally reference the header file of libcxxabi.
* [#14586](https://github.com/apache/nuttx/pull/14586) libxx/patch: Remove jira information and change-id 
* [#14238](https://github.com/apache/nuttx/pull/14238) nuttx/libc:Add _dl_find_object and dl_iterate_phdr function.
* [#14085](https://github.com/apache/nuttx/pull/14085) nuttx/libcxxtest: Fix build error.
Tools
* [#13959](https://github.com/apache/nuttx/pull/13959) [bugfix]checkpatch.sh:Fix checking for wrong cmake files
* [#13958](https://github.com/apache/nuttx/pull/13958) [bugfix]tools/mkdeps.c:add options for gen full path object target
* [#14723](https://github.com/apache/nuttx/pull/14723) [darwin] CI macos-14 : updated toolchains for macOS Apple Silicon
* [#14892](https://github.com/apache/nuttx/pull/14892) [MSYS2] CMake+Ninja Fix arm-none-eabi-ar: Argument list too long
* [#14539](https://github.com/apache/nuttx/pull/14539) toolchain/tasking: fix build break on tasking toolchain
* [#14620](https://github.com/apache/nuttx/pull/14620) toolchains: Compiler versioning adds --print-memory-usage
* [#14387](https://github.com/apache/nuttx/pull/14387) tools: fix parsetrace.py output
* [#14046](https://github.com/apache/nuttx/pull/14046) tools: gcov.sh supports generating device-side code coverage
* [#14289](https://github.com/apache/nuttx/pull/14289) tools: Rename apps-or-nuttx-Make.defs to Make.defs
* [#14399](https://github.com/apache/nuttx/pull/14399) tools/checkpatch: fix isort doesn't return error
* [#14691](https://github.com/apache/nuttx/pull/14691) tools/ci/platforms/darwin.sh: Port NuttX CI Job to macOS-14
* [#14121](https://github.com/apache/nuttx/pull/14121) tools/configure.sh: add relative path
* [#14438](https://github.com/apache/nuttx/pull/14438) tools/esp32s3/Config.mk: fix "printf:`\': invalid format character"
* [#14393](https://github.com/apache/nuttx/pull/14393) tools/esp32s3/Config.mk: fix "unterminated call to function" error
* [#14267](https://github.com/apache/nuttx/pull/14267) tools/espressif: add esptool version check to Espressif build system
* [#14933](https://github.com/apache/nuttx/pull/14933) tools/gdb: Add a singleton class for macros
* [#14902](https://github.com/apache/nuttx/pull/14902) tools/imx9: Add norimage support to bootloader
* [#14565](https://github.com/apache/nuttx/pull/14565) tools/mkdeps: increase MAX_BUFFER from 16384 to 65536
* [#14709](https://github.com/apache/nuttx/pull/14709) tools/rp2040: Building picotool if necessary
* [#14147](https://github.com/apache/nuttx/pull/14147) tools/showsize.sh: support pass custom nuttx executable
* [#14047](https://github.com/apache/nuttx/pull/14047) tools/Unix.mk: allow defconfig to overwrite old config
Various
* [#13919](https://github.com/apache/nuttx/pull/13919) OpenAMP Upgrade Part1: prepare for the OpenAMP Upgrade
* [#14155](https://github.com/apache/nuttx/pull/14155) openamp/libmetal: use config OPENAMP_CACHE to control lib metal cache…
* [#14843](https://github.com/apache/nuttx/pull/14843) GDB Plugin Upgrade Part1 - Thread related commands
* [#14851](https://github.com/apache/nuttx/pull/14851) GDB Plugin Upgrade part2: memory leak detection and other memory tools
* [#14854](https://github.com/apache/nuttx/pull/14854) GDB Plugin Upgrade part3: fs related tools
* [#14899](https://github.com/apache/nuttx/pull/14899) GDB Plugin Upgrade part4: net related tools
* [#14920](https://github.com/apache/nuttx/pull/14920) gdb/debug: add debugpy to debug python code
* [#14315](https://github.com/apache/nuttx/pull/14315) gdbserver.py optimization
* [#14486](https://github.com/apache/nuttx/pull/14486) gdbstub:remove ARCH_HAVE_DEBUG depends
* [#14789](https://github.com/apache/nuttx/pull/14789) gdbstub:typo fix
* [#13903](https://github.com/apache/nuttx/pull/13903) gdbstub:we can use uart to debug with gdb when crash
* [#14309](https://github.com/apache/nuttx/pull/14309) include: queue.h: Make flink clear after sq_rem
* [#14536](https://github.com/apache/nuttx/pull/14536) include/netinet/if_ether.h: add ethhdr definition
* [#14193](https://github.com/apache/nuttx/pull/14193) include/nuttx/arch.h: MSI alloc API should be always available
* [#15015](https://github.com/apache/nuttx/pull/15015) include/usbdev_trace: Fix argument number and return value of macro `usbtrace_enumerate()`
* [#14187](https://github.com/apache/nuttx/pull/14187) nuttx:move "#define STRINGIFY(x)" to nuttx/macro.h
* [#14537](https://github.com/apache/nuttx/pull/14537) nuttx/atomic.h:Add use condition for using stdatomic.h
* [#14233](https://github.com/apache/nuttx/pull/14233) nuttx/elf.h: Fix build error with unknown type name 'bool'.
* [#14665](https://github.com/apache/nuttx/pull/14665) nuttx/uorb.h: Add GNSS firmware version for `struct sensor_gnss`
* [#14913](https://github.com/apache/nuttx/pull/14913) nuttxgdb list function enhancement
* [#14916](https://github.com/apache/nuttx/pull/14916) nuttxgdb memory commands performance optimization
* [#15001](https://github.com/apache/nuttx/pull/15001) nuttxgdb minor fix
* [#14914](https://github.com/apache/nuttx/pull/14914) nuttxgdb net module update
* [#14912](https://github.com/apache/nuttx/pull/14912) nuttxgdb utils module update
* [#14915](https://github.com/apache/nuttx/pull/14915) nuttxgdb utils value update
* [#14919](https://github.com/apache/nuttx/pull/14919) nuttxgdb: add error hint to gdbinit
* [#14921](https://github.com/apache/nuttx/pull/14921) nuttxgdb: minor fix to diagnose command and thread module
* [#14976](https://github.com/apache/nuttx/pull/14976) nuttxgdb/rpmsg.py:dump rpmsg_service message
* [#14347](https://github.com/apache/nuttx/pull/14347) coredump bug fix
* [#14262](https://github.com/apache/nuttx/pull/14262) coredump: add architecture-specific registers dump including NVIC an…
* [#14485](https://github.com/apache/nuttx/pull/14485) coredump: coredump_add_memory_region need use flags
* [#14150](https://github.com/apache/nuttx/pull/14150) coredump: do not dump non-writeable memory segment
* [#14254](https://github.com/apache/nuttx/pull/14254) coredump: fix bug that memsegs got invalid value
* [#14295](https://github.com/apache/nuttx/pull/14295) coredump.c: del multiple behavior
* [#14553](https://github.com/apache/nuttx/pull/14553) coredump.py:bug fix python file not have rename
Build System
Improvements
* [#15053](https://github.com/apache/nuttx/pull/15053) kasan/globals: fix compile error
* [#15056](https://github.com/apache/nuttx/pull/15056) kasan/lto: Turn off lto by default anyway
* [#14327](https://github.com/apache/nuttx/pull/14327) clang: support gcov ARM LLVM clang supports code coverage detection
* [#14472](https://github.com/apache/nuttx/pull/14472) clang:libclang_rt.builtins-xxx.a supports builtin
* [#14637](https://github.com/apache/nuttx/pull/14637) clang/cmake: Fix clang cmake can't find libgcc align with makefile
* [#14877](https://github.com/apache/nuttx/pull/14877) Clang/gcov: Enhance clang gcov dump
* [#14544](https://github.com/apache/nuttx/pull/14544) clang/ld.lld: clang17's ld.lld and above support the option --print-memory-usage
* [#14095](https://github.com/apache/nuttx/pull/14095) common/Toolchain.defs: support CONFIG_DEBUG_NOOPT for x86_64
* [#14127](https://github.com/apache/nuttx/pull/14127) common/Toolchain.defs: support CONFIG_DEBUG_NOOPT for x86_64
* [#14123](https://github.com/apache/nuttx/pull/14123) Compile warning fix & header file adjust
* [#15032](https://github.com/apache/nuttx/pull/15032) gcc/gcov: Add instrumentation function
* [#14970](https://github.com/apache/nuttx/pull/14970) gcov: Add gcov gcc implementation and toolchain to ci compilation
* [#14890](https://github.com/apache/nuttx/pull/14890) gcov: Add toolchain gcov dependency option
* [#14946](https://github.com/apache/nuttx/pull/14946) gcov: Add usage documentation
* [#14538](https://github.com/apache/nuttx/pull/14538) gcov: Fix typographical errors
* [#14557](https://github.com/apache/nuttx/pull/14557) gcov: Support for the most streamlined profile of LLVM-embedded-toolchain-for-Arm
* [#13965](https://github.com/apache/nuttx/pull/13965) gcov:adjust gcov configuration name and delete non-existent dependencie
* [#14251](https://github.com/apache/nuttx/pull/14251) cmake: add newly added sources to cmake
* [#14615](https://github.com/apache/nuttx/pull/14615) cmake: don't include syslog files if CONFIG_SYSLOG=n
* [#14404](https://github.com/apache/nuttx/pull/14404) cmake: fix the fdiagnostics-color handle issue
* [#14401](https://github.com/apache/nuttx/pull/14401) cmake: Renamed savedefconfig with refreshsilent
* [#14756](https://github.com/apache/nuttx/pull/14756) cmake:bugfix kconfig menu in cmake cannot be generated recursively
* [#14592](https://github.com/apache/nuttx/pull/14592) cmake:implement CMake build of xtensa arch
* [#14576](https://github.com/apache/nuttx/pull/14576) cmake(bugfix): add host mkdeps&incdir tool CMake build and fix X86_64 compile error
* [#14206](https://github.com/apache/nuttx/pull/14206) cmake(bugfix):add dependencies for nuttx_post ensure time order
* [#14746](https://github.com/apache/nuttx/pull/14746) cmake(bugfix):add missing source file for driver/serial and keep romfs cmake intermediate 
* [#14607](https://github.com/apache/nuttx/pull/14607) cmake(bugfix):add xtensa libc machine function build
* [#14210](https://github.com/apache/nuttx/pull/14210) cmake(bugfix):disable proxy and service source in open-amp
* [#15064](https://github.com/apache/nuttx/pull/15064) cmake(bugfix):fix CMake build break on MacOS
* [#14703](https://github.com/apache/nuttx/pull/14703) cmake(bugfix):fix directory not being successfully added when adding romfs
* [#14780](https://github.com/apache/nuttx/pull/14780) cmake(bugfix):fix libcxx build error cause by layout changed
* [#14427](https://github.com/apache/nuttx/pull/14427) cmake(bugfix):Fixed the issue that the host toolchain version cannot be specified
* [#14624](https://github.com/apache/nuttx/pull/14624) cmake(bugfix):make sure the extra_lib only added once
* [#14757](https://github.com/apache/nuttx/pull/14757) cmake(bugfix):remove no need target_link_library in static target
* [#13971](https://github.com/apache/nuttx/pull/13971) cmake(bugfix):Synchronize the compilation differences between CMake and Makefile in nuttx repo
* [#14612](https://github.com/apache/nuttx/pull/14612) cmake(build):add the specified armclang compiler to the cmake  Toolchain file
* [#14265](https://github.com/apache/nuttx/pull/14265) cmake(clear warning):toolchain file do not need set parent scope
* [#14747](https://github.com/apache/nuttx/pull/14747) cmake(enhance):add NuttX CMake extensions module
* [#14907](https://github.com/apache/nuttx/pull/14907) cmake(enhance):enhance NuttX cmake target_dependencies and link_library modules
* [#15009](https://github.com/apache/nuttx/pull/15009) cmake(enhance):Enhance romfs so that RAWS files can be added in any location
* [#13955](https://github.com/apache/nuttx/pull/13955) cmake(Enhancement):enhance compile options for custom toolchainimplement the REVERSE opt of `add_compile_options()`
* [#14175](https://github.com/apache/nuttx/pull/14175) cmake(refine):fix cmake options typo and add EXTRA_FLAGS support
* [#13890](https://github.com/apache/nuttx/pull/13890) Cmake/kasan:  cmake supports multiple link global variables out of bounds
* [#14540](https://github.com/apache/nuttx/pull/14540) CMake/preprocess: fix typo PREPROCES -> PREPROCESS
Architectural Support
New Architecture Support
* [#14599](https://github.com/apache/nuttx/pull/14599) Adding STM32H5 arch files
* [#14831](https://github.com/apache/nuttx/pull/14831) Raspberry Pico 2 porting
Architecture Improvements
* [#13876](https://github.com/apache/nuttx/pull/13876) arch/irq: add the up_getusrpc macro to get the PC of the interrupted …
* [#14491](https://github.com/apache/nuttx/pull/14491) arch/Kconfig: remove ARCH_MATH_H if LIBCXX
* [#13967](https://github.com/apache/nuttx/pull/13967) arch/libc: Integrate vfork into fork and vfork directly call up_fork
* [#14058](https://github.com/apache/nuttx/pull/14058) arch/perf: modify the return value of up_perf_gettime to clock_t
* [#14779](https://github.com/apache/nuttx/pull/14779) arch/toolchain: Add toolchain gcc
* [#14170](https://github.com/apache/nuttx/pull/14170) Revert "nuttx/arch:Enabling ARCH_MATH_H is required when compiling sim with the 13.2 version of the toolchain"
* [#14803](https://github.com/apache/nuttx/pull/14803) arch_atomic : Introduce CONFIG_LIBC_ARCH_ATOMIC
* [#14827](https://github.com/apache/nuttx/pull/14827) arch_atomic: support nx atomic function
* [#14880](https://github.com/apache/nuttx/pull/14880) arch_atomic: use small lock in libs/libc/machine/arch_atomic.c
* [#14312](https://github.com/apache/nuttx/pull/14312) select ARM_HAVE_MVE and ARCH_HAVE_FPU for mps platform
ARM
* [#14221](https://github.com/apache/nuttx/pull/14221) Arm qemu
* [#14107](https://github.com/apache/nuttx/pull/14107) arm_gicv2_dump: optimize gic dump
* [#14434](https://github.com/apache/nuttx/pull/14434) arm: fix dataabort on qemu-armv7a:knsh
* [#14865](https://github.com/apache/nuttx/pull/14865) arm: remove up_set_current_regs/up_current_regs
* [#14134](https://github.com/apache/nuttx/pull/14134) arm/armv8-r: add implements of arm_get_mpid()
* [#14498](https://github.com/apache/nuttx/pull/14498) arm/armv8-r: fix unable to switch context in ISR context
* [#14496](https://github.com/apache/nuttx/pull/14496) arm/armv8-r: init HSCTLR and HACTLR for EL2
* [#14502](https://github.com/apache/nuttx/pull/14502) arm/armv8-r: optimize generic timer initialization
* [#14474](https://github.com/apache/nuttx/pull/14474) arm/build: suppress LOAD RWX linker warning
* [#14173](https://github.com/apache/nuttx/pull/14173) arm/cmake: fix cmake compile error
* [#14363](https://github.com/apache/nuttx/pull/14363) arm/cxd56: use chip specific vectors to allow smpcall update regs
* [#14846](https://github.com/apache/nuttx/pull/14846) arm/efm32: fix regression by PR#14810
* [#14503](https://github.com/apache/nuttx/pull/14503) arm/gicv3: replace this_cpu() to up_cpu_index()
* [#14219](https://github.com/apache/nuttx/pull/14219) arm/goldfish: add memory map for DDR region
* [#14959](https://github.com/apache/nuttx/pull/14959) arm/isr: move up_set_interrupt_context() to chip define
* [#14748](https://github.com/apache/nuttx/pull/14748) arm/olimex-stm32-p407: Fix kmodule board profile
* [#14712](https://github.com/apache/nuttx/pull/14712) arm/phy6222: Fix the garbled Linker Script
* [#14277](https://github.com/apache/nuttx/pull/14277) arm/riscv: remove redundant judgment
* [#14750](https://github.com/apache/nuttx/pull/14750) arm/rp2040: Add support for Waveshare RP2040 Zero board
* [#14197](https://github.com/apache/nuttx/pull/14197) arm/stm32f401rc-rs485: Add support to WS2812 addressable LED
* [#14887](https://github.com/apache/nuttx/pull/14887) armv6-m: fix the incorrect stub-function entry address of svc call
* [#14307](https://github.com/apache/nuttx/pull/14307) armv7-a:adjust gdb register order
* [#15058](https://github.com/apache/nuttx/pull/15058) armv7-a/armv7-r/armv8-r: percpu reg store this_task
* [#14301](https://github.com/apache/nuttx/pull/14301) armv8-m: set fpscr when do exception_direct
* [#14360](https://github.com/apache/nuttx/pull/14360) armv8-r/cp15: fix the problem of op1 operand confusion in ICC_SGI1R
* [#14160](https://github.com/apache/nuttx/pull/14160) armv8-r/gicv3: disable 64bits access gic 64bits registers
* [#14929](https://github.com/apache/nuttx/pull/14929) armv8-r/gicv3: support fiq
* [#14928](https://github.com/apache/nuttx/pull/14928) armv8-r/libc: optimize libc string apis with asm
* [#14495](https://github.com/apache/nuttx/pull/14495) armv8m/clang.cmake: add armv8m clang config
* [#13877](https://github.com/apache/nuttx/pull/13877) arch: fix the sched parameter update when exiting
* [#14135](https://github.com/apache/nuttx/pull/14135) arch: set current regs firstly in undefinedinsn
* [#13886](https://github.com/apache/nuttx/pull/13886) arch: support customized up_cpu_index() in AMP mode
* [#14881](https://github.com/apache/nuttx/pull/14881) arch/arm: syscall SYS_switch_context and SYS_restore_context use 0 para
* [#14264](https://github.com/apache/nuttx/pull/14264) arch/armv7:fix a typo
* [#13861](https://github.com/apache/nuttx/pull/13861) arch: cxd56xx: Add SD card 4-bit capability
* [#14847](https://github.com/apache/nuttx/pull/14847) arch: cxd56xx: Fix compile error of cxd56_gnss.c
* [#14842](https://github.com/apache/nuttx/pull/14842) arch: cxd56xx: Fix cxd56xx for SMP
* [#14993](https://github.com/apache/nuttx/pull/14993) arch: cxd56xx: use small lock in arch/arm/src/cxd56xx/cxd56_clock.c
* [#15031](https://github.com/apache/nuttx/pull/15031) arch: cxd56xx: use small lock in arch/arm/src/cxd56xx/cxd56_nxaudio_src.c
* [#15033](https://github.com/apache/nuttx/pull/15033) rp23xx: use small lock in arch/arm/src/rp23xx/rp23xx_usbdev.c
* [#15062](https://github.com/apache/nuttx/pull/15062) s32k1xx_serial: arch/arm/src/s32k1xx/s32k1xx_serial.c
* [#14795](https://github.com/apache/nuttx/pull/14795) arch/arm/src/samv7/sam_afec.c: AFEC1 actually has 12 physical inputs
* [#14436](https://github.com/apache/nuttx/pull/14436) sam_sfc.c incorrect EFUSEIOC name used
* [#14322](https://github.com/apache/nuttx/pull/14322) SAMA5 fix compiler warning in sam_adc.c
* [#14128](https://github.com/apache/nuttx/pull/14128) SAMA5D2. Fix DEBUGASSERT triggered in sam_updhs.c
* [#15013](https://github.com/apache/nuttx/pull/15013) samv7: fix bytes to words calculation in user signature read
* [#14425](https://github.com/apache/nuttx/pull/14425) samv7: fix QSPI build
* [#14512](https://github.com/apache/nuttx/pull/14512) arch/arm/stm32: convert error to warning when CCM is not enabled
* [#13870](https://github.com/apache/nuttx/pull/13870) arch/arm/stm32{|f7}/socketcan: fix debugassert for extid frames
* [#14527](https://github.com/apache/nuttx/pull/14527) arch/arm/stm32/Kconfig: fix Kconfig error
* [#14534](https://github.com/apache/nuttx/pull/14534) arch/arm/stm32/stm32_dumpgpio.c: fix print warnings
* [#14768](https://github.com/apache/nuttx/pull/14768) arch/stm32h5: Add ADC hardware register file
* [#14860](https://github.com/apache/nuttx/pull/14860) arch/stm32h5: add basic ADC support
* [#14692](https://github.com/apache/nuttx/pull/14692) arch/stm32h5: Add ethernet hardware support files
* [#14883](https://github.com/apache/nuttx/pull/14883) arch/stm32h5: Add timer register hardware file
* [#14676](https://github.com/apache/nuttx/pull/14676) arch/stm32h5: H5 add ethernet options to Kconfig
* [#14813](https://github.com/apache/nuttx/pull/14813) arch/stm32h5: Simplify PLL configuration.
* [#14336](https://github.com/apache/nuttx/pull/14336) STM32G4 Flash Driver
* [#14769](https://github.com/apache/nuttx/pull/14769) STM32H5 I2C Driver
* [#14675](https://github.com/apache/nuttx/pull/14675) STM32H5 RCC Fixes
* [#15021](https://github.com/apache/nuttx/pull/15021) Add STM32H5 FDCAN Hardware File
* [#14515](https://github.com/apache/nuttx/pull/14515) arch/arm/stm32h7: add workaround for Renode
* [#14995](https://github.com/apache/nuttx/pull/14995) imxrt_serial: use small lock in arch/arm/src/imxrt/imxrt_serial.c
ARM64
* [#14770](https://github.com/apache/nuttx/pull/14770) Add arm64 support for gdbserver.py tool
* [#13978](https://github.com/apache/nuttx/pull/13978) Arm64 arch
* [#14280](https://github.com/apache/nuttx/pull/14280) Arm64 board
* [#13985](https://github.com/apache/nuttx/pull/13985) ARM64 bug fix
* [#14074](https://github.com/apache/nuttx/pull/14074) ARM64 CONTEXT REGS number is 36
* [#14940](https://github.com/apache/nuttx/pull/14940) arm64: change name saved_reg to saved_regs
* [#14991](https://github.com/apache/nuttx/pull/14991) arm64: change some format
* [#14829](https://github.com/apache/nuttx/pull/14829) arm64: fix compile failed 'tpidr_el1' undeclared
* [#14628](https://github.com/apache/nuttx/pull/14628) arm64: fix compile failed when build ELF apps
* [#14476](https://github.com/apache/nuttx/pull/14476) arm64: fix fvp smp faild to boot
* [#14171](https://github.com/apache/nuttx/pull/14171) arm64: fix the cmake break in kernel mode
* [#14980](https://github.com/apache/nuttx/pull/14980) arm64: remove g_running_tasks[this_cpu()] = NULL
* [#14824](https://github.com/apache/nuttx/pull/14824) arm64: remove unused code
* [#14905](https://github.com/apache/nuttx/pull/14905) arm64: remove up_set_current_regs/up_current_regs
* [#14911](https://github.com/apache/nuttx/pull/14911) arm64: syscall SYS_switch_context and SYS_restore_context use 0 para
* [#15026](https://github.com/apache/nuttx/pull/15026) arm64/imx8: fix build break
* [#14787](https://github.com/apache/nuttx/pull/14787) arm64/imx9: add imx93-evk ddr training
* [#15054](https://github.com/apache/nuttx/pull/15054) arm64/lto: Fix link error after opening lto
* [#14771](https://github.com/apache/nuttx/pull/14771) arm64/mcount.c: Add to nuttx compilation
* [#14978](https://github.com/apache/nuttx/pull/14978) arm64/mte: Add support for arm64 mte
* [#15029](https://github.com/apache/nuttx/pull/15029) arm64/qemu: Add 9pfs configuration
* [#14983](https://github.com/apache/nuttx/pull/14983) arm64/toolchain: Cmake alignment makefile writing
* [#15052](https://github.com/apache/nuttx/pull/15052) arm64/toolchain: Fix toolchain judgment after opening lto
* [#14470](https://github.com/apache/nuttx/pull/14470) arm64/toolchains:Add the following kasan compilation options
* [#14455](https://github.com/apache/nuttx/pull/14455) arhc/arm64: vector table may be far away form arm64_fatal_handle
* [#14648](https://github.com/apache/nuttx/pull/14648) arch/arm64: add have fork config
* [#14235](https://github.com/apache/nuttx/pull/14235) arch/arm64: add support to config SPI interrupt affinity routing to CPU0 by default
* [#14730](https://github.com/apache/nuttx/pull/14730) arch/arm64: bug fixarm64_fatal_handler need regs parms
* [#14247](https://github.com/apache/nuttx/pull/14247) arch/arm64: fix build warnings
* [#14689](https://github.com/apache/nuttx/pull/14689) arch/arm64: Optimized SGI to avoid VM exit.
* [#14381](https://github.com/apache/nuttx/pull/14381) arch/arm64: Remove arm64_copystate.c
* [#14242](https://github.com/apache/nuttx/pull/14242) arch/arm64: remove struct regs_context
* [#14063](https://github.com/apache/nuttx/pull/14063) arch/arm64: rename register names to align with arm32
* [#14739](https://github.com/apache/nuttx/pull/14739) arch/arm64: syscall SYS_switch_context and SYS_restore_context use tcb as parm
* [#14986](https://github.com/apache/nuttx/pull/14986) arch/arm64/imx9: Boot move mmu init to correct place
* [#14972](https://github.com/apache/nuttx/pull/14972) arch/arm64/imx9: Clear DMA channel interrupts on init
* [#14653](https://github.com/apache/nuttx/pull/14653) arch/arm64/imx9: Clear edma4 mux conf before set
* [#14868](https://github.com/apache/nuttx/pull/14868) arch/arm64/imx9: Fix cntrfrq_el0 to correct value
* [#14688](https://github.com/apache/nuttx/pull/14688) arch/arm64/imx9: Reset rx fifo in mode change
* [#14973](https://github.com/apache/nuttx/pull/14973) arch/arm64/imx9/imx9_flexspi: Replace memcpy by while loop
* [#14864](https://github.com/apache/nuttx/pull/14864) arch/arm64/imx9/lspi: improve spi initialization
* [#14671](https://github.com/apache/nuttx/pull/14671) arch/arm64/src/common/arm64_fatal.c: Fix compilation warning with -We…
* [#14577](https://github.com/apache/nuttx/pull/14577) arch/arm64/src/imx9/imx9_lpuart.c: Fix parity get in TCGETS
* [#14306](https://github.com/apache/nuttx/pull/14306) imx8qm-mek: Resolve boot issue for non-EL3 environments
* [#14684](https://github.com/apache/nuttx/pull/14684) Imx9 flexspi updates
* [#14870](https://github.com/apache/nuttx/pull/14870) Imx9 lpi2c fixes
* [#14478](https://github.com/apache/nuttx/pull/14478) Imx9 lpspi fixes
* [#14545](https://github.com/apache/nuttx/pull/14545) Imx9 uart cleanups and flow control
* [#14685](https://github.com/apache/nuttx/pull/14685) imx9/flexcan: Add disable/enable cycle
* [#14373](https://github.com/apache/nuttx/pull/14373) imx9/flexcan: Make self reception disable to be configurable
RISC_V
* [#14741](https://github.com/apache/nuttx/pull/14741) arch/risc-v: Add ARCH_HAVE_RAMFUNCS option for ESP32-C3
* [#14878](https://github.com/apache/nuttx/pull/14878) arch/risc-v: Minor document improvement
* [#14961](https://github.com/apache/nuttx/pull/14961) arch/risc-v/src/cmake/Toolchain.cmake: Msys2 CMake fixed nuttx/config.h: No such file or directory
* [#14841](https://github.com/apache/nuttx/pull/14841) arch/risc-v/src/mpfs/mpfs_irq.c: Default global interrupt priorities
* [#14329](https://github.com/apache/nuttx/pull/14329) arch/riscv: Add cpuid mapping (hartid↔cpuid)
* [#14994](https://github.com/apache/nuttx/pull/14994) MPFS boot enhancements
* [#14345](https://github.com/apache/nuttx/pull/14345) mpfs/opnsbi: refine config for for insufficient envm capacity
* [#14561](https://github.com/apache/nuttx/pull/14561) mpfs/smp: Add riscv_macros to mpfs_shead
* [#14326](https://github.com/apache/nuttx/pull/14326) mps/bringup: Add initialization of tmpfs
* [#14530](https://github.com/apache/nuttx/pull/14530) mps/clang: Add a defconfig for mps to support clang compilation
* [#14143](https://github.com/apache/nuttx/pull/14143) mps/cmake: add cmake build
* [#14305](https://github.com/apache/nuttx/pull/14305) mps2-an500: add missing source file
* [#14270](https://github.com/apache/nuttx/pull/14270) mps2-an521: remove the unnecessary -pipe build options
* [#14776](https://github.com/apache/nuttx/pull/14776) mps3-an547:ap: Disable cmd_wait() as it depends on procfs currently
* [#14398](https://github.com/apache/nuttx/pull/14398) ricv/riscv_cpuid: Return meaningful values for CPU/Hart ID when SMP=no
* [#14754](https://github.com/apache/nuttx/pull/14754) risc-v and xtensa Kconfig : Remove LIBC_ARCH_ATOMIC
* [#14984](https://github.com/apache/nuttx/pull/14984) risc-v: remove g_running_tasks[this_cpu()] = NULL
* [#14064](https://github.com/apache/nuttx/pull/14064) risc-v:Unify module compilation options
* [#14432](https://github.com/apache/nuttx/pull/14432) risc-v/esp32: Fixed path of File-system mount point 
* [#14563](https://github.com/apache/nuttx/pull/14563) risc-v/esp32c3: linker script fix for mcuboot and wifi usage 
* [#14020](https://github.com/apache/nuttx/pull/14020) risc-v/espressif: Fix alert message in `esp_setup_irq()`
* [#14201](https://github.com/apache/nuttx/pull/14201) risc-v/mpfs: enable DEFAULT_SMALL for insufficient envm capacity
* [#14857](https://github.com/apache/nuttx/pull/14857) risc-v/up_testset: Implement test-and-set with AMOSWAP
* [#14384](https://github.com/apache/nuttx/pull/14384) riscv_cpuindex.c: Fix usage of CONFIG_ARCH_RV_HARTID_BASE
* [#14379](https://github.com/apache/nuttx/pull/14379) riscv_cpustart.c: Fix reading of interrupt status
* [#14700](https://github.com/apache/nuttx/pull/14700) riscv_syscall.S: Fix a massive bug in syscall dispatch logic
* [#14962](https://github.com/apache/nuttx/pull/14962) riscv: remove up_set_current_regs/up_current_regs
* [#15030](https://github.com/apache/nuttx/pull/15030) riscv: Some judgments are missing
* [#14724](https://github.com/apache/nuttx/pull/14724) riscv: Suppress LOAD RWX linker warning
* [#14981](https://github.com/apache/nuttx/pull/14981) riscv: syscall SYS_switch_context and SYS_restore_context use 0 para
* [#14642](https://github.com/apache/nuttx/pull/14642) riscv/common/espressif: Fix spi slave driver
* [#14366](https://github.com/apache/nuttx/pull/14366) riscv/cpustart: Ensure we receive Soft IRQ / IPI before booting CPU
* [#14765](https://github.com/apache/nuttx/pull/14765) riscv/espressif/bootloader/mcuboot: Sign image with MCUBoot version
* [#14397](https://github.com/apache/nuttx/pull/14397) riscv/mpfs: Add boilerplate code for SMP
* [#14967](https://github.com/apache/nuttx/pull/14967) riscv/riscv_ipi.h: Do not write to CSR_MIP.MSIP as it is read-only
* [#14562](https://github.com/apache/nuttx/pull/14562) riscv/syscall: Fix sched_note instrumentation for BUILD_KERNEL
* [#14876](https://github.com/apache/nuttx/pull/14876) riscv/syscall.h: Update comment for syscall
SIM
* [#14466](https://github.com/apache/nuttx/pull/14466) nuttx/sim: Fix m64 build error.
* [#14647](https://github.com/apache/nuttx/pull/14647) nuttx/sim: Remove math.h in sim.
* [#14228](https://github.com/apache/nuttx/pull/14228) nuttx/sim:Remove asan check in up_irq_save().
* [#14826](https://github.com/apache/nuttx/pull/14826) Revert "sim/m64:Fix ld error."
* [#14850](https://github.com/apache/nuttx/pull/14850) Revert "sim/make: fix macos sim:nsh make break no -mcmodel in clang"
* [#14119](https://github.com/apache/nuttx/pull/14119) Revert "sim/note: add note related configuration"
* [#13878](https://github.com/apache/nuttx/pull/13878) sim bug fix
* [#14361](https://github.com/apache/nuttx/pull/14361) sim_camera: modify sim camera init videosize using imgsensor extend p…
* [#14449](https://github.com/apache/nuttx/pull/14449) sim_uart: rm LF to CRLF convertion
* [#14693](https://github.com/apache/nuttx/pull/14693) sim: add defconfig for testing cmake compilation of quickjs
* [#14587](https://github.com/apache/nuttx/pull/14587) sim: add note related configuration
* [#13966](https://github.com/apache/nuttx/pull/13966) sim: disable sim uart output processing
* [#14462](https://github.com/apache/nuttx/pull/14462) sim: fix asan address space conflict
* [#14109](https://github.com/apache/nuttx/pull/14109) sim: fix crash caused by function recursion
* [#14908](https://github.com/apache/nuttx/pull/14908) sim: Fix sim m32 start up crash issue.
* [#13933](https://github.com/apache/nuttx/pull/13933) sim: fix sim smp boot regression
* [#14024](https://github.com/apache/nuttx/pull/14024) sim: only POSIX implementation (ARCH_HAVE_MULTICPU) is provided
* [#14767](https://github.com/apache/nuttx/pull/14767) sim:nsh: Enable `PIPES` to make nsh pipeline available
* [#14658](https://github.com/apache/nuttx/pull/14658) sim(feat):support sim elf and dynamic libs package in post build
* [#14341](https://github.com/apache/nuttx/pull/14341) sim/alsa: add ptr check in _stop
* [#14343](https://github.com/apache/nuttx/pull/14343) sim/alsa: clear AUDIO_APB_FINAL flag before DEQUEUE
* [#14344](https://github.com/apache/nuttx/pull/14344) sim/alsa: fix runtime warning.
* [#14797](https://github.com/apache/nuttx/pull/14797) sim/configs/rpserver/rpproxy_virtio: Change the sim 32bit to 64bit compilation
* [#14348](https://github.com/apache/nuttx/pull/14348) sim/heap: malloc returns a valid pointer when allocating 0 bytes.
* [#14852](https://github.com/apache/nuttx/pull/14852) sim/m64: Fix ld error.
* [#14230](https://github.com/apache/nuttx/pull/14230) sim/m64:Fix ld error.
* [#14982](https://github.com/apache/nuttx/pull/14982) sim/nsh: enable SIM_HOSTFS by default
* [#14988](https://github.com/apache/nuttx/pull/14988) sim/tflm: add tflite-micro demo into ci build
* [#15007](https://github.com/apache/nuttx/pull/15007) sim/tflm: enable tflm hello world
* [#14440](https://github.com/apache/nuttx/pull/14440) arch/sim/cmake: remove the host specific -U when HOSTSRCS. remove the bzero implement use macro to memset
x86_64
* [#14957](https://github.com/apache/nuttx/pull/14957) Add kernel build support for X86_64
* [#14036](https://github.com/apache/nuttx/pull/14036) x64: add acrn ioapic init support
* [#14081](https://github.com/apache/nuttx/pull/14081) x64: modify addr limit to support 64 bits addr backtrace
* [#14073](https://github.com/apache/nuttx/pull/14073) X86_64: Add libcxx availability macros.
* [#14132](https://github.com/apache/nuttx/pull/14132) x86_64: align some code
* [#14633](https://github.com/apache/nuttx/pull/14633) x86_64: fix compile warning
* [#13888](https://github.com/apache/nuttx/pull/13888) x86_64: fix regression
* [#14035](https://github.com/apache/nuttx/pull/14035) x86_64:Fix ld error.
* [#14900](https://github.com/apache/nuttx/pull/14900) x86-64: Added KASan compilation options
* [#14885](https://github.com/apache/nuttx/pull/14885) x86: Support symbol table and kasan global variables cross-border detection
* [#14099](https://github.com/apache/nuttx/pull/14099) x86/x86_64: change the build result from nuttx.elf to nuttx
* [#14209](https://github.com/apache/nuttx/pull/14209) x86/x86_64:Adjust the position of the nm command to execute it after NuttX is generated
* [#13983](https://github.com/apache/nuttx/pull/13983) arch/x68_64: properly align ap boot stack for vector operations
* [#13973](https://github.com/apache/nuttx/pull/13973) arch/x86_64: add support for thread_local
* [#13937](https://github.com/apache/nuttx/pull/13937) arch/x86_64: Add vfork support
* [#14040](https://github.com/apache/nuttx/pull/14040) arch/x86_64: cache convert all asm() to __asm__()
* [#14019](https://github.com/apache/nuttx/pull/14019) arch/x86_64: cpuid expect 32 bit variables
* [#14087](https://github.com/apache/nuttx/pull/14087) arch/x86_64: Fix SMP startup for ACRN Hypervisor
* [#14178](https://github.com/apache/nuttx/pull/14178) arch/x86_64: Fix SMP startup for ACRN Hypervisor
* [#14045](https://github.com/apache/nuttx/pull/14045) arch/x86_64: Fix up_timer_start.
* [#14021](https://github.com/apache/nuttx/pull/14021) arch/x86_64: idle convert all asm() to __asm__()
* [#13989](https://github.com/apache/nuttx/pull/13989) arch/x86_64: Map the new page table with read-write permissions
* [#13982](https://github.com/apache/nuttx/pull/13982) arch/x86_64: Resolve weak symbol compilation relocation errors
* [#14350](https://github.com/apache/nuttx/pull/14350) arch/x86_64: Resolving NUC Boot Failure Issue
* [#14349](https://github.com/apache/nuttx/pull/14349) arch/x86_64: The AP retrieves this_task after storing the CPU private…
* [#13980](https://github.com/apache/nuttx/pull/13980) arch/x86_64:Add allsymbol functionality
* [#13939](https://github.com/apache/nuttx/pull/13939) arch/x86_64:Add check stack function
* [#14084](https://github.com/apache/nuttx/pull/14084) arch/x86_64:Add configuration to disable vectorization optimization
* [#14237](https://github.com/apache/nuttx/pull/14237) arch/x86_64:Add CXX configuration for enabling x86_64 support for C++ applications.
* [#14405](https://github.com/apache/nuttx/pull/14405) arch/x86_64:Add CXX configuration for enabling x86_64 support for C++…
* [#14056](https://github.com/apache/nuttx/pull/14056) arch/x86_64:Add macros related to CPUID
* [#14015](https://github.com/apache/nuttx/pull/14015) arch/x86_64:Add nanosecond delay interface to TSC
* [#14016](https://github.com/apache/nuttx/pull/14016) arch/x86_64:Add perf tool
* [#14111](https://github.com/apache/nuttx/pull/14111) arch/x86_64:Change extern g_intstackalloc to g_isrstackalloc
* [#14133](https://github.com/apache/nuttx/pull/14133) arch/x86_64:Code style is consistent
* [#13993](https://github.com/apache/nuttx/pull/13993) arch/x86_64:Configure arch delay using CONFIG_ALARM_ARCH
* [#14075](https://github.com/apache/nuttx/pull/14075) arch/x86_64:Fix build cxx warning.
* [#14473](https://github.com/apache/nuttx/pull/14473) arch/x86_64:Fix variable used before assignment
* [#14017](https://github.com/apache/nuttx/pull/14017) arch/x86_64:Use the checkstack function
* [#14955](https://github.com/apache/nuttx/pull/14955) arch/x86_64/intel64: fix revoke_low_memory
* [#14958](https://github.com/apache/nuttx/pull/14958) arch/x86_64/intel64: up_disable_irq should work from any CPU
* [#14060](https://github.com/apache/nuttx/pull/14060) arch/x86_64/intel64/intel64_irq.c: fix busy irq logic
* [#14245](https://github.com/apache/nuttx/pull/14245) arch/intel64: optimise context switch
* [#14793](https://github.com/apache/nuttx/pull/14793) intel64: add mutliboot framebuffer support
* [#14234](https://github.com/apache/nuttx/pull/14234) nuttx/x86_64:Add _sinit and _einit initialization.
XTENSA
* [#15055](https://github.com/apache/nuttx/pull/15055) xtensa: inline up_switch_context
* [#14964](https://github.com/apache/nuttx/pull/14964) xtensa: remove g_running_tasks[this_cpu()] = NULL
* [#14960](https://github.com/apache/nuttx/pull/14960) xtensa: remove up_set_current_regs/up_current_regs
* [#15010](https://github.com/apache/nuttx/pull/15010) xtensa: syscall SYS_switch_context and SYS_restore_context use 0 para
* [#14760](https://github.com/apache/nuttx/pull/14760) xtensa: use up_interrupt_context() to determine if in interrupt context
* [#14855](https://github.com/apache/nuttx/pull/14855) xtensa/esp32: Remove duplicate board Make.defs
* [#14541](https://github.com/apache/nuttx/pull/14541) xtensa/esp32s3: add esp32s3 reset reasons interface
* [#14215](https://github.com/apache/nuttx/pull/14215) xtensa/esp32s3: add support for getting country code
* [#14542](https://github.com/apache/nuttx/pull/14542) xtensa/esp32s3: enable encrypted flag based on partition and device
* [#13991](https://github.com/apache/nuttx/pull/13991) xtensa/esp32s3: fix missing peripheral initialization for watchdog timer
* [#14214](https://github.com/apache/nuttx/pull/14214) xtensa/esp32s3: inspect if partition mapped as text
* [#14701](https://github.com/apache/nuttx/pull/14701) arch/esp32s3: lcd add fb pandisplay
* [#14963](https://github.com/apache/nuttx/pull/14963) nuttx/arch: remove the custom board check in up_testset implementation
* [#14088](https://github.com/apache/nuttx/pull/14088) nuttx/arch:Enabling ARCH_MATH_H is required when compiling sim with the 13.2 version of the toolchain
* [#14805](https://github.com/apache/nuttx/pull/14805) arch/xtensa: use arch atomic when enable iram heap
Driver Support
New Driver Support
* [#14358](https://github.com/apache/nuttx/pull/14358) drivers/power/battery: add charge/battery health interface support
* [#13880](https://github.com/apache/nuttx/pull/13880) Add goldfish timer driver support
* [#14895](https://github.com/apache/nuttx/pull/14895) draft driver for STUSB4500
Drivers With Improvements
* [#13925](https://github.com/apache/nuttx/pull/13925) driver: add GOLDFISH_GPU_FB_PRIORITY for goldfish_gpu_fb_vsync_thread
* [#14194](https://github.com/apache/nuttx/pull/14194) driver/i2c/ipcc: Post sempahore only when it's value is smaller than one
* [#14510](https://github.com/apache/nuttx/pull/14510) driver/serial: remove return value of up_putc()
* [#14603](https://github.com/apache/nuttx/pull/14603) drivers: Fix the missing headers.
* [#14817](https://github.com/apache/nuttx/pull/14817) drivers/adc: Rename up_ads1255initialize to ads1255_initialize
* [#15011](https://github.com/apache/nuttx/pull/15011) drivers/audio/wm8994.c: Include nuttx/arch.h to fix compilation (up_m…
* [#13979](https://github.com/apache/nuttx/pull/13979) drivers/battery: Fix Goldfish Battery x64 unresponsive interrupt issue
* [#13911](https://github.com/apache/nuttx/pull/13911) drivers/coresight: ETM4 set up
* [#13947](https://github.com/apache/nuttx/pull/13947) drivers/devicetree/fdt: get 'reg' property
* [#13916](https://github.com/apache/nuttx/pull/13916) drivers/fb: use ENOTTY to replace assert
* [#14790](https://github.com/apache/nuttx/pull/14790) Drivers/input
* [#14177](https://github.com/apache/nuttx/pull/14177) drivers/input: fix complie err about undefined
* [#14728](https://github.com/apache/nuttx/pull/14728) drivers/misc: fix rpmsg dev poll assert crash
* [#14729](https://github.com/apache/nuttx/pull/14729) drivers/misc: fix rpmsgdev read overflow
* [#15047](https://github.com/apache/nuttx/pull/15047) drivers/net: change netdev_lower_quota_load to macro
* [#13860](https://github.com/apache/nuttx/pull/13860) drivers/net: Register "/dev/net/tun" as tun node too
* [#13872](https://github.com/apache/nuttx/pull/13872) drivers/note: suport rpmsg transfer channel for notesome note api
* [#14185](https://github.com/apache/nuttx/pull/14185) drivers/optee: Return error if optee_recv return prematurely
* [#14165](https://github.com/apache/nuttx/pull/14165) drivers/pci: fix pci framework warning in 32bit chip
* [#14248](https://github.com/apache/nuttx/pull/14248) drivers/rpmsgdev: support get more battery info by rpmsgdev
* [#14078](https://github.com/apache/nuttx/pull/14078) drivers/rptun: minor fix about rptun
* [#14256](https://github.com/apache/nuttx/pull/14256) drivers/segger: inline note_sysview_get_timestamp
* [#14979](https://github.com/apache/nuttx/pull/14979) drivers/sensors/gnss: Add suffix to macro of geofence index
* [#14999](https://github.com/apache/nuttx/pull/14999) drivers/sensors/gnss: Different nbuffer for each topic
* [#14298](https://github.com/apache/nuttx/pull/14298) drivers/serial: fix cmsdk serial driver warning
* [#14411](https://github.com/apache/nuttx/pull/14411) drivers/spi_slave: call SPIS_DEV_NOTIFY when rx or tx complete for all spi slave driver
* [#14810](https://github.com/apache/nuttx/pull/14810) drivers/syslog: remove implement of syslog_putc()
* [#15038](https://github.com/apache/nuttx/pull/15038) drivers/timers: export arch timer api to support higher resolution
* [#13992](https://github.com/apache/nuttx/pull/13992) drivers/timers:Arch_alarm and arch_timer add up_ndelay interface
* [#14304](https://github.com/apache/nuttx/pull/14304) audio: add offload underflow msg state
* [#14342](https://github.com/apache/nuttx/pull/14342) audio: remove started from audio_complete
* [#14385](https://github.com/apache/nuttx/pull/14385) bluetooth: Fix the incompatibility made by https://github.com/apache/nuttx/pull/14224
* [#14549](https://github.com/apache/nuttx/pull/14549) Bluetooth: improved pairing process and host layer now successfully receives ACL packets
* [#14224](https://github.com/apache/nuttx/pull/14224) bluetooth: upload bt local bug fix and features
* [#14985](https://github.com/apache/nuttx/pull/14985) bt_atomic: use atomic macro to replace wireless/bluetooth/bt_atomic.c
* [#13943](https://github.com/apache/nuttx/pull/13943) misc/assert: add backtrace dump support for mutex hold task
* [#13952](https://github.com/apache/nuttx/pull/13952) misc/dev_mem: fix compile error in aarch64
* [#13981](https://github.com/apache/nuttx/pull/13981) misc/rpmsgdev: fix block mode read/write bug in rpmsgdev
* [#14076](https://github.com/apache/nuttx/pull/14076) misc/rpmsgdev: The private data should be freed only when endpoint is released
* [#13874](https://github.com/apache/nuttx/pull/13874) mmcsd: add multi partitions prototype implementation
* [#14293](https://github.com/apache/nuttx/pull/14293) mmcsd: add multi partitions support
* [#13990](https://github.com/apache/nuttx/pull/13990) mmcsd: refine emmc capacity calculate
* [#14492](https://github.com/apache/nuttx/pull/14492) mmcsd: SDIO_CAPS_4BIT_ONLY set buswidth MMCSD_SCR_BUSWIDTH_4BIT
* [#14266](https://github.com/apache/nuttx/pull/14266) mmcsd:add postsleep fields for mmc_ioc_cmd
* [#14249](https://github.com/apache/nuttx/pull/14249) mmcsd:add reset card to idle state (CMD0) support
* [#14246](https://github.com/apache/nuttx/pull/14246) mmcsd:add STATUS_SEND (CMD13) support
* [#14113](https://github.com/apache/nuttx/pull/14113) note enhance
* [#13948](https://github.com/apache/nuttx/pull/13948) note: change sched_note_counter to a macro
* [#14926](https://github.com/apache/nuttx/pull/14926) note: Remove enter_critical_section from the sched_note module
* [#13949](https://github.com/apache/nuttx/pull/13949) note: support asynchronous sched_note_printf output
* [#13892](https://github.com/apache/nuttx/pull/13892) notesnap_driver.c: modify struct notesnap_s member type
* [#14382](https://github.com/apache/nuttx/pull/14382) nuttx ai driver update
* [#14009](https://github.com/apache/nuttx/pull/14009) nuttx/drivers: add ept_release_cb for destroy server resource
* [#14207](https://github.com/apache/nuttx/pull/14207) nuttx/can: support to Send message priority sorting function.
* [#14096](https://github.com/apache/nuttx/pull/14096) nuttx/can.h: support timestamp for can frame.
* [#13866](https://github.com/apache/nuttx/pull/13866) Rpmsg fs: rpmsgfs bug fix and enhancement
* [#14023](https://github.com/apache/nuttx/pull/14023) Rpmsg ping: improve the rpmsg ping
* [#13887](https://github.com/apache/nuttx/pull/13887) rpmsg services: should release the tx buffer when rpmsg_send_nocopy failed
* [#13853](https://github.com/apache/nuttx/pull/13853) Rpmsg syslog: update rpmsg syslog
* [#14077](https://github.com/apache/nuttx/pull/14077) Rpmsg virtio: update rpmsg virtio and add sim config to verify rpmsg virtio
* [#14106](https://github.com/apache/nuttx/pull/14106) rpmsg_port_spi_slave: fix compile error when enable RPMSG_PORT_SPI_SL…
* [#14118](https://github.com/apache/nuttx/pull/14118) rpmsg_sockif: add some modifaction for rpsocket
* [#13854](https://github.com/apache/nuttx/pull/13854) rpmsgblk.c: fix compile warning
* [#13851](https://github.com/apache/nuttx/pull/13851) rptun: Remove include/nuttx/rptun/openamp.h
* [#15008](https://github.com/apache/nuttx/pull/15008) video/fb: fix integer overflow issue
* [#15043](https://github.com/apache/nuttx/pull/15043) virtio: Add virtio version check
* [#15074](https://github.com/apache/nuttx/pull/15074) virtio: fix compile error
* [#15045](https://github.com/apache/nuttx/pull/15045) virtio: Fix the problem of incorrect setting of virtio queue address under label kasan
* [#15061](https://github.com/apache/nuttx/pull/15061) wm8776: use small lock in drivers/audio/wm8776.c
* [#13945](https://github.com/apache/nuttx/pull/13945) usensor.c:fix container_of member error.
* [#14258](https://github.com/apache/nuttx/pull/14258) usb: Fix issue with the calculation descriptor length error
* [#13960](https://github.com/apache/nuttx/pull/13960) usb: If usb3.0 set the ep0 sssize to cfgdescsize
* [#13920](https://github.com/apache/nuttx/pull/13920) usbdev/cdcacm: Fix read queue counter in shutdown
* [#14033](https://github.com/apache/nuttx/pull/14033) uart_16550:fix bug regincr is used multiple times
* [#13871](https://github.com/apache/nuttx/pull/13871) uart_rpmsg: some bugs fixed
* [#13879](https://github.com/apache/nuttx/pull/13879) timer & nx_start small bug fix
* [#14571](https://github.com/apache/nuttx/pull/14571) timer_create:Checks whether the signo provided by the user is valid
* [#14619](https://github.com/apache/nuttx/pull/14619) timers: Replace DEBUGASSERT with the error code reopen from #12484
* [#14722](https://github.com/apache/nuttx/pull/14722) SYSLOG_DEFAULT: wrap up_putc/up_nputs calls with critical section
* [#14362](https://github.com/apache/nuttx/pull/14362) syslog: convert \n to \r\n in syslog framework layer
* [#14456](https://github.com/apache/nuttx/pull/14456) syslog: Don't allow blocking when in signal handler
* [#14421](https://github.com/apache/nuttx/pull/14421) syslog: enable LF to CRLF config as default
* [#14409](https://github.com/apache/nuttx/pull/14409) syslog: fix ramlog not work issue with cmake
* [#14874](https://github.com/apache/nuttx/pull/14874) syslog.rst: mention the correct kconfig option
* [#13994](https://github.com/apache/nuttx/pull/13994) support syslog redirection to sched_note
* [#14212](https://github.com/apache/nuttx/pull/14212) serial: remove 'TIOCSLINID'
* [#14104](https://github.com/apache/nuttx/pull/14104) serial: use nxsig_tgkill instead of nxsig_kill
* [#13914](https://github.com/apache/nuttx/pull/13914) serial:update some bug fixand functional improvements
Board Support
New Board Support
* [#14659](https://github.com/apache/nuttx/pull/14659) NSH support for Nucleo-H563ZI.
Boards With Improvements
* [#13908](https://github.com/apache/nuttx/pull/13908) board_reset: flush cache before reset
* [#14520](https://github.com/apache/nuttx/pull/14520) board: refresh boards after update LIBCANUTILS dependency
* [#13895](https://github.com/apache/nuttx/pull/13895) board/arm/nrf52: fix use up_interrupt_context to is_nesting_interrupt
* [#15025](https://github.com/apache/nuttx/pull/15025) board/nucleo-h563zi: Add HSE option
* [#14162](https://github.com/apache/nuttx/pull/14162) board/qemu-armv7a: use fdt_virtio_mmio_devices_register() to register mmio devices
* [#14287](https://github.com/apache/nuttx/pull/14287) boards: Enable LTO option for same70-xplained/mcuboot-loader
* [#15070](https://github.com/apache/nuttx/pull/15070) boards: Update configs about system/usbmsc
* [#14839](https://github.com/apache/nuttx/pull/14839) boards/arm/stm32/nucleo-f4x1re/src/stm32_adc.c: fix typo
* [#14840](https://github.com/apache/nuttx/pull/14840) boards/arm/stm32/nucleo-f4x1re/stm32_adc.c: remove dependency on AJOYSTICK
* [#14439](https://github.com/apache/nuttx/pull/14439) boards/arm/stm32f7: fix nucleo boards break for cmake
* [#14437](https://github.com/apache/nuttx/pull/14437) boards/arm/stm32f7: removed extra endif() from cmakefile for nucleo-f746zg nucleo-f722ze nucleo-f767zi
* [#14414](https://github.com/apache/nuttx/pull/14414) boards/arm/stm32f7: separate nucleo-144 board into individual boards
* [#13976](https://github.com/apache/nuttx/pull/13976) stm32f429i-disco: disable TM32_FB_CMAP
* [#14225](https://github.com/apache/nuttx/pull/14225) stm32f4discovery/testlibcxx: Enable tls to fix build error.
* [#14223](https://github.com/apache/nuttx/pull/14223) boards/arm64: Add an impls section to the link script
* [#14687](https://github.com/apache/nuttx/pull/14687) boards/arm64/imx9/imx93-evk: add trdc header
* [#14720](https://github.com/apache/nuttx/pull/14720) boards/esp32c3-legacy: Add missing include to esp32c3_boot.c
* [#14947](https://github.com/apache/nuttx/pull/14947) boards/esp32s3: Add ESP32-S3-WROOM-1-N8R8 depends for ESP32S3_DEVKIT
* [#14481](https://github.com/apache/nuttx/pull/14481) boards/esp32s3: Merge MCUboot and "simple-boot" linker scripts
* [#15027](https://github.com/apache/nuttx/pull/15027) boards/mte: Dependencies changed so need to delete it now
* [#14708](https://github.com/apache/nuttx/pull/14708) boards/nucleo-f302r8: fix LED1 pin
* [#14408](https://github.com/apache/nuttx/pull/14408) boards/nucleo-l432kc: Add internal DAC code.
* [#14055](https://github.com/apache/nuttx/pull/14055) boards/qemu: Open kasan on qemu
* [#15012](https://github.com/apache/nuttx/pull/15012) boards/qemu64:  Deleted test program of kasantest config
* [#14482](https://github.com/apache/nuttx/pull/14482) boards/risc-v: Remove ref to riscv_internal.h
* [#14261](https://github.com/apache/nuttx/pull/14261) boards/same70-xplained: refine config for insufficient flash capacity
* [#14853](https://github.com/apache/nuttx/pull/14853) boards/stm32: split nucleo-f4x1re into separate boards
* [#14762](https://github.com/apache/nuttx/pull/14762) boards/stm32f103-minimum: fix unaligned pointer to .data section in ld.script
* [#13915](https://github.com/apache/nuttx/pull/13915) boards/stm32f7/stm32f746g-disco: fix FMC pin
* [#14791](https://github.com/apache/nuttx/pull/14791) boards/x86_64/intel64/qemu-intel64: add jumbo configuration
* [#14949](https://github.com/apache/nuttx/pull/14949) boards/xtensa/esp32s3: Treat return value that greater than zero as succ
* [#14508](https://github.com/apache/nuttx/pull/14508) esp32: Fix a heap corruption bug with SPIRAM
* [#14068](https://github.com/apache/nuttx/pull/14068) esp32[c3]: Add BLE support
* [#14213](https://github.com/apache/nuttx/pull/14213) ESP32C6-DevKit C/M Add necessary Import to compilation
* [#14442](https://github.com/apache/nuttx/pull/14442) esp32c6-devkit: Remove -Werror to fix compile error
* [#14871](https://github.com/apache/nuttx/pull/14871) esp32s3_partition.c: Appease a compiler warning (-Wdiscarded-qualifiers)
* [#14832](https://github.com/apache/nuttx/pull/14832) esp32s3-devkit doc: Update the procedure after simple boot
* [#14906](https://github.com/apache/nuttx/pull/14906) esp32s3-devkit: Add configuration for ADB
* [#15003](https://github.com/apache/nuttx/pull/15003) esp32s3-devkit/usbmsc: Add bind for MTD
* [#14975](https://github.com/apache/nuttx/pull/14975) esp32s3: don't clear pending interrupts on eg. up_putc
* [#14501](https://github.com/apache/nuttx/pull/14501) esp32s3: Increase the init task stask size when using NSH
* [#14942](https://github.com/apache/nuttx/pull/14942) espressif/mcpwm: fix compile error
File System
Improvements
* [#14071](https://github.com/apache/nuttx/pull/14071) binfmt/libelf: Fix return code
* [#14039](https://github.com/apache/nuttx/pull/14039) fs poll optimize
* [#14752](https://github.com/apache/nuttx/pull/14752) fs_automount:fix ci break
* [#14184](https://github.com/apache/nuttx/pull/14184) fs_file.c: modify files_countlist comments
* [#14137](https://github.com/apache/nuttx/pull/14137) fs_heap_strdup/asprintf
* [#13907](https://github.com/apache/nuttx/pull/13907) fs_open:Adjust the definition of the open path
* [#14461](https://github.com/apache/nuttx/pull/14461) fs: add fs_heap_strndup replace strndup with fs_heap_strndup
* [#14673](https://github.com/apache/nuttx/pull/14673) fs: add merge partitions support
* [#13926](https://github.com/apache/nuttx/pull/13926) fs: fix compile break
* [#14609](https://github.com/apache/nuttx/pull/14609) fs: Fix mtd/sector512.c:554:19: error: incomplete definition of type 'struct partition_info_s'
* [#13928](https://github.com/apache/nuttx/pull/13928) fs: fix wrong config for FS_SHMFS
* [#14903](https://github.com/apache/nuttx/pull/14903) fs/littlefs: Add a kconfig to override littlefs version
* [#14935](https://github.com/apache/nuttx/pull/14935) fs/littlefs: make CONFIG_FS_LITTLEFS_VERSION include the "v" prefix
* [#14956](https://github.com/apache/nuttx/pull/14956) fs/littlefs: stop applying local patches for unknown versions of littlefs
* [#14445](https://github.com/apache/nuttx/pull/14445) fs/mnemofs: Add logs to bind and unbind.
* [#14463](https://github.com/apache/nuttx/pull/14463) fs/mnemofs: Fix extra log unused value error.
* [#14533](https://github.com/apache/nuttx/pull/14533) fs/mnemofs: Fix mkdir for depth > 3 bug better logs
* [#14604](https://github.com/apache/nuttx/pull/14604) fs/mnemofs: Fix open and rmdir return value and seek out of bounds.
* [#14528](https://github.com/apache/nuttx/pull/14528) fs/nfs: fix offset in append mode and attributes after create
* [#14429](https://github.com/apache/nuttx/pull/14429) fs/nxffs: Fix syslog formats compile error
* [#14948](https://github.com/apache/nuttx/pull/14948) fs/partition/txtable: Fix panic when no txtable was found in last eraseblock
* [#14763](https://github.com/apache/nuttx/pull/14763) fs/procfs: The procfsversion should be under control of `FS_PROCFS_EXCLUDE_VERSION`
* [#14359](https://github.com/apache/nuttx/pull/14359) fs/rpmsgfs[bug fix]: return real err value when open failed
* [#13931](https://github.com/apache/nuttx/pull/13931) fs/semaphore: fix a minor issue with goto label
* [#14582](https://github.com/apache/nuttx/pull/14582) fs/shm: support shm_open with flags O_TRUNC
* [#13929](https://github.com/apache/nuttx/pull/13929) fs/vfs: Avoid calling stat with oldrelpath twice in mountptrename
* [#14702](https://github.com/apache/nuttx/pull/14702) fs/vfs: Fix initialization of `g_pseudofile_ops`
* [#13918](https://github.com/apache/nuttx/pull/13918) nuttx/fs:Rename node with inode.
* [#13900](https://github.com/apache/nuttx/pull/13900) zipfs:zipfs not need mtd drivers
Networking
Improvements
* [#14535](https://github.com/apache/nuttx/pull/14535) arp.h: make struct arpreq four-byte aligned
* [#14556](https://github.com/apache/nuttx/pull/14556) arp.h: make struct arpreq four-byte aligned
* [#14650](https://github.com/apache/nuttx/pull/14650) net: fix inet #14634 regression
* [#14634](https://github.com/apache/nuttx/pull/14634) net: inet.h match inet_sockif.c definition
* [#14886](https://github.com/apache/nuttx/pull/14886) net: Move NET_TCP/UDP_HAVE_STACK to netconfig.h
* [#14727](https://github.com/apache/nuttx/pull/14727) net:Compatible with cellular network cards of lladdr generation
* [#14092](https://github.com/apache/nuttx/pull/14092) net/can: Save simple options to socket_conn_s
* [#14643](https://github.com/apache/nuttx/pull/14643) net/igc: Support Intel I226V.
* [#14018](https://github.com/apache/nuttx/pull/14018) net/local: fix the return address is incorrect when accept
* [#14447](https://github.com/apache/nuttx/pull/14447) net/local: fix used after free
* [#14630](https://github.com/apache/nuttx/pull/14630) net/netlink: fix netlink poll return value on success
* [#13905](https://github.com/apache/nuttx/pull/13905) net/rpmsg: add SO_SNDBUF and SO_RCVBUF support
* [#14573](https://github.com/apache/nuttx/pull/14573) net/rpmsg: Don't set POLLHUP if rpmsg channel has not been established
* [#14216](https://github.com/apache/nuttx/pull/14216) net/tcp: Reset the conn when receiving a ACK in the SYN_SENT state.
* [#14529](https://github.com/apache/nuttx/pull/14529) net/usrsock: usrsock supports offload netlink
* [#14163](https://github.com/apache/nuttx/pull/14163) net/vsock: add AF_VSOCK address family
* [#14138](https://github.com/apache/nuttx/pull/14138) netdb: fix may add duplicate DNS servers
* [#14192](https://github.com/apache/nuttx/pull/14192) netdev:In netdev_defaultIf there is only one loopback network devices it returns NULL
* [#14636](https://github.com/apache/nuttx/pull/14636) netinet/if_ether.h: move #define ETH_XXX into if_ether.h
* [#13859](https://github.com/apache/nuttx/pull/13859) Netlink minor fix
* [#14554](https://github.com/apache/nuttx/pull/14554) DNS: Implement TCP fallback
* [#14867](https://github.com/apache/nuttx/pull/14867) IPV6 macro
* [#13906](https://github.com/apache/nuttx/pull/13906) local_sock: fix accept use-after-free
* [#14103](https://github.com/apache/nuttx/pull/14103) local_socket: corrent send/recv return value after shutdown
* [#14574](https://github.com/apache/nuttx/pull/14574) tcp_input: if tcp->req > recvreq send ack only when state is TCP_ESTABLISHED
* [#14698](https://github.com/apache/nuttx/pull/14698) tcp: fix tcp can not retransmit timely when ACK with TCP_NEWDATA
* [#14595](https://github.com/apache/nuttx/pull/14595) sys/socket: fix struct sockaddr_storage alignment issue
Unsorted
* [#14278](https://github.com/apache/nuttx/pull/14278) add  lin status changes the format of the reported frame and add the …
* [#14112](https://github.com/apache/nuttx/pull/14112) add #define CPU_SETSIZE in sched.h
* [#14332](https://github.com/apache/nuttx/pull/14332) add a flag of lin internal sleep/wakeup state
* [#14303](https://github.com/apache/nuttx/pull/14303) Add AI engine driver for heterogeneous NPU backends.
* [#13904](https://github.com/apache/nuttx/pull/13904) Add base64 support to coredump to reduce syslog output size
* [#14130](https://github.com/apache/nuttx/pull/14130) Add GCCVER define to Toolchain.
* [#13999](https://github.com/apache/nuttx/pull/13999) add gprof support
* [#13847](https://github.com/apache/nuttx/pull/13847) Add heap note support
* [#14339](https://github.com/apache/nuttx/pull/14339) Add imx9 socketcan
* [#14125](https://github.com/apache/nuttx/pull/14125) add lin error flags to lin.h
* [#14801](https://github.com/apache/nuttx/pull/14801) add spinlock_type.h and use small lock to protect filelist
* [#14321](https://github.com/apache/nuttx/pull/14321) Add strptime
* [#13964](https://github.com/apache/nuttx/pull/13964) Add support fchstat and chstat  function for littlefs
* [#14866](https://github.com/apache/nuttx/pull/14866) Add tls cleanup to protect tcp
* [#14951](https://github.com/apache/nuttx/pull/14951) Add TXTABLE support for esp32s3
* [#14966](https://github.com/apache/nuttx/pull/14966) Add USB MSC support for esp32s3
* [#13951](https://github.com/apache/nuttx/pull/13951) Adding partitioning support for OTA
* [#15035](https://github.com/apache/nuttx/pull/15035) addrenv: Ensure that the transmission parameter of addrenv_switch is not NULL
* [#14859](https://github.com/apache/nuttx/pull/14859) addrenv/addrenv.c: Use atomic_ functions to handle the reference counter
* [#14065](https://github.com/apache/nuttx/pull/14065) assert: change the do-while of assert to a conditional expression
* [#14879](https://github.com/apache/nuttx/pull/14879) assert: in assert we use small spinlock replace enter_critical_section
* [#14353](https://github.com/apache/nuttx/pull/14353) bug/fix: Makefile expression error caused
* [#14420](https://github.com/apache/nuttx/pull/14420) Bugfix/fix esp spi slave receive data
* [#14211](https://github.com/apache/nuttx/pull/14211) Bugfix/samv7 rswdt
* [#13865](https://github.com/apache/nuttx/pull/13865) cache: do cache_invalidate_all before enable dcache
* [#14809](https://github.com/apache/nuttx/pull/14809) can/sja100: leave critical section properly
* [#13953](https://github.com/apache/nuttx/pull/13953) case SIOCGIWNAME: add filter out non-802.11 interfaces
* [#14241](https://github.com/apache/nuttx/pull/14241) Change the judgment of GCCVER version to greater equal.
* [#14182](https://github.com/apache/nuttx/pull/14182) Changed the i3c_priv_xfer's member to flags from rnw
* [#14300](https://github.com/apache/nuttx/pull/14300) circbuf: fix circbuf_get_read/writeptr return *size = 0 when circbuf full
* [#13848](https://github.com/apache/nuttx/pull/13848) circbuf: Move from mm/circbuf to libs/libc/misc
* [#14713](https://github.com/apache/nuttx/pull/14713) com/can: Remove unnecessary judgment logic
* [#15051](https://github.com/apache/nuttx/pull/15051) configs: Add defconfigs for esp-sparrow-kit
* [#14131](https://github.com/apache/nuttx/pull/14131) Contributing and PR template fix.
* [#14792](https://github.com/apache/nuttx/pull/14792) cosmetic changes in drivers/pci and drivers/sensors
* [#14179](https://github.com/apache/nuttx/pull/14179) cpuinfo: Decouple the fetch cpuinfo from up_perf_getfreq
* [#14997](https://github.com/apache/nuttx/pull/14997) crashdump change to choice add coredump to mtd support based on mtdout stream.
* [#14674](https://github.com/apache/nuttx/pull/14674) crypto/se05x: Allow set_enable_pin to be NULL and fix error handling
* [#13899](https://github.com/apache/nuttx/pull/13899) Deadlock detect fix
* [#15042](https://github.com/apache/nuttx/pull/15042) debug symbol level: Use config instead
* [#14378](https://github.com/apache/nuttx/pull/14378) Discourage the use of LIBC_PRINT_EXTENSION
* [#14094](https://github.com/apache/nuttx/pull/14094) dump more information when CONFIG_MM_DUMP_DETAILS_ON_FAILURE enabled flush log before coredump
* [#13902](https://github.com/apache/nuttx/pull/13902) e1000: add polling mode support for tx/rx
* [#14646](https://github.com/apache/nuttx/pull/14646) Enable DEV_PIPE_NPOLLWAITERS default value 4 for adapte APP
* [#14318](https://github.com/apache/nuttx/pull/14318) Expand samplerate bits from 8 to 32 enchance encode capacity in sim offload.
* [#14310](https://github.com/apache/nuttx/pull/14310) external/ffmpeg: add offloding audio recording with amr format.
* [#13867](https://github.com/apache/nuttx/pull/13867) Fdt mmio: add common fdt mmio virtio device register function
* [#14591](https://github.com/apache/nuttx/pull/14591) Feature/esp i2c bitbang
* [#14590](https://github.com/apache/nuttx/pull/14590) Feature/esp spi bitbang
* [#14008](https://github.com/apache/nuttx/pull/14008) Feature/esp temp sensor uorb support
* [#14597](https://github.com/apache/nuttx/pull/14597) file_readv_compat/file_writev_compat: Fix partial success handling
* [#13921](https://github.com/apache/nuttx/pull/13921) files_getlist:Handling the situation when tcb's grouplist is empty
* [#15019](https://github.com/apache/nuttx/pull/15019) First commit of STM32H5 SPI Hardware file.
* [#13875](https://github.com/apache/nuttx/pull/13875) Fix #13873
* [#14861](https://github.com/apache/nuttx/pull/14861) Fix ALIGN_UP duplicate definition error
* [#14396](https://github.com/apache/nuttx/pull/14396) fix bmi160 some issue
* [#14938](https://github.com/apache/nuttx/pull/14938) fix build error
* [#14392](https://github.com/apache/nuttx/pull/14392) fix build error shift-count-overflow
* [#14500](https://github.com/apache/nuttx/pull/14500) Fix CDCNCM driver printf formatter compiler warning
* [#14945](https://github.com/apache/nuttx/pull/14945) Fix compilation errors
* [#15004](https://github.com/apache/nuttx/pull/15004) Fix compile error
* [#15014](https://github.com/apache/nuttx/pull/15014) fix compile error
* [#14716](https://github.com/apache/nuttx/pull/14716) fix compiler error when CONFIG_CLOCK_TIMEKEEPING=y
* [#14552](https://github.com/apache/nuttx/pull/14552) Fix config repeat define in include deconfig mode
* [#14356](https://github.com/apache/nuttx/pull/14356) Fix disable msi when msi capability not exist issue
* [#14610](https://github.com/apache/nuttx/pull/14610) Fix Error: implicit declaration of function 'enter_critical_section'
* [#14433](https://github.com/apache/nuttx/pull/14433) fix GCCVER cmake define.
* [#14188](https://github.com/apache/nuttx/pull/14188) fix igmp group issue
* [#14453](https://github.com/apache/nuttx/pull/14453) Fix Kconfig style
* [#14882](https://github.com/apache/nuttx/pull/14882) Fix Kconfig style
* [#14606](https://github.com/apache/nuttx/pull/14606) fix macos sim nsh break fix no -mcmodel=medium in clang.
* [#14422](https://github.com/apache/nuttx/pull/14422) Fix make warn as error in pci drivers
* [#14820](https://github.com/apache/nuttx/pull/14820) Fix minor ld script error
* [#14965](https://github.com/apache/nuttx/pull/14965) fix nxstyle
* [#14977](https://github.com/apache/nuttx/pull/14977) fix nxstyle
* [#14944](https://github.com/apache/nuttx/pull/14944) Fix path Error
* [#14971](https://github.com/apache/nuttx/pull/14971) Fix path error
* [#14611](https://github.com/apache/nuttx/pull/14611) fix regression caused by remove sync pause
* [#14001](https://github.com/apache/nuttx/pull/14001) fix runtime pm pm_wakelock_uninit problem decrease charger log regulator possible no action when boot
* [#13917](https://github.com/apache/nuttx/pull/13917) fix snprintf truncation warnings
* [#14458](https://github.com/apache/nuttx/pull/14458) Fix some build error
* [#14925](https://github.com/apache/nuttx/pull/14925) fix some build error
* [#14837](https://github.com/apache/nuttx/pull/14837) fix some comment in https://github.com/apache/nuttx/pull/14764
* [#13909](https://github.com/apache/nuttx/pull/13909) Fix some compile warnings in net directory
* [#14873](https://github.com/apache/nuttx/pull/14873) Fix some minor style issues
* [#14677](https://github.com/apache/nuttx/pull/14677) Fix STM32H5 Serial APB Clock Sources
* [#14108](https://github.com/apache/nuttx/pull/14108) Fix system crash when set CONFIG_PRIORITY_INHERITANCE=y
* [#14818](https://github.com/apache/nuttx/pull/14818) Fix timers/arch_alarm.c:109:3: error: 'now' may be used uninitialized
* [#13977](https://github.com/apache/nuttx/pull/13977) Fix to compile parameters not taking effect When cmake version is greater than 3.18
* [#14072](https://github.com/apache/nuttx/pull/14072) fix typo error
* [#14737](https://github.com/apache/nuttx/pull/14737) Fix typo errors in include/nuttx/clock.h
* [#14489](https://github.com/apache/nuttx/pull/14489) Fix xtensa build error with choice LIBSUPCXX by default.
* [#14828](https://github.com/apache/nuttx/pull/14828) fix: remove duplicated statistics of upd.drop
* [#14889](https://github.com/apache/nuttx/pull/14889) fix(rp2350): should copy data before init clock
* [#15024](https://github.com/apache/nuttx/pull/15024) float.h: Define FLT_ROUNDS if not defined by toolchain previously
* [#14869](https://github.com/apache/nuttx/pull/14869) getifaddrs support returning multiple IPv6 addresses
* [#14037](https://github.com/apache/nuttx/pull/14037) Getline support backspace
* [#14232](https://github.com/apache/nuttx/pull/14232) gnu++20:fix ld error.
* [#14098](https://github.com/apache/nuttx/pull/14098) goldfish add gicv2m support
* [#14090](https://github.com/apache/nuttx/pull/14090) goldfish fix forget clear interrrpt add in cmake
* [#14122](https://github.com/apache/nuttx/pull/14122) goldfish: sync with qemu do rpmsg_syslog init at goldfish
* [#14725](https://github.com/apache/nuttx/pull/14725) gprof: Add a configuration dependency
* [#14740](https://github.com/apache/nuttx/pull/14740) gprof: move gprof function from sched to libbuiltin/libgcc
* [#14717](https://github.com/apache/nuttx/pull/14717) GreenHills Support: add __ARM_ARCH __ARM_FEATURE_DSP macro definition when build with ghs compiler
* [#14825](https://github.com/apache/nuttx/pull/14825) GreenHills support: add thumb mode detection support for ghs compiler
* [#14269](https://github.com/apache/nuttx/pull/14269) greenhills support: fix the build warning with ghs compiler
* [#14719](https://github.com/apache/nuttx/pull/14719) GreenHills support: fix the naked_function attr cannot handle warning with old version GHS compiler
* [#14718](https://github.com/apache/nuttx/pull/14718) GreenHills support: fix the naked_function function non-compatible issue with arm_svcall
* [#14836](https://github.com/apache/nuttx/pull/14836) group_signal_handler: Remove a redundant check
* [#13944](https://github.com/apache/nuttx/pull/13944) group: access group in critical section
* [#14766](https://github.com/apache/nuttx/pull/14766) icjx: disable interrupts in interrupt worker
* [#14443](https://github.com/apache/nuttx/pull/14443) Implement ADC driver interface for MCP3008
* [#14285](https://github.com/apache/nuttx/pull/14285) Implement Position-Independent-Code (PIC) loading
* [#14812](https://github.com/apache/nuttx/pull/14812) in smp_call handle we only change TCB_FLAG_CPU_LOCKED bit of tcb->flag
* [#13869](https://github.com/apache/nuttx/pull/13869) inotify: support truncate and close calls
* [#15002](https://github.com/apache/nuttx/pull/15002) install kconfiglib using apt repo
* [#14567](https://github.com/apache/nuttx/pull/14567) irq: force inline up_interrupt_context
* [#14199](https://github.com/apache/nuttx/pull/14199) irq: irq_attach_wqueue replace irq_attach_thread
* [#14856](https://github.com/apache/nuttx/pull/14856) irq/irq.h: Remove extern of non-existent global
* [#14686](https://github.com/apache/nuttx/pull/14686) isrthread: add configuring the stack of an isrthread as static
* [#14452](https://github.com/apache/nuttx/pull/14452) kconfig: Add link parameters that can print remaining memory information
* [#14325](https://github.com/apache/nuttx/pull/14325) Kconfig:Add an option to disable compilation of floating point
* [#15005](https://github.com/apache/nuttx/pull/15005) lc823450_usbdev: use small lock in arch/arm/src/lc823450/lc823450_usbdev.c
* [#14893](https://github.com/apache/nuttx/pull/14893) lm3s6965-ek/qemu: Using default max command line length
* [#14000](https://github.com/apache/nuttx/pull/14000) long double need use the format of 'Lf'
* [#14635](https://github.com/apache/nuttx/pull/14635) macos: fix “sed: -I or -i may not be used with stdin”
* [#15048](https://github.com/apache/nuttx/pull/15048) make arm-v6/7/8m compatible with signal delivery inside irq handler
* [#14696](https://github.com/apache/nuttx/pull/14696) makefile/build: Delete unnecessary bin and kbin folders
* [#14049](https://github.com/apache/nuttx/pull/14049) makefile/clang: Compare versions for upward compatibility
* [#13864](https://github.com/apache/nuttx/pull/13864) math: remove is_power_of_2() keep IS_POWER_OF_2()
* [#15006](https://github.com/apache/nuttx/pull/15006) max32660_wdt: use small lock in arch/arm/src/max326xx/max32660/max32660_wdt.c
* [#13898](https://github.com/apache/nuttx/pull/13898) Memory delay free kasan error fix and  memory note fix
* [#14146](https://github.com/apache/nuttx/pull/14146) mempool: add the minimum size configuration of mempool
* [#14410](https://github.com/apache/nuttx/pull/14410) merge some nrf52 configurations into one 
* [#14821](https://github.com/apache/nuttx/pull/14821) minor code refactor
* [#14617](https://github.com/apache/nuttx/pull/14617) Minor improve blkoutstream and mtdoutstream
* [#14334](https://github.com/apache/nuttx/pull/14334) modify for set conn status with connected when receive event USRSOCK_EVENT_SENDTO_READY
* [#14205](https://github.com/apache/nuttx/pull/14205) modlib:bug fixallow 64bit elf load and if sym is NULL not load symbol
* [#14732](https://github.com/apache/nuttx/pull/14732) modlib:need add ctors to init_array and dtors to fini_array
* [#14383](https://github.com/apache/nuttx/pull/14383) modlib/modlib_symbols.c: Fix usage of void* arithmetics
* [#14990](https://github.com/apache/nuttx/pull/14990) mps3an547 doc update
* [#13927](https://github.com/apache/nuttx/pull/13927) mq: correct inode release in mq_inode_release()
* [#14654](https://github.com/apache/nuttx/pull/14654) msys2: fix make[3]: warning: jobserver unavailable: using -j1.
* [#14189](https://github.com/apache/nuttx/pull/14189) mtd/nvs: Trigger recovery process in nvs_startup
* [#14053](https://github.com/apache/nuttx/pull/14053) nuttx-names.in: add feof
* [#14468](https://github.com/apache/nuttx/pull/14468) nuttx: Add LIBSUPCXX_TOOLCHAIN to link the prebuilt library provide by toolchain.
* [#14543](https://github.com/apache/nuttx/pull/14543) nuttx: Fix build warning with can't found xt-g++
* [#14721](https://github.com/apache/nuttx/pull/14721) nuttx/qemu: Fix funciton up_idle multiple definition
* [#13923](https://github.com/apache/nuttx/pull/13923) Pci bugfix
* [#13963](https://github.com/apache/nuttx/pull/13963) Pci fixbugs
* [#14969](https://github.com/apache/nuttx/pull/14969) Pci io
* [#14124](https://github.com/apache/nuttx/pull/14124) pci_ivshmem.c: ivshmem_support_irq API support
* [#15071](https://github.com/apache/nuttx/pull/15071) pci: fix pci dev alloc bridge mem error
* [#13897](https://github.com/apache/nuttx/pull/13897) pci: msi and msix irq need release irq
* [#14126](https://github.com/apache/nuttx/pull/14126) pci.h: add pci_write/read_mmio_qword support
* [#14097](https://github.com/apache/nuttx/pull/14097) PFU: do not cause execution of any instructions to be trapped
* [#14621](https://github.com/apache/nuttx/pull/14621) Pico SDK version bump + assimilate old READMEs into RST
* [#14904](https://github.com/apache/nuttx/pull/14904) Publish GDB Plugin as a standard python package
* [#14253](https://github.com/apache/nuttx/pull/14253) Py code check update
* [#13850](https://github.com/apache/nuttx/pull/13850) qemu & goldfish update
* [#14505](https://github.com/apache/nuttx/pull/14505) qemu-intel64: Fixes the linker 'noexecstack' warning
* [#14423](https://github.com/apache/nuttx/pull/14423) ramlog: Remove RAMLOG_CRLF config and related code
* [#14733](https://github.com/apache/nuttx/pull/14733) rammtd:add rammtd_uninitialize
* [#13912](https://github.com/apache/nuttx/pull/13912) release msi/msix irq clean capability struct
* [#14736](https://github.com/apache/nuttx/pull/14736) Remove "dumprun" functions from various LCD drivers
* [#14649](https://github.com/apache/nuttx/pull/14649) Remove all jira and changeid information from the kernel
* [#15050](https://github.com/apache/nuttx/pull/15050) Remove FAR from 32/64bit arch
* [#14450](https://github.com/apache/nuttx/pull/14450) Remove ndelay_accurate
* [#14613](https://github.com/apache/nuttx/pull/14613) remove nxsched_lock_irq/nxsched_unlock_irq
* [#15046](https://github.com/apache/nuttx/pull/15046) remove redundant judgments *running_task != NULL
* [#14974](https://github.com/apache/nuttx/pull/14974) remove redundant scheduling records
* [#14814](https://github.com/apache/nuttx/pull/14814) remove sched_lock in pthread_cond_broadcast
* [#14469](https://github.com/apache/nuttx/pull/14469) remove unused variable 'cpu_freq'
* [#14475](https://github.com/apache/nuttx/pull/14475) remove unused variable 'cpu_freq'
* [#13863](https://github.com/apache/nuttx/pull/13863) remove up_cpu_pause up_cpu_resume up_cpu_paused up_cpu_pausereq
* [#14596](https://github.com/apache/nuttx/pull/14596) remove up_current_regs in common code
* [#14608](https://github.com/apache/nuttx/pull/14608) Replace __attribute__((packed)) with [begin|end]_packed_struct
* [#14751](https://github.com/apache/nuttx/pull/14751) Revert "SYSLOG_DEFAULT: wrap up_putc/up_nputs calls with critical sec…
* [#14806](https://github.com/apache/nuttx/pull/14806) Revert "system: pthread_barrierwait should be moved to kernel space"
* [#14338](https://github.com/apache/nuttx/pull/14338) Revert "Update esptool version on docs and build system"
* [#14180](https://github.com/apache/nuttx/pull/14180) sdio_probe: set voltage use CMD5
* [#14802](https://github.com/apache/nuttx/pull/14802) segger/stream_rtt: fix warning after stream update
* [#14465](https://github.com/apache/nuttx/pull/14465) sem: change sem wait to atomic operation
* [#14152](https://github.com/apache/nuttx/pull/14152) setjmp: fix setjmp returns 0 when calling longjmp with 0 as the secon…
* [#14276](https://github.com/apache/nuttx/pull/14276) shm:fix build error
* [#14524](https://github.com/apache/nuttx/pull/14524) Shmfs bug fix
* [#14822](https://github.com/apache/nuttx/pull/14822) Simplify PCI driver configuration
* [#14656](https://github.com/apache/nuttx/pull/14656) smpcall: add nxsched_smp_call_async and nxsched_smp_call_single_async
* [#14663](https://github.com/apache/nuttx/pull/14663) smpcall: we directly call the function to handle local smpcall
* [#14337](https://github.com/apache/nuttx/pull/14337) Socketcan fixes
* [#14346](https://github.com/apache/nuttx/pull/14346) socketpair.c:Replace kmm with fs heap
* [#14927](https://github.com/apache/nuttx/pull/14927) spelling: fix spelling typo premption -> preemption
* [#14939](https://github.com/apache/nuttx/pull/14939) spinlock: remove recursive locks with write_lock_irqsave/read_lock_irqsave
* [#14931](https://github.com/apache/nuttx/pull/14931) spinlock: use spin_lock_init replace spin_initialize
* [#14989](https://github.com/apache/nuttx/pull/14989) st7789: add configuration option to set default background color
* [#14924](https://github.com/apache/nuttx/pull/14924) stream_getc: use lib_stream_eof instead of EOF
* [#14844](https://github.com/apache/nuttx/pull/14844) Support enabling/disabling attr attribute in littlefs for nuttx
* [#14678](https://github.com/apache/nuttx/pull/14678) Support for the Seeed Studio XIAO SAMD21
* [#14093](https://github.com/apache/nuttx/pull/14093) Support note print in Segger Sysview terminal
* [#13910](https://github.com/apache/nuttx/pull/13910) Support shutdown
* [#14168](https://github.com/apache/nuttx/pull/14168) support trace_beginex and trace_endex
* [#14196](https://github.com/apache/nuttx/pull/14196) systick:when isr_handle is NULL will be crash.
* [#14483](https://github.com/apache/nuttx/pull/14483) task_exit.c: Add missing sched_note_stop()
* [#13924](https://github.com/apache/nuttx/pull/13924) This patch is to allow the application layer to use ioctl to send can/lin status control information to the driver layer.
* [#14156](https://github.com/apache/nuttx/pull/14156) tlsr82/nsh: set LIBC_RAND_ORDER be 0 to fix compile error
* [#13852](https://github.com/apache/nuttx/pull/13852) unify MODULE & ELF flag to Toolchain.defs
* [#14100](https://github.com/apache/nuttx/pull/14100) Unify the code of libelf and modlib and delete the implementation of libelf
* [#14159](https://github.com/apache/nuttx/pull/14159) Unify the definition of GCCVER and remove duplicate code.
* [#14848](https://github.com/apache/nuttx/pull/14848) Unify the linking options for 32-bit and 64-bit to text-segment=0x3000000.
* [#14707](https://github.com/apache/nuttx/pull/14707) Update BOARD_USExxx naming input clock selection and setting of HSIDIV
* [#15067](https://github.com/apache/nuttx/pull/15067) Update cdc.h to fix typo in the comments
* [#14283](https://github.com/apache/nuttx/pull/14283) update defconfig
* [#14120](https://github.com/apache/nuttx/pull/14120) Update esptool version on docs and build system
* [#14794](https://github.com/apache/nuttx/pull/14794) update Intel64 and PCI documentation
* [#14778](https://github.com/apache/nuttx/pull/14778) update stream relative fix mtd&blk stream readback before block update. decrese int use in stream to handle FS_LARGEFILE
* [#13889](https://github.com/apache/nuttx/pull/13889) update the mm dump relative add orphan & biggest dump feature.
* [#13913](https://github.com/apache/nuttx/pull/13913) Upgrade openamp and libmetal to last commit
* [#14255](https://github.com/apache/nuttx/pull/14255) Use BACKTRACE_BUFFER_SIZE to declare backtrace buffer
* [#14517](https://github.com/apache/nuttx/pull/14517) Use memalign to align share memory to CPU cache line size
* [#14632](https://github.com/apache/nuttx/pull/14632) Use pathbuffer reduce stack
* [#14181](https://github.com/apache/nuttx/pull/14181) use r1-r3 as tmp register
* [#14930](https://github.com/apache/nuttx/pull/14930) use spin_lock_wo_note replace spin_lock in csection
* [#14351](https://github.com/apache/nuttx/pull/14351) userspace: Exclude nuttx/arch.h
* [#14953](https://github.com/apache/nuttx/pull/14953) Various improvements for e1000 and igc
* [#14279](https://github.com/apache/nuttx/pull/14279) vsprintf:fix bug when print int64 0x8000000000000000
* [#14499](https://github.com/apache/nuttx/pull/14499) when COMPILE_OPTIONS is not set skip the REMOVE_ITEM in ${HOSTSRCS} fix msvc reported case.

View file

@ -38,13 +38,35 @@ This will generate a ``nutxx`` binary. This file can be run using the RISC-V QEM
Try Python in NSH
=================
Before running the RISC-V QEMU, create a raw disk image with the following command:
.. code:: console
$ .qemu-system-riscv32 -semihosting -M virt,aclint=on -cpu rv32 -smp 1 -bios none -kernel nuttx -nographic
$ dd if=/dev/zero of=./mydisk-1gb.img bs=1M count=1024
Then, run RISC-V QEMU with the following command:
.. code:: console
$ qemu-system-riscv32 -semihosting -M virt,aclint=on -cpu rv32 -smp 8 \
-global virtio-mmio.force-legacy=false \
-device virtio-serial-device,bus=virtio-mmio-bus.0 \
-chardev socket,telnet=on,host=127.0.0.1,port=3450,server=on,wait=off,id=foo \
-device virtconsole,chardev=foo \
-device virtio-rng-device,bus=virtio-mmio-bus.1 \
-netdev user,id=u1,hostfwd=tcp:127.0.0.1:10023-10.0.2.15:23,hostfwd=tcp:127.0.0.1:15001-10.0.2.15:5001 \
-device virtio-net-device,netdev=u1,bus=virtio-mmio-bus.2 \
-drive file=./mydisk-1gb.img,if=none,format=raw,id=hd \
-device virtio-blk-device,bus=virtio-mmio-bus.3,drive=hd \
-bios none -kernel ./nuttx -nographic
ABC[ 0.062131] board_userled: LED 1 set to 0
[ 0.063269] board_userled: LED 2 set to 0
[ 0.063367] board_userled: LED 3 set to 0
telnetd [4:100]
ABC
NuttShell (NSH) NuttX-10.4.0
nsh> mount_modules
nsh> python_mount_modules
Mounting ROMFS filesystem at target=/usr/local/lib/ with source=/dev/ram1
nsh> export PYTHONHOME /usr/local
nsh> export PYTHON_BASIC_REPL 1
@ -58,5 +80,5 @@ Demo
Check the following `asciinema <https://asciinema.org/>`_ demo to see how to run Python on NuttX. You can copy and paste the commands from the demo to try it yourself.
.. image:: https://asciinema.org/a/orkD8fKuahMEgQfBak9abliE4.svg
:target: https://asciinema.org/a/orkD8fKuahMEgQfBak9abliE4
.. image:: https://asciinema.org/a/bYYy1fyIOQ3hOY4lJ7L3WFcNb.svg
:target: https://asciinema.org/a/bYYy1fyIOQ3hOY4lJ7L3WFcNb

View file

@ -7,9 +7,12 @@ It also can be used to run a tests to verify that the vendor's tools are properl
Its primary purpose is to gather information that can be used to debug problems and ease the process of reporting bugs for uninexperienced users.
This tool uses a Python script (``apps/tools/host_sysinfo.py``) to gather information about the host system during build and a C
This tool uses a Python script (``nuttx/tools/host_info_dump.py``) to gather information about the host system during build and a C
program to gather information about the NuttX system and display all available information. For more information about the python
script, check the command line options and code comments of ``host_sysinfo.py``.
script, check the command line options and code comments of ``host_info_dump.py``.
Alternatively, ``host_info`` target can be used without enabling nxdiag application and reflashing to get information about system.
Target can work after configuration step and prints information about the NuttX and host systems.
.. note:: Nxdiag requires Python 3.6 or later. On Linux distributions, the ``distro`` Python module is
recommended as it provides more accurate information about the host system.

View file

@ -0,0 +1,207 @@
========================================================
Building NuttX with Applications Outside the Source Tree
========================================================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/Building+NuttX+with+Applications+Outside+of+the+Source+Tree
Q: Has anyone come up with a tidy way to build NuttX with board-specific pieces outside the source tree?
========================================================================================================
A: Here are four approaches:
============================
1. Make export
--------------
There is a make target called ``make export``. It will build NuttX, then bundle
all of the header files, libraries, startup objects, and other build components
into a ``.zip`` file. You can move that ``.zip`` file into any build environment
you want. You can even build NuttX under a DOS CMD window.
This ``make target`` is documented in the top-level
:doc:`Legacy README </introduction/resources>`. Search for ``Build Targets``
1. Replace the apps/ Directory
------------------------------
You can replace the entire ``apps/`` directory. It is not a critical part of the
OS. The ``apps/`` is simply provided for you to help with your application
development. It should not dictate anything that you do.
To use a different ``apps`` directory, simply execute ``make menuconfig`` in the
top-level ``nuttx/`` directory and redefine ``CONFIG_APPS_DIR`` in your
``.config`` file so that it points to a different, custom application directory.
Note that ``CONFIG_APPS_DIR`` is a `relative` path from the top-level
``nuttx/`` directory.
You can copy any pieces that you like from the old ``apps/`` directory to your
custom ``apps`` directory as necessary. This is documented in
the `NuttX Porting Guide <https://cwiki.apache.org/confluence/display/NUTTX/Porting+Guide>`_
and in the `apps/README.md <https://github.com/apache/nuttx-apps/blob/master/README.md>`_ file.
1. Extend the apps/ Directory
-----------------------------
If you like the random collection of stuff in the ``apps/`` directory but just
want to expand the existing components with your own, external sub-directory,
then there is an easy way to do that too: Create a symbolic link in the
``apps/`` directory that redirects to your application sub-directory (or copy
your code into a sub-directory of ``apps/``).
.. image:: image/custom_app_dir_through_extension.png
Makefile and Make.defs
^^^^^^^^^^^^^^^^^^^^^^
In order to be incorporated into the build, the directory that you link under
the ``apps/`` directory should contain:
1. A ``Makefile`` that supports the ``clean`` and ``distclean`` targets (see
other Makefiles for examples).
2. A tiny ``Make.defs`` make file fragment that simply adds the build
directories to the variable ``CONFIGURED_APPS`` like:
.. code-block:: shell
CONFIGURED_APPS += my_directory1 my_directory2
Automatic Sub-directory Inclusion
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``apps/Makefile`` will always automatically check for the existence of
sub-directories containing a ``Makefile`` and a ``Make.defs`` file. The
``Makefile`` will be used only to support cleaning operations. The
``Make.defs`` file provides the set of relative paths to directories to be
built; these directories must also contain a ``Makefile``. That ``Makefile`` can
build the sources and add the object files to the ``apps/libapps.a`` archive
(see other Makefiles for examples). It should support the ``all``, ``install``,
``context``, and ``depend`` targets.
``apps/Makefile`` does not depend on any hard-coded lists of directories.
Instead, it does a wildcard search to find all appropriate directories. This
means that to install a new application, you simply have to copy the directory
(or link it) into the ``apps/`` directory. If the new directory includes a
``Makefile`` and a ``Make.defs`` file, then it will be automatically discovered
and included in the build at ``make`` time.
Kconfig
^^^^^^^
If the directory that you add also includes a ``Kconfig`` file, then it will be
automatically included in the NuttX configuration system as well.
``apps/Makefile`` uses a tool at ``apps/tools/mkkconfig.sh`` that dynamically
builds the ``apps/Kconfig`` file at pre-configuration time.
.. note::
The native Windows build will use a corresponding tool called
``apps/tools/mkconfig.bat``.
Install script
^^^^^^^^^^^^^^
You could, for example, create a script called ``install.sh`` that installs a
custom application, configuration, and board-specific directory:
1. Copy ``MyBoard`` directory to ``boards/MyBoard``.
2. Add a symbolic link to ``MyApplication`` at ``apps/external``
3. Configure NuttX:
.. code-block:: shell
tools/configure.sh MyBoard:MyConfiguration
Special ``apps/external`` Directory
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use of the name ``apps/external`` is suggested because that name is included in
the ``.gitignore`` file and will save you some nuisance when working with GIT.
4. Contain the apps/ Directory
------------------------------
A simple, minimally invasive approach would be to contain the ``apps/`` GIT
clone within your custom application directory. In this case, ``apps/`` would
appear as a directory under your custom application directory instead of your
application directories being inserted as sub-directories of ``apps/``. It may
even be implemented as a sub-module of your custom application directory.
.. image:: image/custom_app_dir_through_containment.png
Kconfig and Makefile
^^^^^^^^^^^^^^^^^^^^
There are only a few minimal requirements of your custom application directory.
It needs to have only its own ``Makefile`` and ``Kconfig`` file. That
``Kconfig`` would need to include the ``apps/Kconfig``. The ``Makefile`` would
similarly need to invoke the ``apps/Makefile`` for all of the relevant build
targets. For example, the ``clean`` target:
.. code-block:: shell
$(MAKE) -c apps clean TOPDIR=$(TOPDIR)
Library Issues
^^^^^^^^^^^^^^
The contained directory will create and install a static library called
``libapps($LIBEXT)`` in the ``nuttx/staging`` directory. Your custom logic must
also appear in the ``nuttx/staging`` directory. Here are two ways that you might
do that:
1. **Merge with ``libapps($LIBEXT)``.**
The custom application directory's ``Makefile`` could create and install the
final ``libapps($LIBEXT)`` in the ``nuttx/staging`` directory.
``<custom-dir>/apps/libapps($LIBEXT)`` could merge its custom object files
with ``<custom-dir>/libapps($LIBEXT)`` and then re-install the library at
``nuttx/staging``.
2. **Use the EXTRA_LIBS Feature.**
The build system supports two special make-related variables called
``EXTRA_LIBS`` and ``EXTRA_LIBPATHS``. These may be defined in your
board-specific ``Make.defs`` file. ``EXTRA_LIBS`` provides the name of your
custom library. If you create ``<custom-dir>/libcustom.a``, then the value
of ``EXTRA_LIBS`` would be ``-lcustom`` and the value of ``EXTRA_LIBPATHS``
would be ``-L <custom-dir>`` (assuming the GNU ld linker).
Relative Effort and Benefits
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The contained ``apps/`` directory approach requires some more effort than the
extended ``apps/`` approach, but has the advantage that there will be no strange
behavior due to issues with ``.gitignore`` and, hence, a cleaner user
experience.
Out-of-tree Builds
^^^^^^^^^^^^^^^^^^
This configuration also has the possibility of supporting out-of-tree builds
using ``fusefs``. Suppose, for example, that you have a project directory with
the contained ``apps/`` directory and, say, three platform build directories.
Using ``fusefs``, you can overlay one of the platform build directories on top
of the project directory. Then all files generated by the build will be written
into the overlaid platform build directory. When the ``fusefs`` is torn down,
the project directory will still be clean, and the build result will still be in
the platform build directory. This can then be repeated for the other two
platform build directories.
In this case, you would probably also want to contain the ``nuttx/`` directory
in the project directory as well so that the entire system is built out-of-tree.
Hooking External Applications into the Configuration System
-----------------------------------------------------------
Suppose you have opted to extend the ``apps/`` directory with your custom
external application directories and would also like to support configuration
variables in your external application. No problem! Thanks to Sebastien Lorquet,
any external application that you install into the ``apps/`` (whether via a
symbolic link or via a directory copy) `will` be included in the NuttX
configuration system.
The top-level ``Kconfig`` file in the ``apps/`` directory is automatically
generated based on the contents of each ``apps/`` sub-directory. If your
installed sub-directory contains ``Kconfig``, ``Makefile``, and ``Make.defs``
files, then it will be incorporated into the NuttX configuration system when the
top-level ``Kconfig`` file is generated.

View file

@ -0,0 +1,84 @@
=================
Building uClibc++
=================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629550
and is probably outdated
A version of `uClibc++ <http://cxx.uclibc.org/>`_ has been ported to NuttX and is available in the NuttX
uClibc++ GIT repository at `Bitbucket.org <https://bitbucket.org/nuttx/uclibc/>`_ . This version of uClibc++ was
adapted for NuttX by the RGMP team.
This custom version of uClibc++ resides in the NuttX repository at:
https://bitbucket.org/nuttx/uclibc/
rather than in the main NuttX source tree, due to licensing issues: NuttX is
licensed under the permissive, modified BSD License; uClibc++, on the other
hand, is licensed under the stricter GNU LGPL Version 3 license.
General build instructions are available in the uClibc++ `README.txt <https://bitbucket.org/nuttx/uclibc/src/master/README.txt>`_
file. Those instructions are not repeated here. This page documents specific
issues encountered when building this NuttX version of uClibc++ and how they
are resolved.
Undefined Reference to ``_impure_ptr``
======================================
**Problem**
When building uClibc++, you may encounter an undefined reference to
``_impure_ptr`` similar to:
.. code-block:: none
LD: nuttx
.../arm-none-eabi/lib/armv7e-m\libsupc++.a(vterminate.o): In function
`__gnu_cxx::__verbose_terminate_handler()`:
vterminate.cc:(.text._ZN9__gnu_cxx27__verbose_terminate_handlerEv+0xfc):
undefined reference to `_impure_ptr'
**Solution**
A definitive, elegant solution is not known, but the following workaround has
proven to work:
1. Locate the directory where you can find ``libsupc++``:
.. code-block:: console
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -print-file-name=libsupc++.a
2. Go to that directory and save a copy of ``vterminate.o`` (in case you need
it later):
.. code-block:: console
cd <the-directory-containing-libsupc++.a>
arm-none-eabi-ar.exe -x libsupc++.a vterminate.o
3. Remove ``vterminate.o`` from the library. At build time, the uClibc++
package will provide a usable replacement:
.. code-block:: console
arm-none-eabi-ar.exe -d libsupc++.a vterminate.o
4. At this point, NuttX should link with no problem. If you ever want to
restore the original ``vterminate.o`` to ``libsupc++.a``, you can do so
by running:
.. code-block:: console
arm-none-eabi-ar.exe rcs libsupc++.a vterminate.o
After removing ``vterminate.o`` from the standard library, the
uClibc++-provided ``vterminate.o`` becomes the active implementation and
prevents references to ``_impure_ptr`` from arising during linkage.
.. note::
Always exercise caution when modifying toolchain libraries. This
workaround is known to be effective but it replaces standard library
objects, which may have side effects in other toolchain usage scenarios.

View file

@ -0,0 +1,165 @@
===========================================
Custom Application Directories
===========================================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/Custom+Application+Directories
Most people use the generic ``apps/`` directory with NuttX. That is convenient
and well-documented. However, it should always be remembered that NuttX is a
stand-alone, general-purpose OS and has **no dependency** on that "canned"
application directory.
This page shows how to create your own, custom application directory from
scratch.
Creating the Custom Application Directory
=========================================
Below is a simple example of the **minimum** custom application directory. It
contains only three files: ``Makefile``, ``Kconfig``, and ``hello.c``.
Makefile
--------
The custom application directory must include a ``Makefile`` that supports all
of the make targets expected by the NuttX build system **and** must generate an
archive called ``libapps.a`` in the top-level of the custom directory structure.
The minimal required targets for the ``Makefile`` look like this:
.. code-block:: shell
APPDIR = ${shell pwd}
-include $(TOPDIR)/Make.defs
# files
CSRCS = hello.c
COBJS = hello.o
ROOTDEPPATH = --dep-path .
# Build targets
all: libapps.a
.PHONY: dirlinks context preconfig depend clean clean_context distclean
.PRECIOUS: libapps$(LIBEXT)
# Compile C Files
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
# Add object files to the apps archive
libapps.a: $(COBJS)
$(call ARCHIVE, libapps.a, $(COBJS))
# Create directory links
dirlinks:
# Setup any special pre-build context
context:
# Setup any special pre-configuration context
preconfig:
# Make the dependency file, Make.deps
depend: Makefile $(CSRCS)
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
# Clean the results of the last build
clean:
$(call CLEAN)
# Remove the build context and directory links
clean_context:
# Restore the directory to its original state
distclean: clean clean_context
$(call DELFILE, Make.dep)
# Include dependencies
-include Make.dep
Kconfig
-------
A ``Kconfig`` file must be included, but it need not contain any meaningful
configuration options. This file is where you can add application-specific
configuration settings if desired. The minimal ``Kconfig`` might look like:
.. code-block:: shell
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
hello.c
-------
Your custom application must compile at least one source file to generate the
required ``libapps.a`` archive. One of these source files must include the
``main()`` entry point to the application. That main function (or similarly
named entry point) is called after OS initialization completes.
What this application initialization entry point does, how it interacts with
the rest of your application, and where the rest of you application code is
located is of no concern to the OS. Only this one entry point is needed.
Below is a small "Hello, World!" example, where ``custom_main()`` is the
application entry point:
.. code-block:: c
#include <stdio.h>
int custom_main(int argc, char *argv[])
{
printf("Hello, World!!\n");
return 0;
}
Building with the Custom Application Directory
==============================================
In order to build with the new custom application directory, you need the
following in your NuttX configuration:
.. code-block:: shell
CONFIG_APPS_DIR="../custom-apps"
CONFIG_USER_ENTRYPOINT="custom_main"
.. note::
You can only access the ``../custom-apps/Kconfig`` file if
``CONFIG_APPS_DIR`` is set to ``../custom-apps`` **before** running
``make menuconfig``. If you start with an existing configuration, you may
face a "chicken-and-egg" situation. One workaround is to manually edit
the ``.config`` file before running ``make menuconfig``.
Alternatively, if you use the ``tools/configure.sh`` script, you can specify the
custom-apps directory from the command line:
.. code-block:: shell
tools/configure.sh -a ../custom_apps <board>:<config>
Afterward, just build NuttX as you normally would. When you run the program that
was built with your custom application directory, you should see:
.. code-block:: shell
Hello, World!!

View file

@ -0,0 +1,84 @@
==============================
Debugging ELF Loadable Modules
==============================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/Debugging+ELF+Loadable+Modules
Debugging ELF modules loaded in memory can be tricky because the load address
in memory does not match the addresses in the ELF file. This challenge has long
existed for debugging uClinux programs and Linux kernel modules; the same
solution can be used with NuttX ELF files (and probably with NxFLAT modules as
well). Below is a summary of one way to approach this:
1. Get ELF Module Load Address
==============================
Put a change in ``nuttx/binfmt`` so that you print the address where the ELF
text was loaded into memory.
Turning on BINFMT debug (``CONFIG_DEBUG_BINFMT=y``) should give you the same
information, although it may also provide more output than you really want.
Alternatively, you could place a ``printf()`` at the beginning of your ``main()``
function so that your ELF module can print its own load address. For example,
the difference between the address of ``main()`` in your object file and the
address of ``main()`` at run time reveals the actual load address.
2. Make the ELF Module Wait for You
===================================
Insert an infinite loop in the ``main()`` routine of your ELF program. For
example:
.. code-block:: c
volatile bool waitforme;
int main (int arc, char **argv)
{
while (!waitforme);
...
When you start the ELF program, you will see where it was loaded in memory, and
the ELF program will remain stuck in the infinite loop. It will continue to
wait for ``waitforme`` to become true before proceeding.
3. Start the Debugger
=====================
Start the debugger, connect to the GDB server, and halt the program. If your
debugger is well-behaved, it should stop at the infinite loop in ``main()``.
4. Load Offset Symbols
======================
Load symbols using the offset where the ELF module was loaded:
.. code-block:: shell
(gdb) add-symbol-file <myprogram> <load-address>
Here, ``<myprogram>`` is your ELF file containing symbols, and
``<load-address>`` is the address where the program text was actually loaded (as
determined above). Single-step a couple of times and confirm that you are in the
infinite loop.
5. And Debug
============
Set ``waitforme`` to a non-zero value. Execution should exit the infinite loop,
and now you can debug the ELF program loaded into RAM in the usual way.
An Easier Way?
==============
There might be an alternative that allows you to step into the ELF module
without modifying the code to include the ``waitforme`` loop. You could place a
breakpoint on the OS function ``task_start()``. That function runs before your
ELF program starts, so you should be able to single-step from the OS code
directly into your loaded ELF application—no changes to the ELF application
required.
When you step into the application's ``main()``, you have the relocated address
of ``main()`` and can use that address (see step #1) to compute the load offset.

View file

@ -0,0 +1,538 @@
===============================
ELF Programs No Symbol Tables
===============================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629542
You can easily extend the firmware in your released, embedded system using ELF
programs provided via a file system (for example, an SD card or downloaded into
on-board SPI FLASH). In order to support such post-release updates, your
released firmware would have to support execution of fully linked, relocatable
ELF programs loaded into RAM (see, for example, ``apps/examples/elf``).
The files shown in this Wiki page can be downloaded `here <https://cwiki.apache.org/confluence/download/attachments/139629402/elfprog-nosymtab.tar.gz?version=1&modificationDate=1576735520000&api=v2>`_.
Alan Carvalho de Assis has also made a video based on this example in the
YouTube `NuttX Channel <https://www.youtube.com/watch?v=oL6KAgkTb8M>`_.
Creating the Export Package
===========================
At the time that you release the firmware, you should create and save an
export package. The export package is all that you need to create
post-release, add-on modules for your embedded system. Let's illustrate this
using the ``STM32F4-Discovery`` networking ``NSH`` configuration with the
``STM32F4DIS-BB`` baseboard. (This demonstration assumes that you also have
support for some externally modifiable media in the board configuration, such
as removable media like an SD card, or a USB FLASH stick, an internal file
system remotely accessible via USB MSC, FTP, or any remote file system (NFS).
The networking ``NSH`` configuration uses the SD card on the STM32 baseboard
for this demonstration. Other ``NSH`` configurations could be used, provided
that you supply the necessary file system support in some fashion.)
(No baseboard? You can add file system support to the basic ``STM32F4-Discovery``
board by following these instructions:
`USB FLASH drive <https://www.youtube.com/watch?v=5hB5ZXpRoS4>`_
or `SD card <https://www.youtube.com/watch?v=H28t4RbOXqI>`_.)
.. code-block:: shell
$ make distclean
$ tools/configure.sh -c stm32f4discovery:netnsh
$ make menuconfig
Your released firmware would have to have been built with a few important
configuration settings:
1. Disable networking (Only because it is not needed in this example):
.. code-block:: shell
# CONFIG_NET is not set
2. Enable basic ELF binary support with no built-in symbol table support:
.. code-block:: shell
CONFIG_ELF=y
CONFIG_LIBC_EXECFUNCS=y
# CONFIG_EXECFUNCS_HAVE_SYMTAB is not set
3. Enable PATH variable support:
.. code-block:: shell
CONFIG_BINFMT_EXEPATH=y
CONFIG_PATH_INITIAL="/bin"
# CONFIG_DISABLE_ENVIRON not set
4. Enable execution of ELF files from the ``NSH`` command line:
.. code-block:: shell
CONFIG_NSH_FILE_APPS=y
.. note::
You must enable some application that uses ``printf()``. This is necessary
to assure that the symbol ``printf()`` is included in the base system.
Here we assume that you include the "Hello, World!" example from
``apps/examples/hello``:
.. code-block:: shell
CONFIG_EXAMPLES_HELLO=y
Then we can build the NuttX firmware image and the export package:
.. code-block:: shell
$ make
$ make export
When ``make export`` completes, you will find a ZIP'ed package in the top-level
NuttX directory called ``nuttx-export-x.y.zip`` (for version ``x.y``). The
version is determined by the ``.version`` file in the same directory. The
content of this ZIP file is the following directory structure:
.. code-block:: shell
nuttx-export-x.x
|- arch/
|- build/
|- include/
|- libs/
|- startup/
|- System.map
`- .config
The Add-On Build Directory
==========================
In order to create the add-on ELF program, you will need (1) the export
package, (2) the program build ``Makefile``, (3) a linker script used by the
``Makefile``, and (4) a Bash script to create a linker script. That
``Makefile`` and Bash Script are discussed in the following paragraphs.
.. note::
These example files implicitly assume a GNU tool chain is used and, in at
least one place, that the target is an ARMv7-M platform. A non-GNU tool
chain would probably require a significantly different ``Makefile`` and
linker script. There is at least one ARMv7-M specific change that would
have to be made for other platforms in the script that creates the linker
script (``mkdefines.sh``).
Hello Example
=============
To keep things manageable, let's use a concrete example. Suppose the ELF
program that we wish to add to the release code is the single source file
``hello.c``:
.. code-block:: c
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello from Add-On Program!\n");
return 0;
}
Let's say that we have a directory called ``addon`` and it contains the
``hello.c`` source file, a ``Makefile`` that will create the ELF program, and a
Bash script called ``mkdefines.sh`` that will create a linker script.
Building the ELF Program
========================
The first step in creating the ELF program is to unzip the Export Package. We
start with our ``addon`` directory containing the following:
.. code-block:: shell
$ cd addon
$ ls
gnu-elf.ld hello.c Makefile mkdefines.sh nuttx-export-7.25.zip
Where:
- ``gnu-elf.ld`` is the linker script.
- ``hello.c`` is our example source file.
- ``Makefile`` will build our ELF program and symbol table.
- ``mksymtab.h`` is the Bash script that will create the symbol table for the
ELF program.
- ``nuttx-export-7.25.zip`` is the Export Package for NuttX-7.25.
We unzip the Export Package like:
.. code-block:: shell
$ unzip nuttx-export-7.25.zip
Then we have a new directory called ``nuttx-export-7.25`` that contains all of
the content from the released NuttX code that we need to build the ELF
program.
The Makefile
============
The ELF program is created simply as:
.. code-block:: shell
$ make
This uses the following ``Makefile`` to generate several files:
- ``hello.o``: The compiled ``hello.c`` object.
- ``hello.r``: A "partially linked" ELF object that still has undefined
symbols.
- ``hello``: The fully linked, relocatable ELF program.
- ``linker.ld``: A linker script created by ``mkdefines.sh``.
Only the resulting ``hello`` is needed.
Below is the ``Makefile`` used to create the ELF program:
.. code-block:: shell
include nuttx-export-7.25/build/Make.defs
# Long calls are need to call from RAM into FLASH
ARCHCFLAGS += -mlong-calls
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
ARCHINCLUDES = -I. -isystem nuttx-export-7.25/include
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHINCLUDES) -pipe
CROSSDEV = arm-none-eabi-
CC = $(CROSSDEV)gcc
LD = $(CROSSDEV)ld
STRIP = $(CROSSDEV)strip --strip-unneeded
# Setup up linker command line options
LDRELFLAGS = -r
LDELFFLAGS = -r -e main
LDELFFLAGS += -T defines.ld -T gnu-elf.ld
# This might change in a different environment
OBJEXT ?= .o
# This is the generated ELF program
BIN = hello
REL = hello.r
# These are the sources files that we use
SRCS = hello.c
OBJS = $(SRCS:.c=$(OBJEXT))
# Build targets
all: $(BIN)
.PHONY: clean
$(OBJS): %$(OBJEXT): %.c
$(CC) -c $(CFLAGS) -o $@ $<
System.map: nuttx-export-7.25/System.map
cat nuttx-export-7.25/System.map | sed -e "s/\r//g" >System.map
$(REL): $(OBJS)
$(LD) $(LDRELFLAGS) -o $@ $<
defines.ld: System.map $(REL)
./mkdefines.sh System.map "$(REL)" >defines.ld
$(BIN): defines.ld $(REL)
$(LD) $(LDELFFLAGS) -o $@ $(REL)
$(STRIP) $(REL)
clean:
rm -f $(BIN)
rm -f $(REL)
rm -f defines.ld
rm -f System.map
rm -f *.o
The Linker Script
=================
Two linker scripts are used. One is a normal file (we'll call it the main
linker script), and the other, ``defines.ld``, is created on-the-fly as
described in the next section.
The main linker script, ``gnu-elf.ld``, contains the following:
.. code-block:: shell
SECTIONS
{
.text 0x00000000 :
{
_stext = . ;
*(.text)
*(.text.*)
*(.gnu.warning)
*(.stub)
*(.glue_7)
*(.glue_7t)
*(.jcr)
_etext = . ;
}
.rodata :
{
_srodata = . ;
*(.rodata)
*(.rodata1)
*(.rodata.*)
*(.gnu.linkonce.r*)
_erodata = . ;
}
.data :
{
_sdata = . ;
*(.data)
*(.data1)
*(.data.*)
*(.gnu.linkonce.d*)
_edata = . ;
}
.bss :
{
_sbss = . ;
*(.bss)
*(.bss.*)
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.b*)
*(COMMON)
_ebss = . ;
}
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}
Creating the ``defines.ld`` Linker Script
=========================================
The additional linker script ``defines.ld`` is created through a three-step
process:
1. The ``Makefile`` generates a partially linked ELF object, ``hello.r``.
2. The ``Makefile`` then invokes the ``mkdefines.sh`` script, which generates
the ``defines.ld`` linker script that provides values for all of the
undefined symbols.
3. Finally, the ``Makefile`` produces the fully linked, relocatable ``hello``
ELF object using the ``defines.ld`` linker script.
Below is the version of ``mkdefines.sh`` used in this demo:
.. code-block:: bash
#!/bin/bash
usage="Usage: $0 <system-map> <relprog>"
# Check for the required path to the System.map file
sysmap=$1
if [ -z "$sysmap" ]; then
echo "ERROR: Missing <system-map>"
echo ""
echo $usage
exit 1
fi
# Check for the required partially linked file
relprog=$2
if [ -z "$relprog" ]; then
echo "ERROR: Missing <program-list>"
echo ""
echo $usage
exit 1
fi
# Verify the System.map and the partially linked file
if [ ! -r "$sysmap" ]; then
echo "ERROR: $sysmap does not exist"
echo ""
echo $usage
exit 1
fi
if [ ! -r "$relprog" ]; then
echo "ERROR: $relprog does not exist"
echo ""
echo $usage
exit 1
fi
# Extract all of the undefined symbols from the partially linked file and create a
# list of sorted, unique undefined variable names.
varlist=`nm $relprog | fgrep ' U ' | sed -e "s/^[ ]*//g" | cut -d' ' -f2 | sort - | uniq`
# Now output the linker script that provides a value for all of the undefined symbols
for var in $varlist; do
map=`grep " ${var}$" ${sysmap}`
if [ -z "$map" ]; then
echo "ERROR: Variable $var not found in $sysmap"
echo ""
echo $usage
exit 1
fi
varaddr=`echo ${map} | cut -d' ' -f1`
echo "${var} = 0x${varaddr} | 0x00000001;"
done
This script uses the ``nm`` utility to find all of the undefined symbols in the
ELF object, then searches for the address of each undefined symbol in the
``System.map`` that was created when the released firmware was built. Finally,
it uses the symbol name and the symbol address to create each symbol table
entry.
.. note::
- For the ARMv7-M architecture, bit 0 of the address must be set to indicate
thumb mode. If you are using a different architecture that requires
normal aligned addresses, you will need to change the following line by
eliminating the ORed value:
.. code-block:: shell
echo "${var} = 0x${varaddr} | 0x00000001;"
- If the new ELF module uses a symbol that is not provided in the base
firmware and, hence, not included in the ``System.map`` file, this script
will fail. In that case, you will need to provide the missing logic
within the ELF program itself, if possible.
- The technique as described here is only valid in the FLAT build mode. It
could probably also be extended to work in the PROTECTED mode by
substituting ``User.map`` for ``System.map``.
Here is an example ``defines.ld`` created by ``mkdefines.sh``:
.. code-block:: shell
printf = 0x0800aefc | 0x00000001 ;
Replacing an NSH Built-In Function
==================================
Files can be executed by ``NSH`` from the command line by simply typing the
name of the ELF program. This requires:
1. That the feature be enabled with``CONFIG_NSH_FILE_APP=y``
2. That support for the PATH variable is enabled (``CONFIG_BINFMT_EXEPATH=y`` and
``CONFIG_PATH_INITIAL`` set to the mount point of the file system that
may contain ELF programs).
Suppose, for example, I have a built-in application called ``hello``. Before
installing the new replacement ``hello`` ELF program in the file system, this
is the version of ``hello`` that ``NSH`` will execute:
.. code-block:: shell
nsh> hello
Hello, World!
nsh>
In the above configuration, ``NSH`` will first attempt to run the program called
``hello`` from the file system. This will fail because we have not yet placed
our custom ``hello`` ELF program in the file system. So instead, ``NSH`` will
fall back and execute the built-in application called ``hello``.
In this way, any command known to ``NSH`` can be replaced by an ELF program
installed in a mounted file system directory that is found via the PATH
variable.
Now suppose that we do add our custom ``hello`` to the file system. When
``NSH`` attempts to run the program called ``hello`` from the file system, it
will run successfully. The built-in version will be ignored. It has been
replaced with the version in the file system:
.. code-block:: shell
nsh> mount -t vfat /dev/mmcsd0 /bin
nsh> hello
Hello from Add-On Program!
nsh>
Version Dependency
==================
.. note::
This technique generates ELF programs using fixed addresses from the
``System.map`` file of a versioned release. The generated ELF programs can
only be used with that specific firmware version. A crash will most likely
result if used with a different firmware version, because the addresses
from the ``System.map`` will not match the addresses in a different version
of the firmware.
The alternative approach using :doc:`Symbol Tables <fully_linked_elf>` is more
or less version independent.
Tightly Coupled Memories
========================
Most MCUs based on ARMv7-M family processors support some kind of Tightly
Coupled Memory (TCM). These TCMs have somewhat different properties for
specialized operations. Depending on the bus matrix of the processor, you may
not be able to execute programs from TCM. For instance, the ``STM32 F4``
supports Core Coupled Memory (CCM), but since it is tied directly to the D-bus,
it cannot be used to execute programs! On the other hand, the ``STM32F3`` has a
CCM that is accessible to both the D-Bus and the I-Bus, in which case it
should be possible to execute programs from this TCM.
.. image:: ./image/system_arch_stm32f42xx_and_f43xx.png
.. image:: ./image/system_arch_stm32f303xBC_and_f358xC.png
When ELF programs are loaded into memory, the memory is allocated from the
heap via a standard memory allocator. By default with the ``STM32 F4``, the
CCM is included in ``HEAP`` and will typically be allocated first. If CCM
memory is allocated to hold the ELF program, a hard-fault will occur
immediately when you try to execute the ELF program in memory.
Therefore, it is necessary on ``STM32 F4`` platforms to include the following
configuration setting:
.. code-block:: shell
CONFIG_STM32_CCMEXCLUDE=y
With that setting, the CCM memory will be excluded from the heap, and so will
never be allocated for ELF program memory.

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View file

@ -56,4 +56,18 @@ Guides
signal_events_interrupt_handlers.rst
signaling_sem_priority_inheritance.rst
smaller_vector_tables.rst
port.rst
port.rst
updating_release_system_elf.rst
partially_linked_elf.rst
fully_linked_elf.rst
building_nuttx_with_app_out_of_src_tree.rst
building_uclibcpp.rst
custom_app_directories.rst
debugging_elf_loadable_modules.rst
multiple_nsh_sessions.rst
nsh_network_link_management.rst
ram_rom_disks.rst
reading_can_msgs.rst
remove_device_drivers_nsh.rst
rust.rst

View file

@ -0,0 +1,86 @@
=====================
Multiple NSH Sessions
=====================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/Multiple+NSH+Sessions
Q:
I would like to run the NuttShell on multiple serial ports, but haven't
figured it out yet; can you point me in the right direction?
A:
Easy. Don't use ``apps/examples/nsh_main.c``. Create your own main function
something like this (with all error handling omitted for simplicity). By the
way, this is all standard POSIX stuff that you can get detailed information
about by just Googling `dup2` or maybe `I/O redirection`:
.. code-block:: c
int my_main(int argc, char **argv)
{
const char *tty = argv[1];
int fd = open(tty, O_RDWR);
(void)dup2(fd, 0);
(void)dup2(fd, 1);
(void)dup2(fd, 2);
close(fd);
...
}
And the rest is just like the original ``nsh_main()`` function (in fact,
perhaps the existing ``nsh_main()`` function could be optionally extended to
accept a console device string?). Then you can start a new NSH session on any
TTY like:
.. code-block:: none
nsh> mynsh /dev/ttyS2 &
This should cause a new NSH session to appear on ``ttyS2``. That session will
persist until you do the following from the new session:
.. code-block:: none
nsh> exit
Then the new session, i.e., ``my_main()`` will exit.
If you were to do something like:
.. code-block:: none
nsh> mynsh /dev/console
then you would get nested NSH sessions on the same console. The first session
would halt and wait for the second session to take control of the console until
it exits. Then the first session will take over console again.
NuTTY
=====
In a previous discussion, there was talk about implementing the moral equivalent
of getty in NuttX (of course, it would be called "nutty"). A simple
implementation of nutty would work like this:
1. It would wait on ``poll()`` on every (configured) serial device.
2. Whenever it is awakened, it would start something like ``my_main()`` above
on the active serial port.
3. NSH has an option to enable logins, but it would be better to remove the
existing login information from NSH and centralize it in nutty.
That way, you could connect to any TTY, hit enter, and you would get an NSH
session. Hmm... it is not clear how nutty would get the TTY back after the
session is closed. That part may require some additional thought.
Other Ideas
===========
There are other ways to get multiple NSH sessions:
- Telnet already supports multiple sessions.
- Implement the existing NSH as an ELF program, then you can get multiple NSH
sessions with ``posix_spawn`` by simply redirecting I/O.
- Using the tiny NxWM window managers, multiple NSH windows are already
supported.

View file

@ -0,0 +1,122 @@
===========================
NSH Network Link Management
===========================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/NSH+Network+Link+Management
In the past, if the network was not connected when NuttX started, two problems
could arise:
1. It could take a very long time for the NSH prompt to appear because of the
sequential initialization (for example, when the network cable is not
connected).
2. After NuttX came up, installing the network cable would not enable the
network; the only way to recover networking was to connect the cable and
reset the board.
Network link management capability has now been added to NSH to address these
problems.
Configuration Options
=====================
A simple feature can be enabled to move network initialization to a separate
thread so that it is no longer performed sequentially. With this feature, the
network bringup occurs asynchronously, and the NSH prompt appears immediately
(although the network may not be available until some time later). That feature
is enabled with the following setting and is the first prerequisite for the full
NSH link management feature:
- ``CONFIG_NSH_NETINIT_THREAD``. Refer to the help text in the Kconfig file for
this option (``apps/nshlib/Kconfig``). Additional information about this
setting is included there.
The logic that implements NSH network management is provided in
``apps/nshlib/nsh_netinit.c``. The behavior of that logic depends on multiple
configuration settings. First, there are some additional prerequisites that
must be satisfied:
- ``CONFIG_NETDEV_PHY_IOCTL``
Enable PHY IOCTL commands in the Ethernet device driver. Special IOCTL
commands must be provided by the Ethernet driver to support certain PHY
operations needed for link management. These operations are not complex and
are implemented for Atmel SAM4/4, SAMA5 families, and for the STMicro STM32.
See ``nuttx/arch/arm/src/sam34/sam_emac.c``,
``nuttx/arch/arm/src/sam34/sam_emaca.c``, ``sam_emacb.c``, and ``sam_gmac.c``,
and ``nuttx/arch/arm/src/stm32/stm32_eth.c``.
- ``CONFIG_ARCH_PHY_INTERRUPT``
This is not a user-selectable option. Rather, it is set when selecting a board
that supports PHY interrupts. In most architectures, the PHY interrupt is not
directly associated with the Ethernet driver. Instead, the PHY interrupt is
provided through some board-specific GPIO, and the board-specific logic must
provide support for that GPIO interrupt. Specifically, the board logic must:
1. Provide the function ``arch_phy_irq()`` as described and prototyped in
``nuttx/include/nuttx/arch.h``.
2. Select ``CONFIG_ARCH_PHY_INTERRUPT`` in the board configuration file to
advertise that ``arch_phy_irq()`` is supported.
Examples can be found at:
- ``nuttx/boards/arm/sama5/sama5d3x-ek/src/sam_ethernet.c``
- ``nuttx/boards/arm/sama5/sama5d3-xplained/src/sam_ethernet.c``
- ``nuttx/boards/arm/sama5/sama5d4-ek/src/sam_ethernet.c``
- Other requirements: UDP support must be enabled (``CONFIG_NET_UDP``), and
signals must not be disabled (``CONFIG_DISABLE_SIGNALS``).
With all these prerequisites in place, NSH network management can be enabled on
the NSH network initialization thread by selecting these additional options:
- ``CONFIG_NSH_NETINIT_MONITOR``
By default, the network initialization thread brings up the network (or
fails while trying) then exits, freeing all resources it used. If this option
is selected, however, the network initialization thread will persist
indefinitely to monitor the network status. Should the network go down (for
example, if the cable is removed), the thread will monitor the link status
and attempt to bring the network back up. In this scenario, the resources
required for network initialization are never released.
If the network monitor is selected, additional options control its behavior:
- ``CONFIG_NSH_NETINIT_SIGNO``
The network monitor logic receives signals when there is a change in link
status. This setting can be used to customize the signal number to avoid
conflicts.
- ``CONFIG_NSH_NETINIT_RETRYMSEC``
When the network is down, the initialization thread will periodically attempt
to bring the network back up. Because this can be time-consuming, the retry
operation is performed only at the interval specified by this value, in
milliseconds.
- ``CONFIG_NSH_NETINIT_THREAD_STACKSIZE``
The stack size for the network initialization thread.
- ``CONFIG_NSH_NETINIT_THREAD_PRIORITY``
The network initialization thread priority.
Overview of the Operation
=========================
Below is a summary of how the NSH management thread operates:
1. During initialization, the thread opens a UDP socket for IOCTL operations
and connects a signal handler.
2. It enters a loop. At the beginning of each loop iteration, the thread
uses an IOCTL command to register (or re-register) with the Ethernet device
to receive a signal whenever the PHY reports a link up or link down
interrupt. Re-registration is necessary because the notification disarms
after each PHY interrupt.
3. The thread reads the link status from both the PHY and the Ethernet device.
If they disagree, the network monitor uses an IOCTL command to bring the
Ethernet driver up or down to match the current state of the network. If the
network is lost, the monitor brings the Ethernet driver down; if the network
is regained, the monitor brings the Ethernet driver back up and re-establishes
the connection.
4. If the PHY and the Ethernet driver agree on the link state, no action is
performed.
5. At the end of the loop, the network monitor waits for a PHY interrupt or a
timeout. When either occurs, control returns to the top of the loop, and the
process repeats.
6. If a PHY interrupt happens, a signal is delivered to the task and handled by
the network monitors signal handler, which posts a semaphore to immediately
re-awaken the network monitor from its wait.

View file

@ -0,0 +1,434 @@
=================================
ELF Programs With Symbol Tables
=================================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629543
Updating a Release System with ELF Programs With Symbol Tables
================================================================
You can easily extend the firmware in your released, embedded system using
ELF programs provided via a file system. For example, an SD card or, perhaps,
downloaded into on-board SPI FLASH.
In order to support such post-release updates, your released firmware must
support execution of ELF programs loaded into RAM and symbol tables also
provided via the file system (see `apps/examples/elf`).
The files shown in this Wiki page can be downloaded
`here <https://cwiki.apache.org/confluence/download/attachments/139629402/elfprog-wsymtab.tar.gz?version=1&modificationDate=1576735523000&api=v2>`_
Creating a Symbol Table
=======================
There are several ways to create an application symbol table. Only two are
compatible with the example provided here:
1. **Board-specific Bring-up Logic**
Build a symbol table into the base firmware and add it to your
board-specific bring-up logic. This technique is typically used in kernel
mode with ``CONFIG_USER_INITPATH=y``.
In this setup, the system does not initialize using a standard C call like
``nsh_main()``. Instead, it starts with an ``init`` ELF program, similar to
how Linux initializes. The configuration option
``CONFIG_EXECFUNCS_SYMTAB_ARRAY`` initializes the system with a minimal set
of symbols required by the ``init`` program. Once initialized, the ``init``
program would typically call ``boardctl()`` to put the final symbol table in
place.
To enable this method, you must:
- Set ``CONFIG_EXECFUNCS_HAVE_SYMTAB=y`` in your configuration.
- Provide a symbol table with the global name ``CONFIG_EXECFUNCS_SYMTAB_ARRAY`` with the variable name ``CONFIG_EXECFUNCS_NSYMBOLS_VAR`` that holds the number of symbol entries. The default symbol table name is ``g_symtab``.
In this example, let's illustrate this using an STM32F4-Discovery
configuration. We will assume that you have modified the
``boards/arm/stm32/stm32fdiscovery/src/stm32_bringup.c`` file, adding the
following:
.. code-block:: c
#include <stdio.h>
#include <nuttx/binfmt/symtab.h>
const struct symtab_s g_symtab[] = {
{"printf", (FAR void *)printf}
};
int g_nsymbols = 1;
This is a simple symbol table containing only the symbol string "printf,"
whose value is the address of the function ``printf()``.
There is, of course, a lot more that could be said about generating symbol
tables. NuttX provides specialized tools in the ``tools/`` directory and
instructions elsewhere for generating more extensive symbol tables. However,
this example keeps things simple to focus on the core functionality.
2. **Application Logic**
Alternatively, the symbol table can be provided dynamically by the
application itself, using the ``boardctl()`` system interface. The specific
``boardctl()`` command to use is ``BOARDIOC_APP_SYMTAB``. This command
provides the symbol table in the same way as the board-specific logic but
allows for application-level control.
To use this approach, you need to:
- Enable the configurations ``CONFIG_LIB_BOARDCTL=y`` and ``CONFIG_BOARDCTL_APP_SYMTAB=y``.
- Include application logic to provide the symbol table. If ``CONFIG_EXAMPLES_NSH_SYMTAB=y`` is set, NSH can handle this automatically.
Export Package
==============
At the time of firmware release, you should create and save an export package.
This export package contains all the necessary files required to create
post-release add-on modules for your embedded system.
For demonstration purposes, we use the STM32F4-Discovery with the network NSH
configuration. This setup assumes that you have the STM32F4DIS-BB baseboard.
The demonstration also requires support for externally modifiable media, such
as:
- Removable media, like an SD card or USB flash drive.
- An internal file system remotely accessible via USB MSC, FTP, or other
protocols.
- A remote file system, such as NFS.
In this demonstration, the networking NSH configuration uses the SD card on
the STM32 baseboard. Other NSH configurations can also be used, provided they
supply the necessary file system support.
(No baseboard? You can add file system support to the basic ``STM32F4-Discovery``
board by following these instructions:
`USB FLASH drive <https://www.youtube.com/watch?v=5hB5ZXpRoS4>`_
or `SD card <https://www.youtube.com/watch?v=H28t4RbOXqI>`_.)
Example for STM32F4-Discovery:
.. code-block:: shell
$ make distclean
$ tools/configure.sh -c stm32f4discovery:netnsh
$ make menuconfig
Required configurations:
- Disable networking: ``# CONFIG_NET is not set``
- Enable ELF binary support: ``CONFIG_ELF=y``, ``CONFIG_LIBC_EXECFUNCS=y``,
``CONFIG_EXECFUNCS_HAVE_SYMTAB=y``, ``CONFIG_EXECFUNCS_SYMTAB_ARRAY="g_symtab"`` and
``CONFIG_EXECFUNCS_NSYMBOLS_VAR="g_nsymbols"``
- Enable PATH variable support: ``CONFIG_BINFMT_EXEPATH=y``,
``CONFIG_PATH_INITIAL="/bin"``
- Enable execution from NSH: ``CONFIG_NSH_FILE_APPS=y``
Then, build the NuttX firmware image and the export package:
.. code-block:: shell
$ make
$ make export
When ``make export`` completes, you will find a ZIP package in the top-level
NuttX directory called ``nuttx-export-x.y.zip`` (where x.y corresponds to the
version, determined by the .version file in the same directory). The contents
of this ZIP file are organized as follows:
.. code-block:: text
nuttx-export-x.x
|- arch/
|- build/
|- include/
|- libs/
|- startup/
|- System.map
`- .config
Add-On Build Directory
======================
In order to create the add-on ELF program, you will need:
1. The export package.
2. A program build Makefile.
3. A linker script used by the Makefile.
The example Makefile discussed below assumes the use of a GNU toolchain. Note
that non-GNU toolchains would likely require a significantly different
Makefile and linker script.
Hello Example
=============
To keep things manageable, let's use a concrete example. Suppose the ELF
program that we wish to add to the release code is the simple
source file ``hello.c``:
.. code-block:: c
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello from Add-On Program!\n");
return 0;
}
Let's say that we have a directory called ``addon`` that contains the following:
1. The ``hello.c`` source file.
2. A Makefile to build the ELF program.
3. A linker script called ``gnu-elf.ld`` needed by the Makefile.
4. The export package ``nuttx-export-7.25.zip``.
Building the ELF Program
========================
The first step in creating the ELF program is to unzip the export
package. Starting in the ``addon`` directory:
.. code-block:: shell
$ cd addon
$ ls
gnu-elf.ld hello.c Makefile nuttx-export-7.25.zip
Where:
- ``gnu-elf.ld`` is the linker script.
- ``hello.c`` is the example source file.
- ``Makefile`` builds the ELF program.
- ``nuttx-export-7.25.zip`` is the export package from NuttX 7.25.
Unzip the export package as follows:
.. code-block:: shell
$ unzip nuttx-export-7.25.zip
This creates a new directory called ``nuttx-export-7.25``, containing
all the content from the released NuttX code required to build
the ELF program.
The Makefile
============
To build the ELF program, simply run:
.. code-block:: shell
$ make
This uses the following Makefile to generate several files:
- ``hello.o``: The compiled object file for ``hello.c``.
- ``hello``: The linked ELF program.
Only the resulting ``hello`` file is needed.
The Makefile used to create the ELF program is as follows:
.. code-block:: shell
include nuttx-export-7.25/build/Make.defs
# Long calls are need to call from RAM into FLASH
ARCHCFLAGS += -mlong-calls
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
ARCHINCLUDES = -I. -isystem nuttx-export-7.25/include
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHINCLUDES) -pipe
CROSSDEV = arm-none-eabi-
CC = $(CROSSDEV)gcc
LD = $(CROSSDEV)ld
STRIP = $(CROSSDEV)strip --strip-unneeded
# Setup up linker command line options
LDELFFLAGS = -r -e main
LDELFFLAGS += -T gnu-elf.ld
# This might change in a different environment
OBJEXT ?= .o
# This is the generated ELF program
BIN = hello
# These are the sources files that we use
SRCS = hello.c
OBJS = $(SRCS:.c=$(OBJEXT))
# Build targets
all: $(BIN)
.PHONY: clean
$(OBJS): %$(OBJEXT): %.c
$(CC) -c $(CFLAGS) $< -o $@
$(BIN): $(OBJS)
$(LD) $(LDELFFLAGS) -o $@ $^
$(STRIP) $(BIN)
clean:
rm -f $(BIN)
rm -f *.o
The Linker Script
=================
The linker script that I am using in this example, gnu-elf.ld,
contains the following:
.. code-block:: shell
SECTIONS
{
.text 0x00000000 :
{
_stext = . ;
*(.text)
*(.text.*)
*(.gnu.warning)
*(.stub)
*(.glue_7)
*(.glue_7t)
*(.jcr)
_etext = . ;
}
.rodata :
{
_srodata = . ;
*(.rodata)
*(.rodata1)
*(.rodata.*)
*(.gnu.linkonce.r*)
_erodata = . ;
}
.data :
{
_sdata = . ;
*(.data)
*(.data1)
*(.data.*)
*(.gnu.linkonce.d*)
_edata = . ;
}
.bss :
{
_sbss = . ;
*(.bss)
*(.bss.*)
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.b*)
*(COMMON)
_ebss = . ;
}
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}
Replacing NSH Built-In Functions
================================
Files can be executed by NSH from the command line by simply typing the name
of the ELF program. This requires (1) that the feature be enabled with
``CONFIG_NSH_FILE_APP=y`` and (2) that support for the PATH variable is
enabled with ``CONFIG_BINFMT_EXEPATH=y`` and ``CONFIG_PATH_INITIAL`` set to
the mount point of the file system that may contain ELF programs.
In this example, there is no application in the base firmware called
``hello``. So attempts to run ``hello`` will fail:
.. code-block:: shell
nsh> hello
nsh: hello: command not found
nsh>
But if we mount the SD card containing the ``hello`` image that we created
above, then we can successfully execute the ``hello`` command:
.. code-block:: shell
nsh> mount -t vfat /dev/mmcsd0 /bin
nsh> ls /bin
/bin:
System Volume Information/
hello
nsh> hello
Hello from Add-On Program!
nsh>
Here we showed how you can add a new command to NSH to a product without
modifying the base firmware. We can also replace or update an existing
built-in application in this way:
In the above configuration, NSH will first attempt to run the program called
``hello`` from the file system. This will fail because we have not yet put
our custom ``hello`` ELF program in the file system. So instead, NSH will
fallback and execute the built-in application called ``hello``. In this way,
any command known to NSH can be replaced from an ELF program installed in a
mounted file system directory that can be found via the PATH variable.
After we do add our custom ``hello`` to the file system, when NSH attempts to
run the program called ``hello`` from the file system it will run
successfully. The built-in version will be ignored. It has been replaced with
the version in the file system.
Tightly Coupled Memories
========================
Most MCUs based on ARMv7-M family processors support some kind of Tightly
Coupled Memory (TCM). These TCMs have somewhat different properties for
specialized operations. Depending on the bus matrix of the processor, you
may not be able to execute programs from the TCM. For instance, the STM32 F4
supports Core Coupled Memory (CCM), but since it is tied directly to the
D-bus, it cannot be used to execute programs! On the other hand, the STM32F3
has a CCM that is accessible to both the D-Bus and the I-Bus, in which case
it should be possible to execute programs from this TCM.
.. image:: ./image/system_arch_stm32f42xx_and_f43xx.png
.. image:: ./image/system_arch_stm32f303xBC_and_f358xC.png
When ELF programs are loaded into memory, the memory is allocated from the
heap via a standard memory allocator. By default with the STM32 F4, the CCM
is included in the heap and will typically be allocated first. If CCM memory
is allocated to hold the ELF program in memory, then a hard-fault will occur
immediately when you try to execute the ELF program in memory.
Therefore, it is necessary on STM32 F4 platforms to include the following
configuration setting:
.. code-block:: shell
CONFIG_STM32_CCMEXCLUDE=y
With that setting, the CCM memory will be excluded from the heap and so will
never be allocated for ELF program memory.

View file

@ -66,10 +66,14 @@ After that, try follwoing procedure.
| | | count the time accurately or not. |
+------+---------------+--------------------------------------------------------------------+
The result of porting procedure
Porting Case Studies
===============================
Although these depend on specific kernel version.
These porting guides depend on specific kernel versions, as some code structures have changed over time. They will still
provide a general idea on how to port.
.. toctree::
port_arm_cm4.rst
:glob:
:maxdepth: 1
porting-case-studies/*

View file

@ -0,0 +1,382 @@
Porting to the BCM2711 (Raspberry Pi 4B)
========================================
This port was completed for the 12.7.0 version of the NuttX kernel, and was contributed by Matteo Golin.
The pull request with this initial support can be found at `apache/nuttx/pull/15188
<https://github.com/apache/nuttx/pull/15188>`_.
The port required support to be written for a new chip (the BCM2711) and a new board. Matteo created journal entries
while working on the initial port, which can be found `on his blog
<https://linguini1.github.io/blog/2024/12/25/nuttx-bcm2711.html>`_. The details below are a more concise summary of the
porting process.
Researching
-----------
The first step to porting a board to NuttX was researching the board and how NuttX works.
The BCM2711 is a quad-core ARM Cortex A72 based SoC, and it supports both aarch64 and 32 bit ARM architectures. I
focused on the aarch64 implementation only in this port. My first step was determining other boards already in the NuttX
kernel that used the aarch64 architecture, because that gives me a starting point to porting this new chip and board.
I primarily used the blog posts written by Lup Yuen Lee about porting NuttX to the PinePhone, another ARM Cortex-A based
device. The articles are listed `here <https://github.com/lupyuen/pinephone-nuttx>`_. Lup's articles provided me with an
understanding of the NuttX boot process, as well as which files from the aarch64 support on NuttX were pulled into the
build process for booting. He also showed how he created an initial UART driver using the NuttX structure for UART
drivers, which allowed him to get NSH appearing in the console.
Finally, I also of course needed the BCM2711 datasheet in order to figure out which registers were available to me for
creating peripheral drivers. The BCM2711 datasheet isn't exceptionally detailed on many of the features on the SoC, but
it did provide enough detail to set up interrupts and get UART working.
Adding to the source tree
-------------------------
In order to build my code with the NuttX build system, I would have to add the board and the BCM2711 chip to the source
tree for NuttX. This way, it would appear as an available configuration via the ``tools/configure.sh`` script and I
could select options for it with ``make menuconfig``.
The first thing to do was to add the chip, which goes under the ``arch/arm64`` directory because it is an ARM 64 bit
SoC. The chip directory must be added in two places: ``arch/arm64/include/bcm2711`` and ``arch/arm64/src/bcm2711``. C
files go in the ``src`` directory with some header files, and some specific header files go in the ``include``
directory.
In addition, in order to make the BCM2711 visible as a supported chip, I had to add it as an option in
``arch/arm64/Kconfig``. In order to do this, I just copy-pasted the entry for the Allwinner A64, since the two chips
were very similar. I had to change a few fields (for instance, selecting ``ARCH_CORTEX_A72`` instead of
``ARCH_CORTEX_A53``), but this was relatively simple to complete with the information about the SoC. I also needed to
specify ``ARMV8A_HAVE_GICv2``, since that is the interrupt controller used by the BCM2711. ``ARCH_HAVE_MULTICPU``
because it is a quad-core, and ``ARCH_USE_MMU`` because it has a memory management unit.
I also needed to now add the Raspberry Pi 4B board to the source tree. To do this, I copied the board folder for the
PinePhone (``boards/arm64/a64/pinephone``) and renamed it ``raspberrypi-4b``. I also deleted many of the files in this
folder since they weren't applicable to the Pi 4B, and substituted all mentions of the PinePhone with the Raspberry Pi
4B (in path names and header include guards).
I then added the Pi 4B to the list of supported boards in ``boards/Kconfig``. For this, I just needed to create an entry
with the name ``ARCH_BOARD_RASPBERRYPI_4B`` and write that it depends on the ``ARCH_CHIP_BCM2711``. No additional
options necessary! In two other places in this file I also had to add some directives to make sure the Kconfig for the
board was found properly. These set ``ARCH_BOARD`` to the name of the board directory "raspberrypi-4b" when the Pi 4B was
selected, and ``source``'d the Kconfig under ``boards/arm64/bcm2711/raspberrypi-4b`` when selected.
The default configuration for this board was copied from the PinePhone's NSH configuration, which I modified to use the
correct board name, chip, and hardware specific settings. It was still incomplete because there was no code to actually
boot into NSH, but it was a starting point.
This was basically all I needed for the board to show up as a possible configuration in the source tree!
Mapping out the chip
--------------------
To start writing code for the BCM2711, I needed to map out the chip. This included the register addresses and the memory
mapping, which could all be found in the BCM2711 datasheet. From looking at other implementations, the register
addresses are usually defined as C macros and kept in header files under ``arch/<architecture>/src/<chip>/hardware``.
This is where I put them as well, defining all the register mappings the different groups within individual files (i.e.
``bmc2711_i2c.h``, ``bcm2711_spi.h``, etc.).
Many peripherals had groupings of memory-mapped registers, defined using a base address and then offsets from that
address to access the different fields. For instance, the two mini-SPI peripherals had the same structure, each with 12
registers. The way I commonly saw these macros implemented was something like:
.. code-block:: c
#define BCM_AUX_SPI1_BASEADDR (BCM_AUX_BASEADDR + BCM_AUX_SPI1_OFFSET)
#define BCM_AUX_SPI_CNTL0_REG_OFFSET (0x00) /* SPI control register 0 */
/* ... more register offsets */
/* This allows you to choose which SPI interface base address to get the register for. */
#define BCM_AUX_SPI_CNTL0(base) ((base) + BCM_AUX_SPI_CNTL0_REG_OFFSET)
In addition to the registers themselves, I also included macros to mask certain fields within the registers or set
certain values. This makes the code less error prone later, because any mistakes made while copying the long list of
fields and registers from the datasheet can be changed in one place.
.. code-block:: c
#define BCM_SPI_CNTL0_EN (1 << 11) /* Enable SPI interface */
In addition to the registers, I also had to map the interrupts. This was done in ``include/bcm2711/irq.h``. I copied the
IRQ numbers from the datasheet and listed them all as macros with names. I also had to define the number of IRQS, which
was 216 in this case. The ``MPID_TO_CORE(mpid)`` macro was copied from another arm64 implementation.
.. code-block:: c
#define NR_IRQS 216
#define MPID_TO_CORE(mpid) (((mpid) >> MPIDR_AFF0_SHIFT) & MPIDR_AFFLVL_MASK)
/* VideoCore interrupts */
#define BCM_IRQ_VC_BASE 96
#define BCM_IRQ_VC(n) (BCM_IRQ_VC_BASE + n)
#define BCM_IRQ_VC_TIMER0 BCM_IRQ_VC(0)
#define BCM_IRQ_VC_TIMER1 BCM_IRQ_VC(1)
/* More interrupts ... */
Finally was to define the memory mapping within the ``include/bcm2711/chip.h`` file. I did so simply since I was only
testing on the 4GB version of the BCM2711. The RAM starts at address 0, and is roughly 4GB in size. 64 MB of that is
reserved for the memory-mapped I/O, so I had to be sure to remove that. I also defined the load address of the kernel in
memory for the chip.
.. code-block:: c
#define CONFIG_RAMBANK1_ADDR (0x000000000)
/* Both the 4GB and 8GB ram variants use all the size in RAMBANK1 */
#if defined(CONFIG_RPI4B_RAM_4GB) || defined(CONFIG_RPI4B_RAM_8GB)
#define CONFIG_RAMBANK1_SIZE GB(4) - MB(64)
#endif /* defined(CONFIG_RPI4B_RAM_4GB) || defined(CONFIG_RPI4B_RAM_8GB) */
/* Raspberry Pi 4B loads NuttX at this address */
#define CONFIG_LOAD_BASE 0x480000
The same load address had to be specified in the linker script for the Raspberry Pi 4B kernel. This scripts tells the
compiler how to lay out the kernel code in memory and what addresses to use. I was able to copy it from the PinePhone
and just change the load address to ``0x480000``.
Figuring out the boot
---------------------
The first thing I wanted to do was determine how much work had already been done for aarch64 that would allow me to more
easily complete the port. In Lup's blogs, he tested out support for his core type (ARM Cortex-A53 on the PinePhone) by
booting the aarch64 instance of QEMU with NuttX using that core. I decided to take the same approach, and was able to
successfully boot on ARM Cortex-A72 using QEMU following his blog. This was a nice confirmation that the hardware I was
using was already supported in NuttX for booting the OS and getting NSH working with a PL011 UART interface.
I cannot stress enough that the reason porting to this chip was made so much easier was because I am standing on the
shoulders of giants. NuttX contributors had already set up the boot scripts written in assembly, timer configuration,
interrupt handling and drivers for a lot of the standard features in aarch64 architectures. I did not have to deal with
any of this because of them, and it really cut down on the amount of assembly I had to read and understand. I also
barely had to write any assembly outside of debugging the boot process a little (we'll get to that later). Not to
mention I had Lup's well-written articles to guide me.
In order to compile and boot the board, I had to add a definition for ``g_mmu_config``, which I was confused about and
left empty initially just to get past the compilation stage. I also defined the ``GICR_OFFSET`` and ``GICR_BASE`` macros
for the GICv2 interrupt controller by copying them from the Allwinner chip, which used the same controller. After
reading further in Lup's blog, I learned that the boot script has a ``PRINT`` macro which is called early in the boot
process, and requires an implementation of ``up_lowputc`` to print to the console. This would be the first thing I need
to implement. This compiled, but when I booted the Pi, nothing happened.
After quite a while of trying different things and looking at other implementations, I noticed that many people were
using register manipulation directly in the early print functions. I decided I would do the same, but instead of
printing (a more complex operation), I would turn one of the GPIO pins high. I was able to measure this with my
multimeter and confirm that the GPIO did get set, so I knew that the ``arm64_earlyprint_init`` function was getting
called. Something was wrong with my UART configuration.
I then tried directly manipulating registers to put the text "hi" in the UART FIFO. When I booted again, this printed,
but then was followed by some garbled output. It appeared that the the ``char *`` pointer passed to the print function
was getting garbled. After troubleshooting by printing characters directly by calling my ``arm64_lowputc`` in the
assembly boot script, I discovered that I could print a string from the C definition if I declared the string as static.
I also investigated the elf generated by building and confirmed the string was located in ``.rodata``. I was suspicious
that I was loading the kernel incorrectly into memory and some addresses were getting mixed up. Sure enough, I had
defined the load address in the linker script as ``0x80000`` instead of ``0x480000``. Fixing this allowed me to see the
boot messages properly!
I received this message in the console:
.. code-block:: console
----gic_validate_dist_version: No GIC version detect
arm64_gic_initialize: no distributor detected, giving up ret=-19
_assert: Current Version: NuttX 12.6.0-RC0 6791d4a1c4-dirty Aug 4 2024 00:38:21 arm64
_assert: Assertion failed panic: at file: common/arm64_fatal.c:375 task: Idle_Task process: Kernel 0x481418
I had accidentally kept the GICv3 in my config files when copying things from other boards, and changed it to GICv2.
That resolved the issue and presented me with a new one:
.. code-block:: console
MESS:00:00:06.144520:0:----_assert: Current Version: NuttX 12.6.0-RC0 f81fb7a076-dirty Aug 4 2024 16:16:30 arm64
_assert: Assertion failed panic: at file: common/arm64_fatal.c:375 task: Idle_Task process: Kernel 0x4811e4
After enabling all of the debug output in the build options, this became:
.. code-block:: console
arm64_oneshot_initialize: cycle_per_tick 54000
arm64_fatal_error: reason = 0
arm64_fatal_error: CurrentEL: MODE_EL1
arm64_fatal_error: ESR_ELn: 0xbf000002
arm64_fatal_error: FAR_ELn: 0x0
arm64_fatal_error: ELR_ELn: 0x48a458
print_ec_cause: SError interrupt
This looked like an unhandled interrupt, and after narrowing down which line was failing by adding log statements to the
kernel code, I discovered it was due to the spinlock code. An exception was being caused by the ``ldaxr`` instruction,
which the ARM documentation said could only be used once the MMU was enabled. I then enabled the MMU as well as its
debug information and was greeted with the lovely error:
.. code-block:: console
MESS:00:00:06.174977:0:----arm64_mmu_init: xlat tables:
arm64_mmu_init: base table(L1): 0x4cb000, 64 entries
arm64_mmu_init: 0: 0x4c4000
arm64_mmu_init: 1: 0x4c5000
arm64_mmu_init: 2: 0x4c6000
arm64_mmu_init: 3: 0x4c7000
arm64_mmu_init: 4: 0x4c8000
arm64_mmu_init: 5: 0x4c9000
arm64_mmu_init: 6: 0x4ca000
init_xlat_tables: mmap: virt 4227858432x phys 4227858432x size 67108864x
set_pte_table_desc:
set_pte_table_desc: 0x4cb018: [Table] 0x4c4000
init_xlat_tables: mmap: virt 0x phys 0x size 1006632960x
set_pte_table_desc:
set_pte_table_desc: 0x4cb000: [Table] 0x4c5000
init_xlat_tables: mmap: virt 4718592x phys 4718592x size 192512x
split_pte_block_desc: Splitting existing PTE 0x4c5010(L2)
set_pte_table_desc:
set_pte_table_desc: 0x4c5010: [Table] 0x4c6000
init_xlat_tables: mmap: virt 4911104x phys 4911104x size 81920x
init_xlat_tables: mmap: virt 4993024x phys 4993024x size 65536x
enable_mmu_el1: MMU enabled with dcache
nx_start: Entry
up_allocate_heap: heap_start=0x0x4d3000, heap_size=0x47b2d000
mm_initialize: Heap: name=Umem, start=0x4d3000 size=1202900992
mm_addregion: [Umem] Region 1: base=0x4d32a8 size=1202900304
arm64_fatal_error: reason = 0
arm64_fatal_error: CurrentEL: MODE_EL1
arm64_fatal_error: ESR_ELn: 0x96000045
arm64_fatal_error: FAR_ELn: 0x47fffff8
arm64_fatal_error: ELR_ELn: 0x489d28
print_ec_cause: Data Abort taken without a change in Exception level
_assert: Current Version: NuttX 12.6.0-RC0 96be557b64-dirty Aug 5 2024 14:56:42 arm64
_assert: Assertion failed panic: at file: common/arm64_fatal.c:375 task: Idle_Task process: Kernel 0x481a34
up_dump_register: stack = 0x4d2e10
up_dump_register: x0: 0x13 x1: 0x4d32c0
up_dump_register: x2: 0xfe215040 x3: 0xfe215040
up_dump_register: x4: 0x0 x5: 0x0
up_dump_register: x6: 0x1 x7: 0xdba53f65cc808a8
up_dump_register: x8: 0xc4276feb17c016ba x9: 0xecbcfeb328124450
up_dump_register: x10: 0xb7989dd7d34a1280 x11: 0x5ebf5f572386fdee
up_dump_register: x12: 0x6f7c07d067f6e38 x13: 0x3f7b5adaf798b4d5
up_dump_register: x14: 0xf3dffbe2e4cff736 x15: 0xd76b1c050c964ea0
up_dump_register: x16: 0x6d6fa9cfeeb0eff8 x17: 0x1a051d808a830286
up_dump_register: x18: 0x3f7b5adaf798b4bf x19: 0x4d3000
up_dump_register: x20: 0x47fffff0 x21: 0x4d32d0
up_dump_register: x22: 0x47b2cd30 x23: 0x4d32a8
up_dump_register: x24: 0x4d32b0 x25: 0x4806f4
up_dump_register: x26: 0x2f56f66b2df71556 x27: 0x74ee6bbfb5d438f4
up_dump_register: x28: 0x7ef57ab47b85f74f x29: 0x9a7fa1cb06923003
up_dump_register: x30: 0x489cf8
up_dump_register:
up_dump_register: STATUS Registers:
up_dump_register: SPSR: 0x600002c5
up_dump_register: ELR: 0x489d28
up_dump_register: SP_EL0: 0x4d3000
up_dump_register: SP_ELX: 0x4d2f40
up_dump_register: TPIDR_EL0: 0x0
up_dump_register: TPIDR_EL1: 0x0
up_dump_register: EXE_DEPTH: 0x1
Some more debugging allowed me to determine that the ``CONFIG_RAM_START`` and ``CONFIG_RAM_SIZE`` macros in the
defconfig for my nsh configuration were still set to the values from the PinePhone that I copied from. I set these to
the correct values for the Raspberry Pi 4B and got much further!
.. code-block:: console
MESS:00:00:06.211786:0:----irq_attach: In irq_attach
irq_attach: before spin_lock_irqsave
spin_lock_irqsave: me: 0
spin_lock_irqsave: before spin_lock
spin_lock: about to enter loop
spin_lock: loop over
spin_lock_irqsave: after spin_lock
irq_attach: after spin_lock_irqsave
irq_attach: before spin_unlock_irqrestore
irq_attach: after spin_unlock_irqrestore
arm64_serialinit: arm64_serialinit not implemented
group_setupidlefiles: ERROR: Failed to open stdin: -38
_assert: Current Version: NuttX 12.6.0-RC0 be262c7ad3-dirty Aug 5 2024 17:16:27 arm64
_assert: Assertion failed : at file: init/nx_start.c:728 task: Idle_Task process: Kernel 0x48162c
up_dump_register: stack = 0x4c0170
up_dump_register: x0: 0x4c0170 x1: 0x0
up_dump_register: x2: 0x0 x3: 0x0
up_dump_register: x4: 0x0 x5: 0x0
up_dump_register: x6: 0x3 x7: 0x0
up_dump_register: x8: 0x4c7468 x9: 0x0
up_dump_register: x10: 0x4c7000 x11: 0x4
up_dump_register: x12: 0x4b8000 x13: 0x4b7000
up_dump_register: x14: 0x1 x15: 0xfffffff7
up_dump_register: x16: 0x48a654 x17: 0x0
up_dump_register: x18: 0x1 x19: 0x0
up_dump_register: x20: 0x4ac181 x21: 0x4bf430
up_dump_register: x22: 0x0 x23: 0x4c0170
up_dump_register: x24: 0x4c0170 x25: 0x2d8
up_dump_register: x26: 0x240 x27: 0x4b7000
up_dump_register: x28: 0xfdc3ed41d6862df6 x29: 0xbf8e8f7280a0100
up_dump_register: x30: 0x481bf8
up_dump_register:
up_dump_register: STATUS Registers:
up_dump_register: SPSR: 0x20000245
up_dump_register: ELR: 0x480230
up_dump_register: SP_EL0: 0x4c7000
up_dump_register: SP_ELX: 0x4c6e90
up_dump_register: TPIDR_EL0: 0x4bf430
up_dump_register: TPIDR_EL1: 0x4bf430
up_dump_register: EXE_DEPTH: 0x0
dump_tasks: PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACKBASE STACKSIZE USED FILLED COMMAND
dump_tasks: ---- --- --- -------- ------- --- ------- ---------- ---------------- 0x4c4000 4096 144 3.5% irq
dump_task: 0 0 0 FIFO Kthread - Running 0000000000000000 0x4c5010 8176 1200 14.6% Idle_Task
CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.9 | VT102 | Offline | ttyUSB0
We actually got into tasks now! It appears stdin failed to open because in my Mini-UART driver implementation I had the
``attach`` and ``ioctl`` functions return ``-ENOSYS``. Just changing this to 0 for success in the interim allowed us to
get even further, and I could see the beginnings of NSH spawning.
.. code-block:: console
mm_initialize: Heap: name=Umem, start=0x4cc000 size=4222828544
mm_addregion: [Umem] Region 1: base=0x4cc2a8 size=4222827856
mm_malloc: Allocated 0x4cc2d0, size 144
mm_malloc: Allocated 0x4cc360, size 80
gic_validate_dist_version: GICv2 detected
up_timer_initialize: up_timer_initialize: cp15 timer(s) running at 54.0MHz
arm64_oneshot_initialize: oneshot_initialize
mm_malloc: Allocated 0x4cc3b0, size 48
arm64_oneshot_initialize: cycle_per_tick 54000
uart_register: Registering /dev/console
mm_malloc: Allocated 0x4cc3e0, size 80
mm_malloc: Allocated 0x4cc430, size 80
uart_register: Registering /dev/ttys0
mm_malloc: Allocated 0x4cc480, size 80
mm_malloc: Allocated 0x4cc4d0, size 80
mm_malloc: Allocated 0x4cc520, size 80
mm_malloc: Allocated 0x4cc570, size 32
mm_malloc: Allocated 0x4cc590, size 64
work_start_highpri: Starting high-priority kernel worker thread(s)
mm_malloc: Allocated 0x4cc5d0, size 336
mm_malloc: Allocated 0x4cc720, size 8208
nxtask_activate: hpwork pid=1,TCB=0x4cc5d0
nx_start_application: Starting init thread
task_spawn: name=nsh_main entry=0x48b24c file_actions=0 attr=0x4cbfa0 argv=0x4cbf98
mm_malloc: Allocated 0x4ce730, size 1536
mm_malloc: Allocated 0x4ced30, size 64
mm_malloc: Allocated 0x4ced70, size 32
mm_malloc: Allocated 0x4ced90, size 8208
nxtask_activate: nsh_main pid=2,TCB=0x4ce730
lib_cxx_initialize: _sinit: 0x4ad000 _einit: 0x4ad000
mm_malloc: Allocated 0x4d0da0, size 848
mm_free: Freeing 0x4d0da0
mm_free: Freeing 0x4ced70
mm_free: Freeing 0x4ced30
nxtask_exit: nsh_main pid=2,TCB=0x4ce730
mm_free: Freeing 0x4ced90
mm_free: Freeing 0x4ce730
nx_start: CPU0: Beginning Idle Loop
It seemed like we were waiting on an interrupt which never occurred. This was weird, because my Mini-UART driver had an
interrupt implementation and appeared to be written just fine. This took hours of debugging, logging from interrupt
handlers and dumping register values, but eventually I determined that the BCM2711 datasheet actually had an error where
the TX and RX interrupt fields were swapped in the datasheet. A blog post online had mentioned this for the BCM2835, but
it appeared to be an issue on this chip as well. Now we were booting into NSH!
It was at this point that the port is considered a success, since I was able to boot into NSH and successfully run the
``ostest`` benchmark. I went on to write the start of a few more drivers, like the GPIO driver, but this completed the
requirements for an initial port and is most of what ended up being submitted in the initial pull request.

View file

@ -0,0 +1,119 @@
=======================
RAM Disks and ROM Disks
=======================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/RAM+Disks+and+ROM+Disks
NSH mkrd Command
================
The typical way to create a RAM disk is by using the NuttShell (NSH) ``mkrd``
command. The syntax is:
.. code-block:: shell
mkrd [-m <minor>] [-s <sector-size>] <nsectors>
This command creates a RAM disk consisting of ``<nsectors>`` sectors, each of
size ``<sector-size>`` (or 512 bytes if ``<sector-size>`` is not specified). The
RAM disk is then registered as ``/dev/ram<minor>``. If ``<minor>`` is not
specified, ``mkrd`` attempts to register the RAM disk as ``/dev/ram0``.
Internally, the NSH ``mkrd`` command is a simple wrapper around the OS
``boardctl()`` interface, using the ``BOARDIOC_MKRD`` command. “Under the hood,”
this ``boardctl()`` command performs the following:
1. Allocates kernel-space memory with ``kmm_malloc()`` of size ``<nsectors>``
times ``<sector-size>``
2. Zeros the allocated memory, and
3. Calls the OS-internal function ``ramdisk_register()`` to create the RAM disk.
NSH ROMFS /etc Support
======================
A ROM disk is a block device created from a read-only file system image stored
in FLASH or other ROM. There is no NSH command available to create a ROM disk
at runtime. However, it is possible to enable ROM disk support in NSH using the
``CONFIG_NSH_ROMFSETC`` option, as described in the section on NSH start-up
scripts in the `NSH User Guide <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629410>`_.
Any application is able to create a ROM disk using the ``boardctl()`` interface
with the ``BOARDIOC_ROMDISK`` command.
Creating RAM Disks in Board Bring-Up Logic
==========================================
RAM disks may be created in board-specific initialization logic that runs in
supervisor mode. That logic might look as follows:
.. code-block:: c
int board_ramdisk(int minor, unsigned int sectsize, unsigned int nsectors)
{
size_t allocsize = (size_t)sectsize * (size_t)nsectors;
FAR uint8_t *buffer;
/* Allocate the memory backing up the ramdisk */
buffer = (FAR uint8_t *)kmm_zalloc(allocsize);
if (buffer == NULL)
{
return -ENOMEM;
}
/* Then register the ramdisk */
ret = ramdisk_register(minor, buffer, nsectors, sectsize,
RDFLAG_WRENABLED | RDFLAG_FUNLINK);
if (ret < 0)
{
kmm_free(buffer);
}
return ret;
}
Alternatively, this could be replaced by a call to the OS internal function
``mkrd()``.
Creating ROM Disks in Board Bring-Up Logic
==========================================
.. note::
Currently, the ``romdisk_register()`` function is only available within the
OS. Certain logic in ``apps/`` directly calls ``romdisk_register()``, which
violates the portable POSIX OS interface. The correct approach for an
application is to create a ROM disk via ``boardctl(BOARDIOC_ROMDISK)`` as
described above. Calling ``romdisk_register()`` directly is not only a
violation of the NuttX portable interface, but also is not allowed in
PROTECTED or KERNEL build modes.
ROM disks, i.e., read-only disks in FLASH, can be created by board bring-up
logic in a way similar to RAM disks, with the following caveats:
- The FLASH region is not allocated; the FLASH address, the sector size, and the
number of sectors must already be known.
- The ``romdisk_register()`` function is used instead of ``ramdisk_register()``.
A simple example could look like:
.. code-block:: c
int board_romdisk(int minor, FAR uint8_t *buffer, unsigned int sectsize,
unsigned int nsectors)
{
/* Register the romdisk */
return romdisk_register(minor, buffer, nsectors, sectsize);
}
Calling ``romdisk_register()`` is equivalent to calling ``ramdisk_register()``
with the final parameter ``flags == 0``.
Most ROM disks use the ROMFS file system, although CROMFS is another option.
Creating ROMFS file system images involves several steps. Tools are available
to simplify the process of building ROMFS images, but that topic is outside the
scope of this Wiki page.

View file

@ -0,0 +1,62 @@
====================
Reading CAN Messages
====================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/Reading+CAN+Messages
Twice now, there have been complaints or issues about reading messages from the
CAN driver. The usual concern is that the driver is somehow losing or dropping
CAN messages. In these cases, it is often discovered that the CAN driver is
being used incorrectly and, as is human nature, the driver itself is blamed for
the problem.
When reading from the CAN driver, multiple messages may be returned, depending
on two factors:
1. The size of the returned CAN messages.
2. The size of the buffer provided to receive CAN messages.
It should never be assumed that a single message will be returned; making this
assumption can lead to lost CAN messages under conditions in which the read
buffer can hold more than one small message. The following example shows how to
properly handle the CAN read operation:
.. code-block:: c
#define BUFLEN 128 /* Some arbitrary size for the CAN RX buffer */
FAR struct can_msg_s *msg;
char rxbuffer[BUFLEN];
ssize_t nread;
int nbytes;
int msglen
int i;
/* Read messages into the RX buffer */
nread = read(fd, rxbuffer, BUFLEN);
/* Check for read errors */
...
/* Process each message in the RX buffer */
for (i = 0; i <= nread - CAN_MSGLEN(0); i += msglen)
{
/* Get the next message from the RX buffer */
msg = (FAR struct can_msg_s *)&rxbuffer[i];
nbytes = can_dlc2bytes(msg->cm_hdr.ch_dlc);
msglen = CAN_MSGLEN(nbytes);
DEBUGASSERT(i + msglen < BUFLEN);
/* Process the next CAN message */
...
}
By looping over the read buffer and parsing out each CAN message, it is
possible to avoid losing messages that are stored contiguously in the input
buffer.

View file

@ -0,0 +1,101 @@
================================
Removing Device Drivers with NSH
================================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/Removing+Device+Drivers+with+NSH
NuttX and Unix-like Operating Systems Compared
==============================================
There are many things that are called device drivers. In this context, the
discussion is limited to **character device drivers**. In NuttX, character
device drivers are represented by device driver nodes in the top-level :doc:`pseudo
filesystem </components/filesystem/pseudofs>`.
Standard Unix-like operating systems also support device driver nodes, which
superficially resemble NuttX device driver nodes: Both look like files and
usually reside under the top-level ``/dev`` directory. Both can be accessed
with standard POSIX file system commands such as ``open()``, ``close()``,
``read()``, ``write()``, and so forth. However, the similarity ends there.
The payload of a standard Unix-like operating system device driver node is a
device major and minor number. These major and minor device numbers are used to
look up the actual device driver interface using internal OS logic and data
structures. A NuttX device node, by contrast, directly holds the device driver
interface with no intervening lookup. This design is less flexible, but it is
more efficient and conserves limited resources in an embedded system.
In standard Unix-like operating systems, the device node can simply be deleted
using the shell command ``rm`` or the programmatic interface ``unlink()``. The
node is removed, and nothing special happens to the underlying device driver
(except that it may no longer be accessible).
In NuttX, if the device node were removed in the same way, the entire device
interface would also be removed, effectively breaking the driver. Internally,
NuttX supports a function called ``unregister_driver()`` that can be invoked
to remove a device driver. Therefore, removing the device driver node must
behave as though ``unregister_driver()`` were called.
The unlink() Method
===================
How is this accomplished in NuttX? It is done via a special device driver
method called ``unlink()``.
NuttX device drivers are implemented via a vtable of function pointers. That
vtable defines the interface between the pseudo-file system and the device
driver. This vtable is the structure ``struct file_operations`` defined in
``[nuttx]/include/nuttx/fs/fs.h``. It provides several interfaces that closely
match the standard POSIX interfaces—``open()``, ``close()``, ``read()``,
``write()``, etc.—and also includes a method called ``unlink()``. This
``unlink()`` method is called by the NuttX VFS when a user removes a device
driver node.
.. note::
Removal of device driver nodes is only permitted if
``CONFIG_DISABLE_PSEUDOFS_OPERATIONS`` is **not** defined. All pseudo-file
system operations may be suppressed to reduce the FLASH footprint in systems
with extremely limited resources.
Removing a Device Node from NSH
===============================
Below is a summary of what happens when a device node is deleted using the NSH
``rm`` command:
1. The user enters the ``rm`` command. The NSH parser recognizes the command
and transfers control to the NSH function ``cmd_rm()``.
2. ``cmd_rm()`` verifies the command, then calls the standard POSIX
``unlink()`` interface. The logic in the VFS ``unlink()`` function in
``[nuttx]/fs/vfs/fs_unlink.c`` is then executed.
3. The VFS ``unlink()`` detects that the target to be removed is a device node
in the top-level pseudo-file system. It calls the device driver's
``unlink()`` method. It also removes the device node from the
pseudo-filesystem. However, the underlying resources required to support
the device driver interface may remain until the device driver frees those
resources.
4. When the device driver's ``unlink()`` method is called, it determines if
the device resources can be freed immediately. If so, it frees those
resources. If, for example, there are still open references to the device
driver, it may defer freeing the resources until the last client has closed
the device driver and there are no open references. In such a case, it may
set a flag indicating that the device driver has been unlinked.
5. If freeing of device driver resources has been deferred, that flag will be
examined later. For instance, when the last client of the device driver
closes its reference to the driver, it checks whether the unlink operation
was deferred. If so, it frees any remaining device driver resources at that
time.
.. warning::
Some character device driver instances do not implement the ``unlink()``
method. If problems arise when attempting to remove character drivers as
described in this Wiki page, a missing ``unlink()`` method is the most
likely cause.

View file

@ -0,0 +1,90 @@
===============
Rust in NuttX
===============
.. warning::
This guide is under development. Rust support in NuttX is experimental.
Introduction
============
NuttX is exploring Rust integration to provide memory safety guarantees and modern
language features while maintaining its small footprint and real-time capabilities.
This guide covers:
- Setting up Rust toolchain for NuttX development
- Building Rust components with NuttX
- Interoperability between Rust and C
- Testing Rust components
Prerequisites
=============
- Rust toolchain installed (rustup recommended)
- NuttX build environment configured
- Basic knowledge of Rust and NuttX development
Supported Platforms
===================
- AArch64 (WIP)
- ARMv7-A (WIP)
- ARMv6-M
- ARMv7-M
- ARMv8-M
- RISCV32
- RISCV64
Getting Started
===============
1. Install Rust toolchain and switch to nightly
Please refer to the official Rust installation guide for more details: https://www.rust-lang.org/tools/install
.. code-block:: bash
rustup toolchain install nightly
rustup default nightly
2. Prepare NuttX build environment
Please ensure that you have a working NuttX build environment, and with the following PR merged or cherry-picked:
- https://github.com/apache/nuttx-apps/pull/2487
- https://github.com/apache/nuttx/pull/15469
3. Enable essential kernel configurations
Pleae enable the following configurations in your NuttX configuration:
- CONFIG_SYSTEM_TIME64
- CONFIG_FS_LARGEFILE
- CONFIG_TLS_NELEM = 16
- CONFIG_DEV_URANDOM
The `rv-virt:nsh` board using make as the build system is recommended for testing Rust applications as it has been verified to work with this configuration.
For `rv-virt:nsh` board, you should disable `CONFIG_ARCH_FPU` configuration since RISCV32 with FPU is not supported yet.
4. Enable sample application
Please enable the sample application in your NuttX configuration:
- CONFIG_EXAMPLES_HELLO_RUST_CARGO
5. Build and run the sample application
Build the NuttX image and run it on your target platform:
.. code-block:: bash
qemu-system-riscv32 -semihosting -M virt,aclint=on -cpu rv32 -smp 8 -bios nuttx/nuttx -nographic
NuttShell (NSH) NuttX-12.8.0
nsh> hello_rust_cargo
{"name":"John","age":30}
{"name":"Jane","age":25}
Deserialized: Alice is 28 years old
Pretty JSON:
{
"name": "Alice",
"age": 28
}
Hello world from tokio!
Congratulations! You have successfully built and run a Rust application on NuttX.

View file

@ -0,0 +1,34 @@
===========================================
Updating a Release System with ELF Programs
===========================================
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/Updating+a+Release+System+with+ELF+Programs
.. warning::
Migrated from:
https://cwiki.apache.org/confluence/display/NUTTX/Updating+a+Release+System+with+ELF+Programs
You can enhance the functionality of your released embedded system by adding
ELF programs, which can be loaded from a file system. These programs can be
stored on an SD card or downloaded into on-board SPI FLASH, allowing for
easy updates or extensions to the system's firmware.
There are two ways you can accomplish this:
Partially linked
================
This describes building the partially linked, relocatable ELF program that
depends on a symbol table provided by the base firmware in FLASH.
Reference:
- See :doc:`Partially Linked ELF Programs <partially_linked_elf>`
Fully linked
============
This describes building a fully linked, relocatable ELF program that does
not depend on any symbol table information.
Reference:
- See :doc:`Fully Linked ELF Programs <fully_linked_elf>`

0
Documentation/implementation/simulation.rst Executable file → Normal file
View file

View file

@ -813,3 +813,83 @@ Configures the board to use the SPI4 and enables RFID driver with MFRC522::
MOSI PE6
CS PE4
======== =====
lvgl
----
Configures the board to use display of 7 inch with lvgl example.
To verify if the display is functioning correctly, use the **fb** command. You should see the display change colors.::
nsh> fb
VideoInfo:
fmt: 11
xres: 1024
yres: 600
nplanes: 1
noverlays: 1
OverlayInfo (overlay 0):
fbmem: 0xc0000000
fblen: 1228800
stride: 2048
overlay: 0
bpp: 16
blank: 0
chromakey: 0x00000000
color: 0x00000000
transp: 0xff
mode: 0
area: (0,0) => (1024,600)
accl: 1
PlaneInfo (plane 0):
fbmem: 0xc0000000
fblen: 1228800
stride: 2048
display: 0
bpp: 16
Mapped FB: 0xc0000000
0: ( 0, 0) (1024,600)
1: ( 93, 54) (838,492)
2: (186,108) (652,384)
3: (279,162) (466,276)
4: (372,216) (280,168)
5: (465,270) ( 94, 60)
Test finished
Once the **fd** command work, run the lvgl exemple. ::
nsh> lvgldemo
**WARNING:** This example at the moment is not working correctly yet and have a bug fix to be done.
In the lvgl file **./apps/graphics/lvgl/lvgl/src/drivers/nuttx/lv_nuttx_fbdev.c**
search the function **lv_nuttx_fbdev_set_file** and modify line 156 as follows:
dsc->mem_off_screen = malloc(data_size);
to
dsc->mem_off_screen = (void*)0xC00000000;
tone
----
This example demonstrates how to use PWM4 and Timer17 to play music using the Tone library and the board's buzzer.
socketcan
---------
This example demonstrates how to use the CAN-FD peripherals can0 and can1 with the SocketCAN protocol.::
# Configure the can0 and can1 to send messages
nsh> ifup can0
ifup can0...OK
nsh> ifup can1
ifup can1 ...OK
nsh> cansend can0 123#DEADBEEF
nsh> cansend can1 5A1#11.2233.44556677.88
# Reset the board and configure the can0 peripheral to receive messages
nsh> ifup can0
ifup can0...OK
nsh> candump can0
can0 051 [8] 00 11 22 33 44 55 66 77
can0 051 [16] 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF

View file

@ -48,7 +48,7 @@ DMA No
EMAC No
GPADC Yes
GPIO Yes
I2C No
I2C Yes
I2S No
PWM No
SPI Yes

View file

@ -208,6 +208,18 @@ You can scan for all I2C devices using the following command::
nsh> i2c dev 0x00 0x7f
nimble
------
This configuration can be used to test ble using the nimble library. The
``nimble`` example starts advertising and can be connected to or disconnected
from. Before starting the ``nimble`` example make sure the bnep0 interface is
up by issuing::
nsh> ifup bnep0
ifup bnep0...OK
nsh> nimble &
nsh
---

View file

@ -287,7 +287,7 @@ Peripheral Support NOTES
=========== ======= ====================
ADC No
AES No
Bluetooth No
Bluetooth Yes
CAN/TWAI Yes
CDC Console Yes Rev.3
DMA Yes

View file

@ -361,7 +361,7 @@ This configuration is used for 32-bit RISC-V
python
------
Enables the Python interpreter for NuttX. This configuration is based on `nsh`_.
Enables the Python interpreter for NuttX. This configuration is based on `netnsh`_.
For more information on how to build and run Python on NuttX,
please refer to the :doc:`Python Interpreter </applications/interpreters/python/index>` page.

View file

@ -158,6 +158,7 @@ config ARCH_XTENSA
select ARCH_HAVE_INTERRUPTSTACK
select ARCH_HAVE_STACKCHECK
select ARCH_HAVE_CUSTOMOPT
select ARCH_HAVE_THREAD_LOCAL
select ARCH_HAVE_TCBINFO
select ARCH_HAVE_STDARG_H
select ARCH_HAVE_SETJMP if ARCH_TOOLCHAIN_GNU

View file

@ -177,7 +177,7 @@ extern volatile bool g_interrupt_context[CONFIG_SMP_NCPUS];
/* Save the current interrupt enable state & disable IRQs. */
static inline irqstate_t up_irq_save(void)
static inline_function irqstate_t up_irq_save(void)
{
unsigned int flags;
unsigned int temp;
@ -194,7 +194,7 @@ static inline irqstate_t up_irq_save(void)
/* Restore saved IRQ & FIQ state */
static inline void up_irq_restore(irqstate_t flags)
static inline_function void up_irq_restore(irqstate_t flags)
{
__asm__ __volatile__
(
@ -206,7 +206,7 @@ static inline void up_irq_restore(irqstate_t flags)
/* Enable IRQs and return the previous IRQ state */
static inline irqstate_t up_irq_enable(void)
static inline_function irqstate_t up_irq_enable(void)
{
unsigned int flags;
unsigned int temp;
@ -256,6 +256,25 @@ static inline_function void up_set_interrupt_context(bool flag)
#endif
}
static inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
__asm__ __volatile__
(
"mov %0, sp\n"
: "=r" (sp)
);
return sp;
}
static inline_function uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = (uint32_t *)regs;
return ptr[REG_SP];
}
/****************************************************************************
* Public Function Prototypes
****************************************************************************/

View file

@ -209,8 +209,7 @@ struct xcptcontext
/* Get/set the PRIMASK register */
static inline uint8_t getprimask(void) always_inline_function;
static inline uint8_t getprimask(void)
static always_inline_function uint8_t getprimask(void)
{
uint32_t primask;
__asm__ __volatile__
@ -223,8 +222,7 @@ static inline uint8_t getprimask(void)
return (uint8_t)primask;
}
static inline void setprimask(uint32_t primask) always_inline_function;
static inline void setprimask(uint32_t primask)
static always_inline_function void setprimask(uint32_t primask)
{
__asm__ __volatile__
(
@ -236,16 +234,14 @@ static inline void setprimask(uint32_t primask)
/* Disable IRQs */
static inline void up_irq_disable(void) always_inline_function;
static inline void up_irq_disable(void)
static always_inline_function void up_irq_disable(void)
{
__asm__ __volatile__ ("\tcpsid i\n");
}
/* Save the current primask state & disable IRQs */
static inline irqstate_t up_irq_save(void) always_inline_function;
static inline irqstate_t up_irq_save(void)
static always_inline_function irqstate_t up_irq_save(void)
{
unsigned short primask;
@ -266,16 +262,14 @@ static inline irqstate_t up_irq_save(void)
/* Enable IRQs */
static inline void up_irq_enable(void) always_inline_function;
static inline void up_irq_enable(void)
static always_inline_function void up_irq_enable(void)
{
__asm__ __volatile__ ("\tcpsie i\n");
}
/* Restore saved primask state */
static inline void up_irq_restore(irqstate_t flags) always_inline_function;
static inline void up_irq_restore(irqstate_t flags)
static always_inline_function void up_irq_restore(irqstate_t flags)
{
/* If bit 0 of the primask is 0, then we need to restore
* interrupts.
@ -291,8 +285,7 @@ static inline void up_irq_restore(irqstate_t flags)
/* Get/set IPSR */
static inline uint32_t getipsr(void) always_inline_function;
static inline uint32_t getipsr(void)
static always_inline_function uint32_t getipsr(void)
{
uint32_t ipsr;
__asm__ __volatile__
@ -307,8 +300,7 @@ static inline uint32_t getipsr(void)
/* Get/set CONTROL */
static inline uint32_t getcontrol(void) always_inline_function;
static inline uint32_t getcontrol(void)
static always_inline_function uint32_t getcontrol(void)
{
uint32_t control;
__asm__ __volatile__
@ -321,8 +313,7 @@ static inline uint32_t getcontrol(void)
return control;
}
static inline void setcontrol(uint32_t control) always_inline_function;
static inline void setcontrol(uint32_t control)
static always_inline_function void setcontrol(uint32_t control)
{
__asm__ __volatile__
(
@ -332,6 +323,20 @@ static inline void setcontrol(uint32_t control)
: "memory");
}
static always_inline_function uint32_t getpsp(void)
{
uint32_t psp;
__asm__ __volatile__
(
"\tmrs %0, psp\n"
: "=r" (psp)
:
: "memory");
return psp;
}
/****************************************************************************
* Name: up_cpu_index
*
@ -344,7 +349,7 @@ static inline void setcontrol(uint32_t control)
int up_cpu_index(void) noinstrument_function;
#endif /* CONFIG_ARCH_HAVE_MULTICPU */
static inline_function uint32_t up_getsp(void)
static always_inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
@ -357,8 +362,13 @@ static inline_function uint32_t up_getsp(void)
return sp;
}
noinstrument_function
static inline_function bool up_interrupt_context(void)
static always_inline_function uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = (uint32_t *)regs;
return ptr[REG_SP];
}
static always_inline_function bool up_interrupt_context(void)
{
return getipsr() != 0;
}

View file

@ -343,7 +343,7 @@ struct xcptcontext
/* Return the current IRQ state */
static inline irqstate_t irqstate(void)
static inline_function irqstate_t irqstate(void)
{
unsigned int cpsr;
@ -360,7 +360,7 @@ static inline irqstate_t irqstate(void)
/* Disable IRQs and return the previous IRQ state */
noinstrument_function static inline irqstate_t up_irq_save(void)
noinstrument_function static inline_function irqstate_t up_irq_save(void)
{
unsigned int cpsr;
@ -382,7 +382,7 @@ noinstrument_function static inline irqstate_t up_irq_save(void)
/* Enable IRQs and return the previous IRQ state */
static inline irqstate_t up_irq_enable(void)
static inline_function irqstate_t up_irq_enable(void)
{
unsigned int cpsr;
@ -406,7 +406,7 @@ static inline irqstate_t up_irq_enable(void)
/* Disable IRQs and return the previous IRQ state */
static inline irqstate_t up_irq_disable(void)
static inline_function irqstate_t up_irq_disable(void)
{
unsigned int cpsr;
@ -424,7 +424,8 @@ static inline irqstate_t up_irq_disable(void)
/* Restore saved IRQ & FIQ state */
noinstrument_function static inline void up_irq_restore(irqstate_t flags)
noinstrument_function static inline_function
void up_irq_restore(irqstate_t flags)
{
__asm__ __volatile__
(
@ -472,6 +473,12 @@ static inline_function uint32_t up_getsp(void)
return sp;
}
static inline_function uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = (uint32_t *)regs;
return ptr[REG_SP];
}
noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{

View file

@ -267,8 +267,7 @@ struct xcptcontext
/* Get/set the PRIMASK register */
static inline uint8_t getprimask(void) always_inline_function;
static inline uint8_t getprimask(void)
static always_inline_function uint8_t getprimask(void)
{
uint32_t primask;
__asm__ __volatile__
@ -281,8 +280,7 @@ static inline uint8_t getprimask(void)
return (uint8_t)primask;
}
static inline void setprimask(uint32_t primask) always_inline_function;
static inline void setprimask(uint32_t primask)
static always_inline_function void setprimask(uint32_t primask)
{
__asm__ __volatile__
(
@ -292,14 +290,12 @@ static inline void setprimask(uint32_t primask)
: "memory");
}
static inline void cpsie(void) always_inline_function;
static inline void cpsie(void)
static always_inline_function void cpsie(void)
{
__asm__ __volatile__ ("\tcpsie i\n");
}
static inline void cpsid(void) always_inline_function;
static inline void cpsid(void)
static always_inline_function void cpsid(void)
{
__asm__ __volatile__ ("\tcpsid i\n");
}
@ -310,8 +306,7 @@ static inline void cpsid(void)
* lower priority level as the BASEPRI value.
*/
static inline uint8_t getbasepri(void) always_inline_function;
static inline uint8_t getbasepri(void)
static always_inline_function uint8_t getbasepri(void)
{
uint32_t basepri;
@ -325,8 +320,7 @@ static inline uint8_t getbasepri(void)
return (uint8_t)basepri;
}
static inline void setbasepri(uint32_t basepri) always_inline_function;
static inline void setbasepri(uint32_t basepri)
static always_inline_function void setbasepri(uint32_t basepri)
{
__asm__ __volatile__
(
@ -343,8 +337,7 @@ static inline void setbasepri(uint32_t basepri)
* 837070 Workaround may be required if we are raising the priority.
*/
static inline void raisebasepri(uint32_t basepri) always_inline_function;
static inline void raisebasepri(uint32_t basepri)
static always_inline_function void raisebasepri(uint32_t basepri)
{
register uint32_t primask;
@ -378,8 +371,7 @@ static inline void raisebasepri(uint32_t basepri)
/* Disable IRQs */
static inline void up_irq_disable(void) always_inline_function;
static inline void up_irq_disable(void)
static always_inline_function void up_irq_disable(void)
{
/* Probably raising priority */
@ -388,9 +380,7 @@ static inline void up_irq_disable(void)
/* Save the current primask state & disable IRQs */
static inline irqstate_t up_irq_save(void)
always_inline_function noinstrument_function;
static inline irqstate_t up_irq_save(void)
static always_inline_function irqstate_t up_irq_save(void)
{
/* Probably raising priority */
@ -401,8 +391,7 @@ static inline irqstate_t up_irq_save(void)
/* Enable IRQs */
static inline void up_irq_enable(void) always_inline_function;
static inline void up_irq_enable(void)
static always_inline_function void up_irq_enable(void)
{
/* In this case, we are always retaining or lowering the priority value */
@ -412,9 +401,7 @@ static inline void up_irq_enable(void)
/* Restore saved primask state */
static inline void up_irq_restore(irqstate_t flags)
always_inline_function noinstrument_function;
static inline void up_irq_restore(irqstate_t flags)
static always_inline_function void up_irq_restore(irqstate_t flags)
{
/* In this case, we are always retaining or lowering the priority value */
@ -423,8 +410,7 @@ static inline void up_irq_restore(irqstate_t flags)
/* Get/set IPSR */
static inline uint32_t getipsr(void) always_inline_function;
static inline uint32_t getipsr(void)
static always_inline_function uint32_t getipsr(void)
{
uint32_t ipsr;
__asm__ __volatile__
@ -439,8 +425,7 @@ static inline uint32_t getipsr(void)
/* Get/set FAULTMASK */
static inline uint32_t getfaultmask(void) always_inline_function;
static inline uint32_t getfaultmask(void)
static always_inline_function uint32_t getfaultmask(void)
{
uint32_t faultmask;
__asm__ __volatile__
@ -453,8 +438,7 @@ static inline uint32_t getfaultmask(void)
return faultmask;
}
static inline void setfaultmask(uint32_t faultmask) always_inline_function;
static inline void setfaultmask(uint32_t faultmask)
static always_inline_function void setfaultmask(uint32_t faultmask)
{
__asm__ __volatile__
(
@ -466,8 +450,7 @@ static inline void setfaultmask(uint32_t faultmask)
/* Get/set CONTROL */
static inline uint32_t getcontrol(void) always_inline_function;
static inline uint32_t getcontrol(void)
static always_inline_function uint32_t getcontrol(void)
{
uint32_t control;
__asm__ __volatile__
@ -480,8 +463,7 @@ static inline uint32_t getcontrol(void)
return control;
}
static inline void setcontrol(uint32_t control) always_inline_function;
static inline void setcontrol(uint32_t control)
static always_inline_function void setcontrol(uint32_t control)
{
__asm__ __volatile__
(
@ -491,6 +473,20 @@ static inline void setcontrol(uint32_t control)
: "memory");
}
static always_inline_function uint32_t getpsp(void)
{
uint32_t psp;
__asm__ __volatile__
(
"\tmrs %0, psp\n"
: "=r" (psp)
:
: "memory");
return psp;
}
/****************************************************************************
* Name: up_cpu_index
*
@ -503,7 +499,7 @@ static inline void setcontrol(uint32_t control)
int up_cpu_index(void) noinstrument_function;
#endif /* CONFIG_ARCH_HAVE_MULTICPU */
static inline_function uint32_t up_getsp(void)
static always_inline_function uint32_t up_getsp(void)
{
register uint32_t sp;
@ -516,8 +512,13 @@ static inline_function uint32_t up_getsp(void)
return sp;
}
noinstrument_function
static inline_function bool up_interrupt_context(void)
static always_inline_function uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = (uint32_t *)regs;
return ptr[REG_SP];
}
static always_inline_function bool up_interrupt_context(void)
{
return getipsr() != 0;
}

View file

@ -342,7 +342,7 @@ struct xcptcontext
/* Return the current IRQ state */
static inline irqstate_t irqstate(void)
static inline_function irqstate_t irqstate(void)
{
unsigned int cpsr;
@ -359,7 +359,7 @@ static inline irqstate_t irqstate(void)
/* Disable IRQs and return the previous IRQ state */
noinstrument_function static inline irqstate_t up_irq_save(void)
noinstrument_function static inline_function irqstate_t up_irq_save(void)
{
unsigned int cpsr;
@ -380,7 +380,7 @@ noinstrument_function static inline irqstate_t up_irq_save(void)
/* Enable IRQs and return the previous IRQ state */
static inline irqstate_t up_irq_enable(void)
static inline_function irqstate_t up_irq_enable(void)
{
unsigned int cpsr;
@ -401,7 +401,7 @@ static inline irqstate_t up_irq_enable(void)
/* Disable IRQs and return the previous IRQ state */
static inline irqstate_t up_irq_disable(void)
static inline_function irqstate_t up_irq_disable(void)
{
unsigned int cpsr;
@ -419,7 +419,8 @@ static inline irqstate_t up_irq_disable(void)
/* Restore saved IRQ & FIQ state */
noinstrument_function static inline void up_irq_restore(irqstate_t flags)
noinstrument_function static inline_function
void up_irq_restore(irqstate_t flags)
{
__asm__ __volatile__
(
@ -467,6 +468,12 @@ static inline_function uint32_t up_getsp(void)
return sp;
}
static inline_function uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = (uint32_t *)regs;
return ptr[REG_SP];
}
noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{

View file

@ -278,8 +278,7 @@ struct xcptcontext
/* Get/set the PRIMASK register */
static inline uint8_t getprimask(void) always_inline_function;
static inline uint8_t getprimask(void)
static always_inline_function uint8_t getprimask(void)
{
uint32_t primask;
__asm__ __volatile__
@ -292,8 +291,7 @@ static inline uint8_t getprimask(void)
return (uint8_t)primask;
}
static inline void setprimask(uint32_t primask) always_inline_function;
static inline void setprimask(uint32_t primask)
static always_inline_function void setprimask(uint32_t primask)
{
__asm__ __volatile__
(
@ -303,14 +301,12 @@ static inline void setprimask(uint32_t primask)
: "memory");
}
static inline void cpsie(void) always_inline_function;
static inline void cpsie(void)
static always_inline_function void cpsie(void)
{
__asm__ __volatile__ ("\tcpsie i\n");
}
static inline void cpsid(void) always_inline_function;
static inline void cpsid(void)
static always_inline_function void cpsid(void)
{
__asm__ __volatile__ ("\tcpsid i\n");
}
@ -321,8 +317,7 @@ static inline void cpsid(void)
* lower priority level as the BASEPRI value.
*/
static inline uint8_t getbasepri(void) always_inline_function;
static inline uint8_t getbasepri(void)
static always_inline_function uint8_t getbasepri(void)
{
uint32_t basepri;
@ -336,8 +331,7 @@ static inline uint8_t getbasepri(void)
return (uint8_t)basepri;
}
static inline void setbasepri(uint32_t basepri) always_inline_function;
static inline void setbasepri(uint32_t basepri)
static always_inline_function void setbasepri(uint32_t basepri)
{
__asm__ __volatile__
(
@ -351,8 +345,7 @@ static inline void setbasepri(uint32_t basepri)
/* Disable IRQs */
static inline void up_irq_disable(void) always_inline_function;
static inline void up_irq_disable(void)
static always_inline_function void up_irq_disable(void)
{
/* Probably raising priority */
@ -361,9 +354,7 @@ static inline void up_irq_disable(void)
/* Save the current primask state & disable IRQs */
static inline irqstate_t up_irq_save(void)
always_inline_function noinstrument_function;
static inline irqstate_t up_irq_save(void)
static always_inline_function irqstate_t up_irq_save(void)
{
/* Probably raising priority */
@ -374,8 +365,7 @@ static inline irqstate_t up_irq_save(void)
/* Enable IRQs */
static inline void up_irq_enable(void) always_inline_function;
static inline void up_irq_enable(void)
static always_inline_function void up_irq_enable(void)
{
/* In this case, we are always retaining or lowering the priority value */
@ -385,9 +375,8 @@ static inline void up_irq_enable(void)
/* Restore saved primask state */
static inline void up_irq_restore(irqstate_t flags)
always_inline_function noinstrument_function;
static inline void up_irq_restore(irqstate_t flags)
static always_inline_function
void up_irq_restore(irqstate_t flags)
{
/* In this case, we are always retaining or lowering the priority value */
@ -396,8 +385,7 @@ static inline void up_irq_restore(irqstate_t flags)
/* Get/set IPSR */
static inline uint32_t getipsr(void) always_inline_function;
static inline uint32_t getipsr(void)
static always_inline_function uint32_t getipsr(void)
{
uint32_t ipsr;
__asm__ __volatile__
@ -412,8 +400,7 @@ static inline uint32_t getipsr(void)
/* Get/set FAULTMASK */
static inline uint32_t getfaultmask(void) always_inline_function;
static inline uint32_t getfaultmask(void)
static always_inline_function uint32_t getfaultmask(void)
{
uint32_t faultmask;
__asm__ __volatile__
@ -426,8 +413,7 @@ static inline uint32_t getfaultmask(void)
return faultmask;
}
static inline void setfaultmask(uint32_t faultmask) always_inline_function;
static inline void setfaultmask(uint32_t faultmask)
static always_inline_function void setfaultmask(uint32_t faultmask)
{
__asm__ __volatile__
(
@ -439,8 +425,7 @@ static inline void setfaultmask(uint32_t faultmask)
/* Get/set CONTROL */
static inline uint32_t getcontrol(void) always_inline_function;
static inline uint32_t getcontrol(void)
static always_inline_function uint32_t getcontrol(void)
{
uint32_t control;
__asm__ __volatile__
@ -453,8 +438,7 @@ static inline uint32_t getcontrol(void)
return control;
}
static inline void setcontrol(uint32_t control) always_inline_function;
static inline void setcontrol(uint32_t control)
static always_inline_function void setcontrol(uint32_t control)
{
__asm__ __volatile__
(
@ -464,6 +448,20 @@ static inline void setcontrol(uint32_t control)
: "memory");
}
static always_inline_function uint32_t getpsp(void)
{
uint32_t psp;
__asm__ __volatile__
(
"\tmrs %0, psp\n"
: "=r" (psp)
:
: "memory");
return psp;
}
/****************************************************************************
* Name: up_cpu_index
*
@ -476,7 +474,7 @@ static inline void setcontrol(uint32_t control)
int up_cpu_index(void) noinstrument_function;
#endif /* CONFIG_ARCH_HAVE_MULTICPU */
static inline_function uint32_t up_getsp(void)
static always_inline_function uint32_t up_getsp(void)
{
uint32_t sp;
@ -489,8 +487,13 @@ static inline_function uint32_t up_getsp(void)
return sp;
}
noinstrument_function
static inline_function bool up_interrupt_context(void)
static always_inline_function uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = (uint32_t *)regs;
return ptr[REG_SP];
}
static always_inline_function bool up_interrupt_context(void)
{
return getipsr() != 0;
}

View file

@ -342,7 +342,7 @@ struct xcptcontext
/* Return the current IRQ state */
static inline irqstate_t irqstate(void)
static inline_function irqstate_t irqstate(void)
{
unsigned int cpsr;
@ -359,7 +359,7 @@ static inline irqstate_t irqstate(void)
/* Disable IRQs and return the previous IRQ state */
noinstrument_function static inline irqstate_t up_irq_save(void)
noinstrument_function static inline_function irqstate_t up_irq_save(void)
{
unsigned int cpsr;
@ -380,7 +380,7 @@ noinstrument_function static inline irqstate_t up_irq_save(void)
/* Enable IRQs and return the previous IRQ state */
static inline irqstate_t up_irq_enable(void)
static inline_function irqstate_t up_irq_enable(void)
{
unsigned int cpsr;
@ -401,7 +401,7 @@ static inline irqstate_t up_irq_enable(void)
/* Disable IRQs and return the previous IRQ state */
static inline irqstate_t up_irq_disable(void)
static inline_function irqstate_t up_irq_disable(void)
{
unsigned int cpsr;
@ -419,7 +419,8 @@ static inline irqstate_t up_irq_disable(void)
/* Restore saved IRQ & FIQ state */
noinstrument_function static inline void up_irq_restore(irqstate_t flags)
noinstrument_function static inline_function
void up_irq_restore(irqstate_t flags)
{
__asm__ __volatile__
(
@ -467,6 +468,12 @@ static inline_function uint32_t up_getsp(void)
return sp;
}
static inline_function uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = (uint32_t *)regs;
return ptr[REG_SP];
}
noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{

View file

@ -194,7 +194,7 @@ extern volatile bool g_interrupt_context[CONFIG_SMP_NCPUS];
/* Save the current interrupt enable state & disable IRQs. */
static inline irqstate_t up_irq_save(void)
static inline_function irqstate_t up_irq_save(void)
{
irqstate_t r = _IRQ_EN_REG;
_IRQ_EN_REG = 0;
@ -203,36 +203,36 @@ static inline irqstate_t up_irq_save(void)
/* Restore saved IRQ & FIQ state */
static inline void up_irq_restore(irqstate_t flags)
static inline_function void up_irq_restore(irqstate_t flags)
{
_IRQ_EN_REG = flags;
}
/* Enable IRQs and return the previous IRQ state */
static inline irqstate_t up_irq_enable(void)
static inline_function irqstate_t up_irq_enable(void)
{
irqstate_t r = _IRQ_EN_REG;
_IRQ_EN_REG = 1;
return r;
}
static inline void up_irq_disable(void)
static inline_function void up_irq_disable(void)
{
up_irq_save();
}
static inline void up_disable_irq(int irq)
static inline_function void up_disable_irq(int irq)
{
_IRQ_MASK_REG &= ~(1 << irq);
}
static inline void up_enable_irq(int irq)
static inline_function void up_enable_irq(int irq)
{
_IRQ_MASK_REG |= (1 << irq);
}
static inline uint32_t getcontrol(void)
static inline_function uint32_t getcontrol(void)
{
return 0;
}
@ -262,6 +262,12 @@ static inline_function uint32_t up_getsp(void)
return sp;
}
static inline_function uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = (uint32_t *)regs;
return ptr[REG_SP];
}
noinstrument_function
static inline_function bool up_interrupt_context(void)
{

View file

@ -29,7 +29,7 @@ add_subdirectory(common)
target_include_directories(arch BEFORE PUBLIC ${NUTTX_CHIP_ABS_DIR} common
${ARCH_SUBDIR})
if(NOT CONFIG_BUILD_FLAT)
if(CONFIG_BUILD_PROTECTED)
target_include_directories(arch_interface BEFORE PUBLIC ${NUTTX_CHIP_ABS_DIR}
common ${ARCH_SUBDIR})
endif()

View file

@ -27,9 +27,11 @@
#include <nuttx/config.h>
#include <assert.h>
#include <sched.h>
#include <arch/board/board.h>
#include <nuttx/irq.h>
#include <nuttx/spinlock.h>
#include <nuttx/arch.h>
#include <nuttx/can/can.h>
@ -205,6 +207,8 @@ static struct can_dev_s g_can1dev =
};
#endif
static spinlock_t g_can_lock = SP_UNLOCKED;
/****************************************************************************
* Private Functions
****************************************************************************/
@ -1079,7 +1083,8 @@ struct can_dev_s *am335x_can_initialize(int port)
syslog(LOG_DEBUG, "CAN%d\n", port);
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_can_lock);
sched_lock();
#ifdef CONFIG_AM335X_CAN0
if (port == 0)
@ -1109,11 +1114,13 @@ struct can_dev_s *am335x_can_initialize(int port)
{
canerr("Unsupported port: %d\n", port);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_can_lock, flags);
sched_unlock();
return NULL;
}
leave_critical_section(flags);
spin_unlock_irqrestore(&g_can_lock, flags);
sched_unlock();
return candev;
}
@ -1124,7 +1131,8 @@ void am335x_can_uninitialize(struct can_dev_s *dev)
DEBUGASSERT(dev);
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_can_lock);
sched_lock();
#ifdef CONFIG_AM335X_CAN0
if (dev == &g_can0dev)
@ -1151,7 +1159,8 @@ void am335x_can_uninitialize(struct can_dev_s *dev)
canerr("Not a CAN device: %p\n", dev);
}
leave_critical_section(flags);
spin_unlock_irqrestore(&g_can_lock, flags);
sched_unlock();
}
#endif

View file

@ -31,6 +31,7 @@
#include <errno.h>
#include <nuttx/irq.h>
#include <nuttx/spinlock.h>
#include "chip.h"
#include "arm_internal.h"
@ -219,6 +220,8 @@ static const uint8_t *g_gpio_padctl[AM335X_GPIO_NPORTS] =
g_gpio3_padctl, /* GPIO3 */
};
static spinlock_t g_gpio_lock = SP_UNLOCKED;
/****************************************************************************
* Private Functions
****************************************************************************/
@ -364,7 +367,7 @@ int am335x_gpio_config(gpio_pinset_t pinset)
/* Configure the pin as an input initially to avoid any spurious outputs */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_gpio_lock);
/* Configure based upon the pin mode */
@ -407,7 +410,7 @@ int am335x_gpio_config(gpio_pinset_t pinset)
break;
}
leave_critical_section(flags);
spin_unlock_irqrestore(&g_gpio_lock, flags);
return ret;
}
@ -425,9 +428,9 @@ void am335x_gpio_write(gpio_pinset_t pinset, bool value)
int port = (pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
int pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_gpio_lock);
am335x_gpio_setoutput(port, pin, value);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_gpio_lock, flags);
}
/****************************************************************************
@ -445,9 +448,9 @@ bool am335x_gpio_read(gpio_pinset_t pinset)
int pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
bool value;
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_gpio_lock);
value = am335x_gpio_getinput(port, pin);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_gpio_lock, flags);
return value;
}

View file

@ -37,6 +37,7 @@
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <nuttx/spinlock.h>
#include <nuttx/clock.h>
#include <nuttx/mutex.h>
#include <nuttx/semaphore.h>
@ -185,6 +186,7 @@ struct am335x_i2c_priv_s
int refs; /* Reference count */
mutex_t lock; /* Mutual exclusion mutex */
spinlock_t spinlock; /* Spinlock */
#ifndef CONFIG_I2C_POLLED
sem_t sem_isr; /* Interrupt wait semaphore */
#endif
@ -317,6 +319,7 @@ static struct am335x_i2c_priv_s am335x_i2c0_priv =
.config = &am335x_i2c0_config,
.refs = 0,
.lock = NXMUTEX_INITIALIZER,
.spinlock = SP_UNLOCKED,
#ifndef CONFIG_I2C_POLLED
.sem_isr = SEM_INITIALIZER(0),
#endif
@ -352,6 +355,7 @@ static struct am335x_i2c_priv_s am335x_i2c1_priv =
.config = &am335x_i2c1_config,
.refs = 0,
.lock = NXMUTEX_INITIALIZER,
.spinlock = SP_UNLOCKED,
#ifndef CONFIG_I2C_POLLED
.sem_isr = SEM_INITIALIZER(0),
#endif
@ -387,6 +391,7 @@ static struct am335x_i2c_priv_s am335x_i2c2_priv =
.config = &am335x_i2c2_config,
.refs = 0,
.lock = NXMUTEX_INITIALIZER,
.spinlock = SP_UNLOCKED,
#ifndef CONFIG_I2C_POLLED
.sem_isr = SEM_INITIALIZER(0),
#endif
@ -492,7 +497,7 @@ static inline int am335x_i2c_sem_waitdone(struct am335x_i2c_priv_s *priv)
uint32_t regval;
int ret;
flags = enter_critical_section();
flags = spin_lock_irqsave(&priv->spinlock);
/* Enable Interrupts when master mode */
@ -529,6 +534,8 @@ static inline int am335x_i2c_sem_waitdone(struct am335x_i2c_priv_s *priv)
*/
priv->intstate = INTSTATE_WAITING;
spin_unlock_irqrestore(&priv->spinlock, flags);
do
{
/* Wait until either the transfer is complete or the timeout expires */
@ -551,6 +558,8 @@ static inline int am335x_i2c_sem_waitdone(struct am335x_i2c_priv_s *priv)
}
}
flags = spin_lock_irqsave(&priv->spinlock);
/* Loop until the interrupt level transfer is complete. */
while (priv->intstate != INTSTATE_DONE);
@ -563,7 +572,7 @@ static inline int am335x_i2c_sem_waitdone(struct am335x_i2c_priv_s *priv)
am335x_i2c_putreg(priv, AM335X_I2C_IRQ_EN_CLR_OFFSET, I2C_ICR_CLEARMASK);
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->spinlock, flags);
return ret;
}
#else
@ -992,7 +1001,7 @@ static int am335x_i2c_isr_process(struct am335x_i2c_priv_s *priv)
*/
#ifdef CONFIG_I2C_POLLED
irqstate_t flags = enter_critical_section();
irqstate_t flags = spin_lock_irqsave(&priv->spinlock);
#endif
/* Transmit a byte */
@ -1001,7 +1010,7 @@ static int am335x_i2c_isr_process(struct am335x_i2c_priv_s *priv)
priv->dcnt--;
#ifdef CONFIG_I2C_POLLED
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->spinlock, flags);
#endif
if ((priv->dcnt == 0) && ((priv->flags & I2C_M_NOSTOP) == 0))
{
@ -1026,7 +1035,7 @@ static int am335x_i2c_isr_process(struct am335x_i2c_priv_s *priv)
*/
#ifdef CONFIG_I2C_POLLED
irqstate_t flags = enter_critical_section();
irqstate_t flags = spin_lock_irqsave(&priv->spinlock);
#endif
/* Receive a byte */
@ -1036,7 +1045,7 @@ static int am335x_i2c_isr_process(struct am335x_i2c_priv_s *priv)
priv->dcnt--;
#ifdef CONFIG_I2C_POLLED
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->spinlock, flags);
#endif
if ((priv->msgc <= 0) && (priv->dcnt == 0))
{
@ -1100,7 +1109,7 @@ static int am335x_i2c_isr_process(struct am335x_i2c_priv_s *priv)
*/
#ifdef CONFIG_I2C_POLLED
irqstate_t flags = enter_critical_section();
irqstate_t flags = spin_lock_irqsave(&priv->spinlock);
#endif
/* Transmit a byte */
@ -1109,7 +1118,7 @@ static int am335x_i2c_isr_process(struct am335x_i2c_priv_s *priv)
priv->dcnt--;
#ifdef CONFIG_I2C_POLLED
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->spinlock, flags);
#endif
if ((priv->dcnt == 0) && ((priv->flags & I2C_M_NOSTOP) == 0))
{

View file

@ -29,6 +29,7 @@
#include <assert.h>
#include <nuttx/arch.h>
#include <nuttx/spinlock.h>
#include "arm_internal.h"
#include "sctlr.h"
@ -36,6 +37,13 @@
#include "am335x_gpio.h"
#include "am335x_irq.h"
/****************************************************************************
* Private Data
****************************************************************************/
#ifdef CONFIG_ARCH_IRQPRIO
static spinlock_t g_irq_lock = SP_UNLOCKED;
#endif
/****************************************************************************
* Public Data
****************************************************************************/
@ -328,7 +336,7 @@ int up_prioritize_irq(int irq, int priority)
{
/* These operations must be atomic */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_irq_lock);
#if 0 // TODO
/* Set the new priority */
@ -340,7 +348,7 @@ int up_prioritize_irq(int irq, int priority)
putreg32(regval, regaddr);
#endif
leave_critical_section(flags);
spin_unlock_irqrestore(&g_irq_lock, flags);
return OK;
}

View file

@ -39,6 +39,7 @@
#endif
#include <nuttx/irq.h>
#include <nuttx/spinlock.h>
#include <nuttx/arch.h>
#include <nuttx/fs/ioctl.h>
#include <nuttx/serial/serial.h>
@ -76,13 +77,14 @@
struct up_dev_s
{
uint32_t uartbase; /* Base address of UART registers */
uint32_t baud; /* Configured baud */
uint32_t ier; /* Saved IER value */
uint8_t irq; /* IRQ associated with this UART */
uint8_t parity; /* 0=none, 1=odd, 2=even */
uint8_t bits; /* Number of bits (7 or 8) */
bool stopbits2; /* true: Configure with 2 stop bits instead of 1 */
uint32_t uartbase; /* Base address of UART registers */
uint32_t baud; /* Configured baud */
uint32_t ier; /* Saved IER value */
uint8_t irq; /* IRQ associated with this UART */
uint8_t parity; /* 0=none, 1=odd, 2=even */
uint8_t bits; /* Number of bits (7 or 8) */
bool stopbits2; /* true: Configure with 2 stop bits instead of 1 */
spinlock_t spinlock; /* Spinlock */
};
/****************************************************************************
@ -169,6 +171,7 @@ static struct up_dev_s g_uart0priv =
.parity = CONFIG_UART0_PARITY,
.bits = CONFIG_UART0_BITS,
.stopbits2 = CONFIG_UART0_2STOP,
.spinlock = SP_UNLOCKED,
};
static uart_dev_t g_uart0port =
@ -200,6 +203,7 @@ static struct up_dev_s g_uart1priv =
.parity = CONFIG_UART1_PARITY,
.bits = CONFIG_UART1_BITS,
.stopbits2 = CONFIG_UART1_2STOP,
.spinlock = SP_UNLOCKED,
};
static uart_dev_t g_uart1port =
@ -230,6 +234,7 @@ static struct up_dev_s g_uart2priv =
.parity = CONFIG_UART2_PARITY,
.bits = CONFIG_UART2_BITS,
.stopbits2 = CONFIG_UART2_2STOP,
.spinlock = SP_UNLOCKED,
};
static uart_dev_t g_uart2port =
@ -260,6 +265,7 @@ static struct up_dev_s g_uart3priv =
.parity = CONFIG_UART3_PARITY,
.bits = CONFIG_UART3_BITS,
.stopbits2 = CONFIG_UART3_2STOP,
.spinlock = SP_UNLOCKED,
};
static uart_dev_t g_uart3port =
@ -290,6 +296,7 @@ static struct up_dev_s g_uart4priv =
.parity = CONFIG_UART4_PARITY,
.bits = CONFIG_UART4_BITS,
.stopbits2 = CONFIG_UART4_2STOP,
.spinlock = SP_UNLOCKED,
};
static uart_dev_t g_uart4port =
@ -320,6 +327,7 @@ static struct up_dev_s g_uart5priv =
.parity = CONFIG_UART5_PARITY,
.bits = CONFIG_UART5_BITS,
.stopbits2 = CONFIG_UART5_2STOP,
.spinlock = SP_UNLOCKED,
};
static uart_dev_t g_uart5port =
@ -484,6 +492,10 @@ static uart_dev_t g_uart5port =
# define UART5_ASSIGNED 1
#endif
/* Spinlock */
static spinlock_t g_gpio_lock = SP_UNLOCKED;
/****************************************************************************
* Inline Functions
****************************************************************************/
@ -567,7 +579,7 @@ static inline void am335x_uart0config(void)
/* Step 1: Enable power to UART0 */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_gpio_lock);
#warning Missing logic
/* Step 2: Enable clocking to UART0 */
@ -577,7 +589,7 @@ static inline void am335x_uart0config(void)
am335x_gpio_config(GPIO_UART0_TXD);
am335x_gpio_config(GPIO_UART0_RXD);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_gpio_lock, flags);
};
#endif
@ -588,7 +600,7 @@ static inline void am335x_uart1config(void)
/* Step 1: Enable power to UART1 */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_gpio_lock);
#warning Missing logic
/* Step 2: Enable clocking to UART1 */
@ -598,7 +610,7 @@ static inline void am335x_uart1config(void)
am335x_gpio_config(GPIO_UART1_TXD);
am335x_gpio_config(GPIO_UART1_RXD);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_gpio_lock, flags);
};
#endif
@ -609,7 +621,7 @@ static inline void am335x_uart2config(void)
/* Step 1: Enable power to UART2 */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_gpio_lock);
#warning Missing logic
/* Step 2: Enable clocking on UART2 */
@ -619,7 +631,7 @@ static inline void am335x_uart2config(void)
am335x_gpio_config(GPIO_UART2_TXD);
am335x_gpio_config(GPIO_UART2_RXD);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_gpio_lock, flags);
};
#endif
@ -630,7 +642,7 @@ static inline void am335x_uart3config(void)
/* Step 1: Enable power to UART3 */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_gpio_lock);
#warning Missing logic
/* Step 2: Enable clocking to UART3 */
@ -640,7 +652,7 @@ static inline void am335x_uart3config(void)
am335x_gpio_config(GPIO_UART3_TXD);
am335x_gpio_config(GPIO_UART3_RXD);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_gpio_lock, flags);
};
#endif
@ -651,7 +663,7 @@ static inline void am335x_uart4config(void)
/* Step 1: Enable power to UART4 */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_gpio_lock);
#warning Missing logic
/* Step 2: Enable clocking to UART4 */
@ -661,7 +673,7 @@ static inline void am335x_uart4config(void)
am335x_gpio_config(GPIO_UART4_TXD);
am335x_gpio_config(GPIO_UART4_RXD);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_gpio_lock, flags);
};
#endif
@ -672,7 +684,7 @@ static inline void am335x_uart5config(void)
/* Step 1: Enable power to UART5 */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_gpio_lock);
#warning Missing logic
/* Step 2: Enable clocking to UART5 */
@ -682,7 +694,7 @@ static inline void am335x_uart5config(void)
am335x_gpio_config(GPIO_UART5_TXD);
am335x_gpio_config(GPIO_UART5_RXD);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_gpio_lock, flags);
};
#endif
@ -1029,18 +1041,18 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{
irqstate_t flags = enter_critical_section();
irqstate_t flags = spin_lock_irqsave(&priv->spinlock);
up_enablebreaks(priv, true);
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->spinlock, flags);
}
break;
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */
{
irqstate_t flags;
flags = enter_critical_section();
flags = spin_lock_irqsave(&priv->spinlock);
up_enablebreaks(priv, false);
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->spinlock, flags);
}
break;
@ -1204,13 +1216,15 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
irqstate_t flags;
flags = enter_critical_section();
flags = spin_lock_irqsave(&priv->spinlock);
if (enable)
{
#ifndef CONFIG_SUPPRESS_SERIAL_INTS
priv->ier |= UART_IER_THR;
up_serialout(priv, AM335X_UART_IER_OFFSET, priv->ier);
spin_unlock_irqrestore(&priv->spinlock, flags);
/* Fake a TX interrupt here by just calling uart_xmitchars() with
* interrupts disabled (note this may recurse).
*/
@ -1222,9 +1236,9 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
{
priv->ier &= ~UART_IER_THR;
up_serialout(priv, AM335X_UART_IER_OFFSET, priv->ier);
}
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->spinlock, flags);
}
}
/****************************************************************************

View file

@ -35,6 +35,7 @@
#include "arm.h"
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -90,8 +91,8 @@ void up_schedule_sigaction(struct tcb_s *tcb)
{
/* In this case just deliver the signal now. */
(tcb->sigdeliver)(tcb);
tcb->sigdeliver = NULL;
nxsig_deliver(tcb);
tcb->flags &= ~TCB_FLAG_SIGDELIVER;
}
/* Otherwise, we are (1) signaling a task is not running

View file

@ -37,6 +37,7 @@
#include <arch/board/board.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -59,9 +60,9 @@ void arm_sigdeliver(void)
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
DEBUGASSERT(rtcb->sigdeliver != NULL);
sinfo("rtcb=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigpendactionq.head);
DEBUGASSERT((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0);
#ifndef CONFIG_SUPPRESS_INTERRUPTS
/* Then make sure that interrupts are enabled. Signal handlers must always
@ -73,7 +74,7 @@ void arm_sigdeliver(void)
/* Deliver the signal */
(rtcb->sigdeliver)(rtcb);
nxsig_deliver(rtcb);
/* Output any debug messages BEFORE restoring errno (because they may
* alter errno), then disable interrupts again and restore the original
@ -93,7 +94,9 @@ void arm_sigdeliver(void)
* could be modified by a hostile program.
*/
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
/* Allows next handler to be scheduled */
rtcb->flags &= ~TCB_FLAG_SIGDELIVER;
/* Then restore the correct state for this thread of execution. */

View file

@ -34,6 +34,7 @@
#include <nuttx/board.h>
#include <arch/board/board.h>
#include <sched/sched.h>
#include <signal/signal.h>
#include "arm_internal.h"
#include "exc_return.h"
@ -86,7 +87,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
irq_dispatch(irq, regs);
#endif
if (tcb->sigdeliver)
if ((tcb->flags & TCB_FLAG_SIGDELIVER) != 0)
{
/* Pendsv able to access running tcb with no critical section */

View file

@ -31,11 +31,18 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/spinlock.h>
#include "ram_vectors.h"
#ifdef CONFIG_ARCH_RAMVECTORS
/****************************************************************************
* Private Data
****************************************************************************/
static spinlock_t g_ramvec_lock = SP_UNLOCKED;
/****************************************************************************
* Public Functions
****************************************************************************/
@ -68,7 +75,7 @@ int arm_ramvec_attach(int irq, up_vector_t vector)
* common exception handler.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_ramvec_lock);
if (vector == NULL)
{
/* Disable the interrupt if we can before detaching it. We might
@ -87,7 +94,7 @@ int arm_ramvec_attach(int irq, up_vector_t vector)
/* Save the new vector in the vector table */
g_ram_vectors[irq] = vector;
leave_critical_section(flags);
spin_unlock_irqrestore(&g_ramvec_lock, flags);
ret = OK;
}

View file

@ -37,6 +37,7 @@
#include "psr.h"
#include "exc_return.h"
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
#include "irq/irq.h"
#include "nvic.h"
@ -96,8 +97,8 @@ void up_schedule_sigaction(struct tcb_s *tcb)
* REVISIT: Signal handle will run in a critical section!
*/
(tcb->sigdeliver)(tcb);
tcb->sigdeliver = NULL;
nxsig_deliver(tcb);
tcb->flags &= ~TCB_FLAG_SIGDELIVER;
}
else if (tcb == rtcb && ipsr != NVIC_IRQ_PENDSV)
{

View file

@ -37,6 +37,7 @@
#include <arch/board/board.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -69,9 +70,9 @@ void arm_sigdeliver(void)
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
DEBUGASSERT(rtcb->sigdeliver != NULL);
sinfo("rtcb=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigpendactionq.head);
DEBUGASSERT((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0);
retry:
#ifdef CONFIG_SMP
@ -103,7 +104,7 @@ retry:
/* Deliver the signal */
(rtcb->sigdeliver)(rtcb);
nxsig_deliver(rtcb);
/* Output any debug messages BEFORE restoring errno (because they may
* alter errno), then disable interrupts again and restore the original
@ -150,7 +151,9 @@ retry:
* could be modified by a hostile program.
*/
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
/* Allows next handler to be scheduled */
rtcb->flags &= ~TCB_FLAG_SIGDELIVER;
/* Then restore the correct state for this thread of
* execution.

View file

@ -35,7 +35,7 @@ else ifeq ($(CONFIG_ARCH_CORTEXA9),y)
endif
ifeq ($(CONFIG_ARM_THUMB),y)
LLVM_ARCHTYPE := thumbv7
LLVM_ARCHTYPE := thumbv7a
else
LLVM_ARCHTYPE := armv7a
endif

View file

@ -38,6 +38,7 @@
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/spinlock.h>
#include "arm_internal.h"
#include "barriers.h"
@ -225,6 +226,12 @@
#define PL310_GULP_SIZE 4096
/****************************************************************************
* Private Data
****************************************************************************/
static spinlock_t g_l2cc_lock = SP_UNLOCKED;
/****************************************************************************
* Private Functions
****************************************************************************/
@ -262,6 +269,66 @@ static void pl310_flush_all(void)
putreg32(0, L2CC_CSR);
}
/****************************************************************************
* Name: l2cc_disable_nolock
*
* Description:
* Disable the L2CC-P310 L2 cache by clearing the Control Register (CR)
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
static void l2cc_disable_nolock(void)
{
/* Flush all ways using the Clean Invalidate Way Register (CIWR). */
pl310_flush_all();
/* Disable the L2CC-P310 L2 cache by clearing the Control Register (CR) */
putreg32(0, L2CC_CR);
ARM_DSB();
ARM_ISB();
}
/****************************************************************************
* Name: l2cc_invalidate_all_nolock
*
* Description:
* Invalidate all ways using the Invalidate Way Register (IWR).
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
static void l2cc_invalidate_all_nolock(void)
{
/* Invalidate all ways by writing the bit mask of ways to be invalidated
* the Invalidate Way Register (IWR).
*/
putreg32(PL310_WAY_MASK, L2CC_IWR);
/* Wait for cache operation by way to complete */
while ((getreg32(L2CC_IWR) & PL310_WAY_MASK) != 0);
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
putreg32(0, L2CC_CSR);
}
/****************************************************************************
* Public Functions
****************************************************************************/
@ -457,18 +524,18 @@ void l2cc_enable(void)
/* Invalidate and enable the cache (must be disabled to do this!) */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
if ((getreg32(L2CC_CR) & L2CC_CR_L2CEN) != 0)
{
l2cc_disable();
l2cc_disable_nolock();
}
l2cc_invalidate_all();
l2cc_invalidate_all_nolock();
putreg32(L2CC_CR_L2CEN, L2CC_CR);
ARM_DSB();
ARM_ISB();
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -489,17 +556,11 @@ void l2cc_disable(void)
{
irqstate_t flags;
/* Flush all ways using the Clean Invalidate Way Register (CIWR). */
flags = spin_lock_irqsave(&g_l2cc_lock);
flags = enter_critical_section();
pl310_flush_all();
l2cc_disable_nolock();
/* Disable the L2CC-P310 L2 cache by clearing the Control Register (CR) */
putreg32(0, L2CC_CR);
ARM_DSB();
ARM_ISB();
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -525,9 +586,9 @@ void l2cc_sync(void)
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -548,27 +609,11 @@ void l2cc_invalidate_all(void)
{
irqstate_t flags;
/* Invalidate all ways */
flags = spin_lock_irqsave(&g_l2cc_lock);
flags = enter_critical_section();
l2cc_invalidate_all_nolock();
/* Invalidate all ways by writing the bit mask of ways to be invalidated
* the Invalidate Way Register (IWR).
*/
putreg32(PL310_WAY_MASK, L2CC_IWR);
/* Wait for cache operation by way to complete */
while ((getreg32(L2CC_IWR) & PL310_WAY_MASK) != 0);
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -595,7 +640,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
/* Check if the start address is aligned with a cacheline */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
if ((startaddr & PL310_CACHE_LINE_MASK) != 0)
{
/* No.. align down and flush the cache line by writing the address to
@ -622,7 +667,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
putreg32(endaddr, L2CC_CIPALR);
}
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
/* Loop, invalidated the address range by cache line. Interrupts are re-
* enabled momentarily every PL310_GULP_SIZE bytes.
@ -640,7 +685,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
/* Disable interrupts and invalidate the gulp */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
while (startaddr < gulpend)
{
/* Invalidate the cache line by writing the address to the
@ -656,16 +701,16 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
/* Enable interrupts momentarily */
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -690,7 +735,7 @@ void l2cc_clean_all(void)
* Ways Register (CWR).
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(PL310_WAY_MASK, L2CC_CWR);
/* Wait for cache operation by way to complete */
@ -702,7 +747,7 @@ void l2cc_clean_all(void)
*/
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -758,7 +803,7 @@ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr)
/* Disable interrupts and clean the gulp */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
while (startaddr < gulpend)
{
/* Clean the cache line by writing the address to the Clean
@ -774,16 +819,16 @@ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr)
/* Enable interrupts momentarily */
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -806,9 +851,9 @@ void l2cc_flush_all(void)
/* Flush all ways using the Clean Invalidate Way Register (CIWR). */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
pl310_flush_all();
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -864,7 +909,7 @@ void l2cc_flush(uint32_t startaddr, uint32_t endaddr)
/* Disable interrupts and flush the gulp */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
while (startaddr < gulpend)
{
/* Flush the cache line by writing the address to the Clean
@ -880,16 +925,16 @@ void l2cc_flush(uint32_t startaddr, uint32_t endaddr)
/* Enable interrupts momentarily */
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
#endif /* CONFIG_ARMV7A_L2CC_PL310 */

View file

@ -36,6 +36,7 @@
#include "arm.h"
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
#include "irq/irq.h"
@ -94,8 +95,8 @@ void up_schedule_sigaction(struct tcb_s *tcb)
* REVISIT: Signal handler will run in a critical section!
*/
(tcb->sigdeliver)(tcb);
tcb->sigdeliver = NULL;
nxsig_deliver(tcb);
tcb->flags &= ~TCB_FLAG_SIGDELIVER;
}
else
{

View file

@ -37,6 +37,7 @@
#include <arch/board/board.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -69,9 +70,9 @@ void arm_sigdeliver(void)
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
DEBUGASSERT(rtcb->sigdeliver != NULL);
sinfo("rtcb=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigpendactionq.head);
DEBUGASSERT((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0);
retry:
#ifdef CONFIG_SMP
@ -103,7 +104,7 @@ retry:
/* Deliver the signal */
(rtcb->sigdeliver)(rtcb);
nxsig_deliver(rtcb);
/* Output any debug messages BEFORE restoring errno (because they may
* alter errno), then disable interrupts again and restore the original
@ -150,7 +151,9 @@ retry:
* could be modified by a hostile program.
*/
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
/* Allows next handler to be scheduled */
rtcb->flags &= ~TCB_FLAG_SIGDELIVER;
/* Then restore the correct state for this thread of execution. */

View file

@ -410,7 +410,7 @@ uint32_t *arm_syscall(uint32_t *regs)
/* Copy "info" into user stack */
if (rtcb->sigdeliver)
if ((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0)
{
usp = rtcb->xcp.saved_regs[REG_SP];
}

View file

@ -34,6 +34,7 @@
#include <nuttx/board.h>
#include <arch/board/board.h>
#include <sched/sched.h>
#include <signal/signal.h>
#include "arm_internal.h"
#include "exc_return.h"
@ -86,7 +87,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
irq_dispatch(irq, regs);
#endif
if (tcb->sigdeliver)
if ((tcb->flags & TCB_FLAG_SIGDELIVER) != 0)
{
/* Pendsv able to access running tcb with no critical section */

View file

@ -31,11 +31,18 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/spinlock.h>
#include "ram_vectors.h"
#ifdef CONFIG_ARCH_RAMVECTORS
/****************************************************************************
* Private Data
****************************************************************************/
static spinlock_t g_ramvec_lock = SP_UNLOCKED;
/****************************************************************************
* Public Functions
****************************************************************************/
@ -68,7 +75,7 @@ int arm_ramvec_attach(int irq, up_vector_t vector)
* common exception handler.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_ramvec_lock);
if (vector == NULL)
{
/* Disable the interrupt if we can before detaching it. We might
@ -87,7 +94,7 @@ int arm_ramvec_attach(int irq, up_vector_t vector)
/* Save the new vector in the vector table */
g_ram_vectors[irq] = vector;
leave_critical_section(flags);
spin_unlock_irqrestore(&g_ramvec_lock, flags);
ret = OK;
}

View file

@ -38,6 +38,7 @@
#include "psr.h"
#include "exc_return.h"
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
#include "irq/irq.h"
#include "nvic.h"
@ -97,8 +98,8 @@ void up_schedule_sigaction(struct tcb_s *tcb)
* REVISIT: Signal handle will run in a critical section!
*/
(tcb->sigdeliver)(tcb);
tcb->sigdeliver = NULL;
nxsig_deliver(tcb);
tcb->flags &= ~TCB_FLAG_SIGDELIVER;
}
else if (tcb == rtcb && ipsr != NVIC_IRQ_PENDSV)
{

View file

@ -37,6 +37,7 @@
#include <arch/board/board.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -69,9 +70,9 @@ void arm_sigdeliver(void)
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
DEBUGASSERT(rtcb->sigdeliver != NULL);
sinfo("rtcb=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigpendactionq.head);
DEBUGASSERT((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0);
retry:
#ifdef CONFIG_SMP
@ -103,7 +104,7 @@ retry:
/* Deliver the signal */
(rtcb->sigdeliver)(rtcb);
nxsig_deliver(rtcb);
/* Output any debug messages BEFORE restoring errno (because they may
* alter errno), then disable interrupts again and restore the original
@ -150,7 +151,9 @@ retry:
* could be modified by a hostile program.
*/
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
/* Allows next handler to be scheduled */
rtcb->flags &= ~TCB_FLAG_SIGDELIVER;
/* Then restore the correct state for this thread of
* execution.

View file

@ -38,6 +38,7 @@
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/spinlock.h>
#include "arm_internal.h"
#include "barriers.h"
@ -225,6 +226,12 @@
#define PL310_GULP_SIZE 4096
/****************************************************************************
* Private Data
****************************************************************************/
static volatile spinlock_t g_l2cc_lock = SP_UNLOCKED;
/****************************************************************************
* Private Functions
****************************************************************************/
@ -262,6 +269,66 @@ static void pl310_flush_all(void)
putreg32(0, L2CC_CSR);
}
/****************************************************************************
* Name: l2cc_disable_nolock
*
* Description:
* Disable the L2CC-P310 L2 cache by clearing the Control Register (CR)
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
static void l2cc_disable_nolock(void)
{
/* Flush all ways using the Clean Invalidate Way Register (CIWR). */
pl310_flush_all();
/* Disable the L2CC-P310 L2 cache by clearing the Control Register (CR) */
putreg32(0, L2CC_CR);
ARM_DSB();
ARM_ISB();
}
/****************************************************************************
* Name: l2cc_invalidate_all_nolock
*
* Description:
* Invalidate all ways using the Invalidate Way Register (IWR).
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
static void l2cc_invalidate_all_nolock(void)
{
/* Invalidate all ways by writing the bit mask of ways to be invalidated
* the Invalidate Way Register (IWR).
*/
putreg32(PL310_WAY_MASK, L2CC_IWR);
/* Wait for cache operation by way to complete */
while ((getreg32(L2CC_IWR) & PL310_WAY_MASK) != 0);
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
putreg32(0, L2CC_CSR);
}
/****************************************************************************
* Public Functions
****************************************************************************/
@ -457,18 +524,18 @@ void l2cc_enable(void)
/* Invalidate and enable the cache (must be disabled to do this!) */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
if ((getreg32(L2CC_CR) & L2CC_CR_L2CEN) != 0)
{
l2cc_disable();
l2cc_disable_nolock();
}
l2cc_invalidate_all();
l2cc_invalidate_all_nolock();
putreg32(L2CC_CR_L2CEN, L2CC_CR);
ARM_DSB();
ARM_ISB();
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -489,17 +556,11 @@ void l2cc_disable(void)
{
irqstate_t flags;
/* Flush all ways using the Clean Invalidate Way Register (CIWR). */
flags = spin_lock_irqsave(&g_l2cc_lock);
flags = enter_critical_section();
pl310_flush_all();
l2cc_disable_nolock();
/* Disable the L2CC-P310 L2 cache by clearing the Control Register (CR) */
putreg32(0, L2CC_CR);
ARM_DSB();
ARM_ISB();
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -525,9 +586,9 @@ void l2cc_sync(void)
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -548,27 +609,11 @@ void l2cc_invalidate_all(void)
{
irqstate_t flags;
/* Invalidate all ways */
flags = spin_lock_irqsave(&g_l2cc_lock);
flags = enter_critical_section();
l2cc_invalidate_all_nolock();
/* Invalidate all ways by writing the bit mask of ways to be invalidated
* the Invalidate Way Register (IWR).
*/
putreg32(PL310_WAY_MASK, L2CC_IWR);
/* Wait for cache operation by way to complete */
while ((getreg32(L2CC_IWR) & PL310_WAY_MASK) != 0);
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -595,7 +640,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
/* Check if the start address is aligned with a cacheline */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
if ((startaddr & PL310_CACHE_LINE_MASK) != 0)
{
/* No.. align down and flush the cache line by writing the address to
@ -622,7 +667,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
putreg32(endaddr, L2CC_CIPALR);
}
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
/* Loop, invalidated the address range by cache line. Interrupts are re-
* enabled momentarily every PL310_GULP_SIZE bytes.
@ -640,7 +685,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
/* Disable interrupts and invalidate the gulp */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
while (startaddr < gulpend)
{
/* Invalidate the cache line by writing the address to the
@ -656,16 +701,16 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
/* Enable interrupts momentarily */
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -690,7 +735,7 @@ void l2cc_clean_all(void)
* Ways Register (CWR).
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(PL310_WAY_MASK, L2CC_CWR);
/* Wait for cache operation by way to complete */
@ -702,7 +747,7 @@ void l2cc_clean_all(void)
*/
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -758,7 +803,7 @@ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr)
/* Disable interrupts and clean the gulp */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
while (startaddr < gulpend)
{
/* Clean the cache line by writing the address to the Clean
@ -774,16 +819,16 @@ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr)
/* Enable interrupts momentarily */
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -806,9 +851,9 @@ void l2cc_flush_all(void)
/* Flush all ways using the Clean Invalidate Way Register (CIWR). */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
pl310_flush_all();
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -864,7 +909,7 @@ void l2cc_flush(uint32_t startaddr, uint32_t endaddr)
/* Disable interrupts and flush the gulp */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
while (startaddr < gulpend)
{
/* Flush the cache line by writing the address to the Clean
@ -880,16 +925,16 @@ void l2cc_flush(uint32_t startaddr, uint32_t endaddr)
/* Enable interrupts momentarily */
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
#endif /* CONFIG_ARMV7R_L2CC_PL310 */

View file

@ -35,6 +35,7 @@
#include "arm.h"
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -92,8 +93,8 @@ void up_schedule_sigaction(struct tcb_s *tcb)
* REVISIT: Signal handler will run in a critical section!
*/
(tcb->sigdeliver)(tcb);
tcb->sigdeliver = NULL;
nxsig_deliver(tcb);
tcb->flags &= ~TCB_FLAG_SIGDELIVER;
}
else
{

View file

@ -37,6 +37,7 @@
#include <arch/board/board.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -69,9 +70,9 @@ void arm_sigdeliver(void)
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
DEBUGASSERT(rtcb->sigdeliver != NULL);
sinfo("rtcb=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigpendactionq.head);
DEBUGASSERT((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0);
retry:
#ifdef CONFIG_SMP
@ -103,7 +104,7 @@ retry:
/* Deliver the signal */
(rtcb->sigdeliver)(rtcb);
nxsig_deliver(rtcb);
/* Output any debug messages BEFORE restoring errno (because they may
* alter errno), then disable interrupts again and restore the original
@ -147,7 +148,9 @@ retry:
* could be modified by a hostile program.
*/
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
/* Allows next handler to be scheduled */
rtcb->flags &= ~TCB_FLAG_SIGDELIVER;
/* Then restore the correct state for this thread of execution. */

View file

@ -407,7 +407,7 @@ uint32_t *arm_syscall(uint32_t *regs)
/* Copy "info" into user stack */
if (rtcb->sigdeliver)
if ((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0)
{
usp = rtcb->xcp.saved_regs[REG_SP];
}

View file

@ -97,7 +97,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
irq_dispatch(irq, regs);
#endif
if (tcb->sigdeliver)
if ((tcb->flags & TCB_FLAG_SIGDELIVER) != 0)
{
/* Pendsv able to access running tcb with no critical section */

View file

@ -31,11 +31,18 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/spinlock.h>
#include "ram_vectors.h"
#ifdef CONFIG_ARCH_RAMVECTORS
/****************************************************************************
* Private Data
****************************************************************************/
static spinlock_t g_ramvec_lock = SP_UNLOCKED;
/****************************************************************************
* Public Functions
****************************************************************************/
@ -68,7 +75,7 @@ int arm_ramvec_attach(int irq, up_vector_t vector)
* common exception handler.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_ramvec_lock);
if (vector == NULL)
{
/* Disable the interrupt if we can before detaching it. We might
@ -87,7 +94,7 @@ int arm_ramvec_attach(int irq, up_vector_t vector)
/* Save the new vector in the vector table */
g_ram_vectors[irq] = vector;
leave_critical_section(flags);
spin_unlock_irqrestore(&g_ramvec_lock, flags);
ret = OK;
}

View file

@ -38,6 +38,7 @@
#include "psr.h"
#include "exc_return.h"
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
#include "irq/irq.h"
#include "nvic.h"
@ -97,8 +98,8 @@ void up_schedule_sigaction(struct tcb_s *tcb)
* REVISIT: Signal handle will run in a critical section!
*/
(tcb->sigdeliver)(tcb);
tcb->sigdeliver = NULL;
nxsig_deliver(tcb);
tcb->flags &= ~TCB_FLAG_SIGDELIVER;
}
else if (tcb == rtcb && ipsr != NVIC_IRQ_PENDSV)
{

View file

@ -37,6 +37,7 @@
#include <arch/board/board.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -69,9 +70,9 @@ void arm_sigdeliver(void)
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
DEBUGASSERT(rtcb->sigdeliver != NULL);
sinfo("rtcb=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigpendactionq.head);
DEBUGASSERT((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0);
retry:
#ifdef CONFIG_SMP
@ -103,7 +104,7 @@ retry:
/* Deliver the signal */
(rtcb->sigdeliver)(rtcb);
nxsig_deliver(rtcb);
/* Output any debug messages BEFORE restoring errno (because they may
* alter errno), then disable interrupts again and restore the original
@ -150,7 +151,9 @@ retry:
* could be modified by a hostile program.
*/
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
/* Allows next handler to be scheduled */
rtcb->flags &= ~TCB_FLAG_SIGDELIVER;
/* Then restore the correct state for this thread of
* execution.

View file

@ -38,6 +38,7 @@
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/spinlock.h>
#include "arm_internal.h"
#include "barriers.h"
@ -225,6 +226,12 @@
#define PL310_GULP_SIZE 4096
/****************************************************************************
* Private Data
****************************************************************************/
static volatile spinlock_t g_l2cc_lock = SP_UNLOCKED;
/****************************************************************************
* Private Functions
****************************************************************************/
@ -262,6 +269,66 @@ static void pl310_flush_all(void)
putreg32(0, L2CC_CSR);
}
/****************************************************************************
* Name: l2cc_disable_nolock
*
* Description:
* Disable the L2CC-P310 L2 cache by clearing the Control Register (CR)
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
static void l2cc_disable_nolock(void)
{
/* Flush all ways using the Clean Invalidate Way Register (CIWR). */
pl310_flush_all();
/* Disable the L2CC-P310 L2 cache by clearing the Control Register (CR) */
putreg32(0, L2CC_CR);
ARM_DSB();
ARM_ISB();
}
/****************************************************************************
* Name: l2cc_invalidate_all_nolock
*
* Description:
* Invalidate all ways using the Invalidate Way Register (IWR).
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
static void l2cc_invalidate_all_nolock(void)
{
/* Invalidate all ways by writing the bit mask of ways to be invalidated
* the Invalidate Way Register (IWR).
*/
putreg32(PL310_WAY_MASK, L2CC_IWR);
/* Wait for cache operation by way to complete */
while ((getreg32(L2CC_IWR) & PL310_WAY_MASK) != 0);
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
putreg32(0, L2CC_CSR);
}
/****************************************************************************
* Public Functions
****************************************************************************/
@ -457,18 +524,18 @@ void l2cc_enable(void)
/* Invalidate and enable the cache (must be disabled to do this!) */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
if ((getreg32(L2CC_CR) & L2CC_CR_L2CEN) != 0)
{
l2cc_disable();
l2cc_disable_nolock();
}
l2cc_invalidate_all();
l2cc_invalidate_all_nolock();
putreg32(L2CC_CR_L2CEN, L2CC_CR);
ARM_DSB();
ARM_ISB();
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -489,17 +556,11 @@ void l2cc_disable(void)
{
irqstate_t flags;
/* Flush all ways using the Clean Invalidate Way Register (CIWR). */
flags = spin_lock_irqsave(&g_l2cc_lock);
flags = enter_critical_section();
pl310_flush_all();
l2cc_disable_nolock();
/* Disable the L2CC-P310 L2 cache by clearing the Control Register (CR) */
putreg32(0, L2CC_CR);
ARM_DSB();
ARM_ISB();
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -525,9 +586,9 @@ void l2cc_sync(void)
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -548,27 +609,11 @@ void l2cc_invalidate_all(void)
{
irqstate_t flags;
/* Invalidate all ways */
flags = spin_lock_irqsave(&g_l2cc_lock);
flags = enter_critical_section();
l2cc_invalidate_all_nolock();
/* Invalidate all ways by writing the bit mask of ways to be invalidated
* the Invalidate Way Register (IWR).
*/
putreg32(PL310_WAY_MASK, L2CC_IWR);
/* Wait for cache operation by way to complete */
while ((getreg32(L2CC_IWR) & PL310_WAY_MASK) != 0);
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -595,7 +640,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
/* Check if the start address is aligned with a cacheline */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
if ((startaddr & PL310_CACHE_LINE_MASK) != 0)
{
/* No.. align down and flush the cache line by writing the address to
@ -622,7 +667,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
putreg32(endaddr, L2CC_CIPALR);
}
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
/* Loop, invalidated the address range by cache line. Interrupts are re-
* enabled momentarily every PL310_GULP_SIZE bytes.
@ -640,7 +685,7 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
/* Disable interrupts and invalidate the gulp */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
while (startaddr < gulpend)
{
/* Invalidate the cache line by writing the address to the
@ -656,16 +701,16 @@ void l2cc_invalidate(uintptr_t startaddr, uintptr_t endaddr)
/* Enable interrupts momentarily */
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -690,7 +735,7 @@ void l2cc_clean_all(void)
* Ways Register (CWR).
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(PL310_WAY_MASK, L2CC_CWR);
/* Wait for cache operation by way to complete */
@ -702,7 +747,7 @@ void l2cc_clean_all(void)
*/
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -758,7 +803,7 @@ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr)
/* Disable interrupts and clean the gulp */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
while (startaddr < gulpend)
{
/* Clean the cache line by writing the address to the Clean
@ -774,16 +819,16 @@ void l2cc_clean(uintptr_t startaddr, uintptr_t endaddr)
/* Enable interrupts momentarily */
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -806,9 +851,9 @@ void l2cc_flush_all(void)
/* Flush all ways using the Clean Invalidate Way Register (CIWR). */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
pl310_flush_all();
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/****************************************************************************
@ -864,7 +909,7 @@ void l2cc_flush(uint32_t startaddr, uint32_t endaddr)
/* Disable interrupts and flush the gulp */
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
while (startaddr < gulpend)
{
/* Flush the cache line by writing the address to the Clean
@ -880,16 +925,16 @@ void l2cc_flush(uint32_t startaddr, uint32_t endaddr)
/* Enable interrupts momentarily */
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
/* Drain the STB. Operation complete when all buffers, LRB, LFB, STB, and
* EB, are empty.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave(&g_l2cc_lock);
putreg32(0, L2CC_CSR);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_l2cc_lock, flags);
}
#endif /* CONFIG_ARMV8R_L2CC_PL310 */

View file

@ -35,6 +35,7 @@
#include "arm.h"
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -92,8 +93,8 @@ void up_schedule_sigaction(struct tcb_s *tcb)
* REVISIT: Signal handler will run in a critical section!
*/
(tcb->sigdeliver)(tcb);
tcb->sigdeliver = NULL;
nxsig_deliver(tcb);
tcb->flags &= ~TCB_FLAG_SIGDELIVER;
}
else
{

View file

@ -37,6 +37,7 @@
#include <arch/board/board.h>
#include "sched/sched.h"
#include "signal/signal.h"
#include "arm_internal.h"
/****************************************************************************
@ -69,9 +70,9 @@ void arm_sigdeliver(void)
board_autoled_on(LED_SIGNAL);
sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigdeliver, rtcb->sigpendactionq.head);
DEBUGASSERT(rtcb->sigdeliver != NULL);
sinfo("rtcb=%p sigpendactionq.head=%p\n",
rtcb, rtcb->sigpendactionq.head);
DEBUGASSERT((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0);
retry:
#ifdef CONFIG_SMP
@ -103,7 +104,7 @@ retry:
/* Deliver the signal */
(rtcb->sigdeliver)(rtcb);
nxsig_deliver(rtcb);
/* Output any debug messages BEFORE restoring errno (because they may
* alter errno), then disable interrupts again and restore the original
@ -147,7 +148,9 @@ retry:
* could be modified by a hostile program.
*/
rtcb->sigdeliver = NULL; /* Allows next handler to be scheduled */
/* Allows next handler to be scheduled */
rtcb->flags &= ~TCB_FLAG_SIGDELIVER;
/* Then restore the correct state for this thread of execution. */

View file

@ -407,7 +407,7 @@ uint32_t *arm_syscall(uint32_t *regs)
/* Copy "info" into user stack */
if (rtcb->sigdeliver)
if ((rtcb->flags & TCB_FLAG_SIGDELIVER) != 0)
{
usp = rtcb->xcp.saved_regs[REG_SP];
}

View file

@ -36,7 +36,6 @@
#include <errno.h>
#include <assert.h>
#include <debug.h>
#include <unistd.h>
#include <arch/board/board.h>
#include <nuttx/irq.h>

View file

@ -34,7 +34,6 @@
#include <string.h>
#include <assert.h>
#include <debug.h>
#include <assert.h>
#include <errno.h>
#include <arpa/inet.h>

View file

@ -21,3 +21,8 @@
# ##############################################################################
add_compile_options(-mcpu=cortex-m0 -mthumb -mfloat-abi=soft)
# LLVM Configuration
set(LLVM_ARCHTYPE thumbv6m)
set(LLVM_ABITYPE eabi)
set(LLVM_CPUTYPE cortex-m0)

View file

@ -24,24 +24,43 @@ set(PLATFORM_FLAGS)
if(CONFIG_ARCH_CORTEXA5)
list(APPEND PLATFORM_FLAGS -mcpu=cortex-a5)
set(LLVM_CPUTYPE cortex-a5)
elseif(CONFIG_ARCH_CORTEXA7)
list(APPEND PLATFORM_FLAGS -mcpu=cortex-a7)
set(LLVM_CPUTYPE cortex-a7)
elseif(CONFIG_ARCH_CORTEXA8)
list(APPEND PLATFORM_FLAGS -mcpu=cortex-a8)
set(LLVM_CPUTYPE cortex-a8)
elseif(CONFIG_ARCH_CORTEXA9)
list(APPEND PLATFORM_FLAGS -mcpu=cortex-a9)
set(LLVM_CPUTYPE cortex-a9)
endif()
if(CONFIG_ARM_THUMB)
set(LLVM_ARCHTYPE thumbv7a)
else()
set(LLVM_ARCHTYPE armv7-a)
endif()
if(CONFIG_ARCH_FPU)
set(LLVM_ABITYPE eabihf)
else()
set(LLVM_ABITYPE eabi)
endif()
if(NOT CONFIG_ARM_DPFPU32)
set(ARCHFPUD16 -d16)
endif()
# Cortex-A5 | -mfpu=vfpv4-fp16 | -mfpu=vfpv4-d16-fp16 | -mfpu=neon-fp16
# Cortex-A7 | -mfpu=vfpv4 | -mfpu=vfpv4-d16 | -mfpu=neon-vfpv4
# Cortex-A8 | -mfpu=vfpv3 | | -mfpu=neon (alias for
# neon-vfpv3) Cortex-A9 | -mfpu=vfpv3-fp16 | -mfpu=vfpv3-d16-fp16 |
# -mfpu=neon-fp16 Cortex-A15 | -mfpu=vfpv4 | |
# -mfpu=neon-vfpv4
# ~~~
# | Cortex | FPU Option 1 | FPU Option 2 | FPU Option 3 |
# |--------|--------------------|------------------------|-----------------------|
# | A5 | -mfpu=vfpv4-fp16 | -mfpu=vfpv4-d16-fp16 | -mfpu=neon-fp16 |
# | A7 | -mfpu=vfpv4 | -mfpu=vfpv4-d16 | -mfpu=neon-vfpv4 |
# | A8 | -mfpu=vfpv3 | | -mfpu=neon (alias for neon-vfpv3) |
# | A9 | -mfpu=vfpv3-fp16 | -mfpu=vfpv3-d16-fp16 | -mfpu=neon-fp16 |
# | A15 | -mfpu=vfpv4 | | -mfpu=neon-vfpv4 |
# ~~~
if(CONFIG_ARCH_FPU)
if(CONFIG_ARM_FPU_ABI_SOFT)

View file

@ -38,4 +38,23 @@ else() # gcc
set(TOOLCHAIN_ARCH_FILE armv7-m_gcc)
endif()
# LLVM Configuration
if(CONFIG_ARCH_CORTEXM3)
set(LLVM_ARCHTYPE thumbv7m)
set(LLVM_CPUTYPE cortex-m3)
else()
set(LLVM_ARCHTYPE thumbv7em)
if(CONFIG_ARCH_CORTEXM4)
set(LLVM_CPUTYPE cortex-m4)
elseif(CONFIG_ARCH_CORTEXM7)
set(LLVM_CPUTYPE cortex-m7)
endif()
endif()
if(CONFIG_ARCH_FPU)
set(LLVM_ABITYPE eabihf)
else()
set(LLVM_ABITYPE eabi)
endif()
include(${TOOLCHAIN_ARCH_FILE})

View file

@ -22,6 +22,31 @@
set(PLATFORM_FLAGS)
# LLVM Configuration
if(CONFIG_ARCH_CORTEXM23)
set(LLVM_ARCHTYPE thumbv8m.base)
set(LLVM_CPUTYPE cortex-m23)
elseif(CONFIG_ARCH_CORTEXM33)
set(LLVM_ARCHTYPE thumbv8m.main)
set(LLVM_CPUTYPE cortex-m33)
elseif(CONFIG_ARCH_CORTEXM35P)
set(LLVM_ARCHTYPE thumbv8m.main)
set(LLVM_CPUTYPE cortex-m35p)
elseif(CONFIG_ARCH_CORTEXM55)
set(LLVM_ARCHTYPE thumbv8.1m.main)
set(LLVM_CPUTYPE cortex-m55)
elseif(CONFIG_ARCH_CORTEXM85)
set(LLVM_ARCHTYPE thumbv8.1m.main)
set(LLVM_CPUTYPE cortex-m85)
endif()
# Set ABI type based on FPU configuration
if(CONFIG_ARCH_FPU)
set(LLVM_ABITYPE eabihf)
else()
set(LLVM_ABITYPE eabi)
endif()
if(CONFIG_ARM_DSP)
set(EXTCPUFLAGS +dsp)
endif()

View file

@ -546,7 +546,9 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
LDELFFLAGS += -r
ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
LDELFFLAGS += -r
endif
endif
LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)

View file

@ -43,16 +43,6 @@
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_getusrsp
****************************************************************************/
uintptr_t up_getusrsp(void *regs)
{
uint32_t *ptr = regs;
return ptr[REG_SP];
}
/****************************************************************************
* Name: up_dump_register
****************************************************************************/

View file

@ -29,7 +29,6 @@
#include <nuttx/config.h>
#include <assert.h>
#include <debug.h>
#include <sys/types.h>
#include <stdio.h>

View file

@ -27,7 +27,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <sys/types.h>
#include <stdio.h>

View file

@ -399,10 +399,14 @@ time_t up_rtc_time(void)
#ifdef CONFIG_RTC_HIRES
int up_rtc_gettime(struct timespec *tp)
{
irqstate_t flags;
uint64_t count;
count = cxd56_rtc_count();
flags = spin_lock_irqsave(&g_rtc_lock);
count = cxd56_rtc_count_nolock();
count += g_rtc_save->offset;
spin_unlock_irqrestore(&g_rtc_lock, flags);
/* Then we can save the time in seconds and fractional seconds. */
@ -477,21 +481,28 @@ int up_rtc_settime(const struct timespec *tp)
*
****************************************************************************/
uint64_t cxd56_rtc_count(void)
uint64_t cxd56_rtc_count_nolock(void)
{
uint64_t val;
irqstate_t flags;
/* The pre register is latched with reading the post rtcounter register,
* so these registers always have to been read in the below order,
* 1st post -> 2nd pre, and should be operated in atomic.
*/
flags = spin_lock_irqsave(&g_rtc_lock);
val = (uint64_t)getreg32(CXD56_RTC0_RTPOSTCNT) << 15;
val |= getreg32(CXD56_RTC0_RTPRECNT);
return val;
}
uint64_t cxd56_rtc_count(void)
{
uint64_t val;
irqstate_t flags;
flags = spin_lock_irqsave(&g_rtc_lock);
val = cxd56_rtc_count_nolock();
spin_unlock_irqrestore(&g_rtc_lock, flags);
return val;

View file

@ -92,6 +92,7 @@ extern "C"
****************************************************************************/
uint64_t cxd56_rtc_count(void);
uint64_t cxd56_rtc_count_nolock(void);
/****************************************************************************
* Name: cxd56_rtc_almcount

View file

@ -35,7 +35,6 @@
#include <errno.h>
#include <assert.h>
#include <debug.h>
#include <unistd.h>
#include <arch/board/board.h>
#include <nuttx/irq.h>

View file

@ -33,7 +33,6 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <arch/armv7-m/nvicpri.h>
#include "nvic.h"

View file

@ -134,6 +134,7 @@ struct efm32_leuart_s
{
const struct efm32_config_s *config;
uint16_t ien; /* Interrupts enabled */
spinlock_t lock; /* Spinlock */
};
/****************************************************************************
@ -212,6 +213,7 @@ static const struct efm32_config_s g_leuart0config =
static struct efm32_leuart_s g_leuart0priv =
{
.config = &g_leuart0config,
.lock = SP_UNLOCKED
};
static struct uart_dev_s g_leuart0port =
@ -247,6 +249,7 @@ static struct efm32_config_s g_leuart1config =
static struct efm32_leuart_s g_leuart1priv =
{
.config = &g_leuart1config,
.lock = SP_UNLOCKED
};
static struct uart_dev_s g_leuart1port =
@ -303,6 +306,17 @@ static inline void efm32_setuartint(struct efm32_leuart_s *priv)
* Name: efm32_restoreuartint
****************************************************************************/
static void efm32_restoreuartint_nolock(struct efm32_leuart_s *priv,
uint32_t ien)
{
/* Re-enable/re-disable interrupts corresponding to the state of
* bits in ien.
*/
priv->ien = ien;
efm32_setuartint(priv);
}
static void efm32_restoreuartint(struct efm32_leuart_s *priv, uint32_t ien)
{
irqstate_t flags;
@ -311,10 +325,9 @@ static void efm32_restoreuartint(struct efm32_leuart_s *priv, uint32_t ien)
* bits in ien.
*/
flags = spin_lock_irqsave(NULL);
priv->ien = ien;
efm32_setuartint(priv);
spin_unlock_irqrestore(NULL, flags);
flags = spin_lock_irqsave(&priv->lock);
efm32_restoreuartint_nolock(priv, ien);
spin_unlock_irqrestore(&priv->lock, flags);
}
/****************************************************************************
@ -325,14 +338,14 @@ static void efm32_disableuartint(struct efm32_leuart_s *priv, uint32_t *ien)
{
irqstate_t flags;
flags = spin_lock_irqsave(NULL);
flags = spin_lock_irqsave(&priv->lock);
if (ien)
{
*ien = priv->ien;
}
efm32_restoreuartint(priv, 0);
spin_unlock_irqrestore(NULL, flags);
efm32_restoreuartint_nolock(priv, 0);
spin_unlock_irqrestore(&priv->lock, flags);
}
/****************************************************************************
@ -607,7 +620,7 @@ static void efm32_rxint(struct uart_dev_s *dev, bool enable)
struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv;
irqstate_t flags;
flags = enter_critical_section();
flags = spin_lock_irqsave(&priv->lock);
if (enable)
{
/* Receive an interrupt when there is anything in the Rx data register
@ -625,7 +638,7 @@ static void efm32_rxint(struct uart_dev_s *dev, bool enable)
efm32_setuartint(priv);
}
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->lock, flags);
}
/****************************************************************************
@ -673,7 +686,7 @@ static void efm32_txint(struct uart_dev_s *dev, bool enable)
struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv;
irqstate_t flags;
flags = enter_critical_section();
flags = spin_lock_irqsave(&priv->lock);
if (enable)
{
/* Enable the TX interrupt */
@ -697,7 +710,7 @@ static void efm32_txint(struct uart_dev_s *dev, bool enable)
efm32_setuartint(priv);
}
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->lock, flags);
}
/****************************************************************************

View file

@ -223,6 +223,7 @@ struct efm32_usart_s
const struct efm32_config_s *config;
#endif
uint16_t ien; /* Interrupts enabled */
spinlock_t lock; /* Spinlock */
};
/****************************************************************************
@ -303,7 +304,7 @@ static char g_uart1txbuffer[CONFIG_UART1_TXBUFSIZE];
/* This describes the state of the EFM32 USART0 port. */
#ifdef CONFIG_EFM32_USART0_ISUART
static const struct efm32_usart_s g_usart0config =
static const struct efm32_config_s g_usart0config =
{
.uartbase = EFM32_USART0_BASE,
.baud = CONFIG_USART0_BAUD,
@ -317,6 +318,7 @@ static const struct efm32_usart_s g_usart0config =
static struct efm32_usart_s g_usart0priv =
{
.config = &g_usart0config,
.lock = SP_UNLOCKED
};
static struct uart_dev_s g_usart0port =
@ -353,6 +355,7 @@ static struct efm32_config_s g_usart1config =
static struct efm32_usart_s g_usart1priv =
{
.config = &g_usart1config,
.lock = SP_UNLOCKED
};
static struct uart_dev_s g_usart1port =
@ -389,6 +392,7 @@ static struct efm32_config_s g_usart2config =
static struct efm32_usart_s g_usart2priv =
{
.config = &g_usart2config,
.lock = SP_UNLOCKED
};
static struct uart_dev_s g_usart2port =
@ -425,6 +429,7 @@ static struct efm32_config_s g_uart0config =
static struct efm32_usart_s g_uart0priv =
{
.config = &g_uart0config,
.lock = SP_UNLOCKED
};
static struct uart_dev_s g_uart0port =
@ -447,7 +452,7 @@ static struct uart_dev_s g_uart0port =
/* This describes the state of the EFM32 UART1 port. */
#ifdef CONFIG_EFM32_UART1
static struct efm32_usart_s g_uart1config =
static struct efm32_config_s g_uart1config =
{
.uartbase = EFM32_UART1_BASE,
.baud = CONFIG_UART1_BAUD,
@ -461,6 +466,7 @@ static struct efm32_usart_s g_uart1config =
static struct efm32_usart_s g_uart1priv =
{
.config = &g_uart1config,
.lock = SP_UNLOCKED
};
static struct uart_dev_s g_uart1port =
@ -516,6 +522,13 @@ static inline void efm32_setuartint(struct efm32_usart_s *priv)
* Name: efm32_restoreuartint
****************************************************************************/
static void efm32_restoreuartint_nolock(struct efm32_usart_s *priv,
uint32_t ien)
{
priv->ien = ien;
efm32_setuartint(priv);
}
static void efm32_restoreuartint(struct efm32_usart_s *priv, uint32_t ien)
{
irqstate_t flags;
@ -524,10 +537,9 @@ static void efm32_restoreuartint(struct efm32_usart_s *priv, uint32_t ien)
* ien
*/
flags = spin_lock_irqsave(NULL);
priv->ien = ien;
efm32_setuartint(priv);
spin_unlock_irqrestore(NULL, flags);
flags = spin_lock_irqsave(&priv->lock);
efm32_restoreuartint_nolock(priv, len);
spin_unlock_irqrestore(&priv->lock, flags);
}
/****************************************************************************
@ -539,14 +551,14 @@ static void efm32_disableuartint(struct efm32_usart_s *priv, uint32_t *ien)
{
irqstate_t flags;
flags = spin_lock_irqsave(NULL);
flags = spin_lock_irqsave(&priv->lock);
if (ien)
{
*ien = priv->ien;
}
efm32_restoreuartint(priv, 0);
spin_unlock_irqrestore(NULL, flags);
efm32_restoreuartint_nolock(priv, 0);
spin_unlock_irqrestore(&priv->lock, flags);
}
#endif
@ -966,7 +978,7 @@ static void efm32_rxint(struct uart_dev_s *dev, bool enable)
struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv;
irqstate_t flags;
flags = enter_critical_section();
flags = spin_lock_irqsave(&priv->lock);
if (enable)
{
/* Receive an interrupt when their is anything in the Rx data register
@ -984,7 +996,7 @@ static void efm32_rxint(struct uart_dev_s *dev, bool enable)
efm32_setuartint(priv);
}
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->lock, flags);
}
/****************************************************************************
@ -1032,7 +1044,7 @@ static void efm32_txint(struct uart_dev_s *dev, bool enable)
struct efm32_usart_s *priv = (struct efm32_usart_s *)dev->priv;
irqstate_t flags;
flags = enter_critical_section();
flags = spin_lock_irqsave(&priv->lock);
if (enable)
{
/* Enable the TX interrupt */
@ -1056,7 +1068,7 @@ static void efm32_txint(struct uart_dev_s *dev, bool enable)
efm32_setuartint(priv);
}
leave_critical_section(flags);
spin_unlock_irqrestore(&priv->lock, flags);
}
/****************************************************************************

View file

@ -33,7 +33,6 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <arch/armv7-m/nvicpri.h>
#include "nvic.h"

View file

@ -158,6 +158,7 @@ struct up_dev_s
const uint8_t stop_2bits; /* True: Configure with 2 stop bits instead of 1 */
const uint32_t tx_gpio; /* USART TX GPIO pin configuration */
const uint32_t rx_gpio; /* USART RX GPIO pin configuration */
spinlock_t lock; /* Spinlock */
# ifdef CONFIG_SERIAL_IFLOWCONTROL
const uint32_t rts_gpio; /* UART RTS GPIO pin configuration */
@ -437,6 +438,7 @@ static struct up_dev_s g_usart0priv =
.tx_gpio = GPIO_USART0_TX,
.rx_gpio = GPIO_USART0_RX,
.lock = SP_UNLOCKED,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_USART0_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_USART0_RTS,
@ -509,6 +511,7 @@ static struct up_dev_s g_usart1priv =
.tx_gpio = GPIO_USART1_TX,
.rx_gpio = GPIO_USART1_RX,
.lock = SP_UNLOCKED,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_USART1_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_USART1_RTS,
@ -581,6 +584,7 @@ static struct up_dev_s g_usart2priv =
.tx_gpio = GPIO_USART2_TX,
.rx_gpio = GPIO_USART2_RX,
.lock = SP_UNLOCKED,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_USART2_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_USART2_RTS,
@ -653,6 +657,7 @@ static struct up_dev_s g_usart5priv =
.tx_gpio = GPIO_USART5_TX,
.rx_gpio = GPIO_USART5_RX,
.lock = SP_UNLOCKED,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_USART5_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_USART5_RTS,
@ -725,6 +730,7 @@ static struct up_dev_s g_uart3priv =
.tx_gpio = GPIO_UART3_TX,
.rx_gpio = GPIO_UART3_RX,
.lock = SP_UNLOCKED,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_UART3_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_UART3_RTS,
@ -797,6 +803,7 @@ static struct up_dev_s g_uart4priv =
.tx_gpio = GPIO_UART4_TX,
.rx_gpio = GPIO_UART4_RX,
.lock = SP_UNLOCKED,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_UART4_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_UART4_RTS,
@ -869,6 +876,7 @@ static struct up_dev_s g_uart6priv =
.tx_gpio = GPIO_UART6_TX,
.rx_gpio = GPIO_UART6_RX,
.lock = SP_UNLOCKED,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_UART6_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_UART6_RTS,
@ -941,6 +949,7 @@ static struct up_dev_s g_uart7priv =
.tx_gpio = GPIO_UART7_TX,
.rx_gpio = GPIO_UART7_RX,
.lock = SP_UNLOCKED,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_UART7_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_UART7_RTS,
@ -1127,7 +1136,7 @@ static void up_disableusartint(struct up_dev_s *priv, uint32_t *ie)
irqstate_t flags;
uint32_t ctl_ie;
flags = spin_lock_irqsave(NULL);
flags = spin_lock_irqsave(&priv->lock);
if (ie)
{
@ -1161,7 +1170,7 @@ static void up_disableusartint(struct up_dev_s *priv, uint32_t *ie)
ctl_ie = (USART_CFG_CTL_MASK << USART_CFG_SHIFT);
up_setusartint(priv, ctl_ie);
spin_unlock_irqrestore(NULL, flags);
spin_unlock_irqrestore(&priv->lock, flags);
}
/****************************************************************************
@ -1172,11 +1181,11 @@ static void up_restoreusartint(struct up_dev_s *priv, uint32_t ie)
{
irqstate_t flags;
flags = spin_lock_irqsave(NULL);
flags = spin_lock_irqsave(&priv->lock);
up_setusartint(priv, ie);
spin_unlock_irqrestore(NULL, flags);
spin_unlock_irqrestore(&priv->lock, flags);
}
/****************************************************************************

View file

@ -145,6 +145,7 @@ struct imx9_edma_s
/* This array describes each DMA channel */
struct imx9_dmach_s dmach[IMX9_EDMA_NCHANNELS];
spinlock_t lock;
};
/****************************************************************************
@ -159,6 +160,7 @@ static struct imx9_edma_s g_edma =
#if CONFIG_IMX9_EDMA_NTCD > 0
.dsem = SEM_INITIALIZER(CONFIG_IMX9_EDMA_NTCD),
#endif
.lock = SP_UNLOCKED
};
#if CONFIG_IMX9_EDMA_NTCD > 0
@ -198,15 +200,15 @@ static struct imx9_edmatcd_s *imx9_tcd_alloc(void)
* waiting.
*/
flags = enter_critical_section();
nxsem_wait_uninterruptible(&g_edma.dsem);
/* Now there should be a TCD in the free list reserved just for us */
flags = spin_lock_irqsave(&g_edma.lock);
tcd = (struct imx9_edmatcd_s *)sq_remfirst(&g_tcd_free);
DEBUGASSERT(tcd != NULL);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_edma.lock, flags);
return tcd;
}
#endif
@ -220,6 +222,17 @@ static struct imx9_edmatcd_s *imx9_tcd_alloc(void)
****************************************************************************/
#if CONFIG_IMX9_EDMA_NTCD > 0
static void imx9_tcd_free_nolock(struct imx9_edmatcd_s *tcd)
{
/* Add the the TCD to the end of the free list and post the 'dsem',
* possibly waking up another thread that might be waiting for
* a TCD.
*/
sq_addlast((sq_entry_t *)tcd, &g_tcd_free);
nxsem_post(&g_edma.dsem);
}
static void imx9_tcd_free(struct imx9_edmatcd_s *tcd)
{
irqstate_t flags;
@ -229,10 +242,11 @@ static void imx9_tcd_free(struct imx9_edmatcd_s *tcd)
* a TCD.
*/
flags = spin_lock_irqsave(NULL);
sq_addlast((sq_entry_t *)tcd, &g_tcd_free);
nxsem_post(&g_edma.dsem);
spin_unlock_irqrestore(NULL, flags);
flags = spin_lock_irqsave(&g_edma.lock);
sched_lock();
imx9_tcd_free_nolock(tcd);
spin_unlock_irqrestore(&g_edma.lock, flags);
sched_unlock();
}
#endif
@ -458,6 +472,11 @@ static void imx9_dmaterminate(struct imx9_dmach_s *dmach, int result)
edma_callback_t callback;
void *arg;
irqstate_t flags;
flags = spin_lock_irqsave(&g_edma.lock);
sched_lock();
/* Disable channel IRQ requests */
putreg32(EDMA_CH_INT, base + IMX9_EDMA_CH_INT_OFFSET);
@ -487,7 +506,7 @@ static void imx9_dmaterminate(struct imx9_dmach_s *dmach, int result)
next = dmach->flags & EDMA_CONFIG_LOOPDEST ?
NULL : (struct imx9_edmatcd_s *)((uintptr_t)tcd->dlastsga);
imx9_tcd_free(tcd);
imx9_tcd_free_nolock(tcd);
}
dmach->head = NULL;
@ -507,6 +526,9 @@ static void imx9_dmaterminate(struct imx9_dmach_s *dmach, int result)
{
callback((DMACH_HANDLE)dmach, arg, true, result);
}
spin_unlock_irqrestore(&g_edma.lock, flags);
sched_unlock();
}
/****************************************************************************
@ -1344,7 +1366,7 @@ int imx9_dmach_start(DMACH_HANDLE handle, edma_callback_t callback,
/* Save the callback info. This will be invoked when the DMA completes */
flags = spin_lock_irqsave(NULL);
flags = spin_lock_irqsave(&g_edma.lock);
dmach->callback = callback;
dmach->arg = arg;
@ -1363,7 +1385,7 @@ int imx9_dmach_start(DMACH_HANDLE handle, edma_callback_t callback,
putreg32(regval, base + IMX9_EDMA_CH_CSR_OFFSET);
}
spin_unlock_irqrestore(NULL, flags);
spin_unlock_irqrestore(&g_edma.lock, flags);
return OK;
}
@ -1386,14 +1408,11 @@ int imx9_dmach_start(DMACH_HANDLE handle, edma_callback_t callback,
void imx9_dmach_stop(DMACH_HANDLE handle)
{
struct imx9_dmach_s *dmach = (struct imx9_dmach_s *)handle;
irqstate_t flags;
dmainfo("dmach: %p\n", dmach);
DEBUGASSERT(dmach != NULL);
flags = spin_lock_irqsave(NULL);
imx9_dmaterminate(dmach, -EINTR);
spin_unlock_irqrestore(NULL, flags);
}
/****************************************************************************
@ -1508,7 +1527,7 @@ void imx9_dmasample(DMACH_HANDLE handle, struct imx9_dmaregs_s *regs)
/* eDMA Global Registers */
flags = spin_lock_irqsave(NULL);
flags = spin_lock_irqsave(&g_edma.lock);
/* REVISIT: eDMA4 does not show INT_HIGH / HRS_HIGH values correctly */
@ -1542,7 +1561,7 @@ void imx9_dmasample(DMACH_HANDLE handle, struct imx9_dmaregs_s *regs)
regs->dmamux = 0;
}
spin_unlock_irqrestore(NULL, flags);
spin_unlock_irqrestore(&g_edma.lock, flags);
}
#endif /* CONFIG_DEBUG_DMA */

View file

@ -41,7 +41,6 @@
#include "imx9_clockconfig.h"
#include "imx9_iomuxc.h"
#include "hardware/imx9_clock.h"
#include "hardware/imx9_pinmux.h"
#include <arch/board/board.h> /* Include last: has dependencies */

View file

@ -1103,7 +1103,7 @@ static void imx9_lpi2c_setclock(struct imx9_lpi2c_priv_s *priv,
&src_freq);
/* LPI2C output frequency = (Source Clock (Hz)/ 2^prescale) /
* (CLKLO + 1 + CLKHI + 1 + ROUNDDOWN((2 + FILTSCL) / 2^prescale)
* (CLKLO + 1 + CLKHI + 1 + ALIGN_DOWN((2 + FILTSCL)/2^prescale)
*
* Assume CLKLO = 2 * CLKHI, SETHOLD = CLKHI, DATAVD = CLKHI / 2
*/

View file

@ -1871,12 +1871,28 @@ menuconfig IMXRT_FLEXSPI1
default n
select IMXRT_FLEXSPI
menuconfig IMXRT_FLEXSPI1_XIP
bool "FLEXSPI1 is used for XIP"
default n
depends on IMXRT_FLEXSPI1
---help---
FlexSPI1 is used as XIP thus already
initialized by the bootloader
menuconfig IMXRT_FLEXSPI2
bool "FLEXSPI2"
default n
select IMXRT_FLEXSPI
depends on IMXRT_HAVE_FLEXSPI2
menuconfig IMXRT_FLEXSPI2_XIP
bool "FLEXSPI2 is used for XIP"
default n
depends on IMXRT_FLEXSPI2
---help---
FlexSPI2 is used as XIP thus already
initialized by the bootloader
endmenu # FLEXSPI Peripherals
menu "ADC Peripherals"

View file

@ -137,6 +137,7 @@ struct imxrt_edma_s
/* These mutex protect the DMA channel and descriptor tables */
mutex_t chlock; /* Protects channel table */
spinlock_t lock;
#if CONFIG_IMXRT_EDMA_NTCD > 0
sem_t dsem; /* Supports wait for free descriptors */
#endif
@ -158,6 +159,7 @@ static struct imxrt_edma_s g_edma =
#if CONFIG_IMXRT_EDMA_NTCD > 0
.dsem = SEM_INITIALIZER(CONFIG_IMXRT_EDMA_NTCD),
#endif
.lock = SP_UNLOCKED
};
#if CONFIG_IMXRT_EDMA_NTCD > 0
@ -197,15 +199,15 @@ static struct imxrt_edmatcd_s *imxrt_tcd_alloc(void)
* waiting.
*/
flags = enter_critical_section();
nxsem_wait_uninterruptible(&g_edma.dsem);
/* Now there should be a TCD in the free list reserved just for us */
flags = spin_lock_irqsave(&g_edma.lock);
tcd = (struct imxrt_edmatcd_s *)sq_remfirst(&g_tcd_free);
DEBUGASSERT(tcd != NULL);
leave_critical_section(flags);
spin_unlock_irqrestore(&g_edma.lock, flags);
return tcd;
}
#endif
@ -219,6 +221,17 @@ static struct imxrt_edmatcd_s *imxrt_tcd_alloc(void)
****************************************************************************/
#if CONFIG_IMXRT_EDMA_NTCD > 0
static void imxrt_tcd_free_nolock(struct imxrt_edmatcd_s *tcd)
{
/* Add the the TCD to the end of the free list and post the 'dsem',
* possibly waking up another thread that might be waiting for
* a TCD.
*/
sq_addlast((sq_entry_t *)tcd, &g_tcd_free);
nxsem_post(&g_edma.dsem);
}
static void imxrt_tcd_free(struct imxrt_edmatcd_s *tcd)
{
irqstate_t flags;
@ -228,10 +241,9 @@ static void imxrt_tcd_free(struct imxrt_edmatcd_s *tcd)
* a TCD.
*/
flags = spin_lock_irqsave(NULL);
sq_addlast((sq_entry_t *)tcd, &g_tcd_free);
nxsem_post(&g_edma.dsem);
spin_unlock_irqrestore(NULL, flags);
flags = spin_lock_irqsave(&g_edma.lock);
imxrt_tcd_free_nolock(tcd);
spin_unlock_irqrestore(&g_edma.lock, flags);
}
#endif
@ -436,8 +448,11 @@ static void imxrt_dmaterminate(struct imxrt_dmach_s *dmach, int result)
uint8_t regval8;
uint8_t chan;
edma_callback_t callback;
irqstate_t flags;
void *arg;
flags = spin_lock_irqsave(&g_edma.lock);
/* Disable channel ERROR interrupts */
chan = dmach->chan;
@ -469,7 +484,7 @@ static void imxrt_dmaterminate(struct imxrt_dmach_s *dmach, int result)
next = dmach->flags & EDMA_CONFIG_LOOPDEST ?
NULL : (struct imxrt_edmatcd_s *)tcd->dlastsga;
imxrt_tcd_free(tcd);
imxrt_tcd_free_nolock(tcd);
}
dmach->head = NULL;
@ -489,6 +504,8 @@ static void imxrt_dmaterminate(struct imxrt_dmach_s *dmach, int result)
{
callback((DMACH_HANDLE)dmach, arg, true, result);
}
spin_unlock_irqrestore(&g_edma.lock, flags);
}
/****************************************************************************
@ -1143,7 +1160,7 @@ int imxrt_dmach_start(DMACH_HANDLE handle, edma_callback_t callback,
/* Save the callback info. This will be invoked when the DMA completes */
flags = spin_lock_irqsave(NULL);
flags = spin_lock_irqsave(&g_edma.lock);
dmach->callback = callback;
dmach->arg = arg;
@ -1168,7 +1185,7 @@ int imxrt_dmach_start(DMACH_HANDLE handle, edma_callback_t callback,
putreg8(regval8, IMXRT_EDMA_SERQ);
}
spin_unlock_irqrestore(NULL, flags);
spin_unlock_irqrestore(&g_edma.lock, flags);
return OK;
}
@ -1191,14 +1208,11 @@ int imxrt_dmach_start(DMACH_HANDLE handle, edma_callback_t callback,
void imxrt_dmach_stop(DMACH_HANDLE handle)
{
struct imxrt_dmach_s *dmach = (struct imxrt_dmach_s *)handle;
irqstate_t flags;
dmainfo("dmach: %p\n", dmach);
DEBUGASSERT(dmach != NULL);
flags = spin_lock_irqsave(NULL);
imxrt_dmaterminate(dmach, -EINTR);
spin_unlock_irqrestore(NULL, flags);
}
/****************************************************************************
@ -1313,7 +1327,7 @@ void imxrt_dmasample(DMACH_HANDLE handle, struct imxrt_dmaregs_s *regs)
/* eDMA Global Registers */
flags = spin_lock_irqsave(NULL);
flags = spin_lock_irqsave(&g_edma.lock);
regs->cr = getreg32(IMXRT_EDMA_CR); /* Control */
regs->es = getreg32(IMXRT_EDMA_ES); /* Error Status */
@ -1348,7 +1362,7 @@ void imxrt_dmasample(DMACH_HANDLE handle, struct imxrt_dmaregs_s *regs)
regaddr = IMXRT_DMAMUX_CHCFG(chan);
regs->dmamux = getreg32(regaddr); /* Channel configuration */
spin_unlock_irqrestore(NULL, flags);
spin_unlock_irqrestore(&g_edma.lock, flags);
}
#endif /* CONFIG_DEBUG_DMA */

View file

@ -83,6 +83,8 @@ static int imxrt_flexspi_lock(struct flexspi_dev_s *dev, bool lock);
static int imxrt_flexspi_transfer_blocking(struct flexspi_dev_s *dev,
struct flexspi_transfer_s *xfer);
static void imxrt_flexspi_software_reset(struct flexspi_dev_s *dev);
static void imxrt_flexspi_configure_prefetch(struct flexspi_dev_s *dev,
bool enable);
static void imxrt_flexspi_update_lut(struct flexspi_dev_s *dev,
uint32_t index,
const uint32_t *cmd,
@ -102,6 +104,7 @@ static const struct flexspi_ops_s g_flexspi0ops =
.lock = imxrt_flexspi_lock,
.transfer_blocking = imxrt_flexspi_transfer_blocking,
.software_reset = imxrt_flexspi_software_reset,
.configure_prefetch = imxrt_flexspi_configure_prefetch,
.update_lut = imxrt_flexspi_update_lut,
.set_device_config = imxrt_flexspi_set_device_config,
};
@ -118,6 +121,9 @@ static struct imxrt_flexspidev_s g_flexspi0dev =
},
.base = (struct flexspi_type_s *)IMXRT_FLEXSPIC_BASE,
.lock = NXMUTEX_INITIALIZER,
#ifdef CONFIG_IMXRT_FLEXSPI1_XIP
.initialized = true,
#endif
};
#endif
@ -131,6 +137,9 @@ static struct imxrt_flexspidev_s g_flexspi1dev =
.ops = &g_flexspi0ops,
},
.base = (struct flexspi_type_s *) IMXRT_FLEXSPI2C_BASE,
#ifdef CONFIG_IMXRT_FLEXSPI2_XIP
.initialized = true,
#endif
};
#endif
@ -330,6 +339,31 @@ static inline void imxrt_flexspi_software_reset_private(
}
}
/* Configure FLEXSPI preftech.
*
* This function enables/disabled the prefetcher
* Which is needed to do RWW see NXP AN12564
*
* @param base FLEXSPI peripheral base address.
*/
static inline void imxrt_flexspi_configure_prefetch_private(
struct flexspi_type_s *base, bool enable)
{
uint32_t config_value = base->AHBCR;
if (enable)
{
config_value |= FLEXSPI_AHBCR_PREFETCHEN(1);
}
else
{
config_value &= ~FLEXSPI_AHBCR_PREFETCHEN(1);
}
base->AHBCR = config_value;
}
/* Returns whether the bus is idle.
*
* @param base FLEXSPI peripheral base address.
@ -1173,6 +1207,29 @@ static void imxrt_flexspi_software_reset(struct flexspi_dev_s *dev)
imxrt_flexspi_software_reset_private(priv->base);
}
/****************************************************************************
* Name: imxrt_flexspi_configure_prefetch
*
* Description:
* Configures prefetch
*
* Input Parameters:
* dev - Device-specific state data
* enable - Enable prefetch
*
* Returned Value:
* None
*
****************************************************************************/
static void imxrt_flexspi_configure_prefetch(struct flexspi_dev_s *dev,
bool enable)
{
struct imxrt_flexspidev_s *priv = (struct imxrt_flexspidev_s *)dev;
imxrt_flexspi_configure_prefetch_private(priv->base, enable);
}
/****************************************************************************
* Name: imxrt_flexspi_update_lut
*

View file

@ -127,6 +127,23 @@
#define FLEXSPI_TRANSFER(d,x) (d)->ops->transfer_blocking(d,x)
/****************************************************************************
* Name: FLEXSPI_CONFIGURE_PREFTECH
*
* Description:
* Enable / disable prefetch
*
* Input Parameters:
* dev - Device-specific state data
* enable - Enable prefetch
*
* Returned Value:
* none
*
****************************************************************************/
#define FLEXSPI_CONFIGURE_PREFETCH(d,e) (d)->ops->configure_prefetch(d,e)
/****************************************************************************
* Name: FLEXSPI_SOFTWARE_RESET
*
@ -508,6 +525,7 @@ struct flexspi_ops_s
int (*transfer_blocking)(struct flexspi_dev_s *dev,
struct flexspi_transfer_s *xfer);
void (*software_reset)(struct flexspi_dev_s *dev);
void (*configure_prefetch)(struct flexspi_dev_s *dev, bool enable);
void (*update_lut)(struct flexspi_dev_s *dev,
uint32_t index, const uint32_t *cmd,
uint32_t count);

Some files were not shown because too many files have changed in this diff Show more