Commit Graph

53454 Commits

Author SHA1 Message Date
chao an
d4024c8388 arch/armv8-r: update g_running_tasks before context switch
fix invalid running_task() in assertion logic

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-12 00:39:37 +08:00
simbit18
2f8560e838 tools/ci: enable avr32dev1 build
removed in the tools/ci/testlist/other.dat file the entries
 -avr32dev1:nsh
 -avr32dev1:ostest

avr32_bringup.c
Fix  Error: ./avr32_bringup.c:54:4: error: #warning "Not Implemented"

comment out directive '#warning'
/* #warning "Not Implemented" */

avr_doirq.c

fix avr32/avr_doirq.c:117: error: assignment discards qualifiers from pointer target type
  regs = g_current_regs; -> regs = (uint32_t *)g_current_regs;
2024-07-12 00:39:21 +08:00
chao an
7b4f554f39 cmake: strip file full path to save the code size
Cmake build provide absolute paths to compile files. If __FILE__
macros are used in the source code(ASSERT), the binary will be occupied
by many invalid paths.
This saves some memory, stops leaking user locations in binaries, makes
failure logs more deterministic and most importantly makes builds more
deterministic.
Debuggers usually have a path mapping feature to ensure the files are
still found.

Test config sabre-6quad/citest:

Before:
$ size build/nuttx
   text	   data	    bss	    dec	    hex	filename
 279309	    908	  13652	 293869	  47bed	build/nuttx

After:
$ size build/nuttx
   text	   data	    bss	    dec	    hex	filename
 269313	    908	  13652	 283873	  454e1	build/nuttx

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-12 00:39:08 +08:00
chao an
95a9facf3a arch/armv8-r: new config to set SPIs Configuration to edge-triggered
Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-11 15:35:41 +08:00
Henry Rovner
091372069c risc-v/bl808: Add SPI driver
This commit implements a driver for SPI0 and SPI1 on the BL808 and introduces an accompanying example configuration.
2024-07-11 11:32:24 +08:00
chao an
b191153cdc arch/armv8-r: fix typos in config
replace ARMV7R to ARMV8R

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-10 18:41:13 -03:00
Saurav Pal
6f0daf08eb fs/mnemofs: Adds Block Allocator
Adds Block Allocator logic to mnemofs.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-07-10 18:40:47 -03:00
YAMAMOTO Takashi
881f749777 refresh esp32s3-devkit:qemu_debug
after https://github.com/apache/nuttx/pull/12639
2024-07-10 23:38:17 +08:00
Michal Lenc
a91d40e0e8 samv7: fix CAN FD configuration
Larger RX/TX buffers might be required for both FD and FD_BSW modes.
Default bit timing values are also changed since the original ones
did not provide correct results for default SAMv7 board clock selection
(150 MHz clock frequency). The current values provide correct bit timing
with sample point as close to 87.5 %.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-07-10 11:33:03 -03:00
Michal Lenc
e16ee4dba3 can: enhance bit timing ioctl to set both nominal and data bit timing
This adds field type to canioc_bittiming_s structure that allows
to set/obtain bit timing for both CAN CC and CAN FD.
CANIOC_GET_BITTIMING is now bidirectional: user specifies type field
and gets other fields from the controller.

