Commit Graph

39869 Commits

Author SHA1 Message Date
chao.an
826e74a13d libs/libc/dumpbuffer: remove the unnecessary printable characters traversal
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
chao.an
48db71aa24 libs/libc/dumpbuffer: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
chao.an
e32e341886 libs/libc/dumpbuffer: add support to recognizable from wireshark
e.g: Encapsulation Type: Bluetooth H4

From:

[    2.196000] 0000: 030c00                                                            ...
[    2.514600] 0000: 0e0401030c00                                                      ......
[    2.514600] 0000: 031000                                                            ...
[    2.517600] 0000: 0e0c01031000ffff8ffedbff5b87                                      ............[.
[    2.517600] 0000: 011000                                                            ...
[    2.520600] 0000: 0e0c0101100006bb22060a00bb22                                      ........"...."
[    2.520600] 0000: 021000                                                            ...
[    2.527600] 0000: 0e4401021000ffffff03feffffffffff fffff30fe8fe3ff783ff1c00000061f7 .D.............. ......?.......a.
[    2.527600] 0020: ffff7f00000000000000000000000000 00000000000000000000000000000000 ................ ................
[    2.527600] 0040: 000000000000                                                      ......

To:

[    1.567100] 0000  03 0c 00                                         ...
[    1.890100] 0000  0e 04 01 03 0c 00                                ......
[    1.890100] 0000  03 10 00                                         ...
[    1.892900] 0000  0e 0c 01 03 10 00 ff ff 8f fe db ff 5b 87        ............[.
[    1.892900] 0000  01 10 00                                         ...
[    1.894900] 0000  0e 0c 01 01 10 00 06 bb 22 06 0a 00 bb 22        ........"...."
[    1.894900] 0000  02 10 00                                         ...
[    1.901900] 0000  0e 44 01 02 10 00 ff ff ff 03 fe ff ff ff ff ff  .D..............
[    1.901900] 0010  ff ff f3 0f e8 fe 3f f7 83 ff 1c 00 00 00 61 f7  ......?.......a.
[    1.901900] 0020  ff ff 7f 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.901900] 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.901900] 0040  00 00 00 00 00 00                                ......

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
liang
b074ebec9e fix redefined CSR_INSTRET 2020-12-23 01:34:14 -06:00
Sara Souza
6a6121378c xtensa/esp32: Fixed wdt typos 2020-12-22 20:32:38 +01:00
Xiang Xiao
922cf0612b libc/netdb: Move hostbuffer out of the stack
The length of hostbuffer come from Kconfig, it isn't safe to
allocate this variable on the stack.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I75213688153a1cba738544de2a51fa3247626dd3
2020-12-22 10:40:22 -03:00
YAMAMOTO Takashi
0fbfc4c44c esp32_wifi_adapter.c: file mode for open doesn't make sense for O_RDONLY 2020-12-22 03:37:29 -06:00
Huang Qi
073912e232 Replace all wget with curl
wget is missing from some system (like macOS and Windows native),
it's better to use curl to simplify build environment.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-12-22 03:36:10 -06:00
Brennan Ashton
c6947199b2 Bluetooth: Fix bt_buff lifecycle
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-12-21 23:36:57 -06:00
Masayuki Ishikawa
ec73a4e69c arch & sched: task: Fix up_exit() and nxtask_exit() for SMP
Summary:
- During repeating ostest with sabre-6quad:smp (QEMU),
  I noticed that pthread_rwlock_test sometimes stops
- Finally, I found that nxtask_exit() released a critical
  section too early before context switching which resulted in
  selecting inappropriate TCB
- This commit fixes this issue by moving nxsched_resume_scheduler()
  from nxtask_exit() to up_exit() and also removing
  spin_setbit() and spin_clrbit() from nxtask_exit()
  because the caller holds a critical section
- To be consistent with non-SMP cases, the above changes
  were done for all CPU architectures

Impact:
- This commit affects all CPU architectures regardless of SMP

Testing:
- Tested with ostest with the following configs
- sabre-6quad:smp (QEMU, dev board), sabre-6quad:nsh (QEMU)
- spresense:wifi_smp
- sim:smp, sim:ostest
- maix-bit:smp (QEMU)
- esp32-devkitc:smp (QEMU)
- lc823450-xgevk:rndis

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-12-21 23:29:56 -06:00
YAMAMOTO Takashi
d5a1c8cae8 boards/sim/sim/sim/src/etc/init.d/rcS: Make it conditional with FS_FAT
ifdef out the guts of the script because it doesn't make sense
without FAT enabled.
2020-12-21 20:12:05 -08:00
ligd
9ee04b5c53 tools/mkdeps.c: increase MAX_BUFFER to 8192
Change-Id: I0221194a647ff5083c951d682289793430e4268a
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-12-21 20:10:47 -08:00
Nathan Hartman
93b9ad0237 sched/Kconfig: Minor grammar fixes in help text
sched/Kconfig:

    * SCHED_CRITMONITOR, SCHED_CPULOAD: Minor grammar fixes in help
      text.
