Commit Graph

46600 Commits

Author SHA1 Message Date
chao an
afaaa780eb mm/ubsan: UBSan option should be turned on if SIM_UBSAN enabled
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-19 18:36:39 +08:00
wangbowen6
282c4104b9 tlsr82/serial: clear uart tx index when uart_reset called.
Otherwise, after the rx error occur, the tx output will be
out of sequence, for example:
normal log:
[   30.163000] 12345678abcdefgh
[   30.666000] 12345678abcdefgh
[   31.169000] 12345678abcdefgh
[   31.672000] 12345678abcdefgh
[   32.175000] 12345678abcdefgh
[   32.678000] 12345678abcdefgh
[   33.181000] 12345678abcdefgh

error log:
he 7 .20]0003 127456c8abgdefch
gde [6.707002] 16345b78afcde
fcde
fghe10010] 5234a678ebcd
 77 713 00]41238567dabchefgd
che 7 .21]0003 127456c8abgdefch
gde [8.709002] 16345b78afcde
fcde

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-19 17:46:42 +08:00
chao an
f286012c0d net/procfs: disable tcp/udp proc node if no stack available
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-19 15:45:19 +08:00
Lingao Meng
3461990ef4 arch: arm: tlsr: Use flase_read ins of memcpy
Since tlsr arch support A/B bank, the hardware support
relative addr to load or store, but for flash read,
must use absolute addr. also combine with flash_<*>_method.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-09-19 12:19:48 +08:00
chao an
3a5ae5681d arch/arm/makefile: linking libraries with GCC should use option -l
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-19 11:02:27 +08:00
Alan Carvalho de Assis
64c0ec592b esp32-devkitc: Add support to W5500 WIZnet 2022-09-18 18:20:07 +02:00
raiden00pl
7f79466d0b boards: initial support for nrf5340-audio-dk - NSH boots on the app core 2022-09-18 21:49:32 +08:00
raiden00pl
69ecafd352 arch/arm: initial support for NRF5340 2022-09-18 21:49:32 +08:00
chao an
f23a736c80 nxstyle: correct the file path
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-18 01:35:21 +08:00
chao an
0c4ca8dd21 boards/arm/ac6: add scatter linker script for sabre-6quad/lm3s6965-ek
add armclang compiler(AC6) support for board sabre-6quad/lm3s6965-ek

Verified config:
1. lm3s6965-ek:qemu-flat (Disable file apps)
./tools/configure.sh lm3s6965-ek:qemu-flat

-CONFIG_BOARDCTL_APP_SYMTAB=y
-CONFIG_ELF=y
-CONFIG_EXAMPLES_ELF=y
-CONFIG_EXAMPLES_ELF_DEVPATH="/dev/ram5"
-CONFIG_EXAMPLES_HELLO=y
-CONFIG_EXAMPLES_MODULE=y
-CONFIG_EXAMPLES_MODULE_DEVPATH="/dev/ram6"
-CONFIG_EXAMPLES_NETTEST=m
-CONFIG_EXAMPLES_WGET=y
-CONFIG_HOST_MACOS=y
-CONFIG_LIBC_DLFCN=y
-CONFIG_NSH_FILE_APPS=y

2. sabre-6quad/smp

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-18 00:08:42 +08:00
chao an
0bafb014a1 arch/arm/compiler: correct global symbol name
Fix Compile error from Armclang compiler(AC6):
Error: L6218E: Undefined symbol arm_vectoraddrexcption (referred from arm_vectoraddrexcptn.o).

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-17 22:07:21 +08:00
chao an
e156866a73 arch/arm: declare vector array default type to read-only
Reference:
https://developer.arm.com/documentation/dui0474/m/image-structure-and-generation/section-placement-with-the-linker/section-placement-with-the-first-and-last-attributes

CAUTION:
FIRST and LAST must not violate the basic attribute sorting order. For example, FIRST RW is placed after any read-only code or read-only data.

arm-none-eabi-readelf -aS arm_vectors.o
1. Without const:
  Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 3] .vectors          PROGBITS        00000000 000034 00011c 00   A  0   0  4

2. const symbol:
  [ 3] .vectors          PROGBITS        00000000 000034 00011c 00  WA  0   0  4

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-17 21:40:15 +08:00
teknokita
1adef79c24 add include <nuttx/fs/ioctl.h> to esp32c3_usbserial.c
undeclare TCGETS on esp32c3 when enable usbserial and termios
error:
chip/esp32c3_usbserial.c: In function 'esp32c3_ioctl':
chip/esp32c3_usbserial.c:411:10: error: 'TCGETS' undeclared (first use in this function)
2022-09-17 17:06:58 +08:00
ligd
e2df52390a SMP: fix crash when switch to new task which is still running
Situation:

Assume we have 2 cpus, and busy run task0.

