Commit graph

56531 commits

Author SHA1 Message Date
Takuya Miyasita
2275138dcf arch_atomic : Introduce CONFIG_LIBC_ARCH_ATOMIC
Some armv7-m-based SoCs do not work with atomic instructions,
even though armv7-m supports them.

To avoid using atomic instructions generated by gcc,
CONFIG_LIBC_ARCH_ATOMIC is newly introduced with which
arch_atomic.c is linked explicitly.

However, the function names need to be changed to avoid
build errors, since the functions described in stdatomic.h
are gcc built-in and inlined when the code is compiled.

About libcxx with CONFIG_LIBC_ARCH_ATOMIC, it still
does not work. It is also needed to call nx_atomic_ ver
instead of __atomic ver in
libcxx/include/__atomic/cxx_atomic_lmpl.h.

Signed-off-by: Takuya Miyasita <Takuya.Miyashita@sony.com>
2024-11-15 14:01:56 +08:00
Yongrong Wang
07c986905d sim/configs/rpserver/rpproxy_virtio: Change the sim 32bit to 64bit compilation
1.macOS doesn't support 32bit anymore(CONFIG_SIM_M32=y)
2.fix b4bit compile warning:
CC:  ioexpander/ioe_rpmsg.c ioexpander/ioe_rpmsg.c:368:14: warning:
cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
      return (FAR void *)(ret + 1);
             ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-11-15 14:01:11 +08:00
xuxin19
71b169e5fd build(bugfix):pac sim elf ONLY in Linux platform
avoid SIM compilation post build issues on other platforms

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-15 12:21:24 +08:00
Eero Nurkkala
f2949f84a3 arm64/imx9: add imx93-evk ddr training
This performs the DDR training for imx93-evk. In addition to the source code,
it downloads binaries which are included in the final image. The bootloader
must be ARCH_CORTEX_A53 instead of A55 due to atomic instructions that don't
work with the OCRAM / EL3 combination.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2024-11-15 09:56:31 +08:00
Pressl, Štěpán
fe4f7a3a16 arch/arm/src/samv7/sam_afec.c: AFEC1 actually has 12 physical inputs
This commit adds a max_pins field into the private struct.
AFEC0 has 11, AFEC1 has 12. The 12th pin of AFEC0 is an internal
pin connected to a temperature sensor, which we don't use.

Signed-off-by: Stepan Pressl <pressste@fel.cvut.cz>
2024-11-15 08:43:07 +08:00
wangmingrong1
81f060b8d5 sim: Add compiler selection
Use gcc by default

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-15 01:05:16 +08:00
wangmingrong1
9b0df45d1c gcov: arm,arm64 add coverage global
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-15 01:05:16 +08:00
wangmingrong1
17ce9b86c1 gcov: Correct existing gcov configuration
1. add CONFIG_COVERAGE_ALL to replace CONFIG_SCHED_GCOV_ALL
2. Correct all SCHED_GCOV, SCHED_GCOV_ALL

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-15 01:05:16 +08:00
wangmingrong1
b6f6cadf93 gprof: Remove duplicate content
1. arch/arm/src/cmake/gcc.cmake: The same judgment has been made in line 164
2. boards/sim/sim/sim/scripts/Make.defs: arch/sim/src/Makefile also has in line 147

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-15 01:05:16 +08:00
wangmingrong1
181f461145 libbuiltin/kconfig: Modify coverage function dependencies
Currently, there are four code coverage statistics implementations:
1. GCC native implementation
2. CLANG native implementation
3. GCC coverage nuttx mini version
4. CLANG coverage nuttx mini version
Coverage Support:
                                               GCC native implementation  CLANG native implementation  GCC coverage nuttx mini version  CLANG coverage nuttx mini version