The commit also updates current CAN FD capable controllers using the
ioctl. The type is not checked for classical CAN only controllers
and nominal bit timing is returned regardless of type value.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-07-10 11:33:03 -03:00
Michal Lenc
816b1b28a0 can: enhance API to allow better CAN FD handling
This commit moves can_bytes2dlc and can_dlc2bytes from kernel internal
functions to API. These functions are necessary to convert bytes to
dlc for CAN FD frames and has to be accessible from the application
since can_hdr_s does not store message length in bytes but directly in
dlc.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-07-10 11:33:03 -03:00
Eero Nurkkala
80c37c7b36 tools/imx9: prepare bootable bootloader image
This does the following:
  1. Fetches mkimage_imx8 (same used with imx9) source code
  2. Fetches the ELE / AHAB binary
  3. Extracts the ELE / AHAB binary
  4. Compiles the mkimage with hostcc
  5. Utilizes the mkimage tool to create a bootable SD image,
     combining the ELE / AHAB image with the NuttX bootloader
  6. dd is used to prepend empty space in place of BL31
  7. Outputs sdimage.img which is a bootable binary
  8. Removes all binaries, sources code images that have been
     downloaded

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2024-07-10 22:30:38 +08:00
Saurav Pal
23b7dc0651 fs/mnemofs: Setup and VFS methods
The Setup and VFS methods for mnemofs, a NAND Flash File System.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-07-10 09:25:23 -03:00
buxiasen
de460b5a10 mm_ubsan: add dummy to bypass runtime actions
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-07-10 20:09:39 +08:00
Jorge Guzman
738a30a421 stm32h7/linum-stm32h753bi: add support to qencoder
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-07-09 21:19:54 -03:00
Eero Nurkkala
48cf91a7be arm64/imx9: ccm: add default clk init
This adds enablers for setting various clocks to some default
values. Also, this provides helpers to grant nonsecure access
to a number of clocks. Bootloader may utilize these to make
the system boot in a deterministic manner.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2024-07-09 21:14:11 -03:00
dependabot[bot]
db24702fc5 build(deps): bump zipp from 3.16.2 to 3.19.1 in /Documentation
Bumps [zipp](https://github.com/jaraco/zipp) from 3.16.2 to 3.19.1.
- [Release notes](https://github.com/jaraco/zipp/releases)
- [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst)
- [Commits](https://github.com/jaraco/zipp/compare/v3.16.2...v3.19.1)

---
updated-dependencies:
- dependency-name: zipp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-10 03:36:22 +08:00
YAMAMOTO Takashi
2e5749f7a9 Documentation: mention esp32s3-devkit:qemu_debug 2024-07-10 00:06:18 +08:00
YAMAMOTO Takashi
e6f35007f0 esp32s3-devkit: add a config for qemu
based on esp32s3-devkit:toywasm, tailored for the espressif fork
of qemu. [1]

* disabled a few things for which emulation doesn't seem available:

  * wifi
  * spiram
  * ESP32S3_SYSTEM_BBPLL_RECALIB

* enabled DEBUG_SYMBOLS for my convenience (thus _debug suffix)

* enabled hostfs for my convenience

tested with:
qemu-xtensa-softmmu-esp_develop_9.0.0_20240606-x86_64-apple-darwin.tar.xz

[1] https://github.com/espressif/qemu
2024-07-10 00:06:18 +08:00
shizhenghui
f2b1c649eb nxcodec: add .rst documentation
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-07-09 10:46:17 -03:00
xuxingliang
848eca04ca arch/arm64: allow to use custom idle
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-07-09 19:36:48 +08:00
xuxingliang
94387630c9 arch/arm64: remove not used idle trace
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-07-09 19:36:48 +08:00
Alan Carvalho de Assis
82946d0d5f net: Enable ICMP by default if IPv4 is enabled
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-07-09 17:08:27 +08:00
buxiasen
410ed94655 mm_ubsan: add implement for dynamic_type_cache_miss
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-07-09 17:07:50 +08:00
xuxingliang
129f751fae Documentation: add drivers early initialization
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-07-09 16:05:59 +08:00
xuxingliang
bbc31d70f4 drivers: add API for drivers early initialization
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-07-09 16:05:59 +08:00
Lwazi Dube
b881868f19 arch/arm/sama5: Fix typos in ohci driver comments. 2024-07-09 09:20:13 +08:00
Huang Qi
d0210c1174 riscv_tcbinfo: Fix register ordering for PC
X0 is always 0 but still should be transfered to the client, but it don't existed in thread context, use any other register for it, and its value will be omitted by gdb client.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-07-08 21:13:25 +08:00
Yanfeng Liu
794335abce docs/syscall: fix typos in documentation
This fixes a few typos encountered when reading syscall online
document.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-07-08 19:28:30 +08:00
halyssonJr
7223ec3dbe add support to userleds 2024-07-07 20:13:16 -03:00
halyssonJr
47d8557485 add usb configuration of usbnsh 2024-07-07 19:31:13 -03:00
Windrow14
479c393291 fs/fat/fs_fat32.[c|h]: fix fseek bug when file size is multiple of cluster size
Unbinding `ff_currentcluster` and `f_pos`:
1. Added `ff_pos` in `struct fat_file_s`.
2. Added function `fat_zero_cluster` for doing zeroing for gap
   between EOF and new position beyond EOF.
3. Added function `fat_get_sectors` for getting the sector where
   `f_pos` is located, allocting new cluster when `f_pos` is beyond
   EOF.
4. Modify function `fat_read`, and `fat_write` with above functions.
5. Remove redundant logics in `fat_seek` since now new cluster is
   allocated when writing instead of seeking.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-07-06 19:00:01 +08:00
chao an
cef9addbbb sim/cmake: enable garbage collection of unused input sections
enable --gc-sections for linker
enable -ffunction-sections -fdata-sections for compiler

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-06 11:31:40 +08:00
dependabot[bot]
d29875926e build(deps): bump certifi from 2024.2.2 to 2024.7.4 in /Documentation
Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.2.2 to 2024.7.4.
- [Commits](https://github.com/certifi/python-certifi/compare/2024.02.02...2024.07.04)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-06 11:31:19 +08:00
chao an
9915b80e30 arch/sim: add custom data section support
The link script of NuttX Simulator is generated through compilation
options. This PR will support configure special data sections in
kconfig to meet the support of 3rd party applications.

we need to follow the syntax of linker script. In 3rd-party applications, some data will be labeled as section:

| a.c:
| struct task_s a __attribute__((section(".data.custom.taska")));
| b.c:
| struct task_s b __attribute__((section(".data.custom.taskb")));

Data of the same type struct can be placed in a fixed location to reduce the overhead caused by searching:

|   .data           :
|   {
|     _custom_data_table_start = .;
|     KEEP(*(.data.custom.*))
|     _custom_data_table_end = .;
|   }

Such section declare can be configured via Kconfig in the PR:

| CONFIG_SIM_CUSTOM_DATA_SECTION=" .data : { _custom_data_table_start = .; KEEP(*(.data.custom.*)) _custom_data_table_end = .; } "

Signed-off-by: chao an <anchao@lixiang.com>
2024-07-05 16:45:36 -03:00
Jukka Laitinen
b008653ac0 arch/arm64/src/imx9/imx9_lowputc.c: Fix an arithmetic sign error in divisor calculation
In the algorithm there is a subtraction (int - unsigned), which results (potentially overflowed)
unsigned.

Passing this to macro ABS and the assigning to int doesn't work ( unsigned is always >= 0 ).

Fix this by replacing (dangerous) ABS macro with stdlib's standard "int abs(int)"
and change the substraction to (int - int).

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-07-05 21:47:07 +08:00
Jukka Laitinen
31644ec0f5 arch/arm64/src/imx9: Add an mtd driver for NOR flash on FlexSPI interface
This is an initial FlexSPI SPI NOR MTD driver for IMX9

This supprts M25P SPI NOR on FlexSPI for now, and can later be extended to other
SPINOR devices if needed. The following configurations are needed to use this driver:
  CONFIG_IMX9_FLEXSPI_NOR=y
  CONFIG_MTD_M25P=y

In addition, board initialization logic needs to call the imx9_flexspi_nor_initialize
to receive a pointer to the mtd device.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Co-authored-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-07-05 21:46:47 +08:00
Jouni Ukkonen
31a6a4f5d0 imx9: Add flexspi support, ported from imxrt
Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-07-05 21:46:47 +08:00
Henry Rovner
1825c4eb8b Add ox64:adc config to documentation 2024-07-05 13:17:02 +08:00
Henry Rovner
a83e7ced77 ox64: Add adc example config 2024-07-05 13:17:02 +08:00
Henry Rovner
a16956e128 Add peripheral support table to BL808 documentation page 2024-07-05 13:17:02 +08:00
Henry Rovner
8493273c2c risc-v/bl808: Add GPADC character driver
This commit implements a character driver for the general purpose ADC of the BL808, based on the hardware scanning functionality. The driver supports setting different conversion resolutions and the order of channels to be scanned via menuconfig.
2024-07-05 13:17:02 +08:00
Filipe Cavalcanti
0c63840b18 arch/risc-v: add support for capture driver on ESP32C6 and ESP32H2. 2024-07-04 18:24:50 -03:00
Daniel P. Carvalho
3e4a16d851 arch/arm/stm32: Fix EXTI lines definitions for STM32G47XX. 2024-07-04 18:23:51 -03:00
Michal Lenc
f1ef5daa92 samv7/sam_mcan.c: fix TSEG1, TSEG2 and SJW compile warnings for MCAN1
Following warnings were caused by incorrect naming of few defines.

chip/sam_mcan.c:415:7: warning: "MCAN1_NTSEG1" is not defined, evaluates to 0 [-Wundef]
  415 | #  if MCAN1_NTSEG1 > 63
      |       ^~~~~~~~~~~~
chip/sam_mcan.c:418:7: warning: "MCAN1_NTSEG2" is not defined, evaluates to 0 [-Wundef]
  418 | #  if MCAN1_NTSEG2 > 15
      |       ^~~~~~~~~~~~
chip/sam_mcan.c:421:7: warning: "MCAN1_NSJW" is not defined, evaluates to 0 [-Wundef]
  421 | #  if MCAN1_NSJW > 15

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-07-04 18:23:13 -03:00
Almir Okato
457f9d3dce ci: update required esptool version to 4.8.dev4
This esptool version is required when building the
default Simple Boot for Espressif chips.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2024-07-04 18:22:24 -03:00
Almir Okato
652f4f1fe1 esp32[s2|s3]: add volatile bitfields compilation flag
This compilation flag was added in the same way as done for esp32
in order to avoid unexpected behaviors when accessing registers
using struct bitfields.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2024-07-04 18:22:24 -03:00
Almir Okato
593dc946d1 esp32: add simple boot support
The Simple Boot feature for Espressif chips is a method of booting
that doesn't depend on a 2nd stage bootloader. Its not the
intention to replace a 2nd stage bootloader such as MCUboot and
ESP-IDF bootloader, but to have a minimal and straight-forward way
of booting, and also simplify the building.

This commit also removes deprecated code and makes this bootloader
configuration as default for esp32 targets and removes the need
for running 'make bootloader' command for it.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2024-07-04 18:22:24 -03:00
Almir Okato
6ec690cbfc esp32[s2|s3]: move rom segments mapping to espressif common folder
Move and unify map_rom_segments function called when starting
Simple Boot and MCUboot compatible images.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2024-07-04 18:22:24 -03:00
Peter van der Perk
6b79aea0cf imxrt: Correctly update PLL, bit has to toggled instead of being set 2024-07-04 13:00:19 -03:00