Commit Graph

40768 Commits

Author SHA1 Message Date
David Sidrane
21159666fc stm32h7:SPI Fix 16 bit SPI mode 2021-03-24 15:17:20 -03:00
Petteri Aimonen
3dfc4e0afd STM32 USB OTGFSDEV: Update comments 2021-03-24 11:12:40 -07:00
Petteri Aimonen
18bfef1b38 STM32 USB OTGFSDEV: Fix code style issues 2021-03-24 11:12:40 -07:00
Petteri Aimonen
3c610d5d70 STM32 USB OTGFSDEV: Fix handling of SETUP OUT longer than 64 bytes.
For example Windows RNDIS driver issues SETUP requests that are 76 bytes
long. Previously NuttX would read them all, but only if they arrive at
the same time. If host transfer scheduling causes a pause between the
two DATA packets, stm32_ep0out_receive() would proceed with an incomplete
transfer. The rest of the data could either be skipped by the error handler
branch, or be left in NAK state forever, stopping any further communication
on the endpoint.

This commit changes it so that the whole transfer has to be received before
SETUP handler is called. Depending on CONFIG_USBDEV_SETUP_MAXDATASIZE any
excess bytes will be discarded, but doing this in a controlled way ensures
deterministic behavior. In the specific case of RNDIS, the trailing bytes
are unused padding bytes and can be safely discarded.
2021-03-24 11:12:40 -07:00
Petteri Aimonen
d0c6104efb USBDEV RNDIS: Fix style and printf issues 2021-03-24 14:44:23 -03:00
Petteri Aimonen
94480305a7 USBDEV RNDIS: Improve error recovery
Gracefully handle output queue full conditions. This shouldn't happen
in practice as the host is supposed to limit the number of commands
simultaneously in execution.

Reset the response queue on RNDIS_RESET_MSG. This way communication
can recover even if host and device get out of sync.
2021-03-24 14:44:23 -03:00
Petteri Aimonen
4f66624ea3 USBDEV RNDIS: Fix occasional disconnections due to race condition
Sometimes Windows would send RNDIS_KEEPALIVE_MSG and RNDIS_QUERY_MSG close
to each other. This would cause the latter command to overwrite the reply for
the prior command. This in turn will cause Windows to drop the connection after
a 20 second timeout.

Easy way to reproduce the issue is to open the Windows "Adapter Status" dialog that
shows the realtime TX/RX byte counts. This causes multiple RNDIS_QUERY_MSGs per
second, and the connection will drop in less than an hour.

This commit fixes this issue, and other potential race conditions (such as USB
descriptor read in middle on RNDIS query) by using a separate queue for the reply
packets.
2021-03-24 14:44:23 -03:00
Fotis Panagiotopoulos
f13adbe4bb Added support for multiple syslog channels. 2021-03-23 21:35:22 -07:00
Cis van Mierlo
dc31b4f1c1 boardctl: added the option to change the pm state 2021-03-23 21:20:05 -07:00
Abdelatif Guettouche
ed8fb9d96e boards: Refresh configs to add CONFIG_BCH when necessary.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-03-23 21:01:56 -03:00
Roberto Bucher
9a2cb311a3 File for the integration of pysimCoder with NUTTX 2021-03-23 20:37:56 -03:00
chenwen
f54aef9977 xtensa/esp32: Support esp32 wireless ioctl cmd 2021-03-23 16:29:52 -03:00
Gustavo Henrique Nihei
ca05ff5ffb boards/esp32-ethernet-kit: Add configuration for testing Button device 2021-03-23 16:29:15 -03:00
Gustavo Henrique Nihei
72d98e645a boards/esp32-ethernet-kit: Add Button support via the BOOT button 2021-03-23 16:29:15 -03:00
Gustavo Henrique Nihei
c759f7e30e boards/esp32-devkitc: Add configuration for testing Button device 2021-03-23 16:29:15 -03:00
Gustavo Henrique Nihei
fca65f08cf boards/esp32-devkitc: Add Button support via the BOOT button 2021-03-23 16:29:15 -03:00
Gustavo Henrique Nihei
d8073c2fd8 boards/esp32-wrover-kit: Add configuration for testing Button device 2021-03-23 16:29:15 -03:00
Gustavo Henrique Nihei
c29770cde1 boards/esp32-wrover-kit: Add Button support via the BOOT button 2021-03-23 16:29:15 -03:00
YAMAMOTO Takashi
7f8d0c327b sim: Add dlsym to nuttx-names.in
Fixes the following crash with CONFIG_SIM_SANITIZE=y on Linux.