Compiler version requirements                              ALL                       ALL                         GCC 13.2 and below             CLANG 17.0 and below
Program coverage statistics support   Main program          √                         √                                  √                               √
Program coverage statistics support   Interrupt program     X                         √                                  √                               √
Configuration options                         CONFIG_COVERAGE_TOOLCHAIN    CONFIG_COVERAGE_COMPILER_RT          CONFIG_COVERAGE_MINI            CONFIG_COVERAGE_MINI
Platform Support            ARM                             √                         √                                  √                               √
                            ARM64                           √                                                            √
                                                                                                            (Coming soon, not yet merged)

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-15 01:05:16 +08:00
buxiasen
f53f0ecf0e sama5/at25_main: fix direct use of nput, convert to int
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-15 01:05:04 +08:00
buxiasen
a5459cdaca stream: reduce int use, handle FS_LARGEFILE correctly.
offset int -> offset, len int -> size_t, ret int -> ssize_t

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-15 01:05:04 +08:00
buxiasen
2433094ebd blk/mtdoutstream: remove mtd bytewrite support, readback before update
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-15 01:05:04 +08:00
buxiasen
d6c746e88d blk/mtdoutstream: flush before close
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-15 01:05:04 +08:00
p-szafonimateusz
bab1a5d714 boards/x86_64/intel64/qemu-intel64: add lvgl and fb examples
Add lvgl and fb examples for qemu-intel64.

NOTE: multiboot framebufer doesn't work with -kernel argument in QEMU,
NuttX image must be loaded with -cdrom argument.

QEMU command to run examples:

  qemu-system-x86_64 -m 2G -cpu host -enable-kvm -cdrom disk.iso -serial mon:stdio

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-15 01:04:52 +08:00
p-szafonimateusz
bb98911a11 arch/x86_64/intel64: add support for framebuffer
arch/x86_64/intel64: add support for framebuffer

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-15 01:04:52 +08:00
raiden00pl
547cbf3ba6 drivers/sensors: fix style issues in function headers
fix style issues in function headers, add missing new lines
2024-11-15 01:04:10 +08:00
raiden00pl
6fcfe7cf03 drivers/pci: fix style issues in function headers
fix style issues in function headers, add missing new lines
2024-11-15 01:04:10 +08:00
raiden00pl
45c4350cf1 Documentation: update x86_64 doc
Documentation: update x86_64 doc
2024-11-15 01:03:55 +08:00
raiden00pl
0ca02775eb Documentation: add PCI bus doc
Documentation: add PCI bus doc
2024-11-15 01:03:55 +08:00
fangpeina
66976c46ba drivers/input: fix compliation warn in aw86225
input/aw86225.c: In function 'aw86225_ram_work_routine':
input/aw86225.c:1976:27: warning: 'rtp_file.data' may be used uninitialized [-Wmaybe-uninitialized]
 1976 |   struct aw86225_firmware rtp_file;
      |                           ^~~~~~~~
In function 'aw86225_ram_loaded',
    inlined from 'aw86225_ram_work_routine' at input/aw86225.c:1982:3:
input/aw86225.c:1445:17: warning: 'rtp_file.size' may be used uninitialized [-Wmaybe-uninitialized]
 1445 |   for (i = 2; i < cont->size; i++)
      |               ~~^~~~~~~~~~~~
input/aw86225.c: In function 'aw86225_ram_work_routine':
input/aw86225.c:1976:27: note: 'rtp_file.size' was declared here
 1976 |   struct aw86225_firmware rtp_file;

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-11-14 23:35:07 +08:00
fangpeina
3518c69e6c input/ff: extend ioctrl to support factory calibration
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-11-14 23:35:07 +08:00
fangpeina
dcf6dd8c8b drivers/input: fix the issue of unable to replay in RTP mode
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-11-14 23:35:07 +08:00
fangpeina
a719db1b58 drivers/input: support RTP file simulation in RAMLOOP mode
For resource-constrained devices, simulate RTP
playback effects using preset custom RAMLOOP
combinations instead of using RTP files to play
custom vibration effects.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-11-14 23:35:07 +08:00
hujun5
ea20ae588a pthread_cond_broadcast use wait_count for judement
This commit fixes the comment from https://github.com/apache/nuttx/pull/14581

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-14 23:22:52 +08:00
xuxin19
d2a7e454bb build(qemu):add a qemu compilation configuration with application
enable various types of common applications and libraries, and enable CMake CI checks.
To avoid regression issues in the build system

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-14 22:50:49 +08:00
anjiahao
5aac6684f4 gdbstub:typo fix
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-14 22:48:55 +08:00
raiden00pl
e306689436 boards/x86_64/intel64/qemu-intel64: add jumbo configuration
merge pcitest and smp into jumbo and enable more port features
2024-11-14 22:48:38 +08:00
haopengxiang
5ffdf5b264 cmake(bugfix):fix libcxxabi layout build error
/home/data/vela/github/nuttx/libs/libxx/libcxxabi/libcxxabi/src/cxa_exception.h:47:10: error: 'unexpected_handler' in namespace 'std' does not name a type
   47 |     std::unexpected_handler unexpectedHandler;
      |          ^~~~~~~~~~~~~~~~~~