CPU0                                CPU1
task0 -> task1                      task2 -> task0
1. remove task0 form runninglist
2. take task1 as new tcb
3. add task0 to blocklist
4. clear spinlock
                                    4.1 remove task2 form runninglist
                                    4.2 take task0 as new tcb
                                    4.3 add task2 to blocklist
                                    4.4 use svc ISR swith to task0
                                    4.5 crash
5. use svc ISR swith to task1

Fix:
Move clear spinlock to the end of svc ISR

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-17 17:37:47 +09:00
ligd
615bc9f0e2 SMP: fix assert failed when one task set to 255
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-17 17:37:47 +09:00
Petro Karashchenko
4fc76ea661 arch/arm/samv7: fix random corruption of data after SDIO RX DMA transaction
use time based timeout calculation instead of cycle based

minor styling fixes

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-09-17 12:29:58 +08:00
Xiang Xiao
9c229a0173 libc: Remove LIBC_ERR from libs/libc/misc/Kconfig
forget in https://github.com/apache/incubator-nuttx/pull/6805

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-16 22:56:38 +02:00
田昕
521f870965 phy62xx:support MTDIOC_ERASESTATE
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-16 21:11:06 +08:00
Xiang Xiao
a7b3217c37 boards/arch: Remove FAR from 32bit/64bit arch
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-16 10:22:12 +02:00
Xiang Xiao
78fcc6670d boards/ucleo-h743zi: Remove CONFIG_ARMV7M_SYSTICK from stm32_boot_image.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-16 10:19:39 +02:00
chao an
7dbaa4f4c4 arch/arm: add support for armclang compiler(AC6)
Reference:
https://developer.arm.com/Tools%20and%20Software/Arm%20Compiler%20for%20Embedded

