Commit Graph

47323 Commits

Author SHA1 Message Date
Xiang Xiao
923c779c83 Fix lpc17_40_serial.c:935:20: error: unused function 'lpc17_40_uart3config'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-03 14:41:14 +01:00
raiden00pl
ef517ed05c stm32/stm32_adc.c fix clang warning
chip/stm32_adc.c:2529:32: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
setbits = ADC_CCR_DUAL_IND | ADC_CCR_DELAY(0) | ADC_CCR_MDMA_DISABLED |
^~~~~~~~~~~~~~~~
2022-11-03 10:15:39 -03:00
yinshengkai
85f727f232 tools: replace INCDIR to Makefile variable
In the past, header file paths were generated by the incdir command
Now they are generated by concatenating environment variables

In this way, when executing makefile, no shell command will be executed,
it will improve the speed of executing makfile
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-03 19:59:55 +08:00
yinshengkai
95d9abcf58 tools: replace DEFINE script to Makefile variable
In the past, predefined macros were generated by define.sh scripts
Now they are generated by concatenating environment variables

In this way, when executing makefile, no shell command will be executed,
it will improve the speed of executing makfile

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-03 19:59:55 +08:00
zhangyuan21
cdeddcb028 arch/armv7-ar: add isb after CACHE and TLB operations. 2022-11-03 19:49:24 +08:00
ligd
8be4bca3eb kasan: fix kasan race-condition
Change-Id: I1c729b8a85422a1f4326785e5d52cb0fc60d4822
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-11-03 08:58:16 +08:00
Xiang Xiao
69575975f4 binfmt: elf_addrenv_free select addrenv before up_addrenv_destroy
to avoid up_addrenv_destroy delete the current task page table
this patch fix the below panic due to elf contain the unresolved symbol:
qemu-system-arm -s -S -semihosting -M sabrelite -m 1024 -smp 4 -kernel nuttx -nographic -net nic -net user,hostfwd=tcp:127.0.0.1:10023-10.0.2.15:23,hostfwd=tcp:127.0.0.1:10021-10.0.2.15:21,hostfwd=tcp:127.0.0.1:15001-10.0.2.15:5001,hostfwd=tcp:127.0.0.1:15555-10.0.2.15:5555
ABDGHIJKNOPQ
[    0.470000] elf_relocate: Section 2 reloc 163: Failed to get value of symbol[1505]: -2
[    0.530000] arm_dataabort: Data abort. PC: 108323de DFAR: 80202778 DFSR: 00000005
[    0.530000] up_assert: Assertion failed at file:armv7-a/arm_dataabort.c line: 161 task: /system/bin/init
[    0.530000] arm_registerdump: R0: 10845820 R1: 80202778 R2: 00000001  R3: 80202778
[    0.530000] arm_registerdump: R4: 80202624 R5: 80202634 R6: 80200330  FP: 80202628
[    0.530000] arm_registerdump: R8: 802026b4 SB: 00000000 SL: 8000dbfe R11: 00000000
[    0.530000] arm_registerdump: IP: 108453e0 SP: 108456b0 LR: 1082b091  PC: 108323de
[    0.530000] arm_registerdump: CPSR: a000007f
[    0.530000] arm_dump_stack: IRQ Stack:
[    0.530000] arm_dump_stack: sp:     10845510
[    0.530000] arm_dump_stack:   base: 108397c0
[    0.530000] arm_dump_stack:   size: 00000800
[    0.530000] arm_dump_stack: ERROR: IRQ Stack pointer is not within the stack
[    0.530000] arm_stackdump: 10839f00: deadbeef 00adbeef 00000001 10844990 00000000 00000000 80300000 1082f2ef
[    0.530000] arm_stackdump: 10839f20: deadbeef 00000000 deadbeef 10844990 80200000 1082f2ff 1083d980 1082f311
[    0.530000] arm_stackdump: 10839f40: 00000002 10814659 00000004 00000002 deadbeef 1081469b 00000001 00000000
[    0.530000] arm_stackdump: 10839f60: 10845460 00000057 10844a90 00000002 deadbeef 10808d1b 10845460 00000057
[    0.530000] arm_stackdump: 10839f80: 00dfbeef 00000057 00000000 00000002 deadbeef 10801d1f 10845460 00000057
[    0.530000] arm_stackdump: 10839fa0: 00000000 10800fc5 deadbeef 10845460 00000057 00000057 deadbeef 108000a0
[    0.530000] arm_dump_stack: User Stack:
[    0.530000] arm_dump_stack: sp:     108456b0
[    0.530000] arm_dump_stack:   base: 80202038
[    0.530000] arm_dump_stack:   size: 000007c8
[    0.530000] arm_dump_stack: ERROR: User Stack pointer is not within the stack
[    0.530000] arm_dump_stack: Kernel Stack:
[    0.530000] arm_dump_stack: sp:     108456b0
[    0.530000] arm_dump_stack:   base: 10844c10
[    0.530000] arm_dump_stack:   size: 00000c00
[    0.530000] arm_stackdump: 108456a0: 00000000 108453e0 108323de a000007f 80202778 10845820 00000000 10812aa9
[    0.530000] arm_stackdump: 108456c0: 00000000 1083ff90 10845838 00000000 001f001e 10812b2f 10840008 1083ff90
[    0.530000] arm_stackdump: 108456e0: 10845840 10812fab 10845840 1083ff90 005f0000 10844990 10845818 10845ff8
[    0.530000] arm_stackdump: 10845700: 10845ff8 10845838 10845840 10812017 fffffffe 10845820 80202624 1082b091
[    0.530000] arm_stackdump: 10845720: 00000000 00000000 80202778 10841d40 00000000 10845840 10845820 fffffffe
[    0.530000] arm_stackdump: 10845740: 00000000 1082998b 00000000 80200330 802026b4 80202778 10845788 0084578c
[    0.530000] arm_stackdump: 10845760: 10841d40 10844990 00000000 108306fb 00000000 80202634 802026b4 80202634
[    0.530000] arm_stackdump: 10845780: 80202778 80202628 00000000 00000000 00000000 00000000 00000000 1083085f
[    0.530000] arm_stackdump: 108457a0: 80200330 00000000 00000000 00000000 80202634 80202624 80202778 80202628
[    0.530000] arm_stackdump: 108457c0: 00000000 00000000 00000000 80202614 80202624 1080f26b 802026b4 80200330
[    0.530000] arm_stackdump: 108457e0: 80202624 80202778 80202628 0000001f 00000000 80202634 802026b4 108012c3
[    0.530000] arm_showtasks:    PID    PRI     STACK      USED   FILLED    COMMAND
[    0.530000] arm_showtasks:   ----   ----      2048       188     9.1%    irq
[    0.530000] arm_dump_task:      0      0      2024      1240    61.2%    Idle Task
[    0.530000] arm_dump_task:      1    224      1992       504    25.3%    hpwork 0x1083e0f8
[    0.530000] arm_dump_task:      2    100      1992       504    25.3%    lpwork 0x1083e110
after apply this patch, nsh report error instead of crash:
qemu-system-arm -s -S -semihosting -M sabrelite -m 1024 -smp 4 -kernel nuttx -nographic -net nic -net user,hostfwd=tcp:127.0.0.1:10023-10.0.2.15:23,hostfwd=tcp:127.0.0.1:10021-10.0.2.15:21,hostfwd=tcp:127.0.0.1:15001-10.0.2.15:5001,hostfwd=tcp:127.0.0.1:15555-10.0.2.15:5555
ABDGHIJKNOPQ
[    0.440000] elf_relocate: Section 2 reloc 163: Failed to get value of symbol[1505]: -2
telnetd [4:100]

