Commit Graph

51129 Commits

Author SHA1 Message Date
xinbingnan
4c75318778 tools/minidumpserver: refactor codes
VELAPLATFO-16411

1. refactor code style and simplify parse method
2. change mem find algorythm to bi-search

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2023-09-21 00:38:41 +08:00
Shanmin Zhang
9b68971853 goldfish: add goldfish gps driver
Verification:

uorb_listener -r 1 sensor_gps

[   18.240000] [13] [  INFO] [ap]
Mointor objects num:2
[   18.240000] [13] [  INFO] [ap] object_name:sensor_gps, object_instance:0
[   18.240000] [13] [  INFO] [ap] object_name:sensor_gps, object_instance:1
[   18.240000] [13] [ ALERT] [ap] period_us = 1000000
[   19.010000] [13] [  INFO] [ap] sensor_gps:	timestamp: 19010000 (0 us ago) time_utc: 1689601925 latitude: 37.4210 longitude: -121.9150
[   19.010000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   19.010000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
[   20.020000] [13] [  INFO] [ap] sensor_gps:	timestamp: 20020000 (0 us ago) time_utc: 1689601926 latitude: 37.4210 longitude: -121.9150
[   20.020000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   20.020000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
[   21.010000] [13] [  INFO] [ap] sensor_gps:	timestamp: 21010000 (0 us ago) time_utc: 1689601927 latitude: 37.4210 longitude: -121.9150
[   21.010000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   21.010000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
[   22.020000] [13] [  INFO] [ap] sensor_gps:	timestamp: 22020000 (0 us ago) time_utc: 1689601928 latitude: 37.4210 longitude: -121.9150
[   22.020000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   22.020000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
[   23.010000] [13] [  INFO] [ap] sensor_gps:	timestamp: 23010000 (0 us ago) time_utc: 1689601929 latitude: 37.4210 longitude: -121.9150
[   23.010000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   23.010000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
...

Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2023-09-21 00:38:14 +08:00
ThomasNS
a2c806027f fix led panic feature 2023-09-21 00:35:12 +08:00
Neale Ferguson
5d7f2fdf16 Fix loading of ET_DYN type of shared objects
* build-globals.sh
  - Only look in the nuttx for external symbols used when loading
    dynamic shared objects

* include/elf64.h
  - Correct the type of fields in the Elf64_Phdr structure

* libs/libc/dlfcn/lib_dlclose.c
  - Distinguish between ET_DYN and other objects as the former
    has both text and data in a single allocation to reserve
    GOT offsets

* libs/libc/dlfcn/lib_dlopen.c
  - Code formatting

* libs/libc/modlib/modlib_bind.c
  - Distinguish between relocation entry sizes by section type
  - Handle RELA style relocations

* libs/libc/modlib/modlib_globals.S
  - Formatting fixes
  - Symbols should not be weak - they exist or they don't

* include/nuttx/lib/modlib.h
  - Add an inidcator to module_s to distinguish between ET_DYN and other

* libs/libc/modlib/modlib_load.c
  - ET_DYN objects need to keep the relative displacement between the text
    and data sections due to GOT references from the former to the latter.
    This also implies that linking may require modification from the default
    for the shared objects being produced. For example, default alignment may
    mean nearly 64K of wasted space.

* libs/libc/modlib/modlib_unload.c
  sched/module/mod_rmmod.c
  - Distingusih between freeing of ET_DYN storage and other as the former
    is a single allocation.

* libs/libc/modlib/mod_insmod.c
  - Cater for ET_DYN objects having init and preinit sections
2023-09-20 09:35:28 -04:00
zhangyuan21
f47991e34d arch/arm64: select ARCH_HAVE_IRQTRIGGER for all arm64 chip
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-20 20:52:03 +08:00
Xiang Xiao
9bd6c70339 input/touchscreen: Bring up TSIOC_[SET|GET]CALIB macro
which is removed accidently in:
https://github.com/apache/nuttx/pull/9398

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-20 20:51:38 +08:00
Jani Paalijarvi
c8540a1f9b drivers/net/rpmsgdrv.c: Improve init error handling
Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2023-09-20 19:23:14 +08:00
Jani Paalijarvi
999970b820 drivers/net/rpmsgdrv.c: Take netdev_register() return value into account
Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2023-09-20 19:23:14 +08:00
Michal Lenc
0a2c79034f documentation: add information about SAMv7 1 wire support
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-09-20 17:27:26 +08:00
Michal Lenc
c5209e6189 samv7: add support for one wire driver over UART/USART
This commit adds support for 1 wire interface over serial driver. SAMv7
MCU does not have build in one wire support therefore external hardware
still has to be used (connection of RX/TX for example).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-09-20 17:27:26 +08:00
Michal Lenc
2e08750daf samv7: rework U(S)ART config option to allow more driver configurations
UART/USART peripheral can be used for more than just standard serial
driver. It can for example be used for 1 wire interface communication
(with external circuitry added). This changes the Kconfig for SAMv7 to
allow future implementation of these drivers. Now user can select
what kind of a driver he wants on UART/USART (serial or something else).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-09-20 17:27:26 +08:00
Philippe Leduc
b47f240b5f Use standard arm-none-eabi toolchain by default. 2023-09-20 17:26:35 +08:00
Huang Qi
ac5e99d330 espressif: Force cast param in libc stubs
Fix:
```
chip/esp_libc_stubs.c: In function '__retarget_lock_init':
Error: chip/esp_libc_stubs.c:246:14: error: passing argument 1 of '_lock_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
  246 |   _lock_init(lock);
      |              ^~~~
      |              |
      |              struct __lock **
chip/esp_libc_stubs.c:181:26: note: expected 'int *' but argument is of type 'struct __lock **'
  181 | void _lock_init(_lock_t *lock)
      |                          ^
chip/esp_libc_stubs.c: In function '__retarget_lock_init_recursive':
Error: chip/esp_libc_stubs.c:251:24: error: passing argument 1 of '_lock_init_recursive' from incompatible pointer type [-Werror=incompatible-pointer-types]
  251 |   _lock_init_recursive(lock);
      |                        ^~~~
      |                        |
      |                        struct __lock **
chip/esp_libc_stubs.c:187:36: note: expected 'int *' but argument is of type 'struct __lock **'
  187 | void _lock_init_recursive(_lock_t *lock)
      |                                    ^
chip/esp_libc_stubs.c: In function '__retarget_lock_close':
Error: chip/esp_libc_stubs.c:256:15: error: passing argument 1 of '_lock_close' from incompatible pointer type [-Werror=incompatible-pointer-types]
  256 |   _lock_close(&lock);
      |               ^~~~~
      |               |
      |               struct __lock **
chip/esp_libc_stubs.c:193:27: note: expected 'int *' but argument is of type 'struct __lock **'
  193 | void _lock_close(_lock_t *lock)
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-09-20 17:04:56 +08:00
Huang Qi
74e59feaaa rv32m1: Fix compile error
Follow other risc-v based chips, and fix:
```
chip/rv32m1_irq.c: In function 'up_irqinitialize':
Error: chip/rv32m1_irq.c:98:3: error: array subscript -2048 is outside array bounds of 'uint8_t[2147483647]' {aka 'unsigned char[2147483647]'} [-Werror=array-bounds]
   98 |   riscv_stack_color(g_intstacktop - intstack_size, intstack_size);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /github/workspace/sources/nuttx/arch/risc-v/src/common/riscv_internal.h:40,
                 from chip/rv32m1_irq.c:36:
/github/workspace/sources/nuttx/arch/risc-v/src/common/riscv_common_memorymap.h:72:16: note: at offset -2048 into object 'g_intstacktop' of size [0, 2147483647]
   72 | EXTERN uint8_t g_intstacktop[];   /* Initial top of interrupt stack */
      |                ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-09-20 17:04:56 +08:00
Huang Qi
e144b1208f boards/riscv: Fix module linker target
Fix:
```
riscv-none-elf-ld: sotest.o: ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
riscv-none-elf-ld: failed to merge target specific data of file sotest.o
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-09-20 17:04:56 +08:00
dongjiuzhu1
3884087396 libc/mod: fix minor issue about description
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-20 17:02:29 +08:00
dongjiuzhu1
e8c9541263 libs/modlib: avoid double free when call modlib_unload with erro
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-20 17:02:29 +08:00
dongjiuzhu1
310ba09ed7 libs/modlib: avoid seeking in each reading
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-20 17:02:29 +08:00
dongjiuzhu1
13bdaaec99 libs/modlib: close fd when error happen
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-20 17:02:29 +08:00
yangyalei
3017cc4402 Exec: Support run exec in current task
There is a problem when vfork() calls execv() (or execl()) to start a new application:
When the parent thread calls vfork() it receives and gets the pid of the vforked task,
and not the pid of the desired execv'ed application.
see issue #3334

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-09-20 16:53:30 +08:00
SPRESENSE
104dfb983d arch: cxd56xx: Return error for RTC alarm setting before initialization
Return EBUSY error for alarm setting before completion of RTC initialization.
2023-09-20 11:50:07 +03:00
zhanghongyu
13f59128fd iob: limit the iob bufsize is sufficient to fill all L2/L3/L4 headers
rndis header length is 36, L2 header is 14, IPv6 header is 40, tcp header is 56 when sack option count is 4(default max_ofosegs is 4). so the iob bufsize should greater than we need.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-20 14:35:22 +08:00
zhanghongyu
55d5006462 tcp_ofosegs: prepare iob to reset io_offset
The previous iob_trimhead added dev->iob->io_offset, so if the
input frame is not merged into the ofo segment, we need to reset
dev->iob->io_offset so that the subsequent tcp_send can properly
assemble packets.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-20 14:32:16 +08:00
zhanghongyu
398734500e wifi: parse channel from IE when ctl_ch is 0
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-20 14:26:41 +08:00
chao an
6b070b2b00 libs/libc: currect usage of getpid/gettid in library
Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-20 10:08:24 +08:00
zhanghongyu
537975656c wifi: Add handle type for disconnecting event
Some disconnected events will be missed

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-20 10:07:40 +08:00
xiao
1487aa267e add Artery at32
check nxstyle

check nxstyle
2023-09-20 02:07:55 +08:00
hujun5
51a412c6b4 pthread_cleanup: rm sched_[un]lock
Since TLS is only used within a single thread and requires no additional protection.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-20 00:44:19 +08:00
wanggang26
fa744e24a3 mmcsd: update cid reg layout
refer spec: https://www.jedec.org/sites/default/files/docs/JESD84-B51.pdf

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-20 00:42:30 +08:00
yintao
f3c9a8643b nuttx: change RPTUNIOC_START and RPTUNIOC_STOP to synchronous
Support quit remote when server poweroff

Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-20 00:42:02 +08:00
ligd
1f9fb5fce2 rptun: add rptun_update_rx() when device_created()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-09-20 00:42:02 +08:00
ligd
378470f611 add remote poweroff support
Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-20 00:42:02 +08:00
Shanmin Zhang
e8550a02b9 arm64: support reboot / poweroff for qemu virt arm64
Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2023-09-20 00:40:44 +08:00
xinbingnan
75e591ae4f tools/minidumpserver: don't stop while gdb client is stopping
VELAPLATFO-16411

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2023-09-20 00:40:14 +08:00
Roy Feng
d98367693d esp32s3: fix build error 2023-09-20 00:35:28 +08:00
yangsen5
e0873c5a48 drivers/video: Fix crash caused by priv->capture_cb = null
When the upper layer calls goldfish_camera_data_uninit, priv->capture_cb=NULL, but when there is data transmission in goldfish_camera_thread, priv->capture_cb will be called, which will cause a crash.

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-09-20 00:34:54 +08:00
Xiang Xiao
f6681218f4 ci: Update aarch64 gcc toolchain to 12.3.rel1
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-19 22:37:54 +08:00
Huang Qi
7d3f11af1f cibuild.sh: Using GCC from xPack for riscv
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-09-19 12:59:48 +03:00
Xu Xingliang
3cd5e20f74 sched: return 0 from clock_systime_ticks if failed
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-09-19 16:17:08 +08:00
ligd
415fe60695 signal: use work_cancel_sync() to fix used after free
bug:

user thread:                             hpwork:
timer_create() with SIGEV_THREAD
timer_settime()
    irq -> work_queue()                  add nxsig_notification_worker to Q
timer_delete()
    nxsig_cancel_notification()
                                         call nxsig_notification_worker()
    work_cancel()
    timer_free()
                                         nxsig_notification_worker() used after free

root cause:
work_cancel() can't cancel work completely, the worker may alreay be running.

resolve:
use work_cancel_sync() API to cancel the work completely

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-09-19 15:52:48 +08:00
ligd
61ef7eb3dc wqueue: add work_cancel_sync() support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-09-19 15:52:48 +08:00
zhangyuan21
978c8bd249 sim: enable usb board ctrl in adb
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-19 07:51:49 +02:00
sunkun3
219677cdae rndis: Fixed rndis assert issue when calling composite_uninitlize
Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-09-19 07:51:49 +02:00
Huang Qi
89e409a194 tools: Switch riscv GCC to 12.3
GCC13 have compatibility issue with libcxx (need libcxx 17+).

Please refer to: https://github.com/llvm/llvm-project/issues/62396

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-09-19 11:42:51 +08:00
yangguangcai
fe30f0fa82 sched/wdog:change g_wdtickbase update situation.
In the 'wd_timer',the callback function executed by 'wd_expiration' could call wd_start,and g_wdtickbase might be updated.Subsequently, g_wdtickbase is incremented by the value of ticks, causing g_wdtickbase to be greater than the actual passage of time.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-09-19 11:41:50 +08:00
Dong Heng
6ac28d5526 xtensa/esp32s3: LCD controller driver 2023-09-19 11:38:05 +08:00
liaoao
3a08c0a1e6 qemu:fdt:add device tree support for goldfish arm/arm64
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-09-19 11:34:26 +08:00
qinwei1
cb3e6667e3 arm64: add PSCI support for qemu platform
Summary
   Add ARM PCSI (Power State Coordination Interface) Support
for qemu. With the interface, Poweroff/PowerReset can be support

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-09-19 11:34:26 +08:00
zhangyuan21
1e55ca43ef arm64: set cpuid according to mpidr
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-19 11:34:26 +08:00
qinwei1
8eea6d2e2a arm64: GoldFish add miss arm64_netinitialize
Summary
    add miss arm64_netinitialize function for goldfish
platform

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-09-19 11:34:26 +08:00