Commit Graph

51697 Commits

Author SHA1 Message Date
dongjiuzhu1
1fc3de4518 arch/textheap: add _heapmember declare for text and data heap
It was accidentally deleted on PR:#11043

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-11-10 09:03:04 +01:00
Tiago Medicci Serrano
18718316dc esp32/ble: enable the BLE interrupt during a SPI flash operation
This commit sets the BLE's interrupt as a IRAM-enabled interrupt,
which enables it to run during a SPI flash operation. This enables
us to create a cache to off-load semaphores and message queues
operations and treat them when the SPI flash operation is finished.
By doing that, we avoid packet losses during a SPI flash operation.
2023-11-10 09:11:35 +08:00
Tiago Medicci Serrano
f94daf09b2 esp32s3/spiflash: Fix comment and remove unused variable 2023-11-10 09:11:35 +08:00
Tiago Medicci Serrano
b25793ebac esp32/spiflash: Make it similar to ESP32-S3 by removing cache state 2023-11-10 09:11:35 +08:00
Tiago Medicci Serrano
57b8fc9954 esp32/irq: Allow IRAM ISRs to run during SPI flash operation
This commit provides an interface to register ISRs that run from
IRAM and keeps track of the non-IRAM interrupts. It enables, for
instance, to avoid disabling all the interrupts during a SPI flash
operation: IRAM-enabled ISRs are, then, able to run during these
operations.

It also makes the code look more similar to the ESP32-S3 SPI flash
implementation by creating a common `esp32_spiflash_init` that is
responsible to create the SPI flash operation tasks. The function
intended to initialize the SPI flash partions was, then, renamed to
`board_spiflash_init`.
2023-11-10 09:11:35 +08:00
Tiago Medicci Serrano
606190d9b3 esp32/ble: fix saving/restoring the interrupt status flags
Whenever we enter/leave a critical section, the interrupt status is
saved and, then, restored. However, for the ESP32's BLE adapter,
entering/leaving a critical section is done on separate functions
that need to be registered as a callback.

The status flag was being saved as a global variable. However,
calling nested enter_critical_section would overwrite this global
variable that was storing the previous flag and, when leaving the
last critical section, the restored status would be different from
the one expected. The proposed solution for this issue is to create
a global array to store the interrupt status flags for nested calls.
2023-11-10 09:11:35 +08:00
Tiago Medicci Serrano
c60d5c2ea1 esp32s3/wireless: Fix typo
The CPU 2 interrupt source (which is not used for anything else) is
used to off-load BLE data after a SPI flash operation.
2023-11-10 09:11:35 +08:00
Tiago Medicci Serrano
fae075a749 esp32/ble: Lock the scheduler before creating pinned thread
This ensures that the thread that has been just created doesn't
run before its affinity is set, avoiding it to be scheduled in the
wrong CPU core.
2023-11-10 09:11:35 +08:00
Eren Terzioglu
9997a858e2 xtensa/esp32s2: Add SPI slave support 2023-11-10 00:34:39 +08:00
Janne Rosberg
7f48c185c8 sama5d2-xult: add support for QSPI flash and nxffs
Add support for onboard qspi flash with nxffs fs
Signed-off-by: Janne Rosberg <janne.rosberg@offcode.fi>
2023-11-09 23:59:33 +08:00
Eren Terzioglu
77df430f30 xtensa/esp32s2: Add rtc heap support 2023-11-09 23:58:30 +08:00
Dong Heng
c655870b22 boards/esp32s3: Link stack checking function and data to SRAM when enable flash or PSRAM driver
During PSRAM initialization and flash operations, the Cache needs to be disabled.
So all data and code for the aforementioned scope is required to be placed in Internal RAM.
2023-11-09 13:27:31 +01:00
rongyichang
bc43c419f2 drivers/lcd: add stride support for LCD driver
support LCD stride for GET_AREA and PUT_AREA operation

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-11-09 09:52:00 +08:00
yinshengkai
bb5b5420ae mm: record the maximum system memory usage
Add the usmblks field to mallinfo to record the maximum space allocated historically in the system