NuttShell (NSH) NuttX-11.0.0
nsh> nsh: telnetd: command not found

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-03 00:08:12 +01:00
Zhe Weng
66bc2ffbe6 net/utils: add net_chksum_adjust defined by RFC3022
net_chksum_adjust is used for fast checksum adjustment after modifying some fields in a network packet. Will be used in NAT.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-11-02 21:25:01 +01:00
Gustavo Henrique Nihei
1befe6076f xtensa/esp32s3: Move linker scripts to folder common to all boards
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-11-02 16:04:00 +01:00
Eero Nurkkala
3afc83abc7 risc-v/mpfs: ihc: reorganize ihc
Currently the IHC (Inter Hart Communication) depends on OpenAMP and
rptun.  However, the bootloader portion of the IHC doesn't need
either of them.  Now they are wasting a lot of bootloader space.

Reorganize the bootloader portion into a separate file 'mpfs_ihc_sbi.c'.
This file contains the OpenSBI vendor extensions, or the only required
functionalities for the bootloader.  On the other hand, 'mpfs_ihc.c'
contains the non-bootloader code.

This patch also makes it possible to utilize 2 RPMSG channels.  This
has been tested so that 2 separate NuttXs on harts 1 and 2 communicate
with Linux kernel that runs on harts 3 and 4.