2020-12-21 20:04:45 -06:00
Sara Souza
16b1a87da4 xtensa/esp32: Added watcher defconfig 2020-12-21 20:20:43 +01:00
Nathan Hartman
78f308ff2c arch/stm32: Fix nxstyle errors
arch/arm/src/stm32/stm32_dac.h:

    * Fix nxstyle issues.
2020-12-21 20:20:17 +01:00
Nathan Hartman
4cefc5ce7a stm32g4: Fix incorrect FLASH wait states
When the architectural support for STM32G4 family was added, the
reference manual (RM0440) was at revision 2. Since then, it has
undergone several revisions. One significant change is in the
table of FLASH wait states: section 3.3.3 table 9. The outcome
of this change is that fewer FLASH wait states are needed for
most CPU clock (HCLK) frequencies. Notably, if running the CPU
clock at the maximum 170 MHz, only 4 FLASH wait states are
needed, rather than the previously programmed 8 wait states.
This gives a noticeable performance boost.

arch/arm/src/stm32/stm32g4xxxx_rcc.c:

    * FLASH_ACR_LATENCY_SETTING: Reimplement compile-time logic
      that selects the required wait state setting to use the new
      updated table.

    * Update all comments to indicate that RM0440 Rev 5 is used.

    * Update section numbers mentioned in comments in cases where
      they have changed due to added sections in the manual.
2020-12-21 18:43:49 +01:00
Sara Souza
881121444c Changes in the watchdog auto-monitor menu 2020-12-21 11:22:30 -03:00
YAMAMOTO Takashi
7a9f180faf esp32: Bump NAME_MAX where CONFIG_ESP32_WIFI_SAVE_PARAM=y
CONFIG_ESP32_WIFI_SAVE_PARAM seems to use a bit long names
on the filesystem.
eg. "wifi.nvs.net80211.sta.scan_method", which is 33 characters long.
2020-12-21 09:58:22 +01:00
YAMAMOTO Takashi
b1878fe099 libcxx: Don't remove the downloaded file eagerly
It's convenient during development.
Also, it can be useful for offline builds.
2020-12-20 23:16:11 -06:00
YAMAMOTO Takashi
ecd66eb90c sim: libcxx: Use __GLIBCXX__ ABI for non macOS 2020-12-20 23:16:11 -06:00
YAMAMOTO Takashi
dfa2949b69 libcxx: Make download+patch a separate target
So that it doesn't need to be done on every sethost.sh.
2020-12-20 23:16:11 -06:00
YAMAMOTO Takashi
f0e0e6ab4d sim: Make.defs: tweak CXXFLAGS for LIBCXX 2020-12-20 23:16:11 -06:00
Xiang Xiao
92cefb0a78 arch/risc-v: Move CSR register bit definition to csr.h
to avoid the macro duplication

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-20 20:27:13 -08:00
Xiang Xiao
41d576f62b arch/riscv: Reuse the common up_schedule_sigaction implementation
to avoid the code duplication

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-20 20:26:27 -08:00
Xiang Xiao
085619d395 libc: Implement getppid
as specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/getppid.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-20 16:40:14 -03:00
Xiang Xiao
deef880dae sched/signal: Make the pre-allocated irq actions configurable
the action can't be dynamically allocated in any irq handler
so it's important to let the user extend the number as needed

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id30c5d93003e63514c24f2ca0df2f634c4c63c5f
2020-12-20 19:31:59 +01:00
Xiang Xiao
c079760777 sched/mqueue: Make the pre-allocated irq messages configurable
the message can't be dynamically allocated in any irq handler
so it's important to let the user extend the number as needed

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia26584c3815bac6cf24de4c88be0844ac8e8fba2
2020-12-20 19:31:59 +01:00
Xiang Xiao
9ea229cea0 boards: Remove CINCPATH and CXXINCPATH
these macro doesn't need anymore with commit:
commit d32e9c38df
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Sat Jul 11 18:37:40 2020 +0800

boards: Move the C/C++ search path to the common place

so all boards support uClibc++/libc++ automatically
2020-12-20 13:52:50 +01:00
Matias N
91c8d2bac6 sim: add "nimble" config, to test nimBLE on top of bthcisock 2020-12-19 08:00:38 -06:00
danguanghua
7a3f2bf7ab audio: uninitialize usermq to NULL when the device has not
N/A

be opened anymore. There is no need to update usermq to NULL
in audio_open.

Change-Id: I0c20bfa40a4fcd5c8cae0cf09bb55e113435ea62
Signed-off-by: danguanghua <danguanghua@xiaomi.com>
2020-12-19 07:58:04 -06:00
Nathan Hartman
4facd82ae0 arch/stm32: Fix nxstyle errors
arch/arm/src/stm32/stm32_ltdc.h:
arch/arm/src/stm32/stm32_pmsleep.c:
arch/arm/src/stm32/stm32_pmstandby.c:

    * Fix nxstyle issues.