https://man7.org/linux/man-pages/man3/mallinfo.3.html#:~:text=mmap(2).-,usmblks,-This%20field%20is

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-11-09 09:08:49 +08:00
Janne Rosberg
225062305b mtd/mx25rxx: add support for MX25L25673G chip
Add support for MX25L25673G QSPI flash.
2023-11-09 09:04:38 +08:00
Janne Rosberg
03064b9701 sama5: add support for QSPI 2023-11-08 21:58:02 +01:00
Janne Rosberg
0f5cea7322 sama5/sam_dmac: add define for DMACH_FLAG_PERIPHISMEMORY 2023-11-08 21:58:02 +01:00
chenwen@espressif.com
5239d01dba xtensa/esp32s3: Disable psram as task stack
1. Disable psram as task stack to avoid system blocking.
2. Add some function comments.
2023-11-08 16:25:57 -03:00
chenwen@espressif.com
8d94c1b3cb xtensa/esp32s3: Support malloc from external RAM and internal RAM
Enables the allocation of the entire Userspace heap into SPI RAM and reserving the Internal RAM exclusively for the Kernel heap.
2023-11-08 16:25:57 -03:00
Niklas Hauser
660ac63b92 stm32h7/serial: Do not wait on TXDMA semaphore
If using flow control with a high CTS the thread may be blocked forever
on the second transmit attempt due to waiting on the txdma semaphore.
The calling thread can then never make progress and release any
resources it has taken, thus may cause a deadlock in other parts of the
system.

The implementation differs in behavior from interrupt-driven TX and the
STM32F7 TXDMA . It should not implicitly wait on a taken semaphore but
return immediately and let the upper layers decide on what to do next.
2023-11-08 12:52:30 -05:00
simbit18
8fa6a29503 Fix Kconfig style
Remove extra TABs
Remove spaces from Kconfig
Add comments
2023-11-08 22:58:26 +08:00
liqinhui
68a0621b39 simwifi: Fix a compile error.
sim/sim_wifidriver.c:569:31: warning: implicit declaration of function ‘hex2num’ [-Wimplicit-function-declaration]
  569 |                         val = hex2num(*pos);
      |                               ^~~~~~~

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-11-08 19:32:01 +08:00
raiden00pl
16691f29a9 Documentation: migrate "Bottom-Half Interrupt Handlers" from wiki
link: https://cwiki.apache.org/confluence/display/NUTTX/Bottom-Half+Interrupt+Handlers

Co-authored-by: hartmannathan <59230071+hartmannathan@users.noreply.github.com>
2023-11-08 15:54:54 +08:00
raiden00pl
56cb0450cc Documentation: fix warning 2023-11-08 15:54:54 +08:00
raiden00pl
c347343e09 Documentation: migrate "STM32 CCM Allocator" from wiki
link: https://cwiki.apache.org/confluence/display/NUTTX/STM32+CCM+Allocator

Co-authored-by: hartmannathan <59230071+hartmannathan@users.noreply.github.com>
2023-11-08 15:54:54 +08:00
raiden00pl
3e0d1e9b52 Documentation: migrate "STM32 Null Pointer Detection" from wiki
link: https://cwiki.apache.org/confluence/display/NUTTX/STM32+Null+Pointer+Detection