/home/data/vela/github/nuttx/libs/libxx/libcxxabi/libcxxabi/src/cxa_exception.h:85:10: error: 'unexpected_handler' in namespace 'std' does not name a type
   85 |     std::unexpected_handler unexpectedHandler;
      |          ^~~~~~~~~~~~~~~~~~
/home/data/vela/github/nuttx/libs/libxx/libcxxabi/libcxxabi/src/cxa_exception.h:121:65: error: static assertion failed: propagationCount has wrong negative offset
  121 |                       sizeof(_Unwind_Exception) + sizeof(void*) ==
      |                                                                 ^
/home/data/vela/github/nuttx/libs/libxx/libcxxabi/libcxxabi/src/cxa_exception.h:121:65: note: the comparison reduces to '(124 == 128)'
/home/data/vela/github/nuttx/libs/libxx/libcxxabi/libcxxabi/src/cxa_exception.h:125:65: error: static assertion failed: propagationCount has wrong negative offset
  125 |                       sizeof(_Unwind_Exception) + sizeof(void*) ==
      |

/home/data/vela/github/nuttx/libs/libxx/libcxxabi/libcxxabi/src/cxa_default_handlers.cpp:20:10: fatal error: include/atomic_support.h: No such file or directory
   20 | #include "include/atomic_support.h" // from libc++
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-14 19:39:38 +08:00
ligd
9026ba6883 libm: fix typo caused compile failed
make[1]: Entering directory '/home/ligd/platform/trunk_merge_all/nuttx/libs/libm'
Makefile:93: *** target file 'context' has both : and :: entries.  Stop.
make[1]: Leaving directory '/home/ligd/platform/trunk_merge_all/nuttx/libs/libm'

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-11-14 19:38:58 +08:00
raiden00pl
85eba56068 Documentation: migrate qemu-armv7a/README.txt to rst
Migrate qemu-armv7a/README.txt to rst.
Also add some notes about PCI support for this board
2024-11-14 19:38:36 +08:00
wangmingrong1
656883fec5 arch/toochain: Add toochain to gcc
1. Modify the select the gcc compiler

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-14 15:45:24 +08:00
wangjianyu3
85eed31443 mps3-an547:ap: Disable cmd_wait() as it depends on procfs currently
More details please see https://github.com/apache/nuttx-apps/pull/2848

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-14 13:42:34 +08:00
anjiahao
6554ed4d66 get g_tcbinfo just use elf memory
g_tcbinfo is const data, thus elf memmory is more reliable than other
method in case of corruption etc.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-14 13:30:34 +08:00
xuxingliang
c5276f4244 gdbserver.py: add arm64 support
Use struct.unpack_from to eliminate the need to specify data size.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-14 13:30:34 +08:00
xuxingliang
3bfeddcbdd gdbserver.py: add back 64bit support
Original code from https://github.com/apache/nuttx/pull/12469

Accidently removed during merge.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-14 13:30:34 +08:00
wangmingrong1
ec3c064ff0 arm64/nsh: Enable gprof
Let's turn off kasan to prevent gprof from running recursively. And turn on gprof to add this profile library to the CI build.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-14 13:30:05 +08:00
wangmingrong1
c19d440db0 arm64/mcount.c: Add to nuttx compilation
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-14 13:30:05 +08:00
Kyle Wilson
d4f6cc229d STM32H5 I2C Driver
Added I2C driver for the STM32H5. This driver uses the STM32H7 I2C driver as a base. The primary difference is setclock dynamically sets the I2C TIMINGR register instead of using hardcoded values. This allows the I2C peripherals to use any of the input clocks and set to any speed 0-1MHz. Additionally, Kconfig options were made available to set the Digital Noise Filter (DNF), Analog Noise Filter, I2C Clock source (i2c_ker_ck), as well as set i2c rise/fall times which are crucial to timing. Care must be taken when setting the clock source and filters, as not all settings are compatible with all i2c clock frequencies.
2024-11-14 08:50:28 +08:00
stbenn
5d87319cb6 arch/stm32h5: Add ADC hardware register file
This change defines macros for the ADC register map from ST document RM0481.
2024-11-13 16:33:22 -03:00
Davi Diogo
d6a73a46e8 riscv/espressif/bootloader/mcuboot: Sign image with MCUBoot version
Add version signature to MCUBoot compatible image on espressif RISC-V architecture