New configuration files are added as well:
  - rpmsg-ch1:  sample config for RPMSG
  - rpmsg-ch2:  sample config for another RPMSG channel
  - rpmsg-sbi:  sample bootloader config for RPMSG/OpenSBI

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-11-02 21:44:52 +08:00
Eero Nurkkala
e50db35dc4 Revert "mpfs/mpfs_ddr.c: Stop the DDR training once it is completed"
This reverts commit ea9144bda8.

The commit made Icicle MPFS DDR useless. Revert the change for now.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-11-02 21:44:52 +08:00
Gustavo Henrique Nihei
f5c77933cb arch: Fix linking of multiple preprocessed linker script files
Only the last item from the ARCHSCRIPT list was being suffixed with
".tmp".

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-11-02 09:15:27 +08:00
Alan Carvalho de Assis
fd8647d3dd Doc: Add how to configure network MTU size 2022-11-02 09:14:17 +08:00
Xiang Xiao
12926ee864 arch/arm: Document the clever trick of PRI?32 macros
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 23:11:16 +01:00
Xiang Xiao
9e72fe9fab libc/spawn: Always build lib_psa_[get|set]stacksize.c
instead of lib_psa_[get|set]stackaddr.c since the later doesn't exist in kernel mode
regression by:
commit b9b032af72
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Thu Oct 20 03:10:23 2022 +0800

    sched/spawn: Support task_spawnattr_[set|get]stacksize in kernel mode

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 21:03:52 +01:00
Xiang Xiao
93895c42a7 arch/arm: Typedef _[u]int32_t to __[U]INT32_TYPE__
if __INT32_TYPE__ is defined

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 19:58:20 +01:00
Xiang Xiao
463be02921 Fix usbhost/usbhost_hidmouse.c:1693:13: error: unused function 'usbhost_putle16'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
4578df5cbb Fix lpc17_40_serial.c:705:24: error: unused function 'lpc17_40_uartcclkdiv'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
7daacec1fa Fix lpc17_40_serial.c:510:20: error: unused function 'up_restoreuartint'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
3b060bad34 Fix error: format specifies type 'unsigned short' but the argument has type 'int'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
5948dc8c8f Fix lpc17_40_sdcard.c:614:24: error: unused function 'lpc17_40_getpwrctrl'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
09997c6546 Fix lpc17_40_serial.c:814:20: error: unused function 'lpc17_40_uart0config'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
ae9ff3bc67 Fix lpc176x_clockconfig.c:213:16: error: variable 'regval' set but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
zhangyuan21
8512ca74b1 clock: adjust clock function to support tick
When CONFIG_SCHED_TICKLESS_TICK_ARGUMENT enabled, we can
use up_timer_gettick to get ticks for better performance.
2022-11-01 21:54:20 +08:00
zhangyuan21
b118083c35 arch_timer: adjust timer/arch_timer to support tick
Enable CONFIG_SCHED_TICKLESS_TICK_ARGUMENT in tickless mode
to improve the performance.
2022-11-01 21:53:08 +08:00
Fotis Panagiotopoulos
189aa0292f arm: Added breakpoint in stack overflow trap. 2022-11-01 21:42:25 +08:00
SPRESENSE
3379fc96fc arm/backtrace_sp: fix build warning
common/arm_backtrace_sp.c: In function 'up_backtrace':
common/arm_backtrace_sp.c:253:15: warning: assignment to 'long unsigned int' from 'uint8_t *' {aka 'unsigned char *'} makes integer from pointer without a cast [-Wint-conversion]
  253 |           top = g_intstacktop;
      |
2022-11-01 13:49:56 +01:00
wangbowen6
fccda0c08b mm_heap: add debug assert to check the alignment problem
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2022-11-01 19:21:01 +08:00
wangbowen6
5611d89015 nucleo-h743zi2: refresh the pysim defconfig to fix CI problem
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-01 16:16:02 +08:00
Fotis Panagiotopoulos
e89432b563 Added DHCSR definitions for ARMv7 & ARMv8. 2022-11-01 09:22:07 +08:00
Andrés Sánchez Pascual
533a83155b issue/ORDISO-17: Add wdg support
Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
2022-11-01 09:21:04 +08:00
SPRESENSE
77528fbeb9 boards/cxd56xx/spresense: Add CXD56_LTE_LATE_INITIALIZE config
This CXD56_LTE_LATE_INITIALIZE enables to initialize alt1250 lte
driver in the application side code.
2022-11-01 09:20:34 +08:00
SPRESENSE
76e411eca0 boards: cxd56xx: Add CXD56_CAMERA_LATE_INITIALIZE config
This CXD56_CAMERA_LATE_INITIALIZE enables to initialize camera device
drivers in the application side code.
2022-11-01 09:20:34 +08:00
SPRESENSE
9a8576911f boards: cxd56xx: Fix power-off time of video driver
Add a power-off time for image sensor by the device specification.
2022-11-01 09:20:34 +08:00
Xiang Xiao
28947517ca sched/spawn: Rename task_spawnattr_[get|set]stack[size|addr] to posix_spawnattr_[get|set]stack[size|addr]
since they can be not only used in task_spawn but also in posix_spawn

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 09:51:18 +09:00
chao an
e0a3fdf982 sched/posix/timer: handle invaild timerid correctly
TIMER_SETTIME(2)