2020-12-19 00:16:47 -06:00
Xiang Xiao
d42c5a0bf6 arch/risc-v: Move csr.h to common place
since CSR definition is same for 32bit and 64bit arch

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-19 08:41:33 +09:00
Xiang Xiao
fe8122ee2b arch/risc-v: Remove duplicated declaration for up_irq_save and up_irq_restore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-19 08:29:42 +09:00
Abdelatif Guettouche
81a9eb190d arch/xtensa/src/esp32/esp32_spiflash.c: Invalidate the cache and
writeback PSRAM data if the flash address used has a cache mapping.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2020-12-18 16:43:52 -03:00
YAMAMOTO Takashi
1d438bfb9b fs/spiffs/src/spiffs_vfs.c: Fix a comment typo 2020-12-18 06:32:40 -06:00
YAMAMOTO Takashi
b4d68feee9 fs/spiffs/src/spiffs_vfs.c: Fix a typo in a message
"page pages" -> "pages"
2020-12-18 06:32:40 -06:00
Sara Souza
071cfceed6 Update Documentation/components/drivers/character/watchdog.rst 2020-12-18 04:07:07 -08:00
David Sidrane
8de9cba43b Update Documentation/components/drivers/character/watchdog.rst 2020-12-18 03:35:54 -08:00
saramonteiro
48b5ac3ec0 Apply suggestions from code review
Co-authored-by: David Sidrane <David.Sidrane@Nscdg.com>
2020-12-18 03:35:54 -08:00
Sara Souza
4029c315f0 Apply 1 suggestion(s) to 1 file(s) 2020-12-18 03:35:54 -08:00
Sara Souza
51a6665925 Apply 1 suggestion(s) to 1 file(s) 2020-12-18 03:35:54 -08:00
Sara Souza
e049afc2a1 Documentation: how to use auto monitor feature to keep the chip alive 2020-12-18 03:35:54 -08:00
Masayuki Ishikawa
39aa172957 tools: Fix version.sh
Summary:
- The latest version.sh retrieves version information from git tag
- However, if a repository contains private tags, it will fail
- This commit fixes this issue

Impact:
- version.sh only

Testing:
- Tested with https://github.com/masayuki2009/incubator-nuttx

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>>
2020-12-18 04:29:36 -06:00
chao.an
84daee1f76 drivers/netdev: try tcp timer in every txavail call
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-18 14:16:11 +09:00
chao.an
4a559807a5 arch/netdev: try tcp timer in every txavail call
In the current implementation, the first transmission of the new
connection handshake is depends entirely by tcp_timer(), which will
caused 0.5s - 1s delay each time in connect().

This patch is mainly to improve the performance of TCP handshake.

Original:

nsh> tcp_client
[    1.536100] TCP connect start.
[    2.000200] TCP connect end. DIFF: tick: 4641, 464ms.
[    3.000300] TCP connect start.
[    4.000400] TCP connect end. DIFF: tick: 10001, 1000ms.
[    5.000500] TCP connect start.
[    6.000600] TCP connect end. DIFF: tick: 10001, 1000ms.
[    7.000700] TCP connect start.
[    8.000800] TCP connect end. DIFF: tick: 10001, 1000ms.

Optimized:

nsh> tcp_client
[    3.263600] TCP connect start.
[    3.263700] TCP connect end. DIFF: tick: 1, 0ms.
[    4.263800] TCP connect start.
[    4.263800] TCP connect end. DIFF: tick: 0, 0ms.
[    5.263900] TCP connect start.
[    5.263900] TCP connect end. DIFF: tick: 0, 0ms.
[    6.264000] TCP connect start.
[    6.264000] TCP connect end. DIFF: tick: 0, 0ms.
[    7.264100] TCP connect start.
[    7.264100] TCP connect end. DIFF: tick: 0, 0ms.

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-18 14:16:11 +09:00
chao.an
ae5b727580 net/tcp/handshake: send the SYN immediately.
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-18 14:16:11 +09:00
chao.an
5e9e50991c net/tcp: send the ack on nonblock mode
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-18 14:16:11 +09:00
Abdelatif Guettouche
076d89907f tools/version.sh: Fix the version retrieved from GIT.
Use the branch's tag if one exist otherwise use the most recent one.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2020-12-17 10:14:37 -08:00
YAMAMOTO Takashi
48ba0bb30a esp32_wifi_adapter.c: Fix a use-after-free bug 2020-12-17 03:24:15 -06:00
YAMAMOTO Takashi
75bc489e24 esp32: Fix phy_printf
Fix the following error:

CC:  chip/esp32_wifi_adapter.c
In file included from /Users/yamamoto/git/nuttx/nuttx/include/nuttx/mm/shm.h:45,
                 from /Users/yamamoto/git/nuttx/nuttx/include/nuttx/sched.h:42,
                 from /Users/yamamoto/git/nuttx/nuttx/include/sched.h:35,
                 from /Users/yamamoto/git/nuttx/nuttx/include/stdio.h:48,
                 from chip/esp32_wifi_adapter.c:28:
chip/esp32_wifi_adapter.c: In function 'phy_printf':
chip/esp32_wifi_adapter.c:3952:10: error: expected ')' before 'format'
   wlinfo(format, arg);
          ^~~~~~
2020-12-17 03:24:15 -06:00