Signed-off-by: chao an <anchao@xiaomi.com>
Signed-off-by: sheyunhu <sheyunhu@xiaomi.com>
2022-09-16 14:47:27 +08:00
chao an
54aa91f02b arch/arm: unify compile flags to common/Toolchain.defs
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-16 14:47:27 +08:00
chao an
0f0a94186f arch/arm/toolchain: migrate the toolchain define to arch/arm/Kconfig
migrate the toolchain define to arch/arm/Kconfig to simplify new toolchain registration

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-16 14:47:27 +08:00
Xiang Xiao
5253861e7e mm: Fix minor style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-16 15:24:49 +09:00
zhangyuan21
f10759e377 armv7-a/r: modify regs index to improve exception performance 2022-09-16 15:24:03 +09:00
Nathan Hartman
d09304008e net: Fix sa_family returned by SIOCGIFHWADDR
* net/netdev/netdev_ioctl.c:
  (netdev_ifr_ioctl): The ioctl SIOCGIFHWADDR provides the hardware
   address (e.g., Ethernet MAC, etc.) of a network interface. It is
   based on Linux. (BSD-based systems don't have this ioctl.) The Linux
   implementation sets sa_family to ARPHRD_ETHER for Ethernet and IEEE
   802.11 interfaces [1]. NuttX was setting it to NET_SOCK_FAMILY for
   these interface types as well as 6LoWPAN and PKTRADIO; this was
   incorrect and also the value of NET_SOCK_FAMILY varies based on
   Kconfig settings. Correcting this to ARPHRD_ETHER for Ethernet and
   IEEE 802.11 and ARPHRD_IEEE802154 for 6LoWPAN and PKTRADIO.

References:
[1] 'man 7 netdevice' on Linux.
2022-09-16 02:59:50 +08:00
Nathan Hartman
6c4bd5c5ef net: Fix memcpy() size used by SIOCSIFHWADDR for radios
* net/netdev/netdev_ioctl.c:
  (netdev_ifr_ioctl): The ioctl SIOCSIFHWADDR sets the hardware address
   (e.g., Ethernet MAC, etc.) of a network interface. Radio devices may
   have different lengths of hardware addresses, such as
   NET_6LOWPAN_EADDRSIZE (8), NET_6LOWPAN_SADDRSIZE (2), or
   RADIO_MAX_ADDRLEN (8). Also, Kconfig CONFIG_PKTRADIO_ADDRLEN allows
   the user to set any arbitrary size. Note that while the sister ioctl
   SIOCGIFHWADDR "get hardware address" copies
   `dev->d_mac.radio.nv_addrlen` bytes, SIOCSIFHWADDR was copying
   NET_6LOWPAN_ADDRSIZE bytes unconditionally. Depending on which radio
   is used, this could be incorrect. Fixing it to use
   `dev->d_mac.radio.nv_addrlen` for SIOCSIFHWADDR as well. Also adding
   DEBUGASSERT to ensure this is within bounds of source and
   destination of the copy.
2022-09-16 02:59:40 +08:00
Andres Sanchez
64687e438a boards/stm32h7: add support for mcuboot
Add support for MCUBoot.
Two new configurations are added:
- mcuboot-loader: mcuboot-loader app used as a bootloader.
main_mcuboot_loader as entrypoint
- mcuboot-app: used as mcuboot agent app. Needs to be
signed manually through "imgtool sign --pad  --align 4 -v 0 -s
auto -H 0x200 --pad-header -S 0xc0000 nuttx.hex nuttx_sign.bin"

Signed-off-by: Andres Sanchez <tito97_sp@hotmail.com>
2022-09-16 02:12:17 +08:00
xinbingnan
204d143e9e tools/ci/cibuild.sh: add CodeChecker requirements for cibuild.sh
Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2022-09-16 02:09:20 +08:00
xinbingnan
ef6036f63e tools/ci/docker/linux/Dockerfile: Install CodeChecker and requirements(clang, clang-tidy)
Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2022-09-16 02:09:20 +08:00
Lingao Meng
4bc10fe07d boards: tlsr: Add specific section for discribe information
Add specific section for discribe information, current use for
factory test.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-09-15 18:29:44 +08:00
田昕
f6ebbe4429 drivers/mtd:init commit of power-loss resilient cfg
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-15 17:46:56 +08:00
Michal Lenc
7d877fbbc3 imxrt: add support for PWM synchronization
This commit allows the PWM modules to be synchronized by an external
signal (other PWM module for example). The sync source can be selected
from configuration.

PWM module can also now generate a trigger when its timer reaches the duty
cycle. This trigger is used for the synchronization of other modules. It
can also be used for triggering ADC for example in the future.

Thanks to Rastislav Pavlanin and  Jan Spurek from NXP support for
suggestion which helped to solve the inter-module PWM synchronization
task.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2022-09-15 08:10:26 +09:00
chao an
e586f86918 sched/mqueue: fix resource leak in mq_timedsend()
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-15 01:56:35 +08:00
Alan Carvalho de Assis
f69251151e stm32f4discovery: Add W5500 board config example 2022-09-15 01:55:47 +08:00
Alan Carvalho de Assis
5322f909ef stm32f4discovery: Add support to WIZnet W5500 2022-09-15 01:55:47 +08:00
Eero Nurkkala
ec026c14cb risc-v/mpfs: emmcsd: further enhance the clocking
Simplify the clock mode from the board.h -files. Also make the
SD clock definable as well.

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-15 01:55:33 +08:00
Ville Juven
ea9144bda8 mpfs/mpfs_ddr.c: Stop the DDR training once it is completed
The DDR training IP stays active otherwise, so stop it when the training
is complete.

This fixes a potential interrupt storm via MPFS_IRQ_DDRC_TRAIN.
2022-09-14 22:31:36 +08:00
Alan Carvalho de Assis
72313301e2 net/w5500: Fix small typo 2022-09-13 19:50:25 -04:00
Nathan Hartman
1913163c64 drivers: Fix some Kconfig help texts 2022-09-13 23:25:47 +08:00
Nathan Hartman
00666a8778 drivers/mmcsd: Remove executable permissions from source files 2022-09-13 23:07:34 +08:00
ligd
bedd5d382d armv7-a: icache also need SMP cache coherency configuration
This can fixes the random crash happened sometime during boot.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-13 17:59:41 +08:00
Nathan Hartman
69feebe48c tools/pic32: Add description, fix nxstyle, fix typos
* tools/pic32/Config.mk: Fix typo.

* tools/pic32/mkpichex.c:
  (): Add one-line description of this file.
  (adjust_extlin): Fix nxstyle error and typo in comment.
2022-09-13 14:53:54 +08:00
Nathan Hartman
8231485eff tools/b16.c: Fix usage text 2022-09-13 14:53:42 +08:00
Eero Nurkkala
e5305a250a risc-v/mpfs: emmcsd: provide options for selecting clk speed
Some related products, such as Aries m100pfs, don't support eMMC
speeds up to 200MHz. Thus, provide option to select slower clock.
This has only to do with the clocking, no CMD6 is sent to select
high speed modes.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-13 11:23:45 +08:00
licheng
6a01099c59 reinit spi sd when sd status is wrong.
Signed-off-by: licheng <chengli@bestechnic.com>
2022-09-12 17:12:02 -03:00
Ville Juven
ff05cc593f risc-v/mmu: Fix L3 mappings for kernel, and mpfs protected mode userspace
The L3 mapping function was just way too simplistic. Depending on memory
configuration it either works or not.

Noticed that with icicle:pnsh the software crashes due to instruction
page fault, reason is the map_region() implementation that does not
work for regions that are not aligned to 2MB (the L2 page size).

Implemented an extremely simplistic page table allocator for the L3
references, that should once and for all get rid of the L3 mapping issue.

NOTE: gran_alloc() cannot be used at this point, it is too early for it.
2022-09-12 18:01:08 +09:00
Alan Carvalho de Assis
0eb79f1a9a ttgo_lora_esp32: Add support to SX1276 2022-09-11 13:13:16 +08:00
zhangyuan21
3b889d820f armv7-a/r: use SRS and RFE for exception handler 2022-09-11 10:50:37 +09:00
Xiang Xiao
8b8534c4b4 usrsock: Initialize g_usrsockdev in the declaration
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-11 10:08:04 +09:00