NAME
       timer_settime, timer_gettime - arm/disarm and fetch state of POSIX per-process timer

SYNOPSIS
       #include <time.h>

       int timer_settime(timer_t timerid, int flags,
                         const struct itimerspec *new_value,
                         struct itimerspec *old_value);
       int timer_gettime(timer_t timerid, struct itimerspec *curr_value);
...
ERRORS
...
       EINVAL timerid is invalid.

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-31 19:59:29 -03:00
chao an
1550747400 sched/getprioritymax: handle invaild policy as posix style
modify the return value according to posix standard
------------
SCHED_GET_PRIORITY_MAX(2)

NAME
       sched_get_priority_max, sched_get_priority_min  - get static priority range

RETURN VALUE
       On success, sched_get_priority_max() and sched_get_priority_min() return the
                   maximum/minimum priority value for the named scheduling policy.
       On error, -1 is returned, and errno is set appropriately.

ERRORS
       EINVAL The argument policy does not identify a defined scheduling policy.

Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-01 03:33:58 +08:00
Zhe Weng
eeb4d41f55 script: fix simhostroute.sh to remove nat rule correctly
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-10-31 21:22:30 +08:00
Xiang Xiao
a98949d0f6 Fix video/video.c:1458:52: error: implicit conversion from enumeration type 'enum v4l2_buf_type' to different enumeration type 'imgsensor_stream_type_t' (aka 'enum imgsensor_stream_type_e') [-Werror,-Wenum-conversion]
ret = g_video_sensor_ops->validate_frame_setting(type, nr_fmt, sf, &si);
       ~~~~~~~~~~~~~~~~~~                         ^~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 13:10:09 +01:00
Xiang Xiao
3e3364d1a9 Fix the format string mismatch warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 11:20:56 +01:00
Xiang Xiao
e08c296a8e Change the type of tg_joinlock, mm_lock and md_lock from sem_t to mutex_t
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 10:35:53 +01:00
zhangyuan21
18266c1012 nuttx/sched: use pid to check idle task
Pid is more appropriate than the flink pointer to determine idle task,
when we want to use other data structure to optimize the task list.
2022-10-31 17:53:08 +09:00
chao an
b353d84742 net/tcp: fix build break if enable NET_TCP_NO_STACK
devif/ipv6_input.c: In function 'ipv6_input':
devif/ipv6_input.c:59:33: error: 'TCPIPv6BUF' undeclared (first use in this function); did you mean 'IPv6BUF'?
   59 | #define PAYLOAD ((FAR uint8_t *)TCPIPv6BUF)
      |                                 ^~~~~~~~~~
devif/ipv6_input.c:302:14: note: in expansion of macro 'PAYLOAD'
  302 |   payload  = PAYLOAD;     /* Assume payload starts right after IPv6 header */
      |

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-31 15:31:31 +08:00
Xiang Xiao
a42bcaf680 Fix Error: usbhost/usbhost_storage.c:1471:24: error: unused function 'usbhost_getle32' [-Werror,-Wunused-function]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 06:30:26 +01:00
Xiang Xiao
64e7833cbc sched/spawn: Support task_spawnattr_[set|get]stackaddr
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 12:46:58 +09:00
Xiang Xiao
b9b032af72 sched/spawn: Support task_spawnattr_[set|get]stacksize in kernel mode
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-31 12:46:58 +09:00
Xiang Xiao
55083b31a9 boards/sim: Enable CONFIG_NSH_FILE_APPS for loadable config
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 12:46:58 +09:00
Julian Oes
227218659b stm32h7: Add missing time.h include
This is required for me when building within CLion.

Without it, I get the error:

error: field 'lastwrite' has incomplete type
2022-10-31 10:22:27 +08:00
Sergey Nikitenko
74b38d3c65 boards/stm32wb/flipperzero: adding LCD support 2022-10-31 09:40:13 +08:00
Xiang Xiao
59416af3e6 Fix modem/alt1250/altcom_cmd_sms.h:148:7: error: field u within 'struct apicmd_sms_msg_s' is less aligned than 'union
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00