```
    Program received signal SIGSEGV, Segmentation fault.
    getpid () at task/task_getpid.c:76
    76      task/task_getpid.c: No such file or directory.
    rax            0x2feeb4            3141300
    rbx            0xc53f83            12926851
    rcx            0x6837665ee4c00     1833394399759360
    rdx            0x472080            4661376
    rsi            0xc53f83            12926851
    rdi            0xffffffffffffffff  -1
    rbp            0x7ffe4cdfe140      0x7ffe4cdfe140
    rsp            0x7ffe4cdfe0f0      0x7ffe4cdfe0f0
    r8             0xffffffffffffffff  -1
    r9             0x0                 0
    r10            0x22                34
    r11            0x246               582
    r12            0x472080            4661376
    r13            0x7ffe4cdfe3e8      140730188162024
    r14            0x472080            4661376
    r15            0xf60398            16122776
    rip            0x4e9b93            0x4e9b93 <getpid+35>
    eflags         0x10206             [ PF IF RF ]
    cs             0x33                51
    ss             0x2b                43
    ds             0x0                 0
    es             0x0                 0
    fs             0x0                 0
    gs             0x0                 0
    #0  getpid () at task/task_getpid.c:76
    #1  0x00000000006ad25a in modlib_registry_lock () at modlib/modlib_registry.c:89
    #2  0x0000000000c3648d in modsym (handle=0xffffffffffffffff, name=0xc53f83 "mmap") at module/mod_modsym.c:77
    #3  0x0000000000c2cd3a in dlsym (handle=0xffffffffffffffff, name=0xc53f83 "mmap") at dlfcn/lib_dlsym.c:149
    #4  0x00000000004a0034 in __interception::InterceptFunction(char const*, unsigned long*, unsigned long, unsigned long) ()
    #5  0x000000000048181e in InitializeCommonInterceptors() ()
    #6  0x000000000048106a in __asan::InitializeAsanInterceptors() ()
    #7  0x000000000049b85e in __asan::AsanInitInternal() ()
    #8  0x00007f09cfb04ce6 in ?? () from /lib64/ld-linux-x86-64.so.2
    #9  0x00007f09cfaf413a in ?? () from /lib64/ld-linux-x86-64.so.2
    #10 0x0000000000000001 in ?? ()
    #11 0x00007ffe4cdfff56 in ?? ()
    #12 0x0000000000000000 in ?? ()
```
2021-03-23 07:27:09 -07:00
chao.an
a988437e90 net/dev: check the available address further
check the available address further to avoid obtain unusable device

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-23 06:52:32 -07:00
Flavio Alves
bbdec3c4f4 Adding example to build cmake projects in NuttX
Section adjustments

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Matias N. <v01d@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Matias N. <v01d@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Matias N. <v01d@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Matias N. <v01d@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Matias N. <v01d@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Matias N. <v01d@users.noreply.github.com>

Reviewed introduction to the document

Add the motivation for writing the document.

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>

Adding caption and name for files

Correcting caption

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>

test: Separating the file from the document

Revert "test: Separating the file from the document"

This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46.

Removing captions

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>

Update Documentation/guides/cpp_cmake.rst

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-23 06:41:16 -07:00
Xiang Xiao
6f6a5a7cb2 arch/arm: Fix nxstyle warning in stm32h7/stm32_dma.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-23 13:57:31 +01:00
Xiang Xiao
0bbb720be2 boards/arm/imxrt: Fix nxstyle warning in imxrt1060-evk/src/imxrt_boot.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-23 13:57:31 +01:00
YAMAMOTO Takashi
1821352993 sim: Enable the sanitizers in HOSTLDFLAGS as well
This fixes the following error with CONFIG_SIM_SANITIZE=y on macOS.