Co-authored-by: hartmannathan <59230071+hartmannathan@users.noreply.github.com>
2023-11-08 15:54:54 +08:00
zhanghongyu
fbd0b3d1d7 cmake: move NUTTX_CHIP_ABS_DIR before common src
Some APIs are implemented both in common code and CHIP-specific code,
and the link needs to be based on the implementation in CHIP, so move
NUTTX_CHIP_ABS_DIR before common src.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-07 17:39:03 +01:00
zhanghongyu
234dd95e0b libc_atomic: add file to cmake script
resolves an error where atomic related symbols cannot be found at cmake compile time.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-07 17:39:03 +01:00
zhanghongyu
c831c8cc56 cmake: add needed file to cmake script for build sim
nuttx/crypto/chachapoly.c:232: undefined reference to `timingsafe_bcmp'

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-07 17:39:03 +01:00
zhanghongyu
3610b25c91 cmake: add include path for special source
fix the cmake build error.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-07 17:39:03 +01:00
zhanghongyu
766e4a4154 libs/libc: adapt the cmake script from the makefile
fix the cmake build error.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-07 17:39:03 +01:00
Zhe Weng
6403965075 Documentation: Add netdev description with multiple IPv6 addresses
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-07 19:30:36 +08:00
Zhe Weng
4c99ad1ba9 net/utils: Switch argument order of net_ipv6_pref2mask
When implementing IPv6-related logic, we found the `net_ipv6_pref2mask`
and `net_ipv6addr_copy` are using different argument order:
```
net_ipv6addr_copy(ifaddr->addr, addr);
net_ipv6_pref2mask(preflen, ifaddr->mask);
```
Change the order to:
```
net_ipv6addr_copy(ifaddr->addr, addr);
net_ipv6_pref2mask(ifaddr->mask, preflen);
```

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-07 19:30:36 +08:00
Zhe Weng
3e4d847f42 net/netdev: Support managing multiple IPv6 addresses by ioctl
1. Supporting `SIOCSIFADDR` and `SIOCDIFADDR` with Linux in6_ifreq struct to manage ipv6 addresses.
   Ref: https://man7.org/linux/man-pages/man7/netdevice.7.html
2. Supporting alias like 'eth0:0' for multiple IPv6 addresses, to keep previous ioctl `SIOCGLIFADDR`, `SIOCSLIFADDR`, `SIOCGLIFNETMASK` and `SIOCSLIFNETMASK` working.
   Ref: https://man7.org/linux/man-pages/man8/ifconfig.8.html

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-07 19:30:36 +08:00
Zhe Weng
7f421a46ca net/procfs: Support printing multiple IPv6 address per netdev
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-07 19:30:36 +08:00
Zhe Weng
2b9633e652 net: Support multiple IPv6 address per netdev
Note that user-space related code, like procfs and lifreq related ioctl commands, are not touched in this commit.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-07 19:30:36 +08:00
Zhe Weng
96233e0c42 net/netdev: Support multiple IPv6 addresses per device
Compatible with previous usage, because may network drivers are using old member name to print logs, and there's no significant need to change them now.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-07 19:30:36 +08:00
Zhe Weng
c7845f5b25 netlink: Explicitly set ip address for netlink notify
Prepare for multiple IPv6 addresses per net device, then we can notify
add/remove of a single address later.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-07 19:30:36 +08:00
chao an
85a375cd7d drivers/serial: check the remote device before get name
| #0 0x2119bf1 in rpmsg_get_cpuname rptun/rptun.c:1157
| #1 0x24f97bd in uart_rpmsg_device_destroy serial/uart_rpmsg.c:342
| #2 0x2117d56 in rptun_dev_stop rptun/rptun.c:883
| #3 0x21181d7 in rptun_do_ioctl rptun/rptun.c:922
| #4 0x2119721 in rptun_ioctl_foreach rptun/rptun.c:1086

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-07 18:27:05 +08:00
chao an
93ff6f9703 drivers/rptun: check the status before stop remote proc
Race condition if the remote proc is stoped during initialization phase

| #0  0x0249f959 in rpmsg_destroy_ept (ept=0xffffffc0) at open-amp/lib/rpmsg/rpmsg.c:376
| #1  0x024a938c in rpmsg_deinit_vdev (rvdev=0xf2303a48) at open-amp/lib/rpmsg/rpmsg_virtio.c:971
| #2  0x02117e33 in rptun_dev_stop (rproc=0xf2303a04, stop_ns=true) at rptun/rptun.c:891
| #3  0x021181d8 in rptun_do_ioctl (priv=0xf2303a00, cmd=11010, arg=0) at rptun/rptun.c:922
| #4  0x02119722 in rptun_ioctl_foreach (cpuname=0x0, cmd=11010, value=0) at rptun/rptun.c:1086
| #5  0x0211b9df in rptun_poweroff (cpuname=0x0) at rptun/rptun.c:1378
| #6  0x02053aa6 in board_power_off (status=0) at sim/sim_head.c:206
| #7  0x0253d65c in boardctl (cmd=65283, arg=0) at boardctl.c:400
| #8  0x021eb497 in cmd_poweroff (vtbl=0xef606280, argc=1, argv=0xef9b73e0) at nsh_syscmds.c:356
| #9  0x021cdb4d in nsh_command (vtbl=0xef606280, argc=1, argv=0xef9b73e0) at nsh_command.c:1164
| #10 0x021baa72 in nsh_execute (vtbl=0xef606280, argc=1, argv=0xef9b73e0, redirfile=0x0, oflags=0) at nsh_parse.c:845
| #11 0x021c6b0a in nsh_parse_command (vtbl=0xef606280, cmdline=0xef606708 "poweroff") at nsh_parse.c:2744
| #12 0x021c7166 in nsh_parse (vtbl=0xef606280, cmdline=0xef606708 "poweroff") at nsh_parse.c:2828
| #13 0x0221fa2f in nsh_session (pstate=0xef606280, login=1, argc=1, argv=0xef7a7860) at nsh_session.c:245
| #14 0x021f8c04 in nsh_consolemain (argc=1, argv=0xef7a7860) at nsh_consolemain.c:75
| #15 0x021b77eb in nsh_main (argc=1, argv=0xef7a7860) at nsh_main.c:74
| #16 0x02166ddf in nxtask_startup (entrypt=0x21b76ca <nsh_main>, argc=1, argv=0xef7a7860) at sched/task_startup.c:70
| #17 0x020b363c in nxtask_start () at task/task_start.c:134

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-07 18:27:05 +08:00
Huang Qi
0995e17927 sched: Check for zero sleep time and yield CPU if
necessary

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-11-07 18:26:54 +08:00
chao an
d410a6e1a6 libc/realpath: allocate link buffer of pseudofs to save stack
The link buffer of pseudofs will occupy too much of stack, allocate from
the heap to save the stack usage.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-07 09:05:50 +08:00
raiden00pl
4d65d9908b Documentation: migrate "Auto-Mounter" from wiki
link: https://cwiki.apache.org/confluence/display/NUTTX/Auto-Mounter
2023-11-06 18:42:17 -03:00
raiden00pl
1c6e5cc0c4 Documentation: migrate "Work Queue Deadlocks" from wiki
link: https://cwiki.apache.org/confluence/display/NUTTX/Work+Queue+Deadlocks
2023-11-06 18:42:17 -03:00
raiden00pl
2d8c4e6645 Documentation: migrate "SLIP Configuration" from wiki
link: https://cwiki.apache.org/confluence/display/NUTTX/SLIP+Configuration
2023-11-06 18:42:17 -03:00
raiden00pl
8a8111c2fc Documentation: migrate "CONFIG_NET_GUARDSIZE" from wiki
link: https://cwiki.apache.org/confluence/display/NUTTX/CONFIG_NET_GUARDSIZE
2023-11-06 18:42:17 -03:00
raiden00pl
1f9e17f5c7 Documentation: add SystemView configuration instructions 2023-11-06 18:42:17 -03:00
raiden00pl
caef223268 Documentation: migrate "CNxConsole Keyboard Input" from wiki
link: https://cwiki.apache.org/confluence/display/NUTTX/CNxConsole+Keyboard+Input
2023-11-06 18:42:17 -03:00
raiden00pl
200f709092 Documentation: migrate "NxTerm Example" from wiki
link: https://cwiki.apache.org/confluence/display/NUTTX/NxTerm+Example
2023-11-06 18:42:17 -03:00
Tiago Medicci Serrano
59107e5573 esp32s3: Fix issue regarding IRAM-enabled ISRs by fixing the linker
After https://github.com/apache/nuttx/pull/11007/ was merged, the
path for some files changed, requiring the linker to be fixed to
make it run from the internal memory once again.
2023-11-06 18:41:34 -03:00