Signed-off-by: Davi Diogo  <eng.davidiogo@gmail.com>
2024-11-13 20:28:17 +01:00
xuxin19
3ae822c098 cmake:remove no need target_link_library in static target
the link_library of the static target will cause PRIVATE to be inherited to nuttx,
resulting in duplicate linking and definition problems.
because all target static libraries will eventually be linked, there is no need to specify it explicitly.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-14 01:26:38 +08:00
Michal Lenc
ec243f0f6b icjx: disable interrupts in interrupt worker
Interrupts have to be disabled if interrupt worker processes them,
otherwise assertion may occur as another interrupt tries to queue
worker that is not available (because it processes previous interrupts).
Interrupts are re-enabled after the worker leaves the loop processing
previous interrupts.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-11-14 01:16:48 +08:00
wangjianyu3
7e0ee8c74a sim:nsh: Enable PIPES to make nsh pipeline available
More details, please see https://github.com/apache/nuttx-apps/pull/2737

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-14 01:16:29 +08:00
wangjianyu3
4266580319 fs/procfs: The procfsversion should be under control of FS_PROCFS_EXCLUDE_VERSION
Env

  sim:nsh
  - CONFIG_FS_PROCFS_EXCLUDE_PROCESS=y

Error

  LD:  nuttx
  /usr/bin/ld: nuttx.rel:(.rodata.g_procfs_entries+0xc8): undefined reference to `g_version_operations'
  collect2: error: ld returned 1 exit status
  make[1]: *** [Makefile:429: nuttx] Error 1
  make: *** [tools/Unix.mk:551: nuttx] Error 2

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-13 12:31:46 -03:00
Federico Braghiroli
3d90079f50 boards/stm32f103-minimum: fix unaligned pointer to .data section in ld.script
This patch fix _eronly value which is used during boot process to initialize
.data section to sram.

Since .data section is 4 byte aligned in flash, also _eronly must follow this
alignment to stay coherent with the start address of .data.

If one of the sections preceeding .data has a size which is not 4 byte aligned,
the _eronly value does not match with .data physical address resulting in wrong
copy of data section to sram and thus an almost immediate hardfault.

Signed-off-by: Federico Braghiroli <federico.braghiroli@gmail.com>
2024-11-13 21:59:24 +08:00
chenxiaoyi
9cd1c81149 xtensa: use up_interrupt_context() to determine if in interrupt context
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2024-11-13 19:24:22 +08:00
Jouni Ukkonen
e2a9c84260 arch/arm64/imx9: Add trdc support
Trdc is configured in EL3 bootloader
Clock pre-initialization is also executed there.
Trdc board configuration for imx93evk included

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-13 16:46:04 +08:00
lipengfei28
daab676db9 arch/arm64: syscall SYS_switch_context and SYS_restore_context use tcb as
parm

sys_call2(SYS_switch_context, (uintptr_t)rtcb, (uintptr_t)tcb)
sys_call1(SYS_restore_context, (uintptr_t)next)

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-11-13 16:35:15 +08:00
Takuya Miyasita
6847eb0c25 risc-v and xtensa Kconfig : Remove LIBC_ARCH_ATOMIC
In https://github.com/apache/nuttx/pull/13044,
LIBC_ARCH_ATOMIC was finally removed.

Howerver, the following chips still have the config.
- ARCH_CHIP_ESP32S3
- ARCH_CHIP_ESP32C3_GENERIC
- ARCH_CHIP_ESP32H2

This commit fixes the issue.
2024-11-13 15:30:53 +08:00