```
CP:  /Users/yamamoto/git/nuttx/nuttx/include/nuttx/config.h
CC:  nettest_host.c
CC:  nettest_server.c
LD:  tcpserver
Undefined symbols for architecture x86_64:
  "___asan_handle_no_return", referenced from:
      _nettest_server in nettest_server.hobj
  "___asan_init", referenced from:
      _asan.module_ctor in nettest_host.hobj
      _asan.module_ctor in nettest_server.hobj
  "___asan_option_detect_stack_use_after_return", referenced from:
      _nettest_server in nettest_server.hobj
  "___asan_register_image_globals", referenced from:
      _asan.module_ctor in nettest_server.hobj
  "___asan_report_load1", referenced from:
      _nettest_server in nettest_server.hobj
  "___asan_report_load4", referenced from:
      _nettest_server in nettest_server.hobj
  "___asan_report_store1", referenced from:
      _nettest_server in nettest_server.hobj
  "___asan_report_store2", referenced from:
      _nettest_server in nettest_server.hobj
  "___asan_report_store4", referenced from:
      _nettest_server in nettest_server.hobj
  "___asan_stack_malloc_1", referenced from:
      _nettest_server in nettest_server.hobj
  "___asan_unregister_image_globals", referenced from:
      _asan.module_dtor in nettest_server.hobj
  "___asan_version_mismatch_check_apple_clang_1100", referenced from:
      _asan.module_ctor in nettest_host.hobj
      _asan.module_ctor in nettest_server.hobj
  "___ubsan_handle_add_overflow", referenced from:
      _nettest_server in nettest_server.hobj
  "___ubsan_handle_builtin_unreachable", referenced from:
      _nettest_server in nettest_server.hobj
  "___ubsan_handle_pointer_overflow", referenced from:
      _nettest_server in nettest_server.hobj
  "___ubsan_handle_shift_out_of_bounds", referenced from:
      _nettest_server in nettest_server.hobj
  "___ubsan_handle_sub_overflow", referenced from:
      _nettest_server in nettest_server.hobj
  "___ubsan_handle_type_mismatch_v1", referenced from:
      _nettest_server in nettest_server.hobj
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2021-03-23 02:48:50 -07:00
YAMAMOTO Takashi
6797826b84 arch/sim/src/sim/up_hostmemory.c: build fix for older macOS versions
I'm still using 10.14 (Mojave) for nuttx related things.

Note: the CI is using 10.15. (Catalina)
2021-03-23 02:48:50 -07:00
YAMAMOTO Takashi
bf93b1d9d1 sched/module/mod_insmod.c: Fix ELF64-related printf formats 2021-03-23 02:48:42 -07:00
chao.an
03f899f302 net/usrsock: add send multi-elements support
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-23 00:44:37 -07:00
Masayuki Ishikawa
083a11a3c3 arch: sim: Fix sim_sigdeliver() for SMP
Summary:
- In the previous implementation, signal handling for SMP was done
  in a critical section that is not correct
- This commit fixes this issue

Impact:
- signal handling for SMP

Testing:
- Tested with ostest

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-03-23 00:41:57 -07:00
Abdelatif Guettouche
fcafacb9a3 esp32_allocateheap.c: Adjust the region of the heap coming from the
external memory when a BSS section is allowed to reside there.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-03-23 16:39:01 +09:00
Abdelatif Guettouche
cc23bdeca4 boards/xtensa/esp32: Add a section in external memory to hold some BSS
data.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-03-23 16:39:01 +09:00
Xiang Xiao
b2563b99ca fs/littlefs: Suppport the duplication function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I64191bdeab3723b22476d27c44852493eed1b07e
2021-03-23 08:34:09 +01:00
chao.an
db8e498e4f net/if: remove the macro expansion of the public structure
This is a compatibility issue if different structures included
in the usrsock server/client scene, usrsock client has no habit
of actively choosing of config CONFIG_NETDEV_IFINDEX at most of the time

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-23 00:29:20 -07:00
chao.an
9bdf4ccd68 net/arp: add timeout to avoid infinite send wait
add timeout to avoid infinite send wait if the network device is unreachable

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-23 00:28:43 -07:00
chao.an
4abf8e6587 fs/epoll: correct the return value of epoll_ctl(2)
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-23 00:28:18 -07:00
David Sidrane
9800256507 stm32h7:DMA BDMA does not auto disabled on completion 2021-03-22 19:50:53 -07:00
YAMAMOTO Takashi
37300a43a5 esp32_part_ioctl: Return -ENOTTY for unknown commands
It's traditional to use ENOTTY for this purpose.
Littlefs seems to rely on this behavior for BIOC_FLUSH.

Also, drop the log level.
2021-03-22 19:49:27 -07:00
Matias N
a813f79c41 CI: remove linkcheck when building docs
We're running linkcheck and ignoring errors but this still slows CI build
and can even make it fail due to timeout. The linkcheck is useful for local
manual test but not really for CI.
2021-03-22 19:48:53 -07:00
Masayuki Ishikawa
9cce09e58a boards: Remove SCHED_INSTRUMENTATION from all SMP related configs
Summary:
- This commit removes SCHED_INSTRUMENTATION which has been used
  to debug NuttX SMP kernel

Impact:
- None

Testing:
- Tested with ostest

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-03-22 19:47:56 -07:00
Nathan Hartman
f83b30bda1 arch/stm32: Fix wrong Kconfig names for STM32G4xxx MCUs
arch/arm/src/stm32/Kconfig:

    * configs ARCH_CHIP_STM32G431K, ARCH_CHIP_STM32G431C,
      ARCH_CHIP_STM32G431R, ARCH_CHIP_STM32G431M, and
      ARCH_CHIP_STM32G431V: Fix copy/paste of incorrect
      names shown in the Kconfig menu.
2021-03-22 19:47:32 -07:00
Alin Jerpelea
1fdae80321 arch: arm: kinetis: fix nxstyle errors
fix nxstyle errors to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
b6a987afe0 arch: arm: imxrt: nxstyle fix
nxstyle is complaining that the headers are defines outside
Included Files section and we have to duplicate the definitions
to the imported files to avoid build errors.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
fe64ed54b9 boards: arm: stm32: fix Mixed case identifier
Mixed case identifier fix to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
881cfe4b70 arch: arm: kl: fix Mixed case identifier
Mixed case identifier fix to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
ee0861ae7a arch: arm: fixes for nxstyle errors
Nxstyle error fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
e8606942eb libs: libc: nxstyle fixes
nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
c39339a7a8 arch: arm: include: nxstyle fixes
nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
4daa276903 arch: arm: include: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
35e0d13d18 arch: Author Sebastien Lorquet: update licenses to Apache
Sebastien Lorquet has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
85bcf1bd4c arch: Author Alan Carvalho de Assis: update licenses to Apache
Alan Carvalho de Assis has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
37f91b023c arch: Author David Sidrane: update licenses to Apache
David Sidrane has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00