Commit Graph

49165 Commits

Author SHA1 Message Date
zhangyuan21
841b178782 assert: show stacks with the sp from regs
1. Get the value of sp from dump regs when an exception occurs,
   to avoid getting the value of fp from up_getsp and causing
   incomplete stack printing.
2. Determine which stack the value belongs to based on the value
   of SP to avoid false reports of stack overflow

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-05-05 13:40:04 +08:00
Stuart Ianna
dec80be431 arch/risc-v/litex: Fix emac driver compilation when only IPv6 is used. 2023-05-05 11:53:13 +08:00
Lucas Saavedra Vaz
b738379684 boards/xtensa/esp32s2-kaluga-1: Add support for the ES8311 codec
Adds support for the ES8311 codec on the ESP32-S2-Kaluga-1 board. This commit also adds basic configurations for testing and updates the board documentation.
2023-05-04 18:41:54 -03:00
Lucas Saavedra Vaz
8b9dc54a0a drivers/audio: Add support for the ES8311 codec
Adds support for the ES8311 audio codec by Everest Semiconductor on NuttX. Both output and input are supported.
2023-05-04 18:41:54 -03:00
Lucas Saavedra Vaz
58f59fe9dc arch/xtensa/esp32s2: Fix SPIRAM compilation warnings
This commit aims to fix compilation warnings that happens when enabling SPIRAM for ESP32-S2
2023-05-04 18:41:54 -03:00
Lucas Saavedra Vaz
d82d73c660 audio: Separate common settings for the ESXXXX family of products
To avoid code duplication, the common settings for Everest Semiconductor's codecs were separated in an "esxxxx_common" header
2023-05-04 18:41:54 -03:00
Lucas Saavedra Vaz
a5a3b919a0 audio: Add i2s_getmclkfrequency function
Rename i2s_mclkfrequency to i2s_setmclkfrequency and add i2s_getmclkfrequency for getting the current MCLK frequency from the I2S interface
2023-05-04 18:41:54 -03:00
simbit18
fcba68513d arch: Fix nxstyle errors
error: Long line found
2023-05-04 23:21:51 +03:00
zhanghongyu
bdb5639274 netlink: convert lltype to device type
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-05 00:19:59 +08:00
fangxinyong
06f8875c0c arch/sim: do not free memory of zero-length reallocation
Follow the change: https://github.com/apache/nuttx/pull/9151,
if MM_CUSTOMIZE_MANAGER is enabled, heap memory manager in host is used,
for example in sim:asan build.

malloc and related allocation APIs will fall back to host_realloc,
do not free memory of zero-length reallocation. So memory allocations
return valid pointer when request zero size in all sim build.

call stack:
    malloc()         (mm/umm_heap/umm_malloc.c)
    mm_malloc()      (arch/sim/src/sim/sim_heap.c)
    mm_realloc()     (arch/sim/src/sim/sim_heap.c)
    host_realloc()   (arch/sim/src/sim/posix/sim_hostmemory.c)
    host_memalign()  (arch/sim/src/sim/posix/sim_hostmemory.c)

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-05-05 00:19:28 +08:00
zhangyuan21
73257eeda0 libs/libc: fixed armv7-m strcmp build issue
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-05-04 11:59:41 -04:00
chao an
1be95c3313 sim/lsan: disable fast-unwind by default
The fast-unwind implementation of leak-sanitizer will obtain the
current stack top/bottom and frame address(Stack Pointer) for
backtrace calculation:

https://github.com/gcc-mirror/gcc/blob/releases/gcc-13/libsanitizer/lsan/lsan.cpp#L39-L42

Since the scheduling mechanism of NuttX sim is coroutine
(setjmp/longjmp), if the Stack Pointer is switched, the fast-unwind
will unable to get the available address, so the memory leaks on the
system/application side that cannot be caught normally. This PR will
disable fast-unwind by default to avoid unwind failure.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-04 18:05:22 +03:00
anjiahao
1e22163b57 sig_timewait:remove useless assert
use sclock_t repalce int64 and int32

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-05-04 18:04:45 +03:00
zhanghongyu
40d62a40a1 include: header definition changed to nuttx format
fix header definition format

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 18:04:33 +03:00
zhanghongyu
646c41dced tcp_monitor: start_monitor return OK when connect closed by peer
If TCP_FIN is received before the user calls accept, the later accept will
report an error, then the previously received data cannot be read.

operation flow:
tcp_server_listen -> tcp_client_connect -> tcp_client_send ->
tcp_client_close -> tcp_server_accept(fix this error) -> tcp_server_recv

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 17:12:52 +03:00
zhangyuan21
f7cfcd4e95 sched: add the CPU bitset to initialize the non-exclusive CPU
Set the Default CPU bits. The way to use the unset CPU is to call the
sched_setaffinity function to bind a task to the CPU. bit0 means CPU0.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-05-04 20:30:35 +08:00
zhanghongyu
6e36a6f14c ethernet: add ETHERTYPE define
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:38:57 +08:00
zhanghongyu
f6fdf888a9 if_ether: add ether_arp definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:38:29 +08:00
zhanghongyu
fc0ecd4e9e if_arp: add arphdr definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:37:58 +08:00
zhanghongyu
586c89b754 icmp6: add icmp6-related definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:37:21 +08:00
zhanghongyu
e565868eb4 udp: add udphdr definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:36:27 +08:00
zhanghongyu
0acd3078ff ip6: add ip6-related definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:35:43 +08:00
zhanghongyu
f387b138d9 ip: add iphdr definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:35:16 +08:00
zhanghongyu
88d62a1157 if: add net device type
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:34:39 +08:00
zhanghongyu
89eb41797d route: add struct in6_rtmsg definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:34:06 +08:00
zhanghongyu
c288752bef recvmsg: control msg support multi-attribute return
adapts to third-party code compilation. in the process of porting ConnMan,
multiple control message options are enabled, such as IPV6_RECVPKTINFO and
IPV6_RECVHOPLIMIT, so I changed the Filling implementation of the control
message.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 12:04:11 +02:00
Alan Carvalho de Assis
bac304afc0 boards: Fix CONFIG_[START_DATE,START_MONTH] cannot start with 0
Run:
$ ./tools/refresh.sh --silent --defaults all

It will report that CONFIG_START_DATE and/or CONFIG_START_MONTH
are using invalid value starting with 0, so 03 should be 3, and so
on.
2023-05-04 10:11:36 +08:00
simbit18
b1404f486e include: Fix nxstyle errors
error: Long line found
2023-05-04 02:07:01 +08:00
zouboan
e7df243a4a boards/nucleo-f429zi: update CONFIG name to keep up with the CONFIG in arch/stm32 2023-05-03 15:05:25 -03:00
Tiago Medicci Serrano
24ce51f137 documentation/esp32_esp32s3: update informations about Wi-Fi
Add links for `wapi` referencing and links through documentation
pages that indicate Wi-Fi behavior on ESP32 and ESP32-S3.
2023-05-03 23:23:31 +08:00
Tiago Medicci Serrano
28361a295d esp32/wifi: add support to WPA3 on Station Mode
Add support to select WPA3-SAE while connecting to an AP. Please
note that STA mode sets a security threshold, i.e, it was able to
connect to a WPA3-SAE network prior to this change because it
connects to an equally or more secure network than the set
threshold. Considering this patch, the device is now able to
ignore WPA2-PSK APs when WPA3 is set.
2023-05-03 23:23:31 +08:00
Tiago Medicci Serrano
6e76229df2 esp32/wifi: remove debug features from Wi-Fi-related defconfigs 2023-05-03 23:23:31 +08:00
Tiago Medicci Serrano
9ede7d4650 esp32s3/wifi: add support to WPA3 on Station Mode
Add support to select WPA3-SAE while connecting to an AP. Please
note that STA mode sets a security threshold, i.e, it was able to
connect to a WPA3-SAE network prior to this change because it
connects to an equally or more secure network than the set
threshold. Considering this patch, the device is now able to
ignore WPA2-PSK APs when WPA3 is set.
2023-05-03 23:23:31 +08:00
Tiago Medicci Serrano
a86a9dc09e esp32s3/wifi: fix Wi-Fi's NVS-like storage long filename error
While using NVS-like storage of the Wi-Fi driver, an error was
thrown while trying to access a file whose name was longer than
the mounted SPIFFS `CONFIG_SPIFFS_NAME_MAX`.
2023-05-03 23:23:31 +08:00
Xiang Xiao
a514c0a13e mtd/nand: Implement isbad and markbad callback
these new callbacks are added by:
https://github.com/apache/nuttx/pull/8683

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:18 +03:00
Xiang Xiao
3e1ddb3de9 mtd/nand: Return -EUCLEAN when the bit error happen but fixed by ecc
follow how Linux report the correction information from ecc:
http://www.infradead.org/pipermail/linux-mtd/2012-March/040305.html
since this information is very useful to file system(e.g. yaffs, ubi/buifs)
which is specially designed for nand flash.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:18 +03:00
Xiang Xiao
74e2b75857 net: Simplify the tcp/udp existence check
Replace defined(CONFIG_NET_TCP) && !defined(CONFIG_NET_TCP_NO_STACK) with NET_TCP_HAVE_STACK
Replace defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_UDP_NO_STACK) with NET_UDP_HAVE_STACK

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:00 +03:00
Xiang Xiao
5de49d2939 net: Remove the extra space
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 15:18:21 +02:00
Xiang Xiao
df246461ec net/can: Remove the unnecessary "ret = OK;" in can_getsockopt
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 15:18:21 +02:00
liuhaitao
db84cd2e59 tools: add git pre-commit hook based on checkpatch.sh
tools/pre-commit should be copied to .git/hooks/pre-commit to take
effect.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2023-05-03 14:42:34 +02:00
fangxinyong
f1e37a4987 libs/libxx: remove redundant code
Follow the change: https://github.com/apache/nuttx/pull/9151,
that is no need to deal with zero size in C++ allocator.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-05-03 19:54:19 +08:00
zhangyuan21
884be2bdb9 assert: Distinguish between assert and exception
CURRENT_REGS may change during assert handling, so pass
in the 'regs' parameter at the entry point of _assert.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-05-03 14:49:32 +08:00
Tiago Medicci Serrano
5a1efdecfd documentation: add references to RTP Tools' defconfigs
Added examples of using the RTP Tools (`rtpdump`, in particular)
to receive RTP packets and 1) print the data and/or 2) playback
audio content through I2S.
2023-05-03 07:57:11 +02:00
Tiago Medicci Serrano
0f808a352a boards/esp32-lyrat/configs: add defconfig for RTP Tools
RTP Tools is a set of small applications that can be used for
processing RTP data. This application is able to receive RTP
packets and write the content to a FIFO. `nxplayer` then reads
from the FIFO, enabling using NuttX as a RTP receiver for audio
applications.

This is particularly useful to stream uncompressed audio through
Wi-Fi to remote speakers.
2023-05-03 07:57:11 +02:00
Tiago Medicci Serrano
34dbfa0370 boards/sim/configs: add defconfig for RTP Tools
RTP Tools is a set of small applications that can be used for
processing RTP data. This `defconfig` builds the `rtpdump` and
is able to receive RTP packets and print the contents.
2023-05-03 07:57:11 +02:00
Lwazi Dube
e2083354f1 arch/arm/sama5: Use a recursive mutex to fix OHCI deadlock.
Unplugging a USB device from an OHCI root hub will cause
a deadlock if DRVR_EPFREE is called from sam_rhsc_bottomhalf. A
typical call chain looks like this: sam_rhsc_bottomhalf->
CLASS_DISCONNECTED->usbhost_destroy->DRVR_EPFREE. In this case
DRVR_EPFREE tries to lock a locked mutex. A recursive mutex
prevents this deadlock.
2023-05-03 12:53:30 +08:00
simbit18
79574c18d8 arch: Fix nxstyle errors
error: Long line found
2023-05-02 18:31:40 -06:00
Petro Karashchenko
fa07c90522 mm/tlsf: fix compilation warnings
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-05-02 18:29:29 -06:00
Petro Karashchenko
5a298e8685 mm: memory allocations return valid pointer when request 0 size
This change introduce 2 items:
1. If the size of the space requested is 0, the behavior is implementation-defined:
   either a null pointer shall be returned, or the behavior shall be as if the size
   were some non-zero value, except that the behavior is undefined if the returned
   pointer is used to access an object.

   Change the behavior to be similar to Linux and Android and allocates an object
   of a minimum size instead of returning null pointer.

   https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html
   https://pubs.opengroup.org/onlinepubs/9699919799/functions/calloc.html
   https://pubs.opengroup.org/onlinepubs/9699919799/functions/realloc.html

2. The description of realloc() has been modified from previous versions of this
   standard to align with the ISO/IEC 9899:1999 standard. Previous versions explicitly
   permitted a call to realloc (p, 0) to free the space pointed to by p and return
   a null pointer. While this behavior could be interpreted as permitted by this
   version of the standard, the C language committee have indicated that this
   interpretation is incorrect. Applications should assume that if realloc() returns
   a null pointer, the space pointed to by p has not been freed. Since this could lead
   to double-frees, implementations should also set errno if a null pointer actually
   indicates a failure, and applications should only free the space if errno was changed.

   Do not free memory of zero-length reallocation is requested

   https://pubs.opengroup.org/onlinepubs/9699919799/functions/realloc.html

Co-authored-by: fangxinyong <fangxinyong@xiaomi.com>
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-05-02 18:29:29 -06:00
Tiago Medicci Serrano
ea276b20ef audio/pcm_decode: fix warnings regarding unused functions and vars
* 'pcm_dump' available if 'CONFIG_DEBUG_AUDIO_INFO' is set
instead of using the 'CONFIG_PCM_DEBUG'.
* 'pcm_leuint16' and 'pcm_leuint32' available if
'CONFIG_AUDIO_FORMAT_RAW' is not set (once 'pcm_parsewav', which
is available under the same condition, use them).
* 'headersize' var, from 'pcm_enqueuebuffer' declared only if
'CONFIG_AUDIO_FORMAT_RAW' is not set (as it's used by the code
defined by the same condition).
2023-05-02 19:19:14 +03:00