[nuttx] branch master updated (5ff1e85947 -> d0139d1206)

2023-05-10 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 5ff1e85947 boardctl: add 
BOARDIOC_SOFTRESETCAUSE_RESTORE_FACTORY_INQUIRY
 new 7f4cb3057a arch/arm64: merge serial_pl011.c and qemu_serial.c
 new 6e71527af2 arch/arm64: 64 bit platform compile error reported
 new d0139d1206 arch/arm64: change config order

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/arm64/src/common/arm64_arch_timer.c   |   2 +-
 arch/arm64/src/fvp-v8r/Kconfig |   7 -
 arch/arm64/src/fvp-v8r/Make.defs   |   2 +-
 arch/arm64/src/fvp-v8r/fvp_boot.h  |   2 -
 .../arm64/src/fvp-v8r/fvp_serial.c |  57 +-
 arch/arm64/src/fvp-v8r/serial_pl011.h  |  15 -
 arch/arm64/src/qemu/Kconfig|   7 -
 arch/arm64/src/qemu/qemu_boot.h|   2 -
 arch/arm64/src/qemu/qemu_serial.c  | 796 +
 arch/arm64/src/qemu/qemu_serial.h  |   3 -
 .../arm64/fvp-v8r/fvp-armv8r/configs/nsh/defconfig |  14 +-
 .../fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig   |  14 +-
 .../configs/{nsh_gicv2 => citest}/defconfig|   7 +-
 .../qemu/qemu-armv8a/configs/netnsh/defconfig  |   5 +-
 .../qemu/qemu-armv8a/configs/netnsh_smp/defconfig  |   5 +-
 .../arm64/qemu/qemu-armv8a/configs/nsh/defconfig   |   5 +-
 .../qemu/qemu-armv8a/configs/nsh_gicv2/defconfig   |   5 +-
 .../qemu/qemu-armv8a/configs/nsh_smp/defconfig |   5 +-
 .../qemu-armv8a/configs/nsh_smp_tickless/defconfig |   5 +-
 drivers/serial/Kconfig |   8 +
 drivers/serial/Kconfig-pl011   |  60 ++
 drivers/serial/Make.defs   |   4 +
 .../src/fvp-v8r => drivers/serial}/serial_pl011.c  |  30 +-
 .../nuttx/serial/uart_pl011.h  |  28 +-
 24 files changed, 190 insertions(+), 898 deletions(-)
 copy boards/arm/lc823450/lc823450-xgevk/src/lc823450_spi.c => 
arch/arm64/src/fvp-v8r/fvp_serial.c (68%)
 copy boards/arm64/qemu/qemu-armv8a/configs/{nsh_gicv2 => citest}/defconfig 
(94%)
 create mode 100644 drivers/serial/Kconfig-pl011
 rename {arch/arm64/src/fvp-v8r => drivers/serial}/serial_pl011.c (98%)
 copy arch/arm/src/am335x/am335x_serial.h => include/nuttx/serial/uart_pl011.h 
(85%)



[nuttx] 03/03: arch/arm64: change config order

2023-05-10 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit d0139d1206d8383a7b7c34bd694ca2a4d8ca1d50
Author: hujun5 
AuthorDate: Wed May 10 08:47:05 2023 +0800

arch/arm64: change config order

Signed-off-by: hujun5 
---
 .../arm64/fvp-v8r/fvp-armv8r/configs/nsh/defconfig | 26 +++---
 .../fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig   | 26 +++---
 .../qemu/qemu-armv8a/configs/citest/defconfig  |  8 +++
 .../qemu/qemu-armv8a/configs/netnsh/defconfig  |  8 +++
 .../qemu/qemu-armv8a/configs/netnsh_smp/defconfig  |  8 +++
 .../arm64/qemu/qemu-armv8a/configs/nsh/defconfig   |  8 +++
 .../qemu/qemu-armv8a/configs/nsh_gicv2/defconfig   |  8 +++
 .../qemu/qemu-armv8a/configs/nsh_smp/defconfig |  8 +++
 .../qemu-armv8a/configs/nsh_smp_tickless/defconfig |  8 +++
 9 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh/defconfig 
b/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh/defconfig
index 9a7dd51de8..bf1a985d2f 100644
--- a/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh/defconfig
+++ b/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh/defconfig
@@ -33,19 +33,6 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_FS_PROCFS=y
 CONFIG_FS_PROCFS_REGISTER=y
 CONFIG_FS_ROMFS=y
-CONFIG_UART0_PL011=y
-CONFIG_UART0_BASE=0x9c09
-CONFIG_UART0_IRQ=37
-CONFIG_UART1_PL011=y
-CONFIG_UART1_BASE=0x9c0a
-CONFIG_UART1_IRQ=38
-CONFIG_UART2_PL011=y
-CONFIG_UART2_BASE=0x9c0b
-CONFIG_UART2_IRQ=39
-CONFIG_UART3_PL011=y
-CONFIG_UART3_BASE=0x9c0c
-CONFIG_UART3_IRQ=40
-CONFIG_UART_PL011=y
 CONFIG_IDLETHREAD_STACKSIZE=8192
 CONFIG_INIT_ENTRYPOINT="nsh_main"
 CONFIG_INTELHEX_BINARY=y
@@ -76,5 +63,18 @@ CONFIG_SYSTEM_SYSTEM=y
 CONFIG_SYSTEM_TIME64=y
 CONFIG_TESTING_GETPRIME=y
 CONFIG_TESTING_OSTEST=y
+CONFIG_UART0_BASE=0x9c09
+CONFIG_UART0_IRQ=37
+CONFIG_UART0_PL011=y
+CONFIG_UART1_BASE=0x9c0a
+CONFIG_UART1_IRQ=38
+CONFIG_UART1_PL011=y
 CONFIG_UART1_SERIAL_CONSOLE=y
+CONFIG_UART2_BASE=0x9c0b
+CONFIG_UART2_IRQ=39
+CONFIG_UART2_PL011=y
+CONFIG_UART3_BASE=0x9c0c
+CONFIG_UART3_IRQ=40
+CONFIG_UART3_PL011=y
+CONFIG_UART_PL011=y
 CONFIG_USEC_PER_TICK=1000
diff --git a/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig 
b/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig
index 22fd417b8d..ea25788059 100644
--- a/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig
+++ b/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig
@@ -33,19 +33,6 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_FS_PROCFS=y
 CONFIG_FS_PROCFS_REGISTER=y
 CONFIG_FS_ROMFS=y
-CONFIG_UART0_PL011=y
-CONFIG_UART0_BASE=0x9c09
-CONFIG_UART0_IRQ=37
-CONFIG_UART1_PL011=y
-CONFIG_UART1_BASE=0x9c0a
-CONFIG_UART1_IRQ=38
-CONFIG_UART2_PL011=y
-CONFIG_UART2_BASE=0x9c0b
-CONFIG_UART2_IRQ=39
-CONFIG_UART3_PL011=y
-CONFIG_UART3_BASE=0x9c0c
-CONFIG_UART3_IRQ=40
-CONFIG_UART_PL011=y
 CONFIG_IDLETHREAD_STACKSIZE=8192
 CONFIG_INIT_ENTRYPOINT="nsh_main"
 CONFIG_INTELHEX_BINARY=y
@@ -79,5 +66,18 @@ CONFIG_SYSTEM_TIME64=y
 CONFIG_TESTING_GETPRIME=y
 CONFIG_TESTING_OSTEST=y
 CONFIG_TESTING_SMP=y
+CONFIG_UART0_BASE=0x9c09
+CONFIG_UART0_IRQ=37
+CONFIG_UART0_PL011=y
+CONFIG_UART1_BASE=0x9c0a
+CONFIG_UART1_IRQ=38
+CONFIG_UART1_PL011=y
 CONFIG_UART1_SERIAL_CONSOLE=y
+CONFIG_UART2_BASE=0x9c0b
+CONFIG_UART2_IRQ=39
+CONFIG_UART2_PL011=y
+CONFIG_UART3_BASE=0x9c0c
+CONFIG_UART3_IRQ=40
+CONFIG_UART3_PL011=y
+CONFIG_UART_PL011=y
 CONFIG_USEC_PER_TICK=1000
diff --git a/boards/arm64/qemu/qemu-armv8a/configs/citest/defconfig 
b/boards/arm64/qemu/qemu-armv8a/configs/citest/defconfig
index b2c18b5552..9644187caa 100644
--- a/boards/arm64/qemu/qemu-armv8a/configs/citest/defconfig
+++ b/boards/arm64/qemu/qemu-armv8a/configs/citest/defconfig
@@ -43,10 +43,6 @@ CONFIG_NSH_READLINE=y
 CONFIG_NSH_ROMFSETC=y
 CONFIG_PREALLOC_TIMERS=4
 CONFIG_PTHREAD_STACK_MIN=8192
-CONFIG_UART1_PL011=y
-CONFIG_UART1_BASE=0x900
-CONFIG_UART1_IRQ=33
-CONFIG_UART_PL011=y
 CONFIG_RAMLOG=y
 CONFIG_RAM_SIZE=134217728
 CONFIG_RAM_START=0x4000
@@ -64,5 +60,9 @@ CONFIG_SYSTEM_NSH=y
 CONFIG_SYSTEM_SYSTEM=y
 CONFIG_TESTING_GETPRIME=y
 CONFIG_TESTING_OSTEST=y
+CONFIG_UART1_BASE=0x900
+CONFIG_UART1_IRQ=33
+CONFIG_UART1_PL011=y
 CONFIG_UART1_SERIAL_CONSOLE=y
+CONFIG_UART_PL011=y
 CONFIG_USEC_PER_TICK=1000
diff --git a/boards/arm64/qemu/qemu-armv8a/configs/netnsh/defconfig 
b/boards/arm64/qemu/qemu-armv8a/configs/netnsh/defconfig
index 48397c7174..d3bb170182 100644
--- a/boards/arm64/qemu/qemu-armv8a/configs/netnsh/defconfig
+++ b/boards/arm64/qemu/qemu-armv8a/configs/netnsh/defconfig
@@ -59,10 +59,6 @@ CONFIG_NSH_FILEIOSIZE=512
 CONFIG_NSH_READLINE=y
 CONFIG_PREALLOC_TIMERS=4
 CONFIG_PTHREAD_STACK_MIN=8192
-CONFIG_UART1_PL011=y
-CONFIG_UART1_BASE=0x900
-CONFIG_UART1_IRQ=33
-CONFIG_UART_PL011=y
 CONFIG_RAM_SIZE=1342177

[nuttx] 01/03: arch/arm64: merge serial_pl011.c and qemu_serial.c

2023-05-10 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 7f4cb3057a230f5996fdaadad7919748f9749fef
Author: hujun5 
AuthorDate: Wed Mar 8 19:53:36 2023 +0800

arch/arm64: merge serial_pl011.c and qemu_serial.c

At present, the serial drivers qemu_serial.c and serial_pl011.c on the 
fvp-v8r and qemu platforms in arm64 are duplicated
and need to be merged. The plan is to place them under the drivers\serial 
directory to create a common code module,
so that both fvp-v8r and qemu can use the same code.
In the future, if new platforms use pl011 serial ports, they can also be 
directly reused

Signed-off-by: hujun5 
---
 arch/arm64/src/fvp-v8r/Kconfig |   7 -
 arch/arm64/src/fvp-v8r/Make.defs   |   2 +-
 arch/arm64/src/fvp-v8r/fvp_boot.h  |   2 -
 .../{qemu/qemu_serial.h => fvp-v8r/fvp_serial.c}   |  75 +-
 arch/arm64/src/fvp-v8r/serial_pl011.h  |  15 -
 arch/arm64/src/qemu/Kconfig|   7 -
 arch/arm64/src/qemu/qemu_boot.h|   2 -
 arch/arm64/src/qemu/qemu_serial.c  | 796 +
 arch/arm64/src/qemu/qemu_serial.h  |   3 -
 .../arm64/fvp-v8r/fvp-armv8r/configs/nsh/defconfig |  14 +-
 .../fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig   |  14 +-
 .../configs/{nsh_gicv2 => citest}/defconfig|   7 +-
 .../qemu/qemu-armv8a/configs/netnsh/defconfig  |   5 +-
 .../qemu/qemu-armv8a/configs/netnsh_smp/defconfig  |   5 +-
 .../arm64/qemu/qemu-armv8a/configs/nsh/defconfig   |   5 +-
 .../qemu/qemu-armv8a/configs/nsh_gicv2/defconfig   |   5 +-
 .../qemu/qemu-armv8a/configs/nsh_smp/defconfig |   5 +-
 .../qemu-armv8a/configs/nsh_smp_tickless/defconfig |   5 +-
 drivers/serial/Kconfig |   8 +
 drivers/serial/Kconfig-pl011   |  60 ++
 drivers/serial/Make.defs   |   4 +
 .../src/fvp-v8r => drivers/serial}/serial_pl011.c  |  30 +-
 .../nuttx/serial/uart_pl011.h  |  31 +-
 23 files changed, 197 insertions(+), 910 deletions(-)

diff --git a/arch/arm64/src/fvp-v8r/Kconfig b/arch/arm64/src/fvp-v8r/Kconfig
index c79840f7ae..d8b4704c38 100644
--- a/arch/arm64/src/fvp-v8r/Kconfig
+++ b/arch/arm64/src/fvp-v8r/Kconfig
@@ -21,11 +21,4 @@ endchoice # FVP Chip Selection
 
 endmenu # "FVP Chip Selection"
 
-menu "FVP Peripheral Selection"
-config FVP_UART_PL011
-   bool "UART"
-   default n
-   select UART1_SERIALDRIVER
-endmenu # FVP Peripheral Selection
-
 endif # ARCH_CHIP_FVP_ARMV8R
diff --git a/arch/arm64/src/fvp-v8r/Make.defs b/arch/arm64/src/fvp-v8r/Make.defs
index 0f5d396c1b..c314e8d139 100644
--- a/arch/arm64/src/fvp-v8r/Make.defs
+++ b/arch/arm64/src/fvp-v8r/Make.defs
@@ -21,7 +21,7 @@
 include common/Make.defs
 
 # fvp-specific C source files
-CHIP_CSRCS  = fvp_boot.c serial_pl011.c
+CHIP_CSRCS  = fvp_boot.c fvp_serial.c
 
 ifeq ($(CONFIG_ARCH_EARLY_PRINT),y)
 CHIP_ASRCS  += fvp_lowputc.S
diff --git a/arch/arm64/src/fvp-v8r/fvp_boot.h 
b/arch/arm64/src/fvp-v8r/fvp_boot.h
index 611d23a962..0ef44f255d 100644
--- a/arch/arm64/src/fvp-v8r/fvp_boot.h
+++ b/arch/arm64/src/fvp-v8r/fvp_boot.h
@@ -31,8 +31,6 @@
 #include 
 #include 
 #include 
-#include "arm64_internal.h"
-#include "arm64_arch.h"
 
 /
  * Pre-processor Definitions
diff --git a/arch/arm64/src/qemu/qemu_serial.h 
b/arch/arm64/src/fvp-v8r/fvp_serial.c
similarity index 61%
copy from arch/arm64/src/qemu/qemu_serial.h
copy to arch/arm64/src/fvp-v8r/fvp_serial.c
index 815ec639a3..4d08cf373f 100644
--- a/arch/arm64/src/qemu/qemu_serial.h
+++ b/arch/arm64/src/fvp-v8r/fvp_serial.c
@@ -1,5 +1,5 @@
-/
- * arch/arm64/src/qemu/qemu_serial.h
+/***
+ * arch/arm64/src/fvp-v8r/fvp_serial.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -16,46 +16,59 @@
  * License for the specific language governing permissions and limitations
  * under the License.
  *
- /
+ ***/
 
-#ifndef __ARCH_ARM64_SRC_QEMU_QEMU_SERIAL_H
-#define __ARCH_ARM64_SRC_QEMU_QEMU_SERIAL_H
-
-/
+/***
  * Included Files
- /
+ 

[nuttx] 02/03: arch/arm64: 64 bit platform compile error reported

2023-05-10 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 6e71527af2400a40bc4396f569f5972c4ede533c
Author: hujun5 
AuthorDate: Tue Mar 28 19:21:17 2023 +0800

arch/arm64: 64 bit platform compile error reported

compile error log:
common/arm64_arch_timer.c: In function 'arm64_tick_max_delay':
common/arm64_arch_timer.c:178:12: error: conversion from 'long unsigned 
int' to 'clock_t' {aka 'unsigned int'} changes value from 
'18446744073709551615' to '4294967295' [-Werror=overflow]
  178 |   *ticks = UINT64_MAX;
  |^~

Signed-off-by: hujun5 
---
 arch/arm64/src/common/arm64_arch_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/src/common/arm64_arch_timer.c 
b/arch/arm64/src/common/arm64_arch_timer.c
index 06489a3070..21fc07c3ad 100644
--- a/arch/arm64/src/common/arm64_arch_timer.c
+++ b/arch/arm64/src/common/arm64_arch_timer.c
@@ -175,7 +175,7 @@ static int arm64_tick_max_delay(struct oneshot_lowerhalf_s 
*lower,
 {
   DEBUGASSERT(ticks != NULL);
 
-  *ticks = UINT64_MAX;
+  *ticks = (clock_t)UINT64_MAX;
 
   return OK;
 }



[nuttx] branch master updated (5a553db88a -> e10fda570b)

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 5a553db88a arch/arm/sama5: Fix OHCI SchedulingOverrun interrupt storm.
 add e10fda570b udp: change PKTINFO flag to socket_conn_s struct

No new revisions were added by this update.

Summary of changes:
 include/netinet/in.h   |  6 +++---
 include/nuttx/net/net.h|  2 +-
 net/inet/ipv4_setsockopt.c | 18 +-
 net/inet/ipv6_setsockopt.c | 18 +++---
 net/udp/udp.h  |  1 -
 net/udp/udp_recvfrom.c | 19 ++-
 6 files changed, 30 insertions(+), 34 deletions(-)



[nuttx] branch master updated (3403b983ec -> 2b51111030)

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 3403b983ec libc/qsort: fix invalid-pointer-pair if enable 
detect_invalid_pointer_pairs=2
 add 2b5030 arch/z80/src/z180: Fix nxstyle errors

No new revisions were added by this update.

Summary of changes:
 arch/z80/src/z180/chip.h| 16 
 arch/z80/src/z180/switch.h  | 84 ++---
 arch/z80/src/z180/z180_config.h | 28 +++---
 arch/z80/src/z180/z180_iomap.h  | 42 +++--
 arch/z80/src/z180/z80_mem.h | 33 
 5 files changed, 107 insertions(+), 96 deletions(-)



[nuttx] branch master updated: libc/qsort: fix invalid-pointer-pair if enable detect_invalid_pointer_pairs=2

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 3403b983ec libc/qsort: fix invalid-pointer-pair if enable 
detect_invalid_pointer_pairs=2
3403b983ec is described below

commit 3403b983ec4740a1a1410d0ed4f84f61e6bdb034
Author: chao an 
AuthorDate: Mon May 8 15:00:49 2023 +0800

libc/qsort: fix invalid-pointer-pair if enable 
detect_invalid_pointer_pairs=2

=
==2920138==ERROR: AddressSanitizer: invalid-pointer-pair: 0x60300130 
0x
#0 0x5602d3c6a89d in qsort stdlib/lib_qsort.c:180
#1 0x5602d3c28928 in romfs_cachenode romfs/fs_romfsutil.c:503
#2 0x5602d3c2854d in romfs_cachenode romfs/fs_romfsutil.c:486
#3 0x5602d3c2b056 in romfs_fsconfigure romfs/fs_romfsutil.c:777
#4 0x5602d3c24856 in romfs_bind romfs/fs_romfs.c:
#5 0x5602d3bf5179 in nx_mount mount/fs_mount.c:427
#6 0x5602d3bf5796 in mount mount/fs_mount.c:539
#7 0x5602d3bc1154 in nsh_romfsetc apps/nshlib/nsh_romfsetc.c:110
#8 0x5602d3b8f38d in nsh_initialize apps/nshlib/nsh_init.c:127
#9 0x5602d3b8f2b7 in nsh_main apps/system/nsh/nsh_main.c:69
#10 0x5602d3b7a3a6 in nxtask_startup sched/task_startup.c:70
#11 0x5602d3b5de89 in nxtask_start task/task_start.c:134

0x60300130 is located 0 bytes inside of 32-byte region 
[0x60300130,0x60300150)
allocated by thread T0 here:
#0 0x7fcdac74793c in __interceptor_posix_memalign 
../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226
#1 0x5602d3c9024e in host_memalign sim/posix/sim_hostmemory.c:180
#2 0x5602d3c907d2 in host_realloc sim/posix/sim_hostmemory.c:222
#3 0x5602d3b8aaff in mm_realloc sim/sim_heap.c:262
#4 0x5602d3b87a6a in realloc umm_heap/umm_realloc.c:91
#5 0x5602d3c280c4 in romfs_cachenode romfs/fs_romfsutil.c:466
#6 0x5602d3c2854d in romfs_cachenode romfs/fs_romfsutil.c:486
#7 0x5602d3c2b056 in romfs_fsconfigure romfs/fs_romfsutil.c:777
#8 0x5602d3c24856 in romfs_bind romfs/fs_romfs.c:
#9 0x5602d3bf5179 in nx_mount mount/fs_mount.c:427
#10 0x5602d3bf5796 in mount mount/fs_mount.c:539
#11 0x5602d3bc1154 in nsh_romfsetc apps/nshlib/nsh_romfsetc.c:110
#12 0x5602d3b8f38d in nsh_initialize apps/nshlib/nsh_init.c:127
#13 0x5602d3b8f2b7 in nsh_main apps/system/nsh/nsh_main.c:69
#14 0x5602d3b7a3a6 in nxtask_startup sched/task_startup.c:70
#15 0x5602d3b5de89 in nxtask_start task/task_start.c:134

Address 0x is a wild pointer.
SUMMARY: AddressSanitizer: invalid-pointer-pair stdlib/lib_qsort.c:180 in 
qsort
==2920138==ABORTING
Aborted (core dumped)

Signed-off-by: chao an 
---
 libs/libc/stdlib/lib_qsort.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libs/libc/stdlib/lib_qsort.c b/libs/libc/stdlib/lib_qsort.c
index 0801631f2c..ea9e3151d0 100644
--- a/libs/libc/stdlib/lib_qsort.c
+++ b/libs/libc/stdlib/lib_qsort.c
@@ -67,8 +67,8 @@
   }
 
 #define SWAPINIT(a, width) \
-  swaptype = ((FAR char *)a - (FAR char *)0) % sizeof(long) || \
-  width % sizeof(long) ? 2 : width == sizeof(long)? 0 : 1;
+  swaptype = (uintptr_t)a % sizeof(long) || \
+  width % sizeof(long) ? 2 : width == sizeof(long) ? 0 : 1;
 
 #define swap(a, b) \
   if (swaptype == 0) \



[nuttx] branch master updated (0f243bde33 -> 1955992ae5)

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 0f243bde33 arch: fix the issue of asynchronous signal processing
 new 08ababd704 fs/vfs: Add a new argument(size_t len) to inode_getpath
 new 6354a742f1 libc: Add a new argument(size_t fulllen) to lib_getfullpath
 new fa8719bb5a Replace all strcat with strlcat
 new 6f6fce95a2 Replace all sprintf with snprintf
 new 325f395300 Replace all strncpy with strlcpy
 new 1955992ae5 fs: Replace strncat with strlcat

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/arm/src/armv7-m/arm_systick.c |  2 +-
 arch/arm/src/armv8-m/arm_systick.c |  2 +-
 arch/arm/src/c5471/c5471_watchdog.c|  4 +-
 arch/arm/src/phy62xx/uart.h| 10 -
 arch/arm/src/tlsr82/tlsr82_flash_mtd.c | 22 ++
 arch/risc-v/src/esp32c3/esp32c3_partition.c|  2 +-
 arch/sim/src/sim/sim_rptun.c   |  4 +-
 arch/xtensa/src/esp32/esp32_himem_chardev.c|  2 +-
 boards/arm/imxrt/imxrt1064-evk/src/imxrt_progmem.c |  3 +-
 boards/arm/stm32/cloudctrl/src/stm32_chipid.c  |  3 +-
 boards/arm/stm32/shenzhou/src/stm32_chipid.c   |  3 +-
 boards/arm/stm32f7/nucleo-144/src/stm32_bringup.c  |  6 +--
 .../arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c  |  3 +-
 .../arm/stm32l4/nucleo-l432kc/src/stm32_appinit.c  | 12 +++---
 .../arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c  | 12 +++---
 boards/sim/sim/sim/src/sim_foc.c   |  2 +-
 drivers/contactless/mfrc522.c  |  2 +-
 drivers/modem/alt1250/altcom_hdlr.c| 49 +++---
 drivers/mtd/smart.c|  4 +-
 drivers/net/rpmsgdrv.c |  7 ++--
 drivers/segger/stream_rtt.c|  4 +-
 drivers/serial/uart_rpmsg.c|  6 ++-
 drivers/usbdev/pl2303.c|  2 +-
 drivers/video/max7456.c|  4 +-
 drivers/wireless/cc1101.c  |  2 +-
 drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.c   |  7 ++--
 drivers/wireless/ieee802154/at86rf23x/at86rf23x.c  |  9 ++--
 .../wireless/ieee802154/mrf24j40/mrf24j40_regops.c | 18 +---
 drivers/wireless/nrf24l01.c| 14 +++
 drivers/wireless/spirit/lib/spirit_spi.c   |  2 +-
 fs/binfs/fs_binfs.c|  5 ++-
 fs/hostfs/hostfs.c |  6 +--
 fs/inode/fs_foreachinode.c |  7 ++--
 fs/inode/fs_inodegetpath.c |  8 ++--
 fs/inode/inode.h   |  2 +-
 fs/mount/fs_automount.c|  7 ++--
 fs/mount/fs_foreachmountpoint.c|  2 +-
 fs/romfs/fs_romfs.c|  4 +-
 fs/rpmsgfs/rpmsgfs.c   |  4 +-
 fs/vfs/fs_dir.c|  2 +-
 fs/vfs/fs_ioctl.c  |  2 +-
 graphics/nxmu/nxmu_server.c|  2 +-
 include/nuttx/wireless/bluetooth/bt_core.h |  2 +-
 libs/libc/libc.h   |  3 +-
 libs/libc/misc/lib_envpath.c   |  2 +-
 libs/libc/misc/lib_fchmodat.c  |  2 +-
 libs/libc/misc/lib_fstatat.c   |  2 +-
 libs/libc/misc/lib_getfullpath.c   |  9 ++--
 libs/libc/misc/lib_mkdirat.c   |  2 +-
 libs/libc/misc/lib_mkfifo.c|  2 +-
 libs/libc/misc/lib_mknod.c |  2 +-
 libs/libc/misc/lib_openat.c|  2 +-
 libs/libc/misc/lib_utimensat.c |  2 +-
 libs/libc/stdio/lib_renameat.c |  6 ++-
 libs/libc/unistd/lib_access.c  |  2 +-
 libs/libc/unistd/lib_fchownat.c|  2 +-
 libs/libc/unistd/lib_linkat.c  |  6 ++-
 libs/libc/unistd/lib_readlinkat.c  |  2 +-
 libs/libc/unistd/lib_swab.c|  2 +-
 libs/libc/unistd/lib_symlinkat.c   |  2 +-
 libs/libc/unistd/lib_unlinkat.c|  2 +-
 libs/libc/unistd/lib_utimes.c  |  2 +-
 libs/libnx/nxmu/nx_connect.c   |  2 +-
 mm/mempool/mempool.c   |  5 ++-
 mm/mm_heap/mm_memdump.c|  5 ++-
 mm/tlsf/mm_tlsf.c  |  5 ++-
 net/neighbor/neighbor_dumpentry.c  |  6 +--
 sched/

[nuttx] 02/06: libc: Add a new argument(size_t fulllen) to lib_getfullpath

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 6354a742f1b87d51a922eaae57ccca091d9f106c
Author: Xiang Xiao 
AuthorDate: Sun Mar 5 22:39:02 2023 +0800

libc: Add a new argument(size_t fulllen) to lib_getfullpath

Signed-off-by: Xiang Xiao 
---
 libs/libc/libc.h  | 3 ++-
 libs/libc/misc/lib_fchmodat.c | 2 +-
 libs/libc/misc/lib_fstatat.c  | 2 +-
 libs/libc/misc/lib_getfullpath.c  | 9 +
 libs/libc/misc/lib_mkdirat.c  | 2 +-
 libs/libc/misc/lib_mkfifo.c   | 2 +-
 libs/libc/misc/lib_mknod.c| 2 +-
 libs/libc/misc/lib_openat.c   | 2 +-
 libs/libc/misc/lib_utimensat.c| 2 +-
 libs/libc/stdio/lib_renameat.c| 6 --
 libs/libc/unistd/lib_access.c | 2 +-
 libs/libc/unistd/lib_fchownat.c   | 2 +-
 libs/libc/unistd/lib_linkat.c | 6 --
 libs/libc/unistd/lib_readlinkat.c | 2 +-
 libs/libc/unistd/lib_symlinkat.c  | 2 +-
 libs/libc/unistd/lib_unlinkat.c   | 2 +-
 libs/libc/unistd/lib_utimes.c | 2 +-
 17 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/libs/libc/libc.h b/libs/libc/libc.h
index 7a81e44549..897e1f7df3 100644
--- a/libs/libc/libc.h
+++ b/libs/libc/libc.h
@@ -83,7 +83,8 @@ FAR char *__dtoa(double d, int mode, int ndigits, FAR int 
*decpt,
 
 /* Defined in lib_getfullpath.c */
 
-int lib_getfullpath(int dirfd, FAR const char *path, FAR char *fullpath);
+int lib_getfullpath(int dirfd, FAR const char *path,
+FAR char *fullpath, size_t fulllen);
 
 /* Defined in lib_fopen.c */
 
diff --git a/libs/libc/misc/lib_fchmodat.c b/libs/libc/misc/lib_fchmodat.c
index 7ebb47c966..c2a96817fb 100644
--- a/libs/libc/misc/lib_fchmodat.c
+++ b/libs/libc/misc/lib_fchmodat.c
@@ -67,7 +67,7 @@ int fchmodat(int dirfd, FAR const char *path, mode_t mode, 
int flags)
   char fullpath[PATH_MAX];
   int ret;
 
-  ret = lib_getfullpath(dirfd, path, fullpath);
+  ret = lib_getfullpath(dirfd, path, fullpath, sizeof(fullpath));
   if (ret < 0)
 {
   set_errno(-ret);
diff --git a/libs/libc/misc/lib_fstatat.c b/libs/libc/misc/lib_fstatat.c
index af64110f3d..99003aa4bb 100644
--- a/libs/libc/misc/lib_fstatat.c
+++ b/libs/libc/misc/lib_fstatat.c
@@ -68,7 +68,7 @@ int fstatat(int dirfd, FAR const char *path, FAR struct stat 
*buf,
   char fullpath[PATH_MAX];
   int ret;
 
-  ret = lib_getfullpath(dirfd, path, fullpath);
+  ret = lib_getfullpath(dirfd, path, fullpath, sizeof(fullpath));
   if (ret < 0)
 {
   set_errno(-ret);
diff --git a/libs/libc/misc/lib_getfullpath.c b/libs/libc/misc/lib_getfullpath.c
index 1cd454c38e..7e457c71a8 100644
--- a/libs/libc/misc/lib_getfullpath.c
+++ b/libs/libc/misc/lib_getfullpath.c
@@ -42,7 +42,8 @@
  *
  /
 
-int lib_getfullpath(int dirfd, FAR const char *path, FAR char *fullpath)
+int lib_getfullpath(int dirfd, FAR const char *path,
+FAR char *fullpath, size_t fulllen)
 {
   if (path == NULL || fullpath == NULL)
 {
@@ -52,7 +53,7 @@ int lib_getfullpath(int dirfd, FAR const char *path, FAR char 
*fullpath)
 {
   /* The path is absolute, then dirfd is ignored. */
 
-  strlcpy(fullpath, path, PATH_MAX);
+  strlcpy(fullpath, path, fulllen);
   return 0;
 }
 
@@ -73,7 +74,7 @@ int lib_getfullpath(int dirfd, FAR const char *path, FAR char 
*fullpath)
 }
 #endif
 
-  sprintf(fullpath, "%s/%s", pwd, path);
+  snprintf(fullpath, fulllen, "%s/%s", pwd, path);
   return 0;
 }
   else
@@ -85,7 +86,7 @@ int lib_getfullpath(int dirfd, FAR const char *path, FAR char 
*fullpath)
   ret = fcntl(dirfd, F_GETPATH, fullpath);
   if (ret >= 0)
 {
-  strlcat(fullpath, path, PATH_MAX);
+  strlcat(fullpath, path, fulllen);
 }
 
   return 0;
diff --git a/libs/libc/misc/lib_mkdirat.c b/libs/libc/misc/lib_mkdirat.c
index 9932f900ee..db99dbdb66 100644
--- a/libs/libc/misc/lib_mkdirat.c
+++ b/libs/libc/misc/lib_mkdirat.c
@@ -65,7 +65,7 @@ int mkdirat(int dirfd, FAR const char *path, mode_t mode)
   char fullpath[PATH_MAX];
   int ret;
 
-  ret = lib_getfullpath(dirfd, path, fullpath);
+  ret = lib_getfullpath(dirfd, path, fullpath, sizeof(fullpath));
   if (ret < 0)
 {
   set_errno(-ret);
diff --git a/libs/libc/misc/lib_mkfifo.c b/libs/libc/misc/lib_mkfifo.c
index 5999fb39f4..bbe3551ef0 100644
--- a/libs/libc/misc/lib_mkfifo.c
+++ b/libs/libc/misc/lib_mkfifo.c
@@ -115,7 +115,7 @@ int mkfifoat(int dirfd, FAR const char *path, mode_t mode)
   char fullpath[PATH_MAX];
   int ret;
 
-  ret = lib_getfullpath(dirfd, path, fullpath);
+  ret = lib_getfullpath(dirfd, path, fullpath, sizeof(fullpath));
   if (ret < 0)
 {
   set_errno(-ret);
diff --git a/libs/libc/misc/lib_mknod.c b/libs/libc/misc/lib_mknod.c
index 205300a91b..c4a3bb859f 1006

[nuttx] 03/06: Replace all strcat with strlcat

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit fa8719bb5a0e1ce37c1d1398faf5be02362a45c1
Author: Xiang Xiao 
AuthorDate: Sun Mar 5 21:48:08 2023 +0800

Replace all strcat with strlcat

Signed-off-by: Xiang Xiao 
---
 drivers/video/max7456.c | 4 ++--
 fs/hostfs/hostfs.c  | 4 ++--
 fs/rpmsgfs/rpmsgfs.c| 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/max7456.c b/drivers/video/max7456.c
index 518d558351..66ba212700 100644
--- a/drivers/video/max7456.c
+++ b/drivers/video/max7456.c
@@ -1554,11 +1554,11 @@ static int add_interface(FAR const char *path,
 {
   /* Convert @path to a directory name. */
 
-  strcat(buf, "/");
+  strlcat(buf, "/", sizeof(buf));
 
   /* Append the real interface name. */
 
-  strcat(buf, name);
+  strlcat(buf, name, sizeof(buf));
 }
 
   /* Register the interface in the usual way. NuttX will build the
diff --git a/fs/hostfs/hostfs.c b/fs/hostfs/hostfs.c
index 8ee8aed21f..f250f3d989 100644
--- a/fs/hostfs/hostfs.c
+++ b/fs/hostfs/hostfs.c
@@ -1002,7 +1002,7 @@ static int hostfs_rewinddir(FAR struct inode *mountpt,
 static int hostfs_bind(FAR struct inode *blkdriver, FAR const void *data,
FAR void **handle)
 {
-  FAR struct hostfs_mountpt_s  *fs;
+  FAR struct hostfs_mountpt_s *fs;
   FAR char *options;
   char *saveptr;
   char *ptr;
@@ -1080,7 +1080,7 @@ static int hostfs_bind(FAR struct inode *blkdriver, FAR 
const void *data,
 
   if (fs->fs_root[len - 1] != '/')
 {
-  strcat(fs->fs_root, "/");
+  strlcat(fs->fs_root, "/", sizeof(fs->fs_root));
 }
 
   *handle = (FAR void *)fs;
diff --git a/fs/rpmsgfs/rpmsgfs.c b/fs/rpmsgfs/rpmsgfs.c
index 71f1349f1c..c8b8d048b2 100644
--- a/fs/rpmsgfs/rpmsgfs.c
+++ b/fs/rpmsgfs/rpmsgfs.c
@@ -1140,7 +1140,7 @@ static int rpmsgfs_bind(FAR struct inode *blkdriver, FAR 
const void *data,
 
   if (fs->fs_root[len - 1] != '/')
 {
-  strcat(fs->fs_root, "/");
+  strlcat(fs->fs_root, "/", sizeof(fs->fs_root));
 }
 
   *handle = (FAR void *)fs;



[nuttx] 05/06: Replace all strncpy with strlcpy

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 325f39530034108cf3b5580f820069bb3423a56d
Author: Xiang Xiao 
AuthorDate: Mon Mar 6 00:53:04 2023 +0800

Replace all strncpy with strlcpy

Signed-off-by: Xiang Xiao 
---
 arch/sim/src/sim/sim_rptun.c   |  4 +-
 arch/xtensa/src/esp32/esp32_himem_chardev.c|  2 +-
 boards/arm/imxrt/imxrt1064-evk/src/imxrt_progmem.c |  3 +-
 .../arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c  |  3 +-
 drivers/modem/alt1250/altcom_hdlr.c| 49 +++---
 libs/libc/unistd/lib_swab.c|  2 +-
 sched/pthread/pthread_create.c |  3 +-
 7 files changed, 31 insertions(+), 35 deletions(-)

diff --git a/arch/sim/src/sim/sim_rptun.c b/arch/sim/src/sim/sim_rptun.c
index 8144b482a0..86d58d33da 100644
--- a/arch/sim/src/sim/sim_rptun.c
+++ b/arch/sim/src/sim/sim_rptun.c
@@ -262,8 +262,8 @@ int sim_rptun_init(const char *shmemname, const char 
*cpuname, bool master)
 
   dev->master = master;
   dev->rptun.ops = _sim_rptun_ops;
-  strncpy(dev->cpuname, cpuname, RPMSG_NAME_SIZE);
-  strncpy(dev->shmemname, shmemname, RPMSG_NAME_SIZE);
+  strlcpy(dev->cpuname, cpuname, RPMSG_NAME_SIZE);
+  strlcpy(dev->shmemname, shmemname, RPMSG_NAME_SIZE);
   list_add_tail(_dev_list, >node);
 
   ret = rptun_initialize(>rptun);
diff --git a/arch/xtensa/src/esp32/esp32_himem_chardev.c 
b/arch/xtensa/src/esp32/esp32_himem_chardev.c
index 6d2bdd82db..bb13583841 100644
--- a/arch/xtensa/src/esp32/esp32_himem_chardev.c
+++ b/arch/xtensa/src/esp32/esp32_himem_chardev.c
@@ -314,7 +314,7 @@ int himem_chardev_register(char *name, size_t size)
 
   dev->size = size;
 
-  strncpy(dev->name, name, 32);
+  strlcpy(dev->name, name, 32);
   ret = esp_himem_alloc(dev->size, >mem_handle);
   if (ret != 0)
 {
diff --git a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_progmem.c 
b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_progmem.c
index bd031ee979..8d8fd7f692 100644
--- a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_progmem.c
+++ b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_progmem.c
@@ -186,8 +186,7 @@ static int init_ota_partitions(void)
   const struct ota_partition_s *part = _ota_partition_table[i];
   mtd = progmem_alloc_mtdpart(part->offset, part->size);
 
-  strncpy(path, (char *)part->devpath, PARTITION_LABEL_LEN);
-  path[PARTITION_LABEL_LEN] = '\0';
+  strlcpy(path, (char *)part->devpath, PARTITION_LABEL_LEN);
 
   finfo("INFO: [label]:   %s\n", path);
   finfo("INFO: [offset]:  0x%08" PRIx32 "\n", part->offset);
diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c 
b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c
index 893da57f29..195608b26c 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c
+++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c
@@ -187,8 +187,7 @@ static int init_ota_partitions(void)
   const struct ota_partition_s *part = _ota_partition_table[i];
   mtd = progmem_alloc_mtdpart(part->offset, part->size);
 
-  strncpy(path, (char *)part->devpath, PARTITION_LABEL_LEN);
-  path[PARTITION_LABEL_LEN] = '\0';
+  strlcpy(path, (char *)part->devpath, PARTITION_LABEL_LEN);
 
   finfo("INFO: [label]:   %s\n", path);
   finfo("INFO: [offset]:  0x%08" PRIx32 "\n", part->offset);
diff --git a/drivers/modem/alt1250/altcom_hdlr.c 
b/drivers/modem/alt1250/altcom_hdlr.c
index 67201621c2..17ccfcb1bf 100644
--- a/drivers/modem/alt1250/altcom_hdlr.c
+++ b/drivers/modem/alt1250/altcom_hdlr.c
@@ -790,9 +790,9 @@ int32_t altcombs_set_pdninfo(struct apicmd_pdnset_s 
*cmd_pdn,
   for (i = 0; i < lte_pdn->ipaddr_num; i++)
 {
   lte_pdn->address[i].ip_type = cmd_pdn->ip_address[i].iptype;
-  strncpy(lte_pdn->address[i].address,
+  strlcpy(lte_pdn->address[i].address,
   (FAR char *)cmd_pdn->ip_address[i].address,
-  LTE_IPADDR_MAX_LEN - 1);
+  LTE_IPADDR_MAX_LEN);
 }
 
   lte_pdn->ims_register = cmd_pdn->imsregister == APICMD_PDN_IMS_REG ?
@@ -826,9 +826,9 @@ int32_t altcombs_set_pdninfo_v4(FAR struct 
apicmd_pdnset_v4_s *cmd_pdn,
   for (i = 0; i < lte_pdn->ipaddr_num; i++)
 {
   lte_pdn->address[i].ip_type = cmd_pdn->ip_address[i].iptype;
-  strncpy(lte_pdn->address[i].address,
+  strlcpy(lte_pdn->address[i].address,
   (FAR char *)cmd_pdn->ip_address[i].address,
-  LTE_IPADDR_MAX_LEN - 1);
+  LTE_IPADDR_MAX_LEN);
 }
 
   lte_pdn->ims_register = cmd_pdn->imsregister;
@@ -1420,10 +1420,10 @@ static void getver_parse_response(FAR struct 
apicmd_cmddat_getverres_s *resp,
   FAR lte

[nuttx] 04/06: Replace all sprintf with snprintf

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 6f6fce95a2c21fcde342ef4d0f35f15f8328cf32
Author: Xiang Xiao 
AuthorDate: Sun Mar 5 22:34:33 2023 +0800

Replace all sprintf with snprintf

Signed-off-by: Xiang Xiao 
---
 arch/arm/src/armv7-m/arm_systick.c |  2 +-
 arch/arm/src/armv8-m/arm_systick.c |  2 +-
 arch/arm/src/c5471/c5471_watchdog.c|  4 ++--
 arch/arm/src/phy62xx/uart.h| 10 +-
 arch/arm/src/tlsr82/tlsr82_flash_mtd.c | 22 ++
 arch/risc-v/src/esp32c3/esp32c3_partition.c|  2 +-
 boards/arm/stm32/cloudctrl/src/stm32_chipid.c  |  3 ++-
 boards/arm/stm32/shenzhou/src/stm32_chipid.c   |  3 ++-
 boards/arm/stm32f7/nucleo-144/src/stm32_bringup.c  |  6 +++---
 .../arm/stm32l4/nucleo-l432kc/src/stm32_appinit.c  | 12 ++--
 .../arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c  | 12 ++--
 boards/sim/sim/sim/src/sim_foc.c   |  2 +-
 drivers/contactless/mfrc522.c  |  2 +-
 drivers/mtd/smart.c|  4 +++-
 drivers/net/rpmsgdrv.c |  7 ---
 drivers/segger/stream_rtt.c|  4 ++--
 drivers/serial/uart_rpmsg.c|  6 --
 drivers/usbdev/pl2303.c|  2 +-
 drivers/wireless/cc1101.c  |  2 +-
 drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.c   |  7 ---
 drivers/wireless/ieee802154/at86rf23x/at86rf23x.c  |  9 ++---
 .../wireless/ieee802154/mrf24j40/mrf24j40_regops.c | 18 --
 drivers/wireless/nrf24l01.c| 14 +++---
 drivers/wireless/spirit/lib/spirit_spi.c   |  2 +-
 fs/inode/fs_foreachinode.c |  7 ---
 fs/mount/fs_automount.c|  7 ---
 fs/mount/fs_foreachmountpoint.c|  2 +-
 graphics/nxmu/nxmu_server.c|  2 +-
 include/nuttx/wireless/bluetooth/bt_core.h |  2 +-
 libs/libc/misc/lib_envpath.c   |  2 +-
 libs/libnx/nxmu/nx_connect.c   |  2 +-
 mm/mempool/mempool.c   |  5 +++--
 mm/mm_heap/mm_memdump.c|  5 +++--
 mm/tlsf/mm_tlsf.c  |  5 +++--
 net/neighbor/neighbor_dumpentry.c  |  6 +++---
 sched/environ/env_setenv.c |  2 +-
 36 files changed, 120 insertions(+), 84 deletions(-)

diff --git a/arch/arm/src/armv7-m/arm_systick.c 
b/arch/arm/src/armv7-m/arm_systick.c
index 25b2a08834..e45728c0cd 100644
--- a/arch/arm/src/armv7-m/arm_systick.c
+++ b/arch/arm/src/armv7-m/arm_systick.c
@@ -302,7 +302,7 @@ struct timer_lowerhalf_s *systick_initialize(bool coreclk,
 {
   char devname[32];
 
-  sprintf(devname, "/dev/timer%d", minor);
+  snprintf(devname, sizeof(devname), "/dev/timer%d", minor);
   timer_register(devname, (struct timer_lowerhalf_s *)lower);
 }
 
diff --git a/arch/arm/src/armv8-m/arm_systick.c 
b/arch/arm/src/armv8-m/arm_systick.c
index 87dad90788..d9733aefd7 100644
--- a/arch/arm/src/armv8-m/arm_systick.c
+++ b/arch/arm/src/armv8-m/arm_systick.c
@@ -302,7 +302,7 @@ struct timer_lowerhalf_s *systick_initialize(bool coreclk,
 {
   char devname[32];
 
-  sprintf(devname, "/dev/timer%d", minor);
+  snprintf(devname, sizeof(devname), "/dev/timer%d", minor);
   timer_register(devname, (struct timer_lowerhalf_s *)lower);
 }
 
diff --git a/arch/arm/src/c5471/c5471_watchdog.c 
b/arch/arm/src/c5471/c5471_watchdog.c
index a27f9e4537..ba6014c2c4 100644
--- a/arch/arm/src/c5471/c5471_watchdog.c
+++ b/arch/arm/src/c5471/c5471_watchdog.c
@@ -250,8 +250,8 @@ static ssize_t wdt_read(struct file *filep, char *buffer, 
size_t buflen)
   wdinfo("buflen=%d\n", buflen);
   if (buflen >= 18)
 {
-  sprintf(buffer, "%08" PRIx32 " %08" PRIx32 "\n",
-  c5471_wdt_cntl, c5471_wdt_count);
+  snprintf(buffer, buflen, "%08" PRIx32 " %08" PRIx32 "\n",
+   c5471_wdt_cntl, c5471_wdt_count);
   return 18;
 }
 
diff --git a/arch/arm/src/phy62xx/uart.h b/arch/arm/src/phy62xx/uart.h
index 518575c338..4cc1823a3d 100644
--- a/arch/arm/src/phy62xx/uart.h
+++ b/arch/arm/src/phy62xx/uart.h
@@ -165,7 +165,15 @@ int hal_uart_set_tx_buf(UART_INDEX_e uart_index, uint8_t 
*buf,
 uint16_t size);
 int hal_uart_get_tx_ready(UART_INDEX_e uart_index);
 int hal_uart_send_buff(UART_INDEX_e uart_index, uint8_t *buff, uint16_t len);
-#define logx(...) {char tmp_str[128]; sprintf(tmp_str, __VA_ARGS__); 
hal_uart_send_buff(0, _str, strlen(tmp_str) + 1);}
+#defi

[nuttx] 06/06: fs: Replace strncat with strlcat

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 1955992ae5cd1894c78398e1206bacd7dc2a1e49
Author: Xiang Xiao 
AuthorDate: Mon Mar 6 01:35:34 2023 +0800

fs: Replace strncat with strlcat

Signed-off-by: Xiang Xiao 
---
 fs/hostfs/hostfs.c   | 2 +-
 fs/rpmsgfs/rpmsgfs.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/hostfs/hostfs.c b/fs/hostfs/hostfs.c
index f250f3d989..f7c4a70886 100644
--- a/fs/hostfs/hostfs.c
+++ b/fs/hostfs/hostfs.c
@@ -228,7 +228,7 @@ static void hostfs_mkpath(FAR struct hostfs_mountpt_s  *fs,
 
   if (depth >= 0)
 {
-  strncat(path, [first], pathlen - strlen(path) - 1);
+  strlcat(path, [first], pathlen - strlen(path));
 }
 }
 
diff --git a/fs/rpmsgfs/rpmsgfs.c b/fs/rpmsgfs/rpmsgfs.c
index c8b8d048b2..d46a2c0e84 100644
--- a/fs/rpmsgfs/rpmsgfs.c
+++ b/fs/rpmsgfs/rpmsgfs.c
@@ -247,7 +247,7 @@ static void rpmsgfs_mkpath(FAR struct rpmsgfs_mountpt_s *fs,
 
   if (depth >= 0)
 {
-  strncat(path, [first], pathlen - strlen(path) - 1);
+  strlcat(path, [first], pathlen - strlen(path));
 }
 
   while (fs->timeout > 0)



[nuttx] 01/06: fs/vfs: Add a new argument(size_t len) to inode_getpath

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 08ababd7044c5e29ac1a943140ec74c8a2a55f62
Author: Xiang Xiao 
AuthorDate: Sun Mar 5 21:13:32 2023 +0800

fs/vfs: Add a new argument(size_t len) to inode_getpath

Signed-off-by: Xiang Xiao 
---
 fs/binfs/fs_binfs.c| 5 +++--
 fs/inode/fs_inodegetpath.c | 8 
 fs/inode/inode.h   | 2 +-
 fs/romfs/fs_romfs.c| 4 ++--
 fs/vfs/fs_dir.c| 2 +-
 fs/vfs/fs_ioctl.c  | 2 +-
 6 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/fs/binfs/fs_binfs.c b/fs/binfs/fs_binfs.c
index 1fe2fa7c8b..92e7dc3bbe 100644
--- a/fs/binfs/fs_binfs.c
+++ b/fs/binfs/fs_binfs.c
@@ -224,13 +224,14 @@ static int binfs_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
 }
   else
 {
-  ret = inode_getpath(filep->f_inode, ptr);
+  ret = inode_getpath(filep->f_inode, ptr, PATH_MAX);
   if (ret < 0)
 {
   return ret;
 }
 
-  strcat(ptr, builtin_getname((int)((uintptr_t)filep->f_priv)));
+  strlcat(ptr, builtin_getname((int)((uintptr_t)filep->f_priv)),
+  PATH_MAX);
 }
 }
   else
diff --git a/fs/inode/fs_inodegetpath.c b/fs/inode/fs_inodegetpath.c
index f3b7b966c1..e0b3572efd 100644
--- a/fs/inode/fs_inodegetpath.c
+++ b/fs/inode/fs_inodegetpath.c
@@ -42,7 +42,7 @@
  *
  /
 
-int inode_getpath(FAR struct inode *node, FAR char *path)
+int inode_getpath(FAR struct inode *node, FAR char *path, size_t len)
 {
   if (path == NULL)
 {
@@ -55,17 +55,17 @@ int inode_getpath(FAR struct inode *node, FAR char *path)
 }
   else
 {
-  int ret = inode_getpath(node->i_parent, path);
+  int ret = inode_getpath(node->i_parent, path, len);
   if (ret < 0)
 {
   return ret;
 }
 }
 
-  strcat(path, node->i_name);
+  strlcat(path, node->i_name, len);
   if (node->i_child || INODE_IS_MOUNTPT(node))
 {
-  strcat(path, "/");
+  strlcat(path, "/", len);
 }
 
   return OK;
diff --git a/fs/inode/inode.h b/fs/inode/inode.h
index 050b10975f..f5f8727be6 100644
--- a/fs/inode/inode.h
+++ b/fs/inode/inode.h
@@ -279,7 +279,7 @@ int inode_chstat(FAR struct inode *inode,
  *
  /
 
-int inode_getpath(FAR struct inode *node, FAR char *path);
+int inode_getpath(FAR struct inode *node, FAR char *path, size_t len);
 
 /
  * Name: inode_free
diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c
index ad72d82ea1..eda870dc04 100644
--- a/fs/romfs/fs_romfs.c
+++ b/fs/romfs/fs_romfs.c
@@ -599,8 +599,8 @@ static int romfs_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
   if (cmd == FIOC_FILEPATH)
 {
   FAR char *ptr = (FAR char *)((uintptr_t)arg);
-  inode_getpath(filep->f_inode, ptr);
-  strcat(ptr, rf->rf_path);
+  inode_getpath(filep->f_inode, ptr, PATH_MAX);
+  strlcat(ptr, rf->rf_path, PATH_MAX);
   return OK;
 }
 
diff --git a/fs/vfs/fs_dir.c b/fs/vfs/fs_dir.c
index 8e4d6a6766..eeb8415114 100644
--- a/fs/vfs/fs_dir.c
+++ b/fs/vfs/fs_dir.c
@@ -599,7 +599,7 @@ int dir_allocate(FAR struct file *filep, FAR const char 
*relpath)
 }
 }
 
-  inode_getpath(inode, path_prefix);
+  inode_getpath(inode, path_prefix, sizeof(path_prefix));
   ret = asprintf(>fd_path, "%s%s/", path_prefix, relpath);
   if (ret < 0)
 {
diff --git a/fs/vfs/fs_ioctl.c b/fs/vfs/fs_ioctl.c
index f952733a39..2fcf0e0124 100644
--- a/fs/vfs/fs_ioctl.c
+++ b/fs/vfs/fs_ioctl.c
@@ -105,7 +105,7 @@ int file_vioctl(FAR struct file *filep, int req, va_list ap)
   case FIOC_FILEPATH:
 if (ret == -ENOTTY && !INODE_IS_MOUNTPT(inode))
   {
-ret = inode_getpath(inode, (FAR char *)(uintptr_t)arg);
+ret = inode_getpath(inode, (FAR char *)(uintptr_t)arg, PATH_MAX);
   }
 break;
 



[nuttx] branch master updated (35dee8fdd2 -> 0f243bde33)

2023-05-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 35dee8fdd2 icmpv6: add SOCK_RAW type support
 add 0f243bde33 arch: fix the issue of asynchronous signal processing

No new revisions were added by this update.

Summary of changes:
 arch/arm/src/armv6-m/arm_sigdeliver.c | 14 --
 arch/arm/src/armv7-a/arm_sigdeliver.c | 14 --
 arch/arm/src/armv7-m/arm_sigdeliver.c | 14 --
 arch/arm/src/armv7-r/arm_sigdeliver.c | 14 --
 arch/arm/src/armv8-m/arm_sigdeliver.c | 14 --
 arch/arm64/src/common/arm64_sigdeliver.c  | 14 --
 arch/risc-v/src/common/riscv_sigdeliver.c | 14 --
 arch/sim/src/sim/sim_sigdeliver.c | 28 ---
 arch/sparc/src/sparc_v8/sparc_v8_sigdeliver.c | 14 --
 arch/xtensa/src/common/xtensa_sigdeliver.c| 14 --
 10 files changed, 125 insertions(+), 29 deletions(-)



[nuttx] branch master updated (91d34ffd09 -> d6747dd6ad)

2023-05-05 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 91d34ffd09 arch/sim: add up_getusrsp for sim
 add d6747dd6ad libc/armv8-m: fix build break if MVE is disabled

No new revisions were added by this update.

Summary of changes:
 libs/libc/machine/arm/armv8-m/gnu/arch_memcpy.S | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



[nuttx] branch master updated (bac304afc0 -> c288752bef)

2023-05-04 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from bac304afc0 boards: Fix CONFIG_[START_DATE,START_MONTH] cannot start 
with 0
 add c288752bef recvmsg: control msg support multi-attribute return

No new revisions were added by this update.

Summary of changes:
 net/can/can_recvmsg.c  | 25 +++---
 net/local/local_recvmsg.c  | 25 +++---
 net/socket/recvmsg.c   | 18 ++-
 net/udp/udp_recvfrom.c | 49 ++
 net/utils/Make.defs|  1 +
 .../grp/lib_getgrgid.c => net/utils/net_cmsg.c | 58 +-
 net/utils/utils.h  | 28 +++
 7 files changed, 113 insertions(+), 91 deletions(-)
 copy libs/libc/grp/lib_getgrgid.c => net/utils/net_cmsg.c (51%)



[nuttx] branch master updated (db84cd2e59 -> 5de49d2939)

2023-05-03 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from db84cd2e59 tools: add git pre-commit hook based on checkpatch.sh
 add df246461ec net/can: Remove the unnecessary "ret = OK;" in 
can_getsockopt
 add 5de49d2939 net: Remove the extra space

No new revisions were added by this update.

Summary of changes:
 net/arp/arp_input.c |  4 ++--
 net/arp/arp_send.c  | 14 +++---
 net/bluetooth/bluetooth_conn.c  |  2 +-
 net/bluetooth/bluetooth_container.c |  8 
 net/bluetooth/bluetooth_input.c |  2 +-
 net/bluetooth/bluetooth_recvmsg.c   | 20 ++--
 net/can/can_getsockopt.c| 20 +++-
 net/can/can_recvmsg.c   | 14 +++---
 net/can/can_sendmsg.c   | 14 +++---
 net/can/can_sockif.c| 12 ++--
 10 files changed, 52 insertions(+), 58 deletions(-)



[nuttx] branch master updated: tools: add git pre-commit hook based on checkpatch.sh

2023-05-03 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new db84cd2e59 tools: add git pre-commit hook based on checkpatch.sh
db84cd2e59 is described below

commit db84cd2e59f2704e609b39f1f0c92f3af3e27254
Author: liuhaitao 
AuthorDate: Tue Jan 7 16:00:22 2020 +0800

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 
---
 tools/pre-commit | 17 +
 1 file changed, 17 insertions(+)

diff --git a/tools/pre-commit b/tools/pre-commit
new file mode 100755
index 00..f9210fc7ce
--- /dev/null
+++ b/tools/pre-commit
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+# tools/pre-commit
+# git hook to run check-patch on the output and stop any commits
+# that do not pass. Note, only for git-commit, and not for any of the
+# other scenarios
+#
+# Copyright 2010 Ben Dooks, 
+
+if git rev-parse --verify HEAD 2>/dev/null >/dev/null
+then
+   against=HEAD
+else
+   # Initial commit: diff against an empty tree object
+   against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+fi
+
+git diff --cached $against -- | ../nuttx/tools/checkpatch.sh -r -



[nuttx] branch master updated (e2083354f1 -> 5a1efdecfd)

2023-05-02 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from e2083354f1 arch/arm/sama5: Use a recursive mutex to fix OHCI deadlock.
 add 34dbfa0370 boards/sim/configs: add defconfig for RTP Tools
 add 0f808a352a boards/esp32-lyrat/configs: add defconfig for RTP Tools
 add 5a1efdecfd documentation: add references to RTP Tools' defconfigs

No new revisions were added by this update.

Summary of changes:
 Documentation/guides/simulator.rst |  2 +
 .../platforms/sim/sim/boards/sim/index.rst | 34 ++
 .../xtensa/esp32/boards/esp32-lyrat/index.rst  | 74 ++
 .../sim/configs/{tcpblaster => rtptools}/defconfig |  1 +
 .../configs/{audio => rtptools}/defconfig  | 23 +--
 5 files changed, 127 insertions(+), 7 deletions(-)
 copy boards/sim/sim/sim/configs/{tcpblaster => rtptools}/defconfig (99%)
 copy boards/xtensa/esp32/esp32-lyrat/configs/{audio => rtptools}/defconfig 
(88%)



[nuttx] branch master updated (b4814811f5 -> 7a725019bc)

2023-05-02 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from b4814811f5 mtd/nand: Implement MTDIOC_ERASESECTORS ioctl
 add 7a725019bc mtd/nand: Add nand_raw_initialize to skip the probing

No new revisions were added by this update.

Summary of changes:
 drivers/mtd/mtd_nand.c   | 83 ++--
 include/nuttx/mtd/nand.h | 17 ++
 2 files changed, 69 insertions(+), 31 deletions(-)



[nuttx] branch master updated (3c54e66683 -> b4814811f5)

2023-05-02 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 3c54e66683 mtd/nand: Fix the comment and remove the uneeded inclusion
 add 3fc882df9e mtd/nand: Implement MTDIOC_ERASESTATE ioctl
 add b4814811f5 mtd/nand: Implement MTDIOC_ERASESECTORS ioctl

No new revisions were added by this update.

Summary of changes:
 drivers/mtd/mtd_nand.c | 15 +++
 1 file changed, 15 insertions(+)



[nuttx] branch master updated: drivers/spi/spi_bitbang: Fix build warnings

2023-04-26 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 93a1adf83e drivers/spi/spi_bitbang: Fix build warnings
93a1adf83e is described below

commit 93a1adf83e157b55f203b5a641419bb51af68a59
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Tue Aug 23 14:51:47 2022 +0900

drivers/spi/spi_bitbang: Fix build warnings

Fix build warnings of spi_bitbang.c
---
 drivers/spi/spi_bitbang.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
index 80bf1af74b..de5b1f8dc4 100644
--- a/drivers/spi/spi_bitbang.c
+++ b/drivers/spi/spi_bitbang.c
@@ -192,7 +192,7 @@ static void spi_select(FAR struct spi_dev_s *dev, uint32_t 
devid,
 {
   FAR struct spi_bitbang_s *priv = (FAR struct spi_bitbang_s *)dev;
 
-  spiinfo("devid=%d selected=%d\n", devid, selected);
+  spiinfo("devid=%" PRIu32 " selected=%d\n", devid, selected);
   DEBUGASSERT(priv && priv->low->select);
   priv->low->select(priv, devid, selected);
 }
@@ -220,7 +220,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
 
   DEBUGASSERT(priv && priv->low->setfrequency);
   actual = priv->low->setfrequency(priv, frequency);
-  spiinfo("frequency=%d holdtime=%d actual=%d\n",
+  spiinfo("frequency=%" PRIu32 " holdtime=%" PRIu32 " actual=%" PRIu32 "\n",
   frequency, priv->holdtime, actual);
   return actual;
 }



[nuttx] branch master updated: video/fb: fix pollnotify calling crash in advance

2023-04-26 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 0939634b42 video/fb: fix pollnotify calling crash in advance
0939634b42 is described below

commit 0939634b421e894d3b43e3202ad46c1512c287c4
Author: pengyiqiang 
AuthorDate: Wed Apr 26 13:22:49 2023 +0800

video/fb: fix pollnotify calling crash in advance

When executing up_fbinitialize, the driver may turn on the vsync interrupt. 
If the vsync interrupt calls fb_pollnotify before executing fb->vtable->priv = 
fb it will cause null pointer access and crash.

Signed-off-by: pengyiqiang 
---
 drivers/video/fb.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index d9300d3142..e805705ead 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -803,6 +803,13 @@ void fb_pollnotify(FAR struct fb_vtable_s *vtable)
 
   fb = vtable->priv;
 
+  /* Prevent calling before getting the vtable. */
+
+  if (fb == NULL)
+{
+  return;
+}
+
   if (fb->vsyncoffset > 0)
 {
   wd_start(>wdog, fb->vsyncoffset, fb_do_pollnotify, (wdparm_t)fb);



[nuttx] branch master updated: stm32_f7/h7_eth: Added error handling for abnormal interrupts.

2023-04-25 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 70e42f5bfe stm32_f7/h7_eth: Added error handling for abnormal 
interrupts.
70e42f5bfe is described below

commit 70e42f5bfed8d5dd99afc495a72365870693d9e0
Author: Fotis Panagiotopoulos 
AuthorDate: Tue Apr 25 01:00:19 2023 +0300

stm32_f7/h7_eth: Added error handling for abnormal interrupts.
---
 arch/arm/src/stm32f7/stm32_ethernet.c | 22 +-
 arch/arm/src/stm32h7/stm32_ethernet.c | 22 +-
 2 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c 
b/arch/arm/src/stm32f7/stm32_ethernet.c
index 45983fd201..5116423e6d 100644
--- a/arch/arm/src/stm32f7/stm32_ethernet.c
+++ b/arch/arm/src/stm32f7/stm32_ethernet.c
@@ -2117,16 +2117,13 @@ static void stm32_interrupt_work(void *arg)
   stm32_putreg(ETH_DMAINT_NIS, STM32_ETH_DMASR);
 }
 
-  /* Handle error interrupt only if CONFIG_DEBUG_NET is eanbled */
-
-#ifdef CONFIG_DEBUG_NET
   /* Check if there are pending "abnormal" interrupts */
 
   if ((dmasr & ETH_DMAINT_AIS) != 0)
 {
   /* Just let the user know what happened */
 
-  nerr("ERROR: Abormal event(s): %08x\n", dmasr);
+  nerr("ERROR: Abnormal event(s): %08" PRIx32 "\n", dmasr);
 
   /* Clear all pending abnormal events */
 
@@ -2135,8 +2132,23 @@ static void stm32_interrupt_work(void *arg)
   /* Clear the pending abnormal summary interrupt */
 
   stm32_putreg(ETH_DMAINT_AIS, STM32_ETH_DMASR);
+
+  /* As per the datasheet's recommendation, the MAC
+   * needs to be reset for all abnormal events. The
+   * scheduled job will take the interface down and
+   * up again.
+   */
+
+  work_queue(ETHWORK, >irqwork, stm32_txtimeout_work, priv, 0);
+
+  /* Interrupts need to remain disabled, no other
+   * processing will take place. After reset
+   * everything will be restored.
+   */
+
+  net_unlock();
+  return;
 }
-#endif
 
   net_unlock();
 
diff --git a/arch/arm/src/stm32h7/stm32_ethernet.c 
b/arch/arm/src/stm32h7/stm32_ethernet.c
index 567d4b0cb1..4017a7410f 100644
--- a/arch/arm/src/stm32h7/stm32_ethernet.c
+++ b/arch/arm/src/stm32h7/stm32_ethernet.c
@@ -2230,16 +2230,13 @@ static void stm32_interrupt_work(void *arg)
   stm32_putreg(ETH_DMACSR_NIS, STM32_ETH_DMACSR);
 }
 
-  /* Handle error interrupt only if CONFIG_DEBUG_NET is eanbled */
-
-#ifdef CONFIG_DEBUG_NET
   /* Check if there are pending "abnormal" interrupts */
 
   if ((dmasr & ETH_DMACSR_AIS) != 0)
 {
   /* Just let the user know what happened */
 
-  nerr("ERROR: Abormal event(s): %08x\n", dmasr);
+  nerr("ERROR: Abnormal event(s): %08" PRIx32 "\n", dmasr);
 
   /* Clear all pending abnormal events */
 
@@ -2248,8 +2245,23 @@ static void stm32_interrupt_work(void *arg)
   /* Clear the pending abnormal summary interrupt */
 
   stm32_putreg(ETH_DMACSR_AIS, STM32_ETH_DMACSR);
+
+  /* As per the datasheet's recommendation, the MAC
+   * needs to be reset for all abnormal events. The
+   * scheduled job will take the interface down and
+   * up again.
+   */
+
+  work_queue(ETHWORK, >irqwork, stm32_txtimeout_work, priv, 0);
+
+  /* Interrupts need to remain disabled, no other
+   * processing will take place. After reset
+   * everything will be restored.
+   */
+
+  net_unlock();
+  return;
 }
-#endif
 
   net_unlock();
 



[nuttx] branch master updated (20623d7369 -> d48114a4b7)

2023-04-25 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 20623d7369 sem/sem_init: Change sem_xxx -> nxsem_xxx in kernel modules
 add d48114a4b7 sched/addrenv.c: Implement re-entrancy for addrenv_select()

No new revisions were added by this update.

Summary of changes:
 arch/arm/src/common/arm_checkstack.c  |  6 --
 arch/risc-v/src/common/riscv_checkstack.c |  6 --
 binfmt/binfmt_execmodule.c|  6 +++---
 binfmt/libelf/libelf_addrenv.c|  4 ++--
 include/nuttx/addrenv.h   | 12 +++-
 include/nuttx/binfmt/binfmt.h |  1 +
 include/nuttx/binfmt/elf.h|  1 +
 sched/addrenv/addrenv.c   | 15 +--
 sched/group/group_argvstr.c   |  7 +--
 sched/sched/sched_get_stateinfo.c | 16 
 sched/semaphore/sem_waitirq.c |  6 --
 11 files changed, 56 insertions(+), 24 deletions(-)



[nuttx] branch master updated: sem/sem_init: Change sem_xxx -> nxsem_xxx in kernel modules

2023-04-25 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 20623d7369 sem/sem_init: Change sem_xxx -> nxsem_xxx in kernel modules
20623d7369 is described below

commit 20623d73698638472b84b36ebb4eec52982cdeff
Author: Ville Juven 
AuthorDate: Fri Apr 21 13:49:51 2023 +0300

sem/sem_init: Change sem_xxx -> nxsem_xxx in kernel modules

Use the kernel space api nxsem_xxx when inside the kernel.
---
 arch/arm/src/rtl8720c/amebaz_depend.c | 5 +++--
 arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c | 5 +++--
 arch/xtensa/src/esp32/esp32_ble_adapter.c | 4 ++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm/src/rtl8720c/amebaz_depend.c 
b/arch/arm/src/rtl8720c/amebaz_depend.c
index 35c902aff8..a29a4cfa3d 100644
--- a/arch/arm/src/rtl8720c/amebaz_depend.c
+++ b/arch/arm/src/rtl8720c/amebaz_depend.c
@@ -24,6 +24,7 @@
 
 #include "amebaz_depend.h"
 #include 
+#include 
 #include 
 
 /
@@ -168,7 +169,7 @@ void rtw_init_sema(void **sema, int init_val)
   return;
 }
 
-  if (sem_init(_sema, 0, init_val))
+  if (nxsem_init(_sema, 0, init_val))
 {
   free(_sema);
   return;
@@ -179,7 +180,7 @@ void rtw_init_sema(void **sema, int init_val)
 
 void rtw_free_sema(void **sema)
 {
-  sem_destroy(*sema);
+  nxsem_destroy(*sema);
   free(*sema);
   *sema = NULL;
 }
diff --git a/arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c 
b/arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c
index a404f25e7c..dce292f5d6 100644
--- a/arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c
+++ b/arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -780,7 +781,7 @@ static void *semphr_create_wrapper(uint32_t max, uint32_t 
init)
   bt_sem = kmm_malloc(tmp);
   DEBUGASSERT(bt_sem);
 
-  ret = sem_init(_sem->sem, 0, init);
+  ret = nxsem_init(_sem->sem, 0, init);
   DEBUGASSERT(ret == OK);
 
 #ifdef CONFIG_ESP32C3_SPIFLASH
@@ -807,7 +808,7 @@ static void *semphr_create_wrapper(uint32_t max, uint32_t 
init)
 static void semphr_delete_wrapper(void *semphr)
 {
   struct bt_sem_s *bt_sem = (struct bt_sem_s *)semphr;
-  sem_destroy(_sem->sem);
+  nxsem_destroy(_sem->sem);
   kmm_free(bt_sem);
 }
 
diff --git a/arch/xtensa/src/esp32/esp32_ble_adapter.c 
b/arch/xtensa/src/esp32/esp32_ble_adapter.c
index 902cf7bfe5..dc33fea4d8 100644
--- a/arch/xtensa/src/esp32/esp32_ble_adapter.c
+++ b/arch/xtensa/src/esp32/esp32_ble_adapter.c
@@ -1143,7 +1143,7 @@ static void *semphr_create_wrapper(uint32_t max, uint32_t 
init)
   return NULL;
 }
 
-  ret = sem_init(sem, 0, init);
+  ret = nxsem_init(sem, 0, init);
   if (ret)
 {
   wlerr("ERROR: Failed to initialize sem error=%d\n", ret);
@@ -1171,7 +1171,7 @@ static void *semphr_create_wrapper(uint32_t max, uint32_t 
init)
 static void semphr_delete_wrapper(void *semphr)
 {
   sem_t *sem = (sem_t *)semphr;
-  sem_destroy(sem);
+  nxsem_destroy(sem);
   kmm_free(sem);
 }
 



[nuttx] branch master updated (308b93b168 -> dd631265c4)

2023-04-24 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 308b93b168 doc: add critmon comand docment
 add 51dc67ad5f fs: Add g_ prefix for all global file_operations instances
 add dd631265c4 fs: Add g_ prefix for all global mountpt_operations 
instances

No new revisions were added by this update.

Summary of changes:
 arch/arm/src/cxd56xx/cxd56_sph.c   |  4 +-
 arch/arm/src/stm32/stm32_bbsram.c  |  5 +-
 arch/arm/src/stm32/stm32_hrtim.c   |  4 +-
 arch/arm/src/stm32f7/stm32_bbsram.c|  5 +-
 arch/arm/src/stm32h7/stm32_bbsram.c|  5 +-
 arch/renesas/src/rx65n/rx65n_sbram.c   |  4 +-
 arch/xtensa/src/esp32/esp32_himem_chardev.c|  4 +-
 boards/arm/kl/freedom-kl25z/src/kl_tsi.c   |  4 +-
 boards/arm/kl/freedom-kl26z/src/kl_tsi.c   |  4 +-
 .../s32k1xx/rddrone-bms772/src/s32k1xx_smbus_sbd.c |  4 +-
 .../stm32/mikroe-stm32f4/src/stm32_touchscreen.c   |  4 +-
 .../pic32mx/pic32mx7mmb/src/pic32_touchscreen.c|  4 +-
 drivers/analog/comp.c  |  4 +-
 drivers/analog/dac.c   |  4 +-
 drivers/analog/opamp.c |  4 +-
 drivers/bch/bch.h  |  2 +-
 drivers/bch/bchdev_driver.c|  2 +-
 drivers/bch/bchdev_register.c  |  2 +-
 drivers/eeprom/i2c_xx24xx.c|  8 +--
 drivers/eeprom/spi_xx25xx.c|  4 +-
 drivers/i2c/i2c_driver.c   |  4 +-
 drivers/i2s/i2schar.c  |  4 +-
 drivers/input/ads7843e.c   |  4 +-
 drivers/input/ajoystick.c  |  4 +-
 drivers/input/button_upper.c   |  4 +-
 drivers/input/djoystick.c  |  4 +-
 drivers/input/ft5x06.c |  4 +-
 drivers/input/max11802.c   |  4 +-
 drivers/input/mxt.c|  4 +-
 drivers/input/nunchuck.c   |  4 +-
 drivers/input/tsc2007.c|  4 +-
 drivers/ipcc/ipcc_register.c   |  4 +-
 drivers/lcd/lcd_dev.c  |  4 +-
 drivers/lcd/tda19988.c |  4 +-
 drivers/leds/userled_upper.c   |  4 +-
 drivers/misc/dev_null.c|  4 +-
 drivers/misc/dev_zero.c|  4 +-
 drivers/modem/u-blox.c |  4 +-
 drivers/motor/motor.c  |  4 +-
 drivers/mtd/mtd_config.c   |  4 +-
 drivers/note/notectl_driver.c  |  4 +-
 drivers/power/supply/powerled.c|  4 +-
 drivers/power/supply/smps.c|  4 +-
 drivers/spi/spi_driver.c   |  4 +-
 drivers/syslog/syslog_chardev.c|  4 +-
 drivers/timers/rtc.c   |  4 +-
 drivers/usbhost/usbhost_cdcmbim.c  |  4 +-
 drivers/video/fb.c |  4 +-
 drivers/video/mipidsi/mipi_dsi_device_driver.c |  4 +-
 drivers/video/mipidsi/mipi_dsi_host_driver.c   |  4 +-
 drivers/wireless/lpwan/sx127x/sx127x.c |  4 +-
 drivers/wireless/nrf24l01.c|  4 +-
 fs/binfs/fs_binfs.c|  3 +-
 fs/cromfs/fs_cromfs.c  |  2 +-
 fs/fat/fs_fat32.c  |  2 +-
 fs/hostfs/hostfs.c |  2 +-
 fs/littlefs/lfs_vfs.c  |  2 +-
 fs/mount/fs_automount.c|  4 +-
 fs/mount/fs_mount.c| 68 ++---
 fs/nfs/nfs_vfsops.c|  2 +-
 fs/nxffs/nxffs_initialize.c|  2 +-
 fs/procfs/fs_procfs.c  |  2 +-
 fs/romfs/fs_romfs.c|  2 +-
 fs/rpmsgfs/rpmsgfs.c   |  2 +-
 fs/shm/shm_open.c  |  2 +-
 fs/shm/shmfs.c |  2 +-
 fs/shm/shmfs.h |  2 +-
 fs/smartfs/smartfs_smart.c |  2 +-
 fs/spiffs/src/spiffs_vfs.c |  2 +-
 fs/tmpfs/fs_tmpfs.c|  2 +-
 fs/tmpfs/fs_tmpfs.h|  2 +-
 fs/unionfs/fs_unionfs.c|  4 +-
 fs/userfs/fs_userfs.c  |  2 +-
 include/nuttx/fs/binfs.h   | 70 --
 wireless/ieee802154/mac802154_device.c |  4 +-
 75

[nuttx-apps] branch master updated (fe1d701b7 -> 5b2a89e17)

2023-04-24 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


from fe1d701b7 system/adb: Replace adb special reset cause with 
boardctl.h's value
 new f0f98c3d7 ostest:  fix smp ostest fail
 new 5b2a89e17 ostest:  fix smp ostest fail

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 testing/ostest/cancel.c | 30 +++---
 testing/ostest/cond.c   | 13 -
 testing/ostest/pthread_rwlock.c |  9 +
 testing/ostest/robust.c |  8 
 testing/ostest/sem.c|  9 +
 testing/ostest/wqueue.c |  7 ++-
 6 files changed, 71 insertions(+), 5 deletions(-)



[nuttx-apps] 02/02: ostest: fix smp ostest fail

2023-04-24 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 5b2a89e174a4af15c1cfa97dd883d0ff5e8794b1
Author: hujun5 
AuthorDate: Tue Apr 18 10:28:16 2023 +0800

ostest:  fix smp ostest fail

In SMP we need improve thread waiting strategy

Signed-off-by: hujun5 
---
 testing/ostest/robust.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/testing/ostest/robust.c b/testing/ostest/robust.c
index f2ed48569..9217a279f 100644
--- a/testing/ostest/robust.c
+++ b/testing/ostest/robust.c
@@ -202,6 +202,14 @@ void robust_test(void)
   nerrors++;
 }
 
+  /* Make sure waiter exit completely */
+
+  do
+{
+  sleep(1);
+}
+  while (kill(g_robust_mutex.pid, 0) == 0 || errno != ESRCH);
+
   /* Make the mutex consistent and try again.  It should succeed this time. */
 
   printf("robust_test: Make the mutex consistent again.\n");



[nuttx-apps] 01/02: ostest: fix smp ostest fail

2023-04-24 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit f0f98c3d73f0f4deb707fc47d9d7a244d3247c6e
Author: hujun5 
AuthorDate: Sun Apr 16 20:54:07 2023 +0800

ostest:  fix smp ostest fail

In SMP we need improve thread waiting strategy

Signed-off-by: hujun5 
---
 testing/ostest/cancel.c | 30 +++---
 testing/ostest/cond.c   | 13 -
 testing/ostest/pthread_rwlock.c |  9 +
 testing/ostest/sem.c|  9 +
 testing/ostest/wqueue.c |  7 ++-
 5 files changed, 63 insertions(+), 5 deletions(-)

diff --git a/testing/ostest/cancel.c b/testing/ostest/cancel.c
index 1db31c073..8f85d0e2d 100644
--- a/testing/ostest/cancel.c
+++ b/testing/ostest/cancel.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "ostest.h"
 
@@ -42,6 +43,7 @@
 
 static pthread_mutex_t mutex;
 static pthread_cond_t  cond;
+static sem_t sem_thread_started;
 
 /
  * Private Functions
@@ -80,6 +82,7 @@ static FAR void *sem_waiter(FAR void *parameter)
ASSERT(false);
 }
 
+  sem_post(_thread_started);
   printf("sem_waiter: Starting wait for condition\n");
 
   /* Are we a non-cancelable thread?   Yes, set the non-cancelable state */
@@ -428,6 +431,8 @@ void cancel_test(void)
   void *result;
   int status;
 
+  sem_init(_thread_started, 0, 0);
+
   /* Test 1: Normal Cancel **/
 
   /* Start the waiter thread  */
@@ -440,7 +445,13 @@ void cancel_test(void)
* make sure.
*/
 
-  usleep(75 * 1000);
+  sem_wait(_thread_started);
+
+  /* Make sure sem_waiter run into pthread_cond_wait */
+
+  pthread_mutex_lock();
+
+  pthread_mutex_unlock();
 
   printf("cancel_test: Canceling thread\n");
   status = pthread_cancel(waiter);
@@ -561,7 +572,13 @@ void cancel_test(void)
* bit to be certain.
*/
 
-  usleep(100 * 1000);
+  sem_wait(_thread_started);
+
+  /* Make sure sem_waiter run into pthread_cond_wait */
+
+  pthread_mutex_lock();
+
+  pthread_mutex_unlock();
 
   printf("cancel_test: Canceling thread\n");
   status = pthread_cancel(waiter);
@@ -625,7 +642,13 @@ void cancel_test(void)
* The cancellation should succeed, because the cancellation is pending.
*/
 
-  usleep(100 * 1000);
+  sem_wait(_thread_started);
+
+  /* Make sure sem_waiter run into pthread_cond_wait */
+
+  pthread_mutex_lock();
+
+  pthread_mutex_unlock();
 
   printf("cancel_test: Canceling thread\n");
   status = pthread_cancel(waiter);
@@ -693,6 +716,7 @@ void cancel_test(void)
 
   printf("cancel_test: Test 6: Cancel message queue wait\n");
   printf("cancel_test: Starting thread (cancelable)\n");
+  sem_destroy(_thread_started);
 
 #if !defined(CONFIG_DISABLE_MQUEUE) && defined(CONFIG_CANCELLATION_POINTS)
   /* Create the message queue */
diff --git a/testing/ostest/cond.c b/testing/ostest/cond.c
index a80a77c28..e6a805ce8 100644
--- a/testing/ostest/cond.c
+++ b/testing/ostest/cond.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "ostest.h"
 
@@ -59,6 +60,7 @@ static int signaler_nloops = 0;
 static int signaler_already = 0;
 static int signaler_state = 0;
 static int signaler_nerrors = 0;
+static sem_t sem_thread_started;
 
 /
  * Private Functions
@@ -78,6 +80,7 @@ static void *thread_waiter(void *parameter)
   status   = pthread_mutex_lock();
   waiter_state = RUNNING;
 
+  sem_post(_thread_started);
   if (status != 0)
 {
   printf("waiter_thread: "
@@ -219,7 +222,10 @@ static void *thread_signaler(void *parameter)
* To avoid this situaltion, we add the following usleep()
*/
 
-  usleep(10 * 1000);
+  while (data_available == 1)
+{
+  usleep(10 * 1000);
+}
 #endif
 
   signaler_nloops++;
@@ -248,6 +254,8 @@ void cond_test(void)
   int prio_mid;
   int status;
 
+  sem_init(_thread_started, 0, 0);
+
   /* Initialize the mutex */
 
   printf("cond_test: Initializing mutex\n");
@@ -302,6 +310,8 @@ void cond_test(void)
   printf("cond_test: pthread_create failed, status=%d\n", status);
 }
 
+  sem_wait(_thread_started);
+
   printf("cond_test: Starting signaler\n");
   status = pthread_attr_init();
   if (status != 0)
@@ -338,6 +348,7 @@ void cond_test(void)
   printf("cond_test: signaler terminated, now cancel the waiter\n");
   pthread_detach(waiter);
   pthread_cancel(waiter);
+  sem_destroy(_thread_started);
 
   printf("cond_test: \tWaiter\tSignaler\n");
   printf("cond_test: Loops\t%d\t%d\n", waiter_n

[nuttx] branch master updated: nuttx/boards /arm/cxd56xx/drivers/sensors/Kconfig: Fix bmp280 texts in Kconfig

2023-04-21 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 6ca0f90d43 nuttx/boards /arm/cxd56xx/drivers/sensors/Kconfig: Fix 
bmp280 texts in Kconfig
6ca0f90d43 is described below

commit 6ca0f90d43931fffb319ad57d82ba3667adb8fd7
Author: simbit18 <101105604+simbi...@users.noreply.github.com>
AuthorDate: Thu Apr 20 18:43:08 2023 +0200

nuttx/boards /arm/cxd56xx/drivers/sensors/Kconfig: Fix bmp280 texts in 
Kconfig

Fix SENSORS_BMP280_SCU texts in Kconfig
---
 boards/arm/cxd56xx/drivers/sensors/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boards/arm/cxd56xx/drivers/sensors/Kconfig 
b/boards/arm/cxd56xx/drivers/sensors/Kconfig
index 26aa52e46c..17909755cf 100644
--- a/boards/arm/cxd56xx/drivers/sensors/Kconfig
+++ b/boards/arm/cxd56xx/drivers/sensors/Kconfig
@@ -128,11 +128,11 @@ config SENSORS_BMI160_SCU_DECI_ACCEL
 endif # SENSORS_BMI160_SCU
 
 config SENSORS_BMP280_SCU
-   bool "Bosch BMP280 Barometic Pressure Sensor"
+   bool "Bosch BMP280 Barometric Pressure Sensor"
default n
depends on !SENSORS_BMP280 && (CXD56_I2C0_SCUSEQ || CXD56_I2C1_SCUSEQ)
---help---
-   Enable driver for the Bosch BMP280 barometic pressure sensor.
+   Enable driver for the Bosch BMP280 barometric pressure sensor.
 
 if SENSORS_BMP280_SCU
 



[nuttx] branch master updated (bbc8562f65 -> 0747ee1ea2)

2023-04-19 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from bbc8562f65 board nucleo-h743zi:Rework board.h not use 
CONFIG_STM32_USE_LEGACY_PINMAP
 add 97a6fd4d18 cxd56_power: Add lowerhalf interface to keep power when 
cold sleep
 add 0747ee1ea2 cxd56_power: Fixup code style

No new revisions were added by this update.

Summary of changes:
 boards/arm/cxd56xx/spresense/include/cxd56_power.h | 20 +
 boards/arm/cxd56xx/spresense/src/cxd56_power.c | 86 ++
 2 files changed, 93 insertions(+), 13 deletions(-)



[nuttx-apps] branch master updated (6b35ff323 -> 4159fa197)

2023-04-17 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


from 6b35ff323 github/linters/setup.cfg: ignore E203 for flake8 to fix 
compatibility issues with black
 new 2655f80dd testing/ostest: fix tasks priority assignment in nested 
signal test
 new 4159fa197 testing/ostest: make sure that pthread_rwlock timeout test 
is executed properly

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 testing/ostest/pthread_rwlock.c |  2 ++
 testing/ostest/signest.c| 10 +-
 2 files changed, 7 insertions(+), 5 deletions(-)



[nuttx-apps] 02/02: testing/ostest: make sure that pthread_rwlock timeout test is executed properly

2023-04-17 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 4159fa197bc69759ea092c1ba908fc440aac82d1
Author: Petro Karashchenko 
AuthorDate: Fri Apr 14 22:14:02 2023 +0300

testing/ostest: make sure that pthread_rwlock timeout test is executed 
properly

Signed-off-by: Petro Karashchenko 
---
 testing/ostest/pthread_rwlock.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testing/ostest/pthread_rwlock.c b/testing/ostest/pthread_rwlock.c
index 3b2b492cc..3c1bc7c3e 100644
--- a/testing/ostest/pthread_rwlock.c
+++ b/testing/ostest/pthread_rwlock.c
@@ -327,6 +327,8 @@ static FAR void *timeout_thread2(FAR void *data)
   struct timespec time;
   int status;
 
+  pthread_yield();
+
   status = clock_gettime(CLOCK_REALTIME, );
   time.tv_sec += 2;
 



[nuttx-apps] 01/02: testing/ostest: fix tasks priority assignment in nested signal test

2023-04-17 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 2655f80dd7093e61cbc1f7076a6e6b65cbfca826
Author: Petro Karashchenko 
AuthorDate: Fri Apr 14 22:13:05 2023 +0300

testing/ostest: fix tasks priority assignment in nested signal test

Signed-off-by: Petro Karashchenko 
---
 testing/ostest/signest.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c
index 8b4080f7c..fd7ecc080 100644
--- a/testing/ostest/signest.c
+++ b/testing/ostest/signest.c
@@ -232,7 +232,7 @@ void signest_test(void)
 
   g_nest_level = 0;
 
-  ret = sched_getparam (0, );
+  ret = sched_getparam(0, );
   if (ret < 0)
 {
   printf("signest_test: ERROR sched_getparam() failed\n");
@@ -244,8 +244,8 @@ void signest_test(void)
 
   prio = param.sched_priority + 1;
   printf("signest_test: Starting signal waiter task at priority %d\n", prio);
-  waiterpid = task_create("waiter", param.sched_priority,
-   STACKSIZE, waiter_main, NULL);
+  waiterpid = task_create("waiter", prio, STACKSIZE,
+  waiter_main, NULL);
   if (waiterpid == ERROR)
 {
   printf("signest_test: ERROR failed to start waiter_main\n");
@@ -259,8 +259,8 @@ void signest_test(void)
 
   prio++;
   printf("signest_test: Starting interfering task at priority %d\n", prio);
-  interferepid = task_create("interfere", param.sched_priority,
-   STACKSIZE, interfere_main, NULL);
+  interferepid = task_create("interfere", prio, STACKSIZE,
+ interfere_main, NULL);
   if (interferepid == ERROR)
 {
   printf("signest_test: ERROR failed to start interfere_main\n");



[nuttx] branch master updated (642358e68f -> 20424a8a59)

2023-04-17 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 642358e68f stm32h7/rcc: make VOS0 configurable from board.h also for 
stm32h7x7xx
 add 79c6efae64 include/audio.h: Add underrun event id
 add 20424a8a59 drivers/audio/cxd56.c: Fix freeze audio and add underrun 
notify

No new revisions were added by this update.

Summary of changes:
 drivers/audio/cxd56.c   | 30 +-
 include/nuttx/audio/audio.h |  1 +
 2 files changed, 26 insertions(+), 5 deletions(-)



[nuttx] annotated tag nuttx-12.1.0 updated (d40f4032fc -> f3e234655c)

2023-04-17 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to annotated tag nuttx-12.1.0
in repository https://gitbox.apache.org/repos/asf/nuttx.git


*** WARNING: tag nuttx-12.1.0 was modified! ***

from d40f4032fc (commit)
  to f3e234655c (tag)
 tagging d40f4032fc5491d2aeb9fde37042a5be9eabeb15 (commit)
 replaces nuttx-8.2
  by Alin Jerpelea
  on Mon Apr 17 08:32:26 2023 +0200

- Log -
nuttx-12.1.0
-BEGIN PGP SIGNATURE-

iQIzBAABCgAdFiEEkgjS5LgA1m90mtTpQTenFpjF5NsFAmQ85/oACgkQQTenFpjF
5Nty1RAAuBoUUJkhdbDEtQaDll+J4VwIkkwjrBubuNdURGnKXzdTCGUtLYopsAX3
KFrUeOdlVMi8+1nEHFpbCh1LutR71N0xDCrb2VWKmiTTPBkfRkBxUU4IkXIjS1jo
JeRaSYAeMgDA+qTdweDHYdwXHur+WhNvJh2KXwvKlGPN34fjqjuJgW+LhOdXINLK
KoSv/hs76KgAIQoodQc3I3mfO+lSGE50F/Trqo3RPEP9091F+S0EZGcf/zVRUsAR
qURtWsP6unfAKkVdAlL/2E7HmYcQyDJcbbDeH+vei2CgkeT7H1UoUSDjQnae/gGc
YA7rRGcVyCIrps56qZRj63Y3XGaEXjnX+2/DHdZHoAdsDujeP8azxRN01bERsk73
S3xIC1kch7BwoxbckscyPZ8qi89gaHpmPs1Z2zxMpeE4uxYqjvza9VufcqrjnJyd
dMaHAB/qZTTdoaxH7zxvjS+Gj246+k9Yh0UpxB4QZfNJ82nLeSuVmfgGvRjYmUhY
KkMrVtRnqVjN0RIKGtz9zENBXXgWUhb8gEdCAeG5vsi2tnxoM9o97mCTQkbXpYD1
xVvGP2rxVmk4PyMkGSfiiyCD3jTfmyKd3iM7dU/arQogew6t7cOoutHOwkuDtj9A
YtKTvdrGUfsQ+Ii4OAk6YTYE1lcDXMHD73w77fDdDJwI7681G9o=
=cj5y
-END PGP SIGNATURE-
---


No new revisions were added by this update.

Summary of changes:



[nuttx-apps] annotated tag nuttx-12.1.0 updated (125cf7abe -> 7df0ee3df)

2023-04-17 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to annotated tag nuttx-12.1.0
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


*** WARNING: tag nuttx-12.1.0 was modified! ***

from 125cf7abe (commit)
  to 7df0ee3df (tag)
 tagging 125cf7abe2d7f345c3bc58c0bdea2360fdefa170 (commit)
 replaces nuttx-12.0.0
  by Alin Jerpelea
  on Mon Apr 17 08:32:45 2023 +0200

- Log -
nuttx-12.1.0
-BEGIN PGP SIGNATURE-

iQIzBAABCgAdFiEEkgjS5LgA1m90mtTpQTenFpjF5NsFAmQ86A0ACgkQQTenFpjF
5NtJ5hAAxhX6tETMAN+mspKH3Oc79B/KQiEC90z/spdDntmoSInRghDofdNcE+k/
aFh/DjFGkvupEAOsjogjseNtnq/64Crgy0oK8xz2ivXMxorBJGJLtpKD23l2hO2b
TsnZOsTxkznFqK16Y+zv4usP2B3WDdrXEo63ZbRmUsN1g4eqR44/7tQzn5ETVjkt
/6sYB91I6GAYtH3/q30uKTaM9wjaOOjUXmNHwN2vGVhFtWtm7063T1FkthNmgq65
42Z2vzRJrfIjsq4o3tNELK7URsxvp0iY76kIzNkvoUaG1lZxduO0pao4ui7TPRFo
AgScEWmAB4RQ2yHKxm7fxITyR6ezLPpPIqUryAzc3RZ8GpnFA8tBftij3MS/8ZK4
iyqfTvcgtGhvaQetHDEzCQbo8eFncxrO9dv9iU/sQogSF1LzWp6+DAWKB6SmqnyX
fQkXEpMUGYxqIPSlzIkie1LZmRtST7pwk2wtqXPVi51LM4PZrh3dFi6Q87SEWz9c
MXWJsg6/c2LQominhAxJtvtxGOFdLFifvsZ74VoyySYOoaq57A+EdGfE6GZ97Q6K
h1BZIxIUbtfrCpbalj+/u6YyVGayisRtsdWzIQBsWSTb4SLTD8/h/KofRJ+JUtFG
vE31Hc8yxujGA23y9djHIlLsmUj2Hiv4jLUOm8+X3Ev7KYOB16w=
=GRAV
-END PGP SIGNATURE-
---


No new revisions were added by this update.

Summary of changes:



svn commit: r61313 - in /release/nuttx/12.1.0: ./ apache-nuttx-12.1.0.tar.gz apache-nuttx-12.1.0.tar.gz.asc apache-nuttx-12.1.0.tar.gz.sha512 apache-nuttx-apps-12.1.0.tar.gz apache-nuttx-apps-12.1.0.t

2023-04-17 Thread jerpelea
Author: jerpelea
Date: Mon Apr 17 06:17:19 2023
New Revision: 61313

Log:
Add apache-nuttx-12.1.0 release

Added:
release/nuttx/12.1.0/
release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz   (with props)
release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz.asc
release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz.sha512
release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz   (with props)
release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz.asc
release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz.sha512

Added: release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz
==
Binary file - no diff available.

Propchange: release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz
--
svn:mime-type = application/octet-stream

Added: release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz.asc
==
--- release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz.asc (added)
+++ release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz.asc Mon Apr 17 06:17:19 2023
@@ -0,0 +1,16 @@
+-BEGIN PGP SIGNATURE-
+
+iQIzBAABCgAdFiEEkgjS5LgA1m90mtTpQTenFpjF5NsFAmQ1G7oACgkQQTenFpjF
+5NujAxAAnupKOripAfEPu+brdsxZoqMw90RtsUMi0RVPSxYff7gyEjKGyIByUMOF
+Wy1Qilqr39rfsvbNJTg8wC3W8GeQCPoGdJ2LGt94Wqw0fBa/wwsa2T40yFo6ShfF
+FF5Hva0geV6B4LStWdYh3LDr4NxE/62t077ha1F/3aH7A7IzRWFf9arUlwooJIrI
+vwis7JXQU7kGx037zOc9IIB1KITXBSlfjuL1Z51HlDdyo7tVaGSbcpu4XgM5xuGw
+pdXKmtBo8z4YEtcySNsUA8YuJEleVBmQy9Zmo6JRpBu0p0lQXfMIF+A/eIZTPzgD
++dMiM082OB6UM5CBUmQmi4gDX3765EGhhGs+YW7sY6OTzHgHJ5YNZFDllzxXSx3p
+s6SFNjgCTfVbuCOwZe4D+b9cwKcwxWwmZRtJ/itaabzNcvPPp8aTripklYcoAP1Z
+Jxw8CTEk4aEeSVviDauQ30NsDFMMx5aQ8XydnY04Is+fU+1QeDQkd6gYduFff3zX
+g6WjJmfh2G3qAXfu2ylbkFPbZRMQKfIo1qwA6OusEQScHUeLBAaOjML4ktX0l7gT
+rw/VOK67YcD1s+G3PxnK9q4Q21rM1/RWNIfpCErtlewI7drJycTQlTJKRRVSXCFN
+TGCLLqTv3XmE3ifgvr8xsqxqFtjrIBDUvWAlAxsimgQxhOP3x/o=
+=IeAM
+-END PGP SIGNATURE-

Added: release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz.sha512
==
--- release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz.sha512 (added)
+++ release/nuttx/12.1.0/apache-nuttx-12.1.0.tar.gz.sha512 Mon Apr 17 06:17:19 
2023
@@ -0,0 +1 @@
+186fc7dff2a8767474cd9c0c78a3b388ee21cff3b67db7fa80ba9d7f44e48db10a645f4a013ad287108241ada96c2a20e13d474e9c446dcf88d87788b6b00b8a
  apache-nuttx-12.1.0.tar.gz

Added: release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz
==
Binary file - no diff available.

Propchange: release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz
--
svn:mime-type = application/octet-stream

Added: release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz.asc
==
--- release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz.asc (added)
+++ release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz.asc Mon Apr 17 
06:17:19 2023
@@ -0,0 +1,16 @@
+-BEGIN PGP SIGNATURE-
+
+iQIzBAABCgAdFiEEkgjS5LgA1m90mtTpQTenFpjF5NsFAmQ1G7oACgkQQTenFpjF
+5NtKdA//faggd4r1CmdsJsztHPnk1mvDxNYoAtsuuJghuKtX30zvrjQjNBqqaRUG
+M2Z7nGBxEqwIECZQck7O6+FxdsoZ72vf1ITWyW7o40bzGjZq7/Iwa4E+lU/BO86q
+JmOua7uSL2gI7CFGSbex1hJtGG0A+tNTL3AYhdKnE9KppqKqMd1zSkaY1WR5nwqZ
+Q9f5h5wZWjkvOoiOGMHssdQnBic+rqqzAlDCYbbubgl7OiE8Y0zKAVquABFgLgZF
+uVIcLUm5ZOg9ZV5LNApIp+hOCWKtX204xNHZe2oCb0ZkzoCKxq60lIdFeCV0Rn4a
+5t7zoVWHf7jaGZBYObNJ0liOoi+knuvbgxP30AEIxEj0DiOrasSjfyQ/EIQ0DPxj
+gMwh22aL1utr+5ie3IxZXJTL1hZnpYePojfgc6iwln4Neu99UGvjAp+BD8GPzGlV
+DMbpdv9WME6g789SPzN3U25SEQd1+u1U6inVZiu0ZhNPAyY9s4Lhi0Q3FJ294b/g
+N72tIcpHs/t2oNN9TFkaLUjkXd/+Tbo6yxDV6Cq9csEufOIwKFTJBzLVXIiRTJiQ
+Nf1s/JlKf0Rw+LALCC9mfjL/PUPwvH2C7z6S3Bdedq1ql3JWWSF9LqIWdkDt6bSp
+xejVk6JzehCIDHJDkv76u6hrYbu1Zj/hThvyluy9zFb+uR7PJHk=
+=7Psb
+-END PGP SIGNATURE-

Added: release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz.sha512
==
--- release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz.sha512 (added)
+++ release/nuttx/12.1.0/apache-nuttx-apps-12.1.0.tar.gz.sha512 Mon Apr 17 
06:17:19 2023
@@ -0,0 +1 @@
+f394cc9ec0763d03205cdc00d17caff40db8df89b9f5299c3a145b305db6fe07bb3952e0e9c9d0be09fd5661bf2fb428283bfab12226c893db46c9fb0fd8209d
  apache-nuttx-apps-12.1.0.tar.gz




[nuttx] branch master updated (2309eacf9f -> 3f05df3fbb)

2023-04-12 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 2309eacf9f drivers/sensors/Kconfig: Fix bmi160 help texts in Kconfig
 add 3f05df3fbb sim/win/hosttime: calculate sec/ms independently to avoid 
overflow

No new revisions were added by this update.

Summary of changes:
 arch/sim/src/sim/win/sim_hosttime.c | 25 -
 1 file changed, 16 insertions(+), 9 deletions(-)



[nuttx] branch master updated: drivers/sensors/Kconfig: Fix bmi160 help texts in Kconfig

2023-04-11 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 2309eacf9f drivers/sensors/Kconfig: Fix bmi160 help texts in Kconfig
2309eacf9f is described below

commit 2309eacf9ff2a0cb300c9c2f58431dcfd049a2b7
Author: simbit18 <101105604+simbi...@users.noreply.github.com>
AuthorDate: Tue Apr 11 17:50:46 2023 +0200

drivers/sensors/Kconfig: Fix bmi160 help texts in Kconfig

Fix bmi160 help texts in Kconfig
---
 drivers/sensors/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/sensors/Kconfig b/drivers/sensors/Kconfig
index 8491ec8227..8288b2bf2b 100644
--- a/drivers/sensors/Kconfig
+++ b/drivers/sensors/Kconfig
@@ -146,7 +146,7 @@ config BMI160_I2C_ADDR_68
bool "0x68"
---help---
Default address.
-   If SDO pin is pulled to VDDIO, use 0x69
+   If SDO pin is pulled to GND, use 0x68
 
 config BMI160_I2C_ADDR_69
bool "0x69"



svn commit: r61170 - in /dev/nuttx/12.1.0-RC0: ./ apache-nuttx-12.1.0.tar.gz apache-nuttx-12.1.0.tar.gz.asc apache-nuttx-12.1.0.tar.gz.sha512 apache-nuttx-apps-12.1.0.tar.gz apache-nuttx-apps-12.1.0.t

2023-04-11 Thread jerpelea
Author: jerpelea
Date: Tue Apr 11 08:47:16 2023
New Revision: 61170

Log:
Staging apache-nuttx-12.1.0-RC0

Added:
dev/nuttx/12.1.0-RC0/
dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz   (with props)
dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz.asc
dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz.sha512
dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz   (with props)
dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz.asc
dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz.sha512

Added: dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz
==
Binary file - no diff available.

Propchange: dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz
--
svn:mime-type = application/octet-stream

Added: dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz.asc
==
--- dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz.asc (added)
+++ dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz.asc Tue Apr 11 08:47:16 2023
@@ -0,0 +1,16 @@
+-BEGIN PGP SIGNATURE-
+
+iQIzBAABCgAdFiEEkgjS5LgA1m90mtTpQTenFpjF5NsFAmQ1G7oACgkQQTenFpjF
+5NujAxAAnupKOripAfEPu+brdsxZoqMw90RtsUMi0RVPSxYff7gyEjKGyIByUMOF
+Wy1Qilqr39rfsvbNJTg8wC3W8GeQCPoGdJ2LGt94Wqw0fBa/wwsa2T40yFo6ShfF
+FF5Hva0geV6B4LStWdYh3LDr4NxE/62t077ha1F/3aH7A7IzRWFf9arUlwooJIrI
+vwis7JXQU7kGx037zOc9IIB1KITXBSlfjuL1Z51HlDdyo7tVaGSbcpu4XgM5xuGw
+pdXKmtBo8z4YEtcySNsUA8YuJEleVBmQy9Zmo6JRpBu0p0lQXfMIF+A/eIZTPzgD
++dMiM082OB6UM5CBUmQmi4gDX3765EGhhGs+YW7sY6OTzHgHJ5YNZFDllzxXSx3p
+s6SFNjgCTfVbuCOwZe4D+b9cwKcwxWwmZRtJ/itaabzNcvPPp8aTripklYcoAP1Z
+Jxw8CTEk4aEeSVviDauQ30NsDFMMx5aQ8XydnY04Is+fU+1QeDQkd6gYduFff3zX
+g6WjJmfh2G3qAXfu2ylbkFPbZRMQKfIo1qwA6OusEQScHUeLBAaOjML4ktX0l7gT
+rw/VOK67YcD1s+G3PxnK9q4Q21rM1/RWNIfpCErtlewI7drJycTQlTJKRRVSXCFN
+TGCLLqTv3XmE3ifgvr8xsqxqFtjrIBDUvWAlAxsimgQxhOP3x/o=
+=IeAM
+-END PGP SIGNATURE-

Added: dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz.sha512
==
--- dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz.sha512 (added)
+++ dev/nuttx/12.1.0-RC0/apache-nuttx-12.1.0.tar.gz.sha512 Tue Apr 11 08:47:16 
2023
@@ -0,0 +1 @@
+186fc7dff2a8767474cd9c0c78a3b388ee21cff3b67db7fa80ba9d7f44e48db10a645f4a013ad287108241ada96c2a20e13d474e9c446dcf88d87788b6b00b8a
  apache-nuttx-12.1.0.tar.gz

Added: dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz
==
Binary file - no diff available.

Propchange: dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz
--
svn:mime-type = application/octet-stream

Added: dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz.asc
==
--- dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz.asc (added)
+++ dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz.asc Tue Apr 11 
08:47:16 2023
@@ -0,0 +1,16 @@
+-BEGIN PGP SIGNATURE-
+
+iQIzBAABCgAdFiEEkgjS5LgA1m90mtTpQTenFpjF5NsFAmQ1G7oACgkQQTenFpjF
+5NtKdA//faggd4r1CmdsJsztHPnk1mvDxNYoAtsuuJghuKtX30zvrjQjNBqqaRUG
+M2Z7nGBxEqwIECZQck7O6+FxdsoZ72vf1ITWyW7o40bzGjZq7/Iwa4E+lU/BO86q
+JmOua7uSL2gI7CFGSbex1hJtGG0A+tNTL3AYhdKnE9KppqKqMd1zSkaY1WR5nwqZ
+Q9f5h5wZWjkvOoiOGMHssdQnBic+rqqzAlDCYbbubgl7OiE8Y0zKAVquABFgLgZF
+uVIcLUm5ZOg9ZV5LNApIp+hOCWKtX204xNHZe2oCb0ZkzoCKxq60lIdFeCV0Rn4a
+5t7zoVWHf7jaGZBYObNJ0liOoi+knuvbgxP30AEIxEj0DiOrasSjfyQ/EIQ0DPxj
+gMwh22aL1utr+5ie3IxZXJTL1hZnpYePojfgc6iwln4Neu99UGvjAp+BD8GPzGlV
+DMbpdv9WME6g789SPzN3U25SEQd1+u1U6inVZiu0ZhNPAyY9s4Lhi0Q3FJ294b/g
+N72tIcpHs/t2oNN9TFkaLUjkXd/+Tbo6yxDV6Cq9csEufOIwKFTJBzLVXIiRTJiQ
+Nf1s/JlKf0Rw+LALCC9mfjL/PUPwvH2C7z6S3Bdedq1ql3JWWSF9LqIWdkDt6bSp
+xejVk6JzehCIDHJDkv76u6hrYbu1Zj/hThvyluy9zFb+uR7PJHk=
+=7Psb
+-END PGP SIGNATURE-

Added: dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz.sha512
==
--- dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz.sha512 (added)
+++ dev/nuttx/12.1.0-RC0/apache-nuttx-apps-12.1.0.tar.gz.sha512 Tue Apr 11 
08:47:16 2023
@@ -0,0 +1 @@
+f394cc9ec0763d03205cdc00d17caff40db8df89b9f5299c3a145b305db6fe07bb3952e0e9c9d0be09fd5661bf2fb428283bfab12226c893db46c9fb0fd8209d
  apache-nuttx-apps-12.1.0.tar.gz




[nuttx] annotated tag nuttx-12.1.0-RC0 updated (d40f4032fc -> 24f52a5bec)

2023-04-11 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to annotated tag nuttx-12.1.0-RC0
in repository https://gitbox.apache.org/repos/asf/nuttx.git


*** WARNING: tag nuttx-12.1.0-RC0 was modified! ***

from d40f4032fc (commit)
  to 24f52a5bec (tag)
 tagging d40f4032fc5491d2aeb9fde37042a5be9eabeb15 (commit)
 replaces nuttx-8.2
  by Alin Jerpelea
  on Tue Apr 11 10:32:39 2023 +0200

- Log -
nuttx-12.1.0-RC0
-BEGIN PGP SIGNATURE-

iQIzBAABCgAdFiEEkgjS5LgA1m90mtTpQTenFpjF5NsFAmQ1GycACgkQQTenFpjF
5NtISBAAyeMlxi8ezCfRceNNt7pr6Raj+AkxIYPvDzyWmZKvfngAmyZ/pZ2aStYp
FS38x8E1Qss8yg3eHAA+AGqH9pp5QA7PbeiUmsxJhFnB9YZaCRDBavA+hu5Fpyh4
WF7OY4h0QMSCG4lqWKJCp9xAq3VR3vu79rAYl31AE312SvcTOy4252DW6tu4cf2Q
JEoDJI1yjjxR64pHdialvL9bycsJPuj3z3V3J/EQdLavXA4sCCXu3wPKaDKRdbkA
vWtY5TfD4oQXNEKBpY8MdCQ9t4FRpMH1dU35dIu8YHkU4HZfGRuNvUjZG+RGHo6c
4sxddnxsROOY9RsrmfuPTZZEw4jSBshWxfSuaXTLnzZ0/hr5rWjr5m/JKxMTCiFR
zr1xWD+hpjWw+V++JkwRpkt2l5vK+VMNbartOiBVSv3RfU1f4i2jg/k+cspLHM2d
A+beVaKBkdShQCimIA7Gw5E4VSnDbaMxLbA+n6+xpFvYVEWqjJKya98ohaeleEaT
YbiEd6UKh37oIv3sdhp/oTHrJDi99vlMe3HFini6bvk9CZhcQ5sLpAf6+ZKLpBuK
94xXtaUQSRQ1035tOCTWL0MjQ9SXuxb/xIMNXihVMn511371qIe0ED1lH1jgS0c7
ljIulIvM5HP3zppRjrfVSmP05beTx5QqPc9OJRYdgm1hEhEWq6k=
=Lq22
-END PGP SIGNATURE-
---


No new revisions were added by this update.

Summary of changes:



[nuttx-apps] annotated tag nuttx-12.1.0-RC0 updated (125cf7abe -> c5d646c0d)

2023-04-11 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to annotated tag nuttx-12.1.0-RC0
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


*** WARNING: tag nuttx-12.1.0-RC0 was modified! ***

from 125cf7abe (commit)
  to c5d646c0d (tag)
 tagging 125cf7abe2d7f345c3bc58c0bdea2360fdefa170 (commit)
 replaces nuttx-12.0.0
  by Alin Jerpelea
  on Tue Apr 11 10:32:49 2023 +0200

- Log -
nuttx-12.1.0-RC0
-BEGIN PGP SIGNATURE-

iQIzBAABCgAdFiEEkgjS5LgA1m90mtTpQTenFpjF5NsFAmQ1GzEACgkQQTenFpjF
5NvOSw/6A9kGTSU93CqluMM+uYxRQqFYVvluomjvRiLToKelXt874g6EERsRIbD2
1E3rhthUIzYNrDhrC+8RgudGCxx8toGHH81lGpaVN6iZdwo5805zHWWWkM06u3t0
IaTFUnNKXsNz9kqkoagWiwwh3Vm8h0Rap3M7n8QMSHuqNWEbBtweAKBlmd3qVNDt
lNSNbnYmxmADWVm2EkFmdQP5x0M/9T6+ngFCdpD4HKRTes0jGGBZsc/I05eHnZaK
u9ueReNGZniykidWokPwQlcxYya5CBiXQeZzTDAtl51cBye56UgKn5i/0jdzddkY
Oqo8P8oyYk8SB6h3PfRqcmvwXxA0K099x/Pi7kPhzNZSCGkGG+laJoOwMaF242/E
5yyaYTw6zL+EhebDPs8FSW+4SOOiSGyzGEoDFBRKMpdMXj/vCVc/VsjW8F0r5w8K
FFcifE3W68qSH9GePaQ4AWLm3pVxBmThCOpq/1wPMNo7NeeQZA+gENkCk0SB3Cbg
RFOfVCdrDhaO6mTZtS82B/Yk7aEGH2uXdfgv7se8irFp5umN2fT6LY8ZTvfT9uKU
eIFT12g/PTtTXF5baPqMD7CrXyelDGXJtpaE+KD/wmkOIa8VQoDPoyU/fYck1q23
bjI1knCXxtoxawP2ss161nUZnl9yAL3IFZXRtivzH+oScuLVkgo=
=bieq
-END PGP SIGNATURE-
---


No new revisions were added by this update.

Summary of changes:



[nuttx] branch master updated: arch/arm: enable eoimode only select CONFIG_XXX_GIC_EOIMODE

2023-04-11 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 024b13f3ed arch/arm: enable eoimode only select CONFIG_XXX_GIC_EOIMODE
024b13f3ed is described below

commit 024b13f3ed352a8dc8715d70d838183c92a05fbf
Author: zhangyuan21 
AuthorDate: Tue Mar 21 11:45:21 2023 +0800

arch/arm: enable eoimode only select CONFIG_XXX_GIC_EOIMODE

On a GICv2 implementation, setting GICC_CTLR.EOImode to 1 separates
the priority drop and interrupt deactivation operations.

Signed-off-by: zhangyuan21 
---
 arch/arm/src/armv7-a/Kconfig| 11 +++
 arch/arm/src/armv7-a/arm_gicv2.c| 18 ++
 arch/arm/src/armv7-r/Kconfig| 11 +++
 arch/arm/src/armv7-r/arm_gicv2.c| 18 ++
 arch/arm64/Kconfig  | 11 +++
 arch/arm64/src/common/arm64_gicv2.c | 18 ++
 6 files changed, 75 insertions(+), 12 deletions(-)

diff --git a/arch/arm/src/armv7-a/Kconfig b/arch/arm/src/armv7-a/Kconfig
index 6da1b941b7..8fb14d6025 100644
--- a/arch/arm/src/armv7-a/Kconfig
+++ b/arch/arm/src/armv7-a/Kconfig
@@ -13,6 +13,17 @@ config ARMV7A_HAVE_GICv2
Selected by the configuration tool if the architecture supports 
the
Generic Interrupt Controller (GIC)
 
+if ARMV7A_HAVE_GICv2
+
+config ARMV7A_GIC_EOIMODE
+   bool "Enable GIC EOImode"
+   default n
+   ---help---
+   Enable GICC_CTLR.EOImode, this will separates the priority drop 
and interrupt
+   deactivation operations.
+
+endif # ARMV7A_HAVE_GICv2
+
 config ARMV7A_HAVE_GTM
bool
default n
diff --git a/arch/arm/src/armv7-a/arm_gicv2.c b/arch/arm/src/armv7-a/arm_gicv2.c
index a35f42ab31..cbcc1f224a 100644
--- a/arch/arm/src/armv7-a/arm_gicv2.c
+++ b/arch/arm/src/armv7-a/arm_gicv2.c
@@ -244,16 +244,17 @@ void arm_gic_initialize(void)
   iccicr |= GIC_ICCICRS_CBPR;
 #endif
 
-#if defined(CONFIG_ARCH_TRUSTZONE_SECURE) || 
defined(CONFIG_ARCH_TRUSTZONE_BOTH)
+#ifdef CONFIG_ARMV7A_GIC_EOIMODE
+#  if defined(CONFIG_ARCH_TRUSTZONE_SECURE) || 
defined(CONFIG_ARCH_TRUSTZONE_BOTH)
   /* Set EnableS=1 to enable CPU interface to signal secure interrupts.
*
* NOTE:  Only for processors that operate in secure state.
*/
 
   iccicr |= GIC_ICCICRS_EOIMODES;
-#endif
+#  endif
 
-#if defined(CONFIG_ARCH_TRUSTZONE_NONSECURE)
+#  if defined(CONFIG_ARCH_TRUSTZONE_NONSECURE)
   /* Set EnableNS=1 to enable the CPU to signal non-secure interrupts.
*
* NOTE:  Only for processors that operate in non-secure state.
@@ -261,13 +262,14 @@ void arm_gic_initialize(void)
 
   iccicr |= GIC_ICCICRS_EOIMODENS;
 
-#elif defined(CONFIG_ARCH_TRUSTZONE_BOTH)
+#  elif defined(CONFIG_ARCH_TRUSTZONE_BOTH)
   /* Set EnableNS=1 to enable the CPU to signal non-secure interrupts.
*
* NOTE:  Only for processors that operate in non-secure state.
*/
 
   iccicr |= GIC_ICCICRU_EOIMODENS;
+#  endif
 #endif
 
  #ifdef CONFIG_ARCH_TRUSTZONE_BOTH
@@ -370,6 +372,10 @@ uint32_t *arm_decodeirq(uint32_t *regs)
   regval = getreg32(GIC_ICCIAR);
   irq= (regval & GIC_ICCIAR_INTID_MASK) >> GIC_ICCIAR_INTID_SHIFT;
 
+#ifdef CONFIG_ARMV7A_GIC_EOIMODE
+  putreg32(regval, GIC_ICCEOIR);
+#endif
+
   /* Ignore spurions IRQs.  ICCIAR will report 1023 if there is no pending
* interrupt.
*/
@@ -384,7 +390,11 @@ uint32_t *arm_decodeirq(uint32_t *regs)
 
   /* Write to the end-of-interrupt register */
 
+#ifdef CONFIG_ARMV7A_GIC_EOIMODE
+  putreg32(regval, GIC_ICCDIR);
+#else
   putreg32(regval, GIC_ICCEOIR);
+#endif
   return regs;
 }
 
diff --git a/arch/arm/src/armv7-r/Kconfig b/arch/arm/src/armv7-r/Kconfig
index 0364440732..b185031ef6 100644
--- a/arch/arm/src/armv7-r/Kconfig
+++ b/arch/arm/src/armv7-r/Kconfig
@@ -13,6 +13,17 @@ config ARMV7R_HAVE_GICv2
Selected by the configuration tool if the architecture supports 
the
Generic Interrupt Controller (GIC)
 
+if ARMV7R_HAVE_GICv2
+
+config ARMV7R_GIC_EOIMODE
+   bool
+   default n
+   ---help---
+   Enable GICC_CTLR.EOImode, this will separates the priority drop 
and interrupt
+   deactivation operations.
+
+endif # ARMV7R_GIC_EOIMODE
+
 config ARMV7R_HAVE_PTM
bool
default n
diff --git a/arch/arm/src/armv7-r/arm_gicv2.c b/arch/arm/src/armv7-r/arm_gicv2.c
index 070e54db00..18957f1517 100644
--- a/arch/arm/src/armv7-r/arm_gicv2.c
+++ b/arch/arm/src/armv7-r/arm_gicv2.c
@@ -228,16 +228,17 @@ void arm_gic_initialize(void)
 
 #endif
 
-#if defined(CONFIG_ARCH_TRUSTZONE_SECURE) || 
defined(CONFIG_ARCH_TRUSTZONE_BOTH)
+#ifdef CONFIG_ARMV7R_GIC_EOIMODE
+#  if defined(CONFIG_ARCH_TRUSTZONE_SECURE) || 
defined(CONFIG_ARCH_TRUSTZONE_BOTH)
   /* Set EnableS=1 to enable CPU interface to sign

[nuttx] branch master updated: Assert if a thread attempts to post a semaphore incorrectly.

2023-04-03 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 758e88672b Assert if a thread attempts to post a semaphore incorrectly.
758e88672b is described below

commit 758e88672b703bcb0d1251ae9731b2ec295e81c0
Author: Gregory Nutt 
AuthorDate: Fri Mar 31 16:25:45 2023 -0600

Assert if a thread attempts to post a semaphore incorrectly.

Assert in nxsem_post if:

- Priority inheritance is enabled on a semaphore
- A thread that does not hold the semaphore attempts to post it

This will detect an error condition described in 
https://cwiki.apache.org/confluence/display/NUTTX/Signaling+Semaphores+and+Priority+Inheritance

None.  The debug instrumentation is only enabled if CONFIG_DEBUG_ASSERTIONS 
is enabled.

Use sim:ostest.  Verify that no assertions occur.
---
 sched/semaphore/sem_holder.c | 59 
 sched/semaphore/sem_post.c   |  6 +
 sched/semaphore/semaphore.h  |  6 +
 3 files changed, 71 insertions(+)

diff --git a/sched/semaphore/sem_holder.c b/sched/semaphore/sem_holder.c
index d012c78fe5..9e0f2c607a 100644
--- a/sched/semaphore/sem_holder.c
+++ b/sched/semaphore/sem_holder.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "sched/sched.h"
 #include "semaphore/semaphore.h"
@@ -1058,4 +1059,62 @@ void nxsem_release_all(FAR struct tcb_s *htcb)
 }
 }
 
+/
+ * Name: nxsem_isholder
+ *
+ * Assertion helper for sem_post().  If priority inheritance is enabled
+ * assure that the calling thread is the same as the holder thread.
+ *
+ /
+
+#ifdef CONFIG_DEBUG_ASSERTIONS
+bool nxsem_checkholder(FAR sem_t *sem)
+{
+  FAR struct tcb_s *htcb;
+  pid_t tid;
+
+  /* Is priorty inheritance selected? */
+
+  if ((sem->flags & SEM_PRIO_MASK) != SEM_PRIO_INHERIT)
+{
+  return true;
+}
+
+  /* Get the thread ID.  Skip thread ID 0; that is the IDLE thread which
+   * normally does not take semaphores but may do so initially as part of
+   * OS bringup.
+   */
+
+  tid = gettid();
+  if (tid == 0)
+{
+  return true;
+}
+
+  /* A semaphore with priority inheritance enabled cannot be called from an
+   * interrupt handler.  There is no valid holder information available in
+   * the interrupt context.
+   */
+
+  if (up_interrupt_context())
+{
+  return false;
+}
+
+  /* Get the TCB associated with this thread */
+
+  htcb = nxsched_get_tcb(tid);
+  if (htcb == NULL)
+{
+  return false;
+}
+
+  /* Return FALSE is the thread of this TCB is not a holder of this
+   * semaphore.
+   */
+
+  return nxsem_findholder(sem, htcb) != NULL;
+}
+#endif /* CONFIG_DEBUG_ASSERTIONS */
+
 #endif /* CONFIG_PRIORITY_INHERITANCE */
diff --git a/sched/semaphore/sem_post.c b/sched/semaphore/sem_post.c
index 6c721d27b0..f6c5e92393 100644
--- a/sched/semaphore/sem_post.c
+++ b/sched/semaphore/sem_post.c
@@ -78,6 +78,12 @@ int nxsem_post(FAR sem_t *sem)
 
   DEBUGASSERT(sem != NULL);
 
+  /* If priority inheritance is enabled assure that the calling thread is
+   * the same as the holder thread.
+   */
+
+  DEBUGASSERT(nxsem_checkholder(sem));
+
   /* The following operations must be performed with interrupts
* disabled because sem_post() may be called from an interrupt
* handler.
diff --git a/sched/semaphore/semaphore.h b/sched/semaphore/semaphore.h
index 7a24f5e696..3f7b4a9375 100644
--- a/sched/semaphore/semaphore.h
+++ b/sched/semaphore/semaphore.h
@@ -91,6 +91,12 @@ void nxsem_release_all(FAR struct tcb_s *stcb);
 #  define nxsem_release_all(stcb)
 #endif
 
+#if defined(CONFIG_DEBUG_ASSERTIONS) && defined(CONFIG_PRIORITY_INHERITANCE)
+bool nxsem_checkholder(FAR sem_t *sem);
+#else
+#  define nxsem_checkholder(sem) true
+#endif /* CONFIG_DEBUG_ASSERTIONS */
+
 #undef EXTERN
 #ifdef __cplusplus
 }



[nuttx] branch master updated (71d7028c4a -> 4ff4562401)

2023-04-03 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 71d7028c4a stm32h7/stm32_sdmmc.c: fix compilation
 add 4ff4562401 tm4c1294-launchpad: Use bmi160 driver for boostxl-sensors.

No new revisions were added by this update.

Summary of changes:
 boards/arm/tiva/tm4c1294-launchpad/Kconfig | 16 ++
 boards/arm/tiva/tm4c1294-launchpad/include/board.h | 37 ++---
 .../arm/tiva/tm4c1294-launchpad/src/tm4c_bringup.c | 60 ++
 3 files changed, 105 insertions(+), 8 deletions(-)



[nuttx] branch releases/12.1 created (now 71d7028c4a)

2023-04-03 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch releases/12.1
in repository https://gitbox.apache.org/repos/asf/nuttx.git


  at 71d7028c4a stm32h7/stm32_sdmmc.c: fix compilation

No new revisions were added by this update.



[nuttx-apps] branch releases/12.1 created (now 125cf7abe)

2023-04-03 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch releases/12.1
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


  at 125cf7abe nshlib: Fix the ps command format

No new revisions were added by this update.



[nuttx] branch master updated (7ac80d4e59 -> e317af0a84)

2023-03-23 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 7ac80d4e59 Documentation: Fix some spelling typos in index.rst
 add e317af0a84 arch: cxd56xx: Fix SPI transfer without DMA

No new revisions were added by this update.

Summary of changes:
 arch/arm/src/cxd56xx/cxd56_spi.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)



[nuttx] branch master updated: drivers/serial: Fix some typo error report in https://github.com/apache/nuttx/pull/8843

2023-03-20 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new e7090022a0 drivers/serial: Fix some typo error report in 
https://github.com/apache/nuttx/pull/8843
e7090022a0 is described below

commit e7090022a0cb36de4f32efefbd5d8da5db957b0a
Author: Xiang Xiao 
AuthorDate: Mon Mar 20 10:38:29 2023 +0800

drivers/serial: Fix some typo error report in 
https://github.com/apache/nuttx/pull/8843

Signed-off-by: Xiang Xiao 
---
 drivers/serial/Kconfig | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 421c2514be..12053c650d 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -169,10 +169,10 @@ config SERIAL_TERMIOS
depends on ARCH_HAVE_SERIAL_TERMIOS
default n
---help---
-   If this is not defined, then the terminal hardware setting
-   (baud, parity, flow control) is not configurable at runtime.
-   Note: other software setting (echo, \r\n<->\n, break, tcflush)
-   is always supported.
+   If this is not defined, then the terminal hardware settings
+   (baud, parity, flow control) are not configurable at runtime.
+   Note: other software settings (echo, \r\n<->\n, break, tcflush)
+   are always supported.
 
 config TTY_LAUNCH
bool "Enable feature TTY launch program"



[nuttx] branch master updated: net/icmpv6: align structs to 2 bytes.

2023-03-10 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 7b0d80c94a net/icmpv6: align structs to 2 bytes.
7b0d80c94a is described below

commit 7b0d80c94a398b115717658d2501ed3b8777a5a7
Author: Zhe Weng 
AuthorDate: Wed Jan 4 17:48:34 2023 +0800

net/icmpv6: align structs to 2 bytes.

Fix following misaligned errors:

icmpv6/icmpv6_radvertise.c:145:21: runtime error: member access within 
misaligned address 0x573da9e6 for type 'struct icmpv6_router_advertise_s', 
which requires 4 byte alignment
0x573da9e6: note: pointer points here
 00 00 00 01 85 00  d6 14 00 00 00 00 01 01  12 8c 25 08 9c f8 04 00  00 00 
ff 02 00 00 00 00  00 00
 ^
icmpv6/icmpv6_radvertise.c:167:21: runtime error: member access within 
misaligned address 0x573da9fe for type 'struct icmpv6_mtu_s', which requires 4 
byte alignment
0x573da9fe: note: pointer points here
 af 78 ab 72 00 00  00 00 00 00 00 01 ff 00  00 01 04 00 00 00 ff 02  00 00 
00 00 00 00 00 00  00 01
 ^
icmpv6/icmpv6_radvertise.c:176:23: runtime error: member access within 
misaligned address 0x573daa06 for type 'struct icmpv6_prefixinfo_s', which 
requires 4 byte alignment
0x573daa06: note: pointer points here
 00 00 05 dc ff 00  00 01 04 00 00 00 ff 02  00 00 00 00 00 00 00 00  00 01 
ff 08 9c f8 04 00  00 00
 ^

Signed-off-by: Zhe Weng 
---
 include/nuttx/net/icmpv6.h | 10 +-
 net/icmpv6/icmpv6_input.c  |  2 +-
 net/icmpv6/icmpv6_radvertise.c | 29 +
 3 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/include/nuttx/net/icmpv6.h b/include/nuttx/net/icmpv6.h
index 89266cf2e7..cae937a3ab 100644
--- a/include/nuttx/net/icmpv6.h
+++ b/include/nuttx/net/icmpv6.h
@@ -258,8 +258,8 @@ struct icmpv6_router_advertise_s
   uint8_t  hoplimit; /* Current hop limit */
   uint8_t  flags;/* See ICMPv6_RADV_FLAG_* definitions */
   uint16_t lifetime; /* Router lifetime */
-  uint32_t reachable;/* Reachable time */
-  uint32_t retrans;  /* Retransmission timer */
+  uint16_t reachable[2]; /* Reachable time */
+  uint16_t retrans[2];   /* Retransmission timer */
  /* Options begin here */
 };
 
@@ -329,8 +329,8 @@ struct icmpv6_prefixinfo_s
   uint8_t  optlen;   /* "   " ": Option length: 4 octets */
   uint8_t  preflen;  /* "   " ": Prefix length */
   uint8_t  flags;/* "   " ": Flags */
-  uint32_t vlifetime;/* "   " ": Valid lifetime */
-  uint32_t plifetime;/* Octet 2: Preferred lifetime */
+  uint16_t vlifetime[2]; /* "   " ": Valid lifetime */
+  uint16_t plifetime[2]; /* Octet 2: Preferred lifetime */
   uint16_t reserved[2];  /* "   " ": Reserved */
   uint16_t prefix[8];/* Octets 3-4: Prefix */
 };
@@ -348,7 +348,7 @@ struct icmpv6_mtu_s
   uint8_t  opttype;  /* Octet 1: Option Type: ICMPv6_OPT_MTU */
   uint8_t  optlen;   /* "   " ": Option length: 1 octet */
   uint16_t reserved; /* "   " ": Reserved */
-  uint32_t mtu;  /* "   " ": MTU */
+  uint16_t mtu[2];   /* "   " ": MTU */
 };
 
 /* The structure holding the ICMP statistics that are gathered if
diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c
index e45533cfe6..2a1ed92d4e 100644
--- a/net/icmpv6/icmpv6_input.c
+++ b/net/icmpv6/icmpv6_input.c
@@ -353,7 +353,7 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned 
int iplen)
   {
 FAR struct icmpv6_mtu_s *mtuopt =
 (FAR struct icmpv6_mtu_s *)opt;
-dev->d_pktsize = NTOHL(mtuopt->mtu) + dev->d_llhdrlen;
+dev->d_pktsize = NTOHS(mtuopt->mtu[1]) + dev->d_llhdrlen;
   }
   break;
 
diff --git a/net/icmpv6/icmpv6_radvertise.c b/net/icmpv6/icmpv6_radvertise.c
index f6a226ea2a..9429b96465 100644
--- a/net/icmpv6/icmpv6_radvertise.c
+++ b/net/icmpv6/icmpv6_radvertise.c
@@ -147,8 +147,10 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev)
   adv->hoplimit = 64;  /* Current hop limit */
   adv->flags= ICMPv6_RADV_FLAG_M;  /* Managed address flag. */
   adv->lifetime = HTONS(1800); /* Router lifetime */
-  adv->reachable= 0;   /* Reachable time */
-  adv->retrans  = 0;   /* Retransmission timer */
+  adv->reachable[0] = 0;   /* Reachable time */
+  adv->re

[nuttx] branch master updated: net/local: Return the unblock handle correctly in local_accept

2023-03-09 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 75ecbd4382 net/local: Return the unblock handle correctly in 
local_accept
75ecbd4382 is described below

commit 75ecbd4382d57580af251bb55e45b7ef207564b7
Author: Xiang Xiao 
AuthorDate: Tue Mar 7 01:38:39 2023 +0800

net/local: Return the unblock handle correctly in local_accept

Signed-off-by: Xiang Xiao 
---
 include/nuttx/net/net.h  | 2 +-
 net/inet/inet_sockif.c   | 5 +++--
 net/local/local.h| 3 ++-
 net/local/local_accept.c | 8 +---
 net/rpmsg/rpmsg_sockif.c | 6 +++---
 net/socket/accept.c  | 2 +-
 net/usrsock/usrsock.h| 3 ++-
 net/usrsock/usrsock_accept.c | 3 ++-
 8 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index 59bc96ba43..291cba2785 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -156,7 +156,7 @@ struct sock_intf_s
 FAR const struct sockaddr *addr, socklen_t addrlen);
   CODE int(*si_accept)(FAR struct socket *psock,
 FAR struct sockaddr *addr, FAR socklen_t *addrlen,
-FAR struct socket *newsock);
+FAR struct socket *newsock, int flags);
   CODE int(*si_poll)(FAR struct socket *psock,
 FAR struct pollfd *fds, bool setup);
   CODE ssize_t(*si_sendmsg)(FAR struct socket *psock,
diff --git a/net/inet/inet_sockif.c b/net/inet/inet_sockif.c
index 6572b2d417..0b7f5512db 100644
--- a/net/inet/inet_sockif.c
+++ b/net/inet/inet_sockif.c
@@ -76,7 +76,7 @@ static intinet_connect(FAR struct socket *psock,
 FAR const struct sockaddr *addr, socklen_t addrlen);
 static intinet_accept(FAR struct socket *psock,
 FAR struct sockaddr *addr, FAR socklen_t *addrlen,
-FAR struct socket *newsock);
+FAR struct socket *newsock, int flags);
 static intinet_poll(FAR struct socket *psock,
 FAR struct pollfd *fds, bool setup);
 static ssize_tinet_send(FAR struct socket *psock, FAR const void *buf,
@@ -1369,7 +1369,8 @@ static int inet_connect(FAR struct socket *psock,
  /
 
 static int inet_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
-   FAR socklen_t *addrlen, FAR struct socket *newsock)
+   FAR socklen_t *addrlen, FAR struct socket *newsock,
+   int flags)
 {
 #if defined(CONFIG_NET_TCP) && defined(NET_TCP_HAVE_STACK)
   int ret;
diff --git a/net/local/local.h b/net/local/local.h
index a3f4b9ab23..6b6bb65cc8 100644
--- a/net/local/local.h
+++ b/net/local/local.h
@@ -347,7 +347,8 @@ int local_listen(FAR struct socket *psock, int backlog);
 
 #ifdef CONFIG_NET_LOCAL_STREAM
 int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
- FAR socklen_t *addrlen, FAR struct socket *newsock);
+ FAR socklen_t *addrlen, FAR struct socket *newsock,
+ int flags);
 #endif
 
 /
diff --git a/net/local/local_accept.c b/net/local/local_accept.c
index 1518444389..c198c99ec7 100644
--- a/net/local/local_accept.c
+++ b/net/local/local_accept.c
@@ -96,12 +96,14 @@ static int local_waitlisten(FAR struct local_conn_s *server)
  /
 
 int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
- FAR socklen_t *addrlen, FAR struct socket *newsock)
+ FAR socklen_t *addrlen, FAR struct socket *newsock,
+ int flags)
 {
   FAR struct local_conn_s *server;
   FAR struct local_conn_s *client;
   FAR struct local_conn_s *conn;
   FAR dq_entry_t *waiter;
+  bool nonblock = !!(flags & SOCK_NONBLOCK);
   int ret;
 
   /* Some sanity checks */
@@ -180,7 +182,7 @@ int local_accept(FAR struct socket *psock, FAR struct 
sockaddr *addr,
* block.
*/
 
-  ret = local_open_server_tx(conn, false);
+  ret = local_open_server_tx(conn, nonblock);
   if (ret < 0)
 {
   nerr("ERROR: Failed to open write-only FIFOs for %s: %d\n",
@@ -199,7 +201,7 @@ int local_accept(FAR struct socket *psock, FAR struct 
sockaddr *addr,
* for writing.
*/
 
-  ret = local_open_server_rx(conn, false);
+  ret = local_open_server_rx(conn, nonblock);
   if (ret < 0)
 {
nerr("ERROR: Failed to open read-only FIFO

[nuttx] branch master updated (62661600b2 -> 47ce89f757)

2023-03-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 62661600b2 treewide: add DOWNLOAD variable as unification of curl call
 new 3f529b4882 Revert "signal/sig_dispatch: Fix case where signal action 
is sent twice"
 new 47ce89f757 Revert "signal/sig_dispatch: Signal action was not 
performed if TCB_FLAG_SYSCALL is set"

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 sched/signal/sig_dispatch.c | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)



[nuttx] 01/02: Revert "signal/sig_dispatch: Fix case where signal action is sent twice"

2023-03-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 3f529b48827dc81f832d19ed6a430e467f7d7f7e
Author: Ville Juven 
AuthorDate: Wed Mar 8 09:04:33 2023 +0200

Revert "signal/sig_dispatch: Fix case where signal action is sent twice"

This reverts commit be0cb4cbe3d50ea8d575766876a5f4194f1da5fe.
---
 sched/signal/sig_dispatch.c | 21 ++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c
index ce2842d513..9b926667a6 100644
--- a/sched/signal/sig_dispatch.c
+++ b/sched/signal/sig_dispatch.c
@@ -372,9 +372,14 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t 
*info)
   if (masked == 1)
 #endif
 {
-  /* Add signal to pending queue regardless. */
+#ifdef CONFIG_LIB_SYSCALL
+  /* If the thread is in syscall, schedule the sigaction here */
 
-  nxsig_add_pendingsignal(stcb, info);
+  if ((stcb->flags & TCB_FLAG_SYSCALL) != 0)
+{
+  nxsig_add_pendingsignal(stcb, info);
+}
+#endif
 
   /* Check if the task is waiting for this pending signal. If so, then
* unblock it. This must be performed in a critical section because
@@ -406,9 +411,19 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t 
*info)
 {
   up_switch_context(stcb, rtcb);
 }
+
+  leave_critical_section(flags);
 }
 
-  leave_critical_section(flags);
+  /* Its not one we are waiting for... Add it to the list of pending
+   * signals.
+   */
+
+  else
+{
+  leave_critical_section(flags);
+  nxsig_add_pendingsignal(stcb, info);
+}
 }
 
   /* UNMASKED SIGNAL ACTIONS /



[nuttx] 02/02: Revert "signal/sig_dispatch: Signal action was not performed if TCB_FLAG_SYSCALL is set"

2023-03-08 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 47ce89f757bd7767124fbe0a88cfc8e76e68c147
Author: Ville Juven 
AuthorDate: Wed Mar 8 09:04:37 2023 +0200

Revert "signal/sig_dispatch: Signal action was not performed if 
TCB_FLAG_SYSCALL is set"

This reverts commit 0e4466682888cf32ca661aa04c649a836860a22f.
---
 sched/signal/sig_dispatch.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c
index 9b926667a6..77d0c5ef71 100644
--- a/sched/signal/sig_dispatch.c
+++ b/sched/signal/sig_dispatch.c
@@ -372,15 +372,6 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t 
*info)
   if (masked == 1)
 #endif
 {
-#ifdef CONFIG_LIB_SYSCALL
-  /* If the thread is in syscall, schedule the sigaction here */
-
-  if ((stcb->flags & TCB_FLAG_SYSCALL) != 0)
-{
-  nxsig_add_pendingsignal(stcb, info);
-}
-#endif
-
   /* Check if the task is waiting for this pending signal. If so, then
* unblock it. This must be performed in a critical section because
* signals can be queued from the interrupt level.



[nuttx-apps] branch master updated: Application: fix multiple main target mismatch during incremental compile

2023-03-07 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
 new 7ad9525c3 Application: fix multiple main target mismatch during 
incremental compile
7ad9525c3 is described below

commit 7ad9525c357adee503bb68d9aeb1c1e08b8332f3
Author: chao an 
AuthorDate: Tue Feb 28 14:45:50 2023 +0800

Application: fix multiple main target mismatch during incremental compile

MAINSRC will fail to match with PROGNAME if one of main source is changed 
in incremental compilation
this PR will correct this issue.

Signed-off-by: chao an 
---
 Application.mk | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Application.mk b/Application.mk
index c54829a13..265e34ba7 100644
--- a/Application.mk
+++ b/Application.mk
@@ -203,16 +203,16 @@ else
 MAINNAME := $(addsuffix _main,$(PROGNAME))
 
 $(MAINCXXOBJ): %$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
-   $(eval $<_CXXFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(firstword 
$(MAINNAME))})
-   $(eval $<_CXXELFFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(firstword 
$(MAINNAME))})
-   $(eval MAINNAME=$(filter-out $(firstword $(MAINNAME)),$(MAINNAME)))
+   $(eval MAIN=$(word $(call GETINDEX,$<,$(MAINCXXSRCS)),$(MAINNAME)))
+   $(eval $<_CXXFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(MAIN)})
+   $(eval $<_CXXELFFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(MAIN)})
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
 
 $(MAINCOBJ): %.c$(SUFFIX)$(OBJEXT): %.c
-   $(eval $<_CFLAGS += ${DEFINE_PREFIX}main=$(firstword $(MAINNAME)))
-   $(eval $<_CELFFLAGS += ${DEFINE_PREFIX}main=$(firstword $(MAINNAME)))
-   $(eval MAINNAME=$(filter-out $(firstword $(MAINNAME)),$(MAINNAME)))
+   $(eval MAIN=$(word $(call GETINDEX,$<,$(MAINCSRCS)),$(MAINNAME)))
+   $(eval $<_CFLAGS += ${DEFINE_PREFIX}main=$(MAIN))
+   $(eval $<_CELFFLAGS += ${DEFINE_PREFIX}main=$(MAIN))
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
 



[nuttx] branch master updated (9f4a15110c -> bd470ea94d)

2023-03-07 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 9f4a15110c net: Finish FIONBIO default action if si_ioctl return OK
 add bd470ea94d AUTHORS: add Tomek CEDRO to the list

No new revisions were added by this update.

Summary of changes:
 AUTHORS | 1 +
 1 file changed, 1 insertion(+)



[nuttx-apps] branch master updated: system/cu: Disable echo if it's enabled to avoid double input character

2023-03-07 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
 new 96cd66cf5 system/cu: Disable echo if it's enabled to avoid double 
input character
96cd66cf5 is described below

commit 96cd66cf517b5426bf45bf090808ebdb6fdbd830
Author: Huang Qi 
AuthorDate: Tue Mar 7 14:37:26 2023 +0800

system/cu: Disable echo if it's enabled to avoid double input character

Signed-off-by: Huang Qi 
---
 system/cu/cu_main.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/system/cu/cu_main.c b/system/cu/cu_main.c
index 88f6c5468..29090bd8b 100644
--- a/system/cu/cu_main.c
+++ b/system/cu/cu_main.c
@@ -179,6 +179,10 @@ static int set_termios(int fd, int rate, enum parity_mode 
parity,
   tio.c_oflag |= ONLCR;
 }
 
+  /* disable echo if it's enabled to avoid double input character */
+
+  tio.c_iflag &= ~ECHO;
+
   ret = tcsetattr(fd, TCSANOW, );
   if (ret)
 {



[nuttx] branch master updated: boards: stm32f4discovery: Update kostest/defconfig to avoid crash

2023-03-06 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 1917870cca boards: stm32f4discovery: Update kostest/defconfig to avoid 
crash
1917870cca is described below

commit 1917870ccac1d993e1f66f240b49bcdc30d26333
Author: Masayuki Ishikawa 
AuthorDate: Mon Mar 6 17:03:22 2023 +0900

boards: stm32f4discovery: Update kostest/defconfig to avoid crash

Summary:
- I noticed that recent mm_heap changes causes a crash with
  stm32f4discovery:kostest
- This is a tentative solution to avoid the crash

Impact:
- None

Testing:
- Tested with stm32f4discovery board

Signed-off-by: Masayuki Ishikawa 
---
 boards/arm/stm32/stm32f4discovery/configs/kostest/defconfig | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/boards/arm/stm32/stm32f4discovery/configs/kostest/defconfig 
b/boards/arm/stm32/stm32f4discovery/configs/kostest/defconfig
index d827f8123b..c5ee7e18d9 100644
--- a/boards/arm/stm32/stm32f4discovery/configs/kostest/defconfig
+++ b/boards/arm/stm32/stm32f4discovery/configs/kostest/defconfig
@@ -18,9 +18,11 @@ CONFIG_BOARD_LATE_INITIALIZE=y
 CONFIG_BOARD_LOOPSPERMSEC=16717
 CONFIG_BUILD_PROTECTED=y
 CONFIG_CONSOLE_SYSLOG=y
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_HARDFAULT_ALERT=y
+CONFIG_DEBUG_SYMBOLS=y
 CONFIG_DISABLE_ENVIRON=y
 CONFIG_DISABLE_MOUNTPOINT=y
-CONFIG_HOST_WINDOWS=y
 CONFIG_INIT_ENTRYPOINT="ostest_main"
 CONFIG_INTELHEX_BINARY=y
 CONFIG_MM_REGIONS=2
@@ -32,6 +34,7 @@ CONFIG_RAM_START=0x2000
 CONFIG_RAW_BINARY=y
 CONFIG_RR_INTERVAL=200
 CONFIG_SCHED_WAITPID=y
+CONFIG_STACK_COLORATION=y
 CONFIG_START_DAY=22
 CONFIG_START_MONTH=3
 CONFIG_START_YEAR=2013



[nuttx] branch master updated: tools/arm: Add missing -mcpu param for zig

2023-03-06 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new bcf5700e8a tools/arm: Add missing -mcpu param for zig
bcf5700e8a is described below

commit bcf5700e8a7d012f0b9bbe2519ff97e8a03d8cc5
Author: Huang Qi 
AuthorDate: Mon Mar 6 15:57:02 2023 +0800

tools/arm: Add missing -mcpu param for zig

Signed-off-by: Huang Qi 
---
 arch/arm/src/common/Toolchain.defs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/src/common/Toolchain.defs 
b/arch/arm/src/common/Toolchain.defs
index 34eaf1c34b..96892ca6fb 100644
--- a/arch/arm/src/common/Toolchain.defs
+++ b/arch/arm/src/common/Toolchain.defs
@@ -285,7 +285,7 @@ else
   ZEABI := gnueabi
 endif
 
-ZIGFLAGS = -target $(ZARCH)-freestanding-$(ZEABI)
+ZIGFLAGS = -target $(ZARCH)-freestanding-$(ZEABI) $(ZARCHCPUFLAGS)
 
 # Optimization of unused sections
 



[nuttx] branch master updated: mm_heap: double malloced memory default alignment (4 -> 8, 8 -> 16)

2023-03-06 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 3e971d2e6d mm_heap: double malloced memory default alignment (4 -> 8, 
8 -> 16)
3e971d2e6d is described below

commit 3e971d2e6d753519985a3e044d4dd21026ec1d12
Author: wangbowen6 
AuthorDate: Mon Mar 6 16:10:31 2023 +0800

mm_heap: double malloced memory default alignment (4 -> 8, 8 -> 16)

Base on the gnu libc standard:

https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html

Change the default memory aligment to 8 bytes for 32-bit system and
16 bytes for 64-bit system.

Signed-off-by: wangbowen6 
---
 mm/Kconfig  | 2 +-
 mm/mm_heap/mm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/Kconfig b/mm/Kconfig
index 71a95c80fa..6d702f7629 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -63,7 +63,7 @@ config MM_KERNEL_HEAPSIZE
 
 config MM_DFAULT_ALIGNMENT
int "Memory default alignment in bytes"
-   default 8
+   default 0
range 0 64
---help---
The memory default alignment in bytes, if this value is 0, the 
real
diff --git a/mm/mm_heap/mm.h b/mm/mm_heap/mm.h
index adc6f24d28..c787ace6af 100644
--- a/mm/mm_heap/mm.h
+++ b/mm/mm_heap/mm.h
@@ -111,7 +111,7 @@
 #define MM_NNODES(MM_MAX_SHIFT - MM_MIN_SHIFT + 1)
 
 #if CONFIG_MM_DFAULT_ALIGNMENT == 0
-#  define MM_ALIGN   sizeof(uintptr_t)
+#  define MM_ALIGN   (2 * sizeof(uintptr_t))
 #else
 #  define MM_ALIGN   CONFIG_MM_DFAULT_ALIGNMENT
 #endif



[nuttx] branch master updated: libc/stdio: Implement lib_get_stream

2023-03-02 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new dfc70b1ddb libc/stdio: Implement lib_get_stream
dfc70b1ddb is described below

commit dfc70b1ddb25d776ad8ed7660ffee416fefd6602
Author: Huang Qi 
AuthorDate: Thu Mar 2 12:53:29 2023 +0800

libc/stdio: Implement lib_get_stream

Use lib_get_stream() to fetch stdin/stdout/stderr,
since is more easy to works with other language by function call
than export native C structure memory layout.

Signed-off-by: Huang Qi 
---
 include/nuttx/lib/lib.h |  1 +
 include/stdio.h |  6 +++---
 libs/libc/stdio/lib_libgetstreams.c | 14 ++
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/include/nuttx/lib/lib.h b/include/nuttx/lib/lib.h
index df30581f87..df71eb988e 100644
--- a/include/nuttx/lib/lib.h
+++ b/include/nuttx/lib/lib.h
@@ -111,6 +111,7 @@ void lib_stream_release(FAR struct task_group_s *group);
 /* Functions contained in lib_getstreams.c **/
 
 FAR struct streamlist *lib_get_streams(void);
+FAR struct file_struct *lib_get_stream(int fd);
 #endif /* CONFIG_FILE_STREAM */
 
 /* Functions defined in lib_srand.c */
diff --git a/include/stdio.h b/include/stdio.h
index ebcfe1b430..854f8ce043 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -63,9 +63,9 @@
 
 /* The first three _iob entries are reserved for standard I/O */
 
-#define stdin  (_get_streams()->sl_std[0])
-#define stdout (_get_streams()->sl_std[1])
-#define stderr (_get_streams()->sl_std[2])
+#define stdin  lib_get_stream(0)
+#define stdout lib_get_stream(1)
+#define stderr lib_get_stream(2)
 
 /* Path to the directory where temporary files can be created */
 
diff --git a/libs/libc/stdio/lib_libgetstreams.c 
b/libs/libc/stdio/lib_libgetstreams.c
index 3c31ecae1a..cb3025f60a 100644
--- a/libs/libc/stdio/lib_libgetstreams.c
+++ b/libs/libc/stdio/lib_libgetstreams.c
@@ -57,4 +57,18 @@ FAR struct streamlist *lib_get_streams(void)
   return >ta_streamlist;
 }
 
+/
+ * Name: lib_get_stream
+ *
+ * Description:
+ *   Return a pointer to the file stream for this thread and given fd。
+ *   Note: only reserved fd number 0/1/2 is valid.
+ *
+ /
+
+FAR struct file_struct *lib_get_stream(int fd)
+{
+  return _get_streams()->sl_std[fd];
+}
+
 #endif /* CONFIG_FILE_STREAM */



[nuttx] branch master updated: sim/wamr: add example of WAMR(WebAssembly Micro Runtime)

2023-03-02 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new b01b93cb54 sim/wamr: add example of WAMR(WebAssembly Micro Runtime)
b01b93cb54 is described below

commit b01b93cb54efc8d1dbd3116fd87287e4aea72426
Author: chao an 
AuthorDate: Thu Mar 2 11:57:15 2023 +0800

sim/wamr: add example of WAMR(WebAssembly Micro Runtime)

Added compilation rules to support the construction of 
WebAssembly(WASM/WAMR):

1. Compile Toolchain
 1> Download WASI sdk and export the WASI_SDK_PATH path:

$ wget 
https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz
$ tar xf wasi-sdk-19.0-linux.tar.gz
Put wasi-sdk-19.0 to your host WASI_SDK_PATH environment variable, like:
$ export WASI_SDK_PATH=`pwd`/wasi-sdk-19.0

 2> Download Wamr "wamrc" AOT compiler and export to the PATH:
$ mkdir wamrc
$ wget 
https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
$ tar xf wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
$ export PATH=$PATH:$PWD

2. Configuring and running

 1> Configuring sim/wamr and compile:

nuttx$ ./tools/configure.sh  sim/wamr
nuttx$ make
...
Wamrc Generate AoT: /home/archer/code/nuttx/n5/apps/wasm/hello.aot
Wamrc Generate AoT: /home/archer/code/nuttx/n5/apps/wasm/coremark.aot
LD:  nuttx

 2> Copy the generated wasm file(Interpreter/AoT)

nuttx$ cp ../apps/wasm/hello.aot .
nuttx$ cp ../apps/wasm/hello.wasm .
nuttx$ cp ../apps/wasm/coremark.wasm .

 3> Run iwasm

nuttx$ ./nuttx
NuttShell (NSH) NuttX-10.4.0
nsh> iwasm /data/hello.wasm
Hello, World!!
nsh> iwasm /data/hello.aot
Hello, World!!
nsh> iwasm /data/coremark.wasm
2K performance run parameters for coremark.
CoreMark Size: 666
Total ticks  : 12000
Total time (secs): 12.00
Iterations/Sec   : 5.00
Iterations   : 60
Compiler version : Clang 15.0.7
Compiler flags   : Using NuttX compilation options
Memory location  : Defined by the NuttX configuration
seedcrc  : 0xe9f5
[0]crclist   : 0xe714
[0]crcmatrix : 0x1fd7
[0]crcstate  : 0x8e3a
[0]crcfinal  : 0xa14c
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 5.00 / Clang 15.0.7 Using NuttX compilation options / 
Defined by the NuttX configuration

Signed-off-by: chao an 
---
 boards/sim/sim/sim/README.txt | 63 +
 boards/sim/sim/sim/configs/wamr/defconfig | 91 +++
 boards/sim/sim/sim/src/etc/init.d/rcS |  6 ++
 tools/ci/testlist/sim-01.dat  |  3 +
 4 files changed, 163 insertions(+)

diff --git a/boards/sim/sim/sim/README.txt b/boards/sim/sim/sim/README.txt
index c6e25de7b9..c6d84bddb6 100644
--- a/boards/sim/sim/sim/README.txt
+++ b/boards/sim/sim/sim/README.txt
@@ -1372,3 +1372,66 @@ vncserver
 vpnkit
 
   This is a configuration with VPNKit support.  See NETWORK-VPNKIT.txt.
+
+wamr
+
+  This is a configuration for WebAssembly sample.
+
+  1. Compile Toolchain
+
+   1> Download WASI sdk and export the WASI_SDK_PATH path:
+
+  $ wget 
https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz
+  $ tar xf wasi-sdk-19.0-linux.tar.gz
+  Put wasi-sdk-19.0 to your host WASI_SDK_PATH environment variable, like:
+  $ export WASI_SDK_PATH=`pwd`/wasi-sdk-19.0
+
+   2> Download Wamr "wamrc" AOT compiler and export to the PATH:
+
+  $ mkdir wamrc
+  $ wget 
https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
+  $ tar xf wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
+  $ export PATH=$PATH:$PWD
+
+  2. Configuring and running
+
+   1> Configuring sim/wamr and compile:
+
+  nuttx$ ./tools/configure.sh  sim/wamr
+  nuttx$ make
+  ...
+  Wamrc Generate AoT: /home/archer/code/nuttx/n5/apps/wasm/hello.aot
+  Wamrc Generate AoT: /home/archer/code/nuttx/n5/apps/wasm/coremark.aot
+  LD:  nuttx
+
+   2> Copy the generated wasm file(Interpreter/AoT)
+
+  nuttx$ cp ../apps/wasm/hello.aot .
+  nuttx$ cp ../apps/wasm/hello.wasm .
+  nuttx$ cp ../apps/wasm/coremark.wasm .
+
+   3> Run iwasm
+
+  nuttx$ ./nuttx
+  NuttShell (NSH) NuttX-10.4.0
+  nsh> iwasm /data/hello.wasm
+  Hello, World!!
+  nsh> iwasm /data/hello.aot
+  Hello, World!!
+  nsh> iwasm /data/coremark.wasm
+  2K performance run parameters for coremark.
+  CoreMark Size: 666
+  Total ticks  : 12000
+  Total time (secs): 12.00
+  Iterations/Sec   : 5.00
+  Iterations   : 60
+  Compiler version : Clang 15.0.7
+  C

[nuttx] branch master updated (d2d954f691 -> 92b2f1bd3d)

2023-03-02 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from d2d954f691 arm64: ARMv8-r(Cortex-R82) support( add FVP platform )
 add 92b2f1bd3d fs: Undefine CONFIG_FS_LARGEFILE if compiler doesn't 
support long long

No new revisions were added by this update.

Summary of changes:
 include/aio.h| 2 +-
 include/dirent.h | 2 +-
 include/fcntl.h  | 2 +-
 include/ftw.h| 2 +-
 include/inttypes.h   | 2 +-
 include/nuttx/compiler.h | 4 
 include/stdio.h  | 2 +-
 include/stdlib.h | 2 +-
 include/sys/mman.h   | 2 +-
 include/sys/resource.h   | 4 ++--
 include/sys/sendfile.h   | 2 +-
 include/sys/stat.h   | 2 +-
 include/sys/statfs.h | 2 +-
 include/sys/statvfs.h| 2 +-
 include/sys/types.h  | 4 ++--
 include/sys/uio.h| 2 +-
 include/unistd.h | 2 +-
 17 files changed, 22 insertions(+), 18 deletions(-)



[nuttx] branch master updated (05801f9fec -> 8c7fc2c175)

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 05801f9fec CI: Free space on worker building container
 new 4a405ca107 boards: spresense: Remove wrong build condition
 new b60fbefabe boards: spresense: Support using GPIO for power control
 new 5b3496fb7b boards: spresense: Add configuration for eMMC power control
 new 96da997b23 boards: spresense: Add board function for eMMC finalization
 new 56d43a4a1d boards: spresense: Add eMMC power-on wait time
 new 171f8a731c boards: spresense: Remove duplicate definitions
 new 9717f48a18 boards: spresense: Support eMMC late initialization
 new 1ce5dd948e boards: spresense: Add eMMC initialization into bringup 
function
 new 8c7fc2c175 boards: spresense: Add LCD support on LTE board

The 9 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 boards/arm/cxd56xx/common/src/cxd56_emmcdev.c  | 57 +-
 boards/arm/cxd56xx/spresense/Kconfig   | 31 +++-
 boards/arm/cxd56xx/spresense/include/board.h   | 24 +
 .../arm/cxd56xx/spresense/include/cxd56_emmcdev.h  |  1 +
 boards/arm/cxd56xx/spresense/include/cxd56_power.h | 18 ++-
 boards/arm/cxd56xx/spresense/src/Make.defs |  2 -
 boards/arm/cxd56xx/spresense/src/cxd56_bringup.c   | 10 
 boards/arm/cxd56xx/spresense/src/cxd56_power.c | 12 +
 8 files changed, 137 insertions(+), 18 deletions(-)



[nuttx] 04/09: boards: spresense: Add board function for eMMC finalization

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 96da997b234cd12d5c5391a8a1cd01710bf89386
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Mar 1 14:29:03 2023 +0900

boards: spresense: Add board function for eMMC finalization

- Un-mount the FAT filesystem for eMMC
- Un-initialize eMMC driver
- Turn off the eMMC device
---
 boards/arm/cxd56xx/common/src/cxd56_emmcdev.c  | 43 ++
 .../arm/cxd56xx/spresense/include/cxd56_emmcdev.h  |  1 +
 2 files changed, 44 insertions(+)

diff --git a/boards/arm/cxd56xx/common/src/cxd56_emmcdev.c 
b/boards/arm/cxd56xx/common/src/cxd56_emmcdev.c
index 03925c5b2a..28acb2fe97 100644
--- a/boards/arm/cxd56xx/common/src/cxd56_emmcdev.c
+++ b/boards/arm/cxd56xx/common/src/cxd56_emmcdev.c
@@ -24,6 +24,8 @@
 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -84,3 +86,44 @@ int board_emmc_initialize(void)
 
   return ret;
 }
+
+/
+ * Name: board_emmc_finalize
+ *
+ * Description:
+ *   Finalize the eMMC device and umount the file system.
+ *
+ /
+
+int board_emmc_finalize(void)
+{
+  int ret;
+
+  /* Un-mount the eMMC device */
+
+  ret = nx_umount2("/mnt/emmc", MNT_DETACH);
+  if (ret < 0)
+{
+  ferr("ERROR: Failed to umount the eMMC. %d\n", ret);
+  return ret;
+}
+
+  /* Uninitialize the eMMC device */
+
+  ret = cxd56_emmcuninitialize();
+  if (ret < 0)
+{
+  ferr("ERROR: Failed to uninitialize eMMC. %d\n", ret);
+  return ret;
+}
+
+  /* Power off the eMMC device */
+
+  ret = board_power_control(POWER_EMMC, false);
+  if (ret)
+{
+  ferr("ERROR: Failed to power off eMMC. %d\n", ret);
+}
+
+  return ret;
+}
diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_emmcdev.h 
b/boards/arm/cxd56xx/spresense/include/cxd56_emmcdev.h
index f0f24f1a2b..a5d3ebf311 100644
--- a/boards/arm/cxd56xx/spresense/include/cxd56_emmcdev.h
+++ b/boards/arm/cxd56xx/spresense/include/cxd56_emmcdev.h
@@ -60,6 +60,7 @@ extern "C"
 
 #ifdef CONFIG_CXD56_EMMC
 int board_emmc_initialize(void);
+int board_emmc_finalize(void);
 #endif
 
 #undef EXTERN



[nuttx] 01/09: boards: spresense: Remove wrong build condition

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 4a405ca1072f4698362d7184bc79287f9dcf246c
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Mar 1 14:27:44 2023 +0900

boards: spresense: Remove wrong build condition

Remove wrong build condition and always build cxd56_gpioif.c.
---
 boards/arm/cxd56xx/spresense/src/Make.defs | 2 --
 1 file changed, 2 deletions(-)

diff --git a/boards/arm/cxd56xx/spresense/src/Make.defs 
b/boards/arm/cxd56xx/spresense/src/Make.defs
index b13f155bd1..99c0281ab2 100644
--- a/boards/arm/cxd56xx/spresense/src/Make.defs
+++ b/boards/arm/cxd56xx/spresense/src/Make.defs
@@ -43,9 +43,7 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y)
 CSRCS += cxd56_buttons.c
 endif
 
-ifeq ($(CONFIG_CXD56_GPIO_IRQ),y)
 CSRCS += cxd56_gpioif.c
-endif
 
 ifeq ($(CONFIG_CXD56_PWM),y)
 CSRCS += cxd56_pwm.c



[nuttx] 07/09: boards: spresense: Support eMMC late initialization

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 9717f48a18e0eca9ddd20bcbfdcd3f6811e27bc0
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Mar 1 14:30:06 2023 +0900

boards: spresense: Support eMMC late initialization

Support eMMC late initialization to initialize eMMC from user application.
---
 boards/arm/cxd56xx/spresense/Kconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/boards/arm/cxd56xx/spresense/Kconfig 
b/boards/arm/cxd56xx/spresense/Kconfig
index 0e9e415470..ff2960348e 100644
--- a/boards/arm/cxd56xx/spresense/Kconfig
+++ b/boards/arm/cxd56xx/spresense/Kconfig
@@ -765,6 +765,14 @@ config CXD56_LTE_LATE_INITIALIZE
 
 endif # CXD56_LTE
 
+config CXD56_EMMC_LATE_INITIALIZE
+   bool "eMMC driver late initialize"
+   default n
+   depends on CXD56_EMMC
+   ---help---
+   eMMC driver can be initialized on an application code after 
system booted up
+   by enabling this configuration switch.
+
 config CXD56_BINARY
bool "spk binary format"
default n



[nuttx] 06/09: boards: spresense: Remove duplicate definitions

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 171f8a731c51a015ff550f7e0e8ba3b72690416c
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Mar 1 14:29:46 2023 +0900

boards: spresense: Remove duplicate definitions

Remove duplicate definitions are defined in board.h.
---
 boards/arm/cxd56xx/spresense/include/cxd56_power.h | 18 --
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_power.h 
b/boards/arm/cxd56xx/spresense/include/cxd56_power.h
index f34ca80dbb..ca3e49193f 100644
--- a/boards/arm/cxd56xx/spresense/include/cxd56_power.h
+++ b/boards/arm/cxd56xx/spresense/include/cxd56_power.h
@@ -29,20 +29,6 @@
 
 #include 
 
-/
- * Pre-processor Definitions
- /
-
-#define PMIC_NONE   (0)
-#define PMIC_TYPE_LSW   (1u << 8)
-#define PMIC_TYPE_GPO   (1u << 9)
-#define PMIC_TYPE_DDCLDO(1u << 10)
-#define PMIC_GET_TYPE(v)((v) & 0xff00)
-#define PMIC_GET_CH(v)  ((v) & 0x00ff)
-#define PMIC_LSW(n) (PMIC_TYPE_LSW | (1u << (n)))
-#define PMIC_GPO(n) (PMIC_TYPE_GPO | (1u << (n)))
-#define PMIC_DDCLDO(n)  (PMIC_TYPE_DDCLDO | (1u << (n)))
-
 /
  * Public Types
  /
@@ -62,6 +48,10 @@ extern "C"
 #define EXTERN extern
 #endif
 
+/
+ * Public Function Prototypes
+ /
+
 /
  * Name: board_pmic_read
  *



[nuttx] 05/09: boards: spresense: Add eMMC power-on wait time

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 56d43a4a1d258c5c9560564db6e14596df6fe6b6
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Mar 1 14:29:24 2023 +0900

boards: spresense: Add eMMC power-on wait time

Add 10msec wait time before eMMC device is powered on.
---
 boards/arm/cxd56xx/common/src/cxd56_emmcdev.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/boards/arm/cxd56xx/common/src/cxd56_emmcdev.c 
b/boards/arm/cxd56xx/common/src/cxd56_emmcdev.c
index 28acb2fe97..b808b7a27c 100644
--- a/boards/arm/cxd56xx/common/src/cxd56_emmcdev.c
+++ b/boards/arm/cxd56xx/common/src/cxd56_emmcdev.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "cxd56_emmc.h"
@@ -42,6 +43,10 @@
 #  define CONFIG_SFC_DEVNO 0
 #endif
 
+/* EMMC power-on time in ms */
+
+#define EMMC_POWER_ON_WAIT_MSEC 10
+
 /
  * Public Functions
  /
@@ -67,12 +72,19 @@ int board_emmc_initialize(void)
   return -ENODEV;
 }
 
+  if (POWER_EMMC != PMIC_NONE)
+{
+  /* Wait time until eMMC device is turned power on */
+
+  nxsig_usleep(EMMC_POWER_ON_WAIT_MSEC * USEC_PER_MSEC);
+}
+
   /* Initialize the eMMC device */
 
   ret = cxd56_emmcinitialize();
   if (ret < 0)
 {
-  ferr("ERROR: Failed to initialize eMMC. %d\n ", ret);
+  ferr("ERROR: Failed to initialize eMMC. %d\n", ret);
   return -ENODEV;
 }
 



[nuttx] 08/09: boards: spresense: Add eMMC initialization into bringup function

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 1ce5dd948e446e039deebdb704298698c9efc714
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Mar 1 14:30:28 2023 +0900

boards: spresense: Add eMMC initialization into bringup function

Add eMMC initialization into bringup function.
---
 boards/arm/cxd56xx/spresense/src/cxd56_bringup.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c 
b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
index 43b61ac0d1..2f2e02e799 100644
--- a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
+++ b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
@@ -440,6 +440,16 @@ int cxd56_bringup(void)
   board_automount_initialize();
 #endif
 
+#if defined(CONFIG_CXD56_EMMC) && !defined(CONFIG_CXD56_EMMC_LATE_INITIALIZE)
+  /* Mount the eMMC block driver */
+
+  ret = board_emmc_initialize();
+  if (ret < 0)
+{
+  _err("ERROR: Failed to initialize eMMC: %d\n", ret);
+}
+#endif
+
 #ifdef CONFIG_CPUFREQ_RELEASE_LOCK
   /* Enable dynamic clock control and CPU clock down for power saving */
 



[nuttx] 09/09: boards: spresense: Add LCD support on LTE board

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 8c7fc2c1755c64272fd89516503717b0b467ff32
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Mar 1 14:30:50 2023 +0900

boards: spresense: Add LCD support on LTE board

Add a configuration to use SPI3 on LTE extension board for LCD.
---
 boards/arm/cxd56xx/spresense/Kconfig |  8 +++-
 boards/arm/cxd56xx/spresense/include/board.h | 15 +++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/boards/arm/cxd56xx/spresense/Kconfig 
b/boards/arm/cxd56xx/spresense/Kconfig
index ff2960348e..dbb7c793e7 100644
--- a/boards/arm/cxd56xx/spresense/Kconfig
+++ b/boards/arm/cxd56xx/spresense/Kconfig
@@ -497,6 +497,12 @@ choice
prompt "LCD SPI connection"
default LCD_ON_EXTENSION_BOARD
 
+config LCD_ON_LTE_EXTENSION_BOARD
+   bool "LTE extension board: SPI3"
+   select CXD56_SPI3
+   ---help---
+   Display connected to LTE extension board.
+
 config LCD_ON_EXTENSION_BOARD
bool "Extension board: SPI4"
select CXD56_SPI4
@@ -609,7 +615,7 @@ endchoice
 
 endif
 
-if LCD_ON_EXTENSION_BOARD
+if LCD_ON_EXTENSION_BOARD || LCD_ON_LTE_EXTENSION_BOARD
 
 choice
prompt "LCD ILI934x RST Pin selection"
diff --git a/boards/arm/cxd56xx/spresense/include/board.h 
b/boards/arm/cxd56xx/spresense/include/board.h
index e19782e6fe..72e4e7e4bb 100644
--- a/boards/arm/cxd56xx/spresense/include/board.h
+++ b/boards/arm/cxd56xx/spresense/include/board.h
@@ -239,6 +239,21 @@ enum board_power_device
 #define DISPLAY_DMA_TX_MAXSIZE (192000)
 #define DISPLAY_DMA_RX_MAXSIZE (192000)
 
+#elif defined(CONFIG_LCD_ON_LTE_EXTENSION_BOARD)
+
+/* Display connected to LTE extension board. */
+
+#define DISPLAY_SPI 3
+
+/* Specify invalid channels because DMA cannot be used */
+
+#define DISPLAY_DMA_TXCH   (-1)
+#define DISPLAY_DMA_RXCH   (-1)
+#define DISPLAY_DMA_TXCH_CFG   (-1)
+#define DISPLAY_DMA_RXCH_CFG   (-1)
+#define DISPLAY_DMA_TX_MAXSIZE (192000)
+#define DISPLAY_DMA_RX_MAXSIZE (192000)
+
 #else /* Display is connected through extension board. */
 
 #define DISPLAY_SPI 4



[nuttx] 03/09: boards: spresense: Add configuration for eMMC power control

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 5b3496fb7be86a22b6dc54e0414d676987a89eca
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Mar 1 14:28:35 2023 +0900

boards: spresense: Add configuration for eMMC power control

Update Kconfig to add eMMC power pin selection.
---
 boards/arm/cxd56xx/spresense/Kconfig | 15 +++
 boards/arm/cxd56xx/spresense/include/board.h |  6 ++
 2 files changed, 21 insertions(+)

diff --git a/boards/arm/cxd56xx/spresense/Kconfig 
b/boards/arm/cxd56xx/spresense/Kconfig
index fc0fe123a1..0e9e415470 100644
--- a/boards/arm/cxd56xx/spresense/Kconfig
+++ b/boards/arm/cxd56xx/spresense/Kconfig
@@ -809,4 +809,19 @@ config CXD56_SDCARD_AUTOMOUNT_UDELAY
 
 endif # CXD56_SDCARD_AUTOMOUNT
 
+choice
+   prompt "eMMC Power Pin selection"
+   default CXD56_EMMC_POWER_PIN_NONE
+
+config CXD56_EMMC_POWER_PIN_NONE
+   bool "None"
+
+config CXD56_EMMC_POWER_PIN_I2S0_BCK
+   bool "Use PIN I2S0_BCK"
+
+config CXD56_EMMC_POWER_PIN_UART2_CTS
+   bool "Use PIN UART2_CTS"
+
+endchoice
+
 endif
diff --git a/boards/arm/cxd56xx/spresense/include/board.h 
b/boards/arm/cxd56xx/spresense/include/board.h
index aa385c46a0..e19782e6fe 100644
--- a/boards/arm/cxd56xx/spresense/include/board.h
+++ b/boards/arm/cxd56xx/spresense/include/board.h
@@ -201,7 +201,13 @@ enum board_power_device
 
   POWER_BTBLE   = PMIC_NONE,
   POWER_SENSOR  = PMIC_NONE,
+#if defined(CONFIG_CXD56_EMMC_POWER_PIN_I2S0_BCK)
+  POWER_EMMC= CHIP_GPIO(PIN_I2S0_BCK),
+#elif defined(CONFIG_CXD56_EMMC_POWER_PIN_UART2_CTS)
+  POWER_EMMC= CHIP_GPIO(PIN_UART2_CTS),
+#else
   POWER_EMMC= PMIC_NONE,
+#endif
   POWER_LTE = PMIC_GPO(2),
 };
 



[nuttx] 02/09: boards: spresense: Support using GPIO for power control

2023-03-01 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit b60fbefabecdfd4eb0aefdd68a62fd7995730089
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Wed Mar 1 14:28:13 2023 +0900

boards: spresense: Support using GPIO for power control

Introduce CHIP_TYPE_GPIO to allow GPIO to be used for power control.
---
 boards/arm/cxd56xx/spresense/include/board.h   |  3 +++
 boards/arm/cxd56xx/spresense/src/cxd56_power.c | 12 
 2 files changed, 15 insertions(+)

diff --git a/boards/arm/cxd56xx/spresense/include/board.h 
b/boards/arm/cxd56xx/spresense/include/board.h
index 53d3ec20e7..aa385c46a0 100644
--- a/boards/arm/cxd56xx/spresense/include/board.h
+++ b/boards/arm/cxd56xx/spresense/include/board.h
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "board_lcdpins.h"
 
@@ -166,11 +167,13 @@
 #define PMIC_TYPE_LSW   (1u << 8)
 #define PMIC_TYPE_GPO   (1u << 9)
 #define PMIC_TYPE_DDCLDO(1u << 10)
+#define CHIP_TYPE_GPIO  (1u << 11)
 #define PMIC_GET_TYPE(v)((v) & 0xff00)
 #define PMIC_GET_CH(v)  ((v) & 0x00ff)
 #define PMIC_LSW(n) (PMIC_TYPE_LSW | (1u << (n)))
 #define PMIC_GPO(n) (PMIC_TYPE_GPO | (1u << (n)))
 #define PMIC_DDCLDO(n)  (PMIC_TYPE_DDCLDO | (1u << (n)))
+#define CHIP_GPIO(n)(CHIP_TYPE_GPIO | (n))
 
 enum board_power_device
 {
diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_power.c 
b/boards/arm/cxd56xx/spresense/src/cxd56_power.c
index 32dafde225..3c596ceedd 100644
--- a/boards/arm/cxd56xx/spresense/src/cxd56_power.c
+++ b/boards/arm/cxd56xx/spresense/src/cxd56_power.c
@@ -200,6 +200,9 @@ int board_power_control(int target, bool en)
   pfunc = cxd56_pmic_set_ddc_ldo;
   break;
 #endif /* CONFIG_CXD56_PMIC */
+case CHIP_TYPE_GPIO:
+  board_gpio_write(PMIC_GET_CH(target), en ? 1 : 0);
+  break;
 default:
   break;
 }
@@ -253,6 +256,10 @@ int board_power_control_tristate(int target, int value)
   usleep(1);
 }
 }
+  else if (PMIC_GET_TYPE(target) == CHIP_TYPE_GPIO)
+{
+  board_gpio_write(PMIC_GET_CH(target), value);
+}
   else
 {
   en = value ? true : false;
@@ -274,6 +281,7 @@ bool board_power_monitor(int target)
 {
   bool ret = false;
   bool (*pfunc)(uint8_t chset) = NULL;
+  int  status;
 
   switch (PMIC_GET_TYPE(target))
 {
@@ -288,6 +296,10 @@ bool board_power_monitor(int target)
   pfunc = cxd56_pmic_get_ddc_ldo;
   break;
 #endif /* CONFIG_CXD56_PMIC */
+case CHIP_TYPE_GPIO:
+  status = board_gpio_read(PMIC_GET_CH(target));
+  ret = (status == 1);
+  break;
 default:
   break;
 }



[nuttx] branch master updated: Performance optimizations in connection allocations.

2023-02-28 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 5e625b9cdb Performance optimizations in connection allocations.
5e625b9cdb is described below

commit 5e625b9cdb347dabce36e9eefa287a335877a164
Author: Fotis Panagiotopoulos 
AuthorDate: Tue Feb 28 12:31:21 2023 +0200

Performance optimizations in connection allocations.
---
 net/bluetooth/bluetooth_conn.c   | 6 ++
 net/can/can_conn.c   | 5 +
 net/icmp/icmp_conn.c | 5 +
 net/icmpv6/icmpv6_conn.c | 6 ++
 net/ieee802154/ieee802154_conn.c | 5 +
 net/netlink/netlink_conn.c   | 5 +
 net/pkt/pkt_conn.c   | 5 +
 net/udp/udp_conn.c   | 5 +
 net/usrsock/usrsock_conn.c   | 2 +-
 9 files changed, 11 insertions(+), 33 deletions(-)

diff --git a/net/bluetooth/bluetooth_conn.c b/net/bluetooth/bluetooth_conn.c
index 9851710d9b..c0b11a5f9d 100644
--- a/net/bluetooth/bluetooth_conn.c
+++ b/net/bluetooth/bluetooth_conn.c
@@ -205,13 +205,10 @@ void bluetooth_conn_free(FAR struct bluetooth_conn_s 
*conn)
   bluetooth_container_free(container);
 }
 
-  /* Reset structure */
-
-  memset(conn, 0, sizeof(*conn));
-
   /* If this is a preallocated or a batch allocated connection store it in
* the free connections list. Else free it.
*/
+
 #if CONFIG_NET_BLUETOOTH_ALLOC_CONNS == 1
   if (conn < g_bluetooth_connections || conn >= (g_bluetooth_connections +
   CONFIG_NET_BLUETOOTH_PREALLOC_CONNS))
@@ -221,6 +218,7 @@ void bluetooth_conn_free(FAR struct bluetooth_conn_s *conn)
   else
 #endif
 {
+  memset(conn, 0, sizeof(*conn));
   dq_addlast(>bc_conn.node, _free_bluetooth_connections);
 }
 
diff --git a/net/can/can_conn.c b/net/can/can_conn.c
index 4310bc81bb..28f1a46001 100644
--- a/net/can/can_conn.c
+++ b/net/can/can_conn.c
@@ -182,10 +182,6 @@ void can_free(FAR struct can_conn_s *conn)
 
   dq_rem(>sconn.node, _active_can_connections);
 
-  /* Reset structure */
-
-  memset(conn, 0, sizeof(*conn));
-
   /* If this is a preallocated or a batch allocated connection store it in
* the free connections list. Else free it.
*/
@@ -199,6 +195,7 @@ void can_free(FAR struct can_conn_s *conn)
   else
 #endif
 {
+  memset(conn, 0, sizeof(*conn));
   dq_addlast(>sconn.node, _free_can_connections);
 }
 
diff --git a/net/icmp/icmp_conn.c b/net/icmp/icmp_conn.c
index 2ddcc6903d..a727ce7e1e 100644
--- a/net/icmp/icmp_conn.c
+++ b/net/icmp/icmp_conn.c
@@ -182,10 +182,6 @@ void icmp_free(FAR struct icmp_conn_s *conn)
 
   dq_rem(>sconn.node, _active_icmp_connections);
 
-  /* Clear the connection structure */
-
-  memset(conn, 0, sizeof(*conn));
-
   /* If this is a preallocated or a batch allocated connection store it
* in the free connections list. Else free it.
*/
@@ -199,6 +195,7 @@ void icmp_free(FAR struct icmp_conn_s *conn)
   else
 #endif
 {
+  memset(conn, 0, sizeof(*conn));
   dq_addlast(>sconn.node, _free_icmp_connections);
 }
 }
diff --git a/net/icmpv6/icmpv6_conn.c b/net/icmpv6/icmpv6_conn.c
index 4299fb62ac..ae5007a2b3 100644
--- a/net/icmpv6/icmpv6_conn.c
+++ b/net/icmpv6/icmpv6_conn.c
@@ -172,13 +172,10 @@ void icmpv6_free(FAR struct icmpv6_conn_s *conn)
 
   dq_rem(>sconn.node, _active_icmpv6_connections);
 
-  /* Clear the connection structure */
-
-  memset(conn, 0, sizeof(*conn));
-
   /* If this is a preallocated or a batch allocated connection store it in
* the free connections list. Else free it.
*/
+
 #if CONFIG_NET_ICMPv6_ALLOC_CONNS == 1
   if (conn < g_icmpv6_connections || conn >= (g_icmpv6_connections +
   CONFIG_NET_ICMPv6_PREALLOC_CONNS))
@@ -188,6 +185,7 @@ void icmpv6_free(FAR struct icmpv6_conn_s *conn)
   else
 #endif
 {
+  memset(conn, 0, sizeof(*conn));
   dq_addlast(>sconn.node, _free_icmpv6_connections);
 }
 
diff --git a/net/ieee802154/ieee802154_conn.c b/net/ieee802154/ieee802154_conn.c
index a6133a100f..b7a5e25f81 100644
--- a/net/ieee802154/ieee802154_conn.c
+++ b/net/ieee802154/ieee802154_conn.c
@@ -194,10 +194,6 @@ void ieee802154_conn_free(FAR struct ieee802154_conn_s 
*conn)
   ieee802154_container_free(container);
 }
 
-  /* Enqueue the connection into the active list */
-
-  memset(conn, 0, sizeof(*conn));
-
   /* If this is a preallocated or a batch allocated connection store it in
* the free connections list. Else free it.
*/
@@ -211,6 +207,7 @@ void ieee802154_conn_free(FAR struct ieee802154_conn_s 
*conn)
   else
 #endif
 {
+  memset(conn, 0, sizeof(*conn));
   dq_addlast(>sconn.node, _free_ieee802154_connections);
 }
 
diff --git a/net/netlink/netlink_conn.c b/net/netlink/netlink_conn.c
index 443e004b0b..c31eeaccc9 100644
--

[nuttx-apps] branch master updated: add "hello_nim" example application written by Nim.

2023-02-27 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
 new c785e3218 add "hello_nim" example application written by Nim.
c785e3218 is described below

commit c785e3218331b9dd3c529eda74c69b94d8a91062
Author: Takeyoshi Kikuchi 
AuthorDate: Sat Feb 25 18:58:43 2023 +0900

add "hello_nim" example application written by Nim.

Signed-off-by: Takeyoshi Kikuchi 
---
 config.nims| 126 +
 examples/hello_nim/.gitignore  |   2 +
 examples/hello_nim/Kconfig |  29 
 examples/hello_nim/Make.defs   |  23 ++
 examples/hello_nim/Makefile|  50 +
 examples/hello_nim/hello_nim_async.nim |  18 +
 examples/hello_nim/hello_nim_main.c|  41 +++
 7 files changed, 289 insertions(+)

diff --git a/config.nims b/config.nims
new file mode 100644
index 0..0d6c4c74c
--- /dev/null
+++ b/config.nims
@@ -0,0 +1,126 @@
+
+# apps/config.nims
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+
+import std/os
+import std/strutils
+
+switch "os", "nuttx"
+switch "mm", "orc"
+
+switch "arm.nuttx.gcc.exe", "arm-none-eabi-gcc"
+switch "arm64.nuttx.gcc.exe", "aarch64-none-elf-gcc"
+switch "riscv32.nuttx.gcc.exe", "riscv64-unknown-elf-gcc"
+switch "amd64.nuttx.gcc.exe", "x86_64-linux-gnu-gcc"
+
+switch "nimcache", ".nimcache"
+switch "d", "useStdLib"
+switch "d", "useMalloc"
+switch "d", "nimAllocPagesViaMalloc"
+switch "d", "noSignalHandler"
+switch "threads", "off"
+switch "noMain", "on"
+switch "compileOnly", "on"
+switch "noLinking", "on"
+# TODO: need OpenSSL-mbedTLS wrapper library.
+#switch "d", "ssl"
+#swich "dynlibOverride", "ssl"
+
+type
+  OptFlag = enum
+oNone
+oSize
+  DotConfig = object
+arch: string
+opt: OptFlag
+debugSymbols: bool
+ramSize: int
+isSim: bool
+
+proc killoBytes(bytes: int): int =
+  result = (bytes / 1024).int
+
+proc read_config(cfg: string): DotConfig =
+  for line in cfg.readFile.splitLines:
+if not line.startsWith("CONFIG_"):
+  continue
+let keyval = line.replace("CONFIG_", "").split("=")
+if keyval.len != 2:
+  continue
+case keyval[0]
+of "ARCH":
+  let arch = keyval[1].strip(chars = {'"'})
+  case arch
+  of "arm", "arm64":
+result.arch = arch
+  of "riscv":
+result.arch = "riscv32"
+  of "sim":
+if defined(amd64):
+  result.arch = "amd64"
+elif defined(aarch64):
+  result.arch = "arm64"
+result.isSim = true
+of "DEBUG_NOOPT":
+  result.opt = oNone
+of "DEBUG_FULLOPT":
+  result.opt = oSize
+of "DEBUG_SYMBOLS":
+  result.debugSymbols = true
+of "RAM_SIZE":
+  result.ramSize = keyval[1].parseInt
+  echo "* arch:" & result.arch
+  echo "* opt: " & $result.opt
+  echo "* debug:   " & $result.debugSymbols
+  echo "* ramSize: " & $result.ramSize
+
+func bool2onoff(b: bool): string =
+  result = if b: "on" else: "off"
+
+proc setup_cfg(cfg: DotConfig) =
+  switch("cpu", cfg.arch)
+  if cfg.opt == oSize:
+switch("define", "release")
+switch("define", "danger")
+switch("opt", "size")
+  if cfg.debugSymbols:
+# use nativ

[nuttx] branch master updated: socket: divide errno & s_error

2023-02-23 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new c4ed55c6df socket: divide errno & s_error
c4ed55c6df is described below

commit c4ed55c6df9659145f1f2a52aa94edf23cb33eef
Author: ligd 
AuthorDate: Tue Feb 14 13:32:41 2023 +0800

socket: divide errno & s_error

Reference:
https: //man7.org/linux/man-pages/man2/connect.2.html

Signed-off-by: ligd 
---
 net/socket/accept.c   | 2 +-
 net/socket/bind.c | 6 +++---
 net/socket/connect.c  | 2 +-
 net/socket/getpeername.c  | 6 +++---
 net/socket/getsockname.c  | 6 +++---
 net/socket/getsockopt.c   | 4 ++--
 net/socket/listen.c   | 6 +++---
 net/socket/net_sendfile.c | 5 -
 net/socket/recvfrom.c | 2 +-
 net/socket/recvmsg.c  | 2 +-
 net/socket/send.c | 2 +-
 net/socket/sendmsg.c  | 2 +-
 net/socket/sendto.c   | 2 +-
 net/socket/shutdown.c | 2 +-
 net/socket/socket.h   | 9 ++---
 net/tcp/tcp_netpoll.c | 5 -
 16 files changed, 28 insertions(+), 35 deletions(-)

diff --git a/net/socket/accept.c b/net/socket/accept.c
index 5a55e04165..ba79296447 100644
--- a/net/socket/accept.c
+++ b/net/socket/accept.c
@@ -313,6 +313,6 @@ errout_with_alloc:
 errout:
   leave_cancellation_point();
 
-  _SO_SETERRNO(psock, errcode);
+  set_errno(errcode);
   return ERROR;
 }
diff --git a/net/socket/bind.c b/net/socket/bind.c
index a638beaa2a..08e6c90ba9 100644
--- a/net/socket/bind.c
+++ b/net/socket/bind.c
@@ -152,11 +152,11 @@ int bind(int sockfd, const struct sockaddr *addr, 
socklen_t addrlen)
 
   if (ret < 0)
 {
-  _SO_SETERRNO(psock, -ret);
-  return ERROR;
+  set_errno(-ret);
+  ret = ERROR;
 }
 
-  return OK;
+  return ret;
 }
 
 #endif /* CONFIG_NET */
diff --git a/net/socket/connect.c b/net/socket/connect.c
index 5813a555be..99266a173d 100644
--- a/net/socket/connect.c
+++ b/net/socket/connect.c
@@ -237,7 +237,7 @@ int connect(int sockfd, FAR const struct sockaddr *addr, 
socklen_t addrlen)
 
   if (ret < 0)
 {
-  _SO_SETERRNO(psock, -ret);
+  set_errno(-ret);
   ret = ERROR;
 }
 
diff --git a/net/socket/getpeername.c b/net/socket/getpeername.c
index ec29dbbbea..b86a746ae7 100644
--- a/net/socket/getpeername.c
+++ b/net/socket/getpeername.c
@@ -161,11 +161,11 @@ int getpeername(int sockfd, FAR struct sockaddr *addr,
 
   if (ret < 0)
 {
-  _SO_SETERRNO(psock, -ret);
-  return ERROR;
+  set_errno(-ret);
+  ret = ERROR;
 }
 
-  return OK;
+  return ret;
 }
 
 #endif /* CONFIG_NET */
diff --git a/net/socket/getsockname.c b/net/socket/getsockname.c
index b7a4e417b9..a2ce0152ad 100644
--- a/net/socket/getsockname.c
+++ b/net/socket/getsockname.c
@@ -155,11 +155,11 @@ int getsockname(int sockfd, FAR struct sockaddr *addr,
 
   if (ret < 0)
 {
-  _SO_SETERRNO(psock, -ret);
-  return ERROR;
+  set_errno(-ret);
+  ret = ERROR;
 }
 
-  return OK;
+  return ret;
 }
 
 #endif /* CONFIG_NET */
diff --git a/net/socket/getsockopt.c b/net/socket/getsockopt.c
index 8eceed0e91..fc38a9a9f5 100644
--- a/net/socket/getsockopt.c
+++ b/net/socket/getsockopt.c
@@ -362,10 +362,10 @@ int getsockopt(int sockfd, int level, int option,
   if (ret < 0)
 {
   set_errno(-ret);
-  return ERROR;
+  ret = ERROR;
 }
 
-  return OK;
+  return ret;
 }
 
 #endif /* CONFIG_NET && CONFIG_NET_SOCKOPTS */
diff --git a/net/socket/listen.c b/net/socket/listen.c
index 4ab2bc505c..4e11b0743e 100644
--- a/net/socket/listen.c
+++ b/net/socket/listen.c
@@ -150,9 +150,9 @@ int listen(int sockfd, int backlog)
 
   if (ret < 0)
 {
-  _SO_SETERRNO(psock, -ret);
-  return ERROR;
+  set_errno(-ret);
+  ret = ERROR;
 }
 
-  return OK;
+  return ret;
 }
diff --git a/net/socket/net_sendfile.c b/net/socket/net_sendfile.c
index e9ef41eb78..441dc0d8c3 100644
--- a/net/socket/net_sendfile.c
+++ b/net/socket/net_sendfile.c
@@ -131,11 +131,6 @@ ssize_t psock_sendfile(FAR struct socket *psock, FAR 
struct file *infile,
   ret = psock->s_sockif->si_sendfile(psock, infile, offset, count);
 }
 
-  if (ret < 0)
-{
-  _SO_SETERRNO(psock, -ret);
-}
-
   return ret;
 }
 
diff --git a/net/socket/recvfrom.c b/net/socket/recvfrom.c
index 11ee35b0b2..5d03866943 100644
--- a/net/socket/recvfrom.c
+++ b/net/socket/recvfrom.c
@@ -170,7 +170,7 @@ ssize_t recvfrom(int sockfd, FAR void *buf, size_t len, int 
flags,
 
   if (ret < 0)
 {
-  _SO_SETERRNO(psock, -ret);
+  set_errno(-ret);
   ret = ERROR;
 }
 
diff --git a/net/socket/recvmsg.c b/net/socket/recvmsg.c
index bf99f731f3..877f6f80ea 100644
--- a/net/socket/recvmsg.c
+++ b/net/socket/recvmsg.c
@@ -168,7 +168,7 @@ ssize_t recvmsg(int sockfd, FAR struct msghdr *msg, int 
flags)
 
   if (r

[nuttx] branch master updated: limits.h: Map _POSIX_[S]SIZE_M[AX|IN] to [U]LONG_M[AX|IN]

2023-02-15 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 6920fffb00 limits.h: Map _POSIX_[S]SIZE_M[AX|IN] to [U]LONG_M[AX|IN]
6920fffb00 is described below

commit 6920fffb00f7206c8d7344a596a455c3913470b0
Author: Xiang Xiao 
AuthorDate: Mon Feb 13 16:33:44 2023 +0800

limits.h: Map _POSIX_[S]SIZE_M[AX|IN] to [U]LONG_M[AX|IN]

correct SIZE_MAX and SSIZE_MAX/SSIZE_MIN definition

Signed-off-by: Xiang Xiao 
---
 include/limits.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/limits.h b/include/limits.h
index 98b7dc724e..b4502fa8bd 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -136,11 +136,11 @@
 
 #else /* CONFIG_SMALL_MEMORY */
 
-#define _POSIX_SIZE_MAX   4294967295UL /* See sys/types.h */
+#define _POSIX_SIZE_MAX   ULONG_MAX
 #define _POSIX_SIZE_MIN   0
 
-#define _POSIX_SSIZE_MAX  2147483647L  /* See sys/types.h */
-#define _POSIX_SSIZE_MIN  -2147483648L
+#define _POSIX_SSIZE_MAX  LONG_MAX
+#define _POSIX_SSIZE_MIN  LONG_MIN
 
 #endif /* CONFIG_SMALL_MEMORY */
 



[nuttx] branch master updated: Adding myself to AUTHORS

2023-02-15 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 2092e9a9ca Adding myself to AUTHORS
2092e9a9ca is described below

commit 2092e9a9cac7b6ceb6609280316281035aaebb76
Author: Nathan Hartman <59230071+hartmannat...@users.noreply.github.com>
AuthorDate: Tue Feb 14 19:34:01 2023 -0500

Adding myself to AUTHORS
---
 AUTHORS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/AUTHORS b/AUTHORS
index 724ef37d0e..a1c9be8a6c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -59,6 +59,7 @@ Michael Jung
 Michal Lyszczek
 Miguel Ángel Herranz Trillo (Miguel Herranz)
 Mihai Serban
+Nathan Hartman
 Neil Hancock
 Nicholas Elliot Chin (Nicholas Chin)
 Oki Minabe



[nuttx] branch master updated: Added myself in AUTHORS file.

2023-02-14 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 4d341ed152 Added myself in AUTHORS file.
4d341ed152 is described below

commit 4d341ed15251f0596edaf5e81d4fd3de175b6c68
Author: Fotis Panagiotopoulos 
AuthorDate: Tue Feb 14 13:24:36 2023 +0200

Added myself in AUTHORS file.
---
 AUTHORS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/AUTHORS b/AUTHORS
index f0cb2362a1..724ef37d0e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -20,6 +20,7 @@ Daniel P. Carvalho
 David S. Alessio
 David Sidrane
 Dong Heng
+Fotis Panagiotopoulos
 Giorgio Groß
 Goden Freemans
 Guiding Li



[nuttx] branch master updated: libc: Move memfd related stuff to sys/mman.h

2023-02-13 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new dc2e9b8771 libc: Move memfd related stuff to sys/mman.h
dc2e9b8771 is described below

commit dc2e9b877144527c7f7723b2eb982f1856631de5
Author: Xiang Xiao 
AuthorDate: Mon Feb 13 06:42:04 2023 +0800

libc: Move memfd related stuff to sys/mman.h

follow the freebsd definition:
https://github.com/freebsd/freebsd-src/blob/master/sys/sys/mman.h#L207-L228

Signed-off-by: Xiang Xiao 
---
 include/sys/memfd.h| 72 --
 include/sys/mman.h | 22 ++
 libs/libc/misc/lib_memfd.c |  3 +-
 3 files changed, 24 insertions(+), 73 deletions(-)

diff --git a/include/sys/memfd.h b/include/sys/memfd.h
deleted file mode 100644
index 7bd244bf9e..00
--- a/include/sys/memfd.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/
- * include/sys/memfd.h
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.  The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- /
-
-#ifndef __INCLUDE_SYS_MEMFD_H
-#define __INCLUDE_SYS_MEMFD_H
-
-/
- * Included Files
- /
-
-#include 
-
-/
- * Pre-processor Definitions
- /
-
-#define MFD_CLOEXEC   O_CLOEXEC
-#define MFD_ALLOW_SEALING (1 << 16)
-#define MFD_HUGETLB   (1 << 17)
-
-#define MFD_HUGE_SHIFT   26
-#define MFD_HUGE_MASK0x3f
-#define MFD_HUGE_64KB(16 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_512KB   (19 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_1MB (20 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_2MB (21 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_8MB (23 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_16MB(24 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_32MB(25 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_256MB   (28 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_512MB   (29 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_1GB (30 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_2GB (31 << MFD_HUGE_SHIFT)
-#define MFD_HUGE_16GB(34 << MFD_HUGE_SHIFT)
-
-/
- * Public Function Prototypes
- /
-
-#ifdef __cplusplus
-#define EXTERN extern "C"
-extern "C"
-{
-#else
-#define EXTERN extern
-#endif
-
-int memfd_create(FAR const char *name, unsigned int flags);
-
-#undef EXTERN
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __INCLUDE_SYS_MEMFD_H */
diff --git a/include/sys/mman.h b/include/sys/mman.h
index b4a154a93a..3bcdd907b4 100644
--- a/include/sys/mman.h
+++ b/include/sys/mman.h
@@ -128,6 +128,27 @@
 #define POSIX_TYPED_MEM_ALLOCATE_CONTIG  (1)
 #define POSIX_TYPED_MEM_MAP_ALLOCATABLE  (2)
 
+/* Flags for memfd_create(). */
+
+#define MFD_CLOEXEC   O_CLOEXEC
+#define MFD_ALLOW_SEALING (1 << 16)
+#define MFD_HUGETLB   (1 << 17)
+
+#define MFD_HUGE_SHIFT26
+#define MFD_HUGE_MASK 0x3f
+#define MFD_HUGE_64KB (16 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_512KB(19 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_1MB  (20 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_2MB  (21 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_8MB  (23 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_16MB (24 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_32MB (25 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_256MB(28 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_512MB(29 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_1GB  (30 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_2GB  (31 << MFD_HUGE_SHIFT)
+#define MFD_HUGE_16GB (34 << MFD_HUGE_SHIFT)
+
 #if defined(CONFIG_FS_LARG

[nuttx] branch master updated: net/udp: Support binding to same addr/port if SO_REUSEADDR is specified.

2023-02-10 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new aad1a70bc5 net/udp: Support binding to same addr/port if SO_REUSEADDR 
is specified.
aad1a70bc5 is described below

commit aad1a70bc5b42df1283fce6bedb422ff8fcd9fb4
Author: Zhe Weng 
AuthorDate: Thu Feb 2 11:24:46 2023 +0800

net/udp: Support binding to same addr/port if SO_REUSEADDR is specified.

Ref: On Linux, if SO_REUSEADDR(sk_reuse) is set for both sockets, port will 
not be regarded as inuse. 
https://github.com/torvalds/linux/blob/v6.1/net/ipv4/udp.c#L146

Signed-off-by: Zhe Weng 
---
 net/udp/udp_conn.c | 36 
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/net/udp/udp_conn.c b/net/udp/udp_conn.c
index 3e39d82ed5..9051bb23c6 100644
--- a/net/udp/udp_conn.c
+++ b/net/udp/udp_conn.c
@@ -64,9 +64,10 @@
 #include 
 
 #include "devif/devif.h"
+#include "inet/inet.h"
 #include "nat/nat.h"
 #include "netdev/netdev.h"
-#include "inet/inet.h"
+#include "socket/socket.h"
 #include "udp/udp.h"
 
 /
@@ -98,6 +99,13 @@ static dq_queue_t g_active_udp_connections;
  * Description:
  *   Find the UDP connection that uses this local port number.
  *
+ * Input Parameters:
+ *   domain - IP domain (PF_INET or PF_INET6)
+ *   ipaddr - The IP address to use in the lookup
+ *   portno - The port to use in the lookup
+ *   opt- The option from another conn to match the conflict conn
+ *  SO_REUSEADDR: If both sockets have this, they never confilct.
+ *
  * Assumptions:
  *   This function must be called with the network locked.
  *
@@ -105,14 +113,28 @@ static dq_queue_t g_active_udp_connections;
 
 static FAR struct udp_conn_s *udp_find_conn(uint8_t domain,
 FAR union ip_binding_u *ipaddr,
-uint16_t portno)
+uint16_t portno, sockopt_t opt)
 {
   FAR struct udp_conn_s *conn = NULL;
+#ifdef CONFIG_NET_SOCKOPTS
+  bool skip_reusable = _SO_GETOPT(opt, SO_REUSEADDR);
+#endif
 
   /* Now search each connection structure. */
 
   while ((conn = udp_nextconn(conn)) != NULL)
 {
+  /* With SO_REUSEADDR set for both sockets, we do not need to check its
+   * address and port.
+   */
+
+#ifdef CONFIG_NET_SOCKOPTS
+  if (skip_reusable && _SO_GETOPT(conn->sconn.s_options, SO_REUSEADDR))
+{
+  continue;
+}
+#endif
+
   /* If the port local port number assigned to the connections matches
* AND the IP address of the connection matches, then return a
* reference to the connection structure.  INADDR_ANY is a special
@@ -534,7 +556,7 @@ uint16_t udp_select_port(uint8_t domain, FAR union 
ip_binding_u *u)
   g_last_udp_port = 4096;
 }
 }
-  while (udp_find_conn(domain, u, HTONS(g_last_udp_port)) != NULL
+  while (udp_find_conn(domain, u, HTONS(g_last_udp_port), 0) != NULL
 #if defined(CONFIG_NET_NAT) && defined(CONFIG_NET_IPv4)
  || (domain == PF_INET &&
  ipv4_nat_port_inuse(IP_PROTO_UDP, u->ipv4.laddr,
@@ -823,7 +845,13 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct 
sockaddr *addr)
* and port ?
*/
 
-  if (udp_find_conn(conn->domain, >u, portno) == NULL
+  if (udp_find_conn(conn->domain, >u, portno,
+#ifdef CONFIG_NET_SOCKOPTS
+conn->sconn.s_options
+#else
+0
+#endif
+   ) == NULL
 #if defined(CONFIG_NET_NAT) && defined(CONFIG_NET_IPv4)
   && !(conn->domain == PF_INET &&
ipv4_nat_port_inuse(IP_PROTO_UDP, conn->u.ipv4.laddr,



[nuttx] branch master updated (916fa4d759 -> 3f3e090716)

2023-02-09 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 916fa4d759 boards/sim: Enable CONFIG_SIM_M32 in nimble
 add 3f3e090716 Revert "include/sys/socket.h: Add SOCK_CTRL to socket type"

No new revisions were added by this update.

Summary of changes:
 include/nuttx/net/netconfig.h  | 44 +++---
 include/sys/socket.h   |  4 
 net/bluetooth/bluetooth_sockif.c   |  2 +-
 net/can/can_sockif.c   |  3 +--
 net/icmp/icmp_sockif.c |  5 ++---
 net/icmpv6/icmpv6_sockif.c |  5 ++---
 net/ieee802154/ieee802154_sockif.c |  2 +-
 net/inet/inet_sockif.c | 30 ++
 net/local/local_sockif.c   | 21 --
 net/netlink/netlink_sockif.c   |  3 +--
 net/pkt/pkt_sockif.c   |  2 +-
 11 files changed, 47 insertions(+), 74 deletions(-)



[nuttx] branch master updated: libc: Define _assert/__assert to avoid 3rd libary redefine them

2023-02-06 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 65a04c66a2 libc: Define _assert/__assert to avoid 3rd libary redefine 
them
65a04c66a2 is described below

commit 65a04c66a25c6ee4746123d1993424e33b3b36b5
Author: Xiang Xiao 
AuthorDate: Mon Feb 6 02:43:39 2023 +0800

libc: Define _assert/__assert to avoid 3rd libary redefine them

Signed-off-by: Xiang Xiao 
---
 include/assert.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/include/assert.h b/include/assert.h
index 2099157cb3..c72a3b998b 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -78,6 +78,11 @@
 #  define assert(f) ASSERT(f)
 #endif
 
+/* Suppress 3rd party library redefine _assert/__assert */
+
+#define _assert _assert
+#define __assert __assert
+
 /* Definition required for C11 compile-time assertion checking.  The
  * static_assert macro simply expands to the _Static_assert keyword.
  */



[nuttx] branch master updated: Remove OK macro from the code base

2023-02-02 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new df102d1f06 Remove OK macro from the code base
df102d1f06 is described below

commit df102d1f0658345d78ea351403734bac5dbfff58
Author: Xiang Xiao 
AuthorDate: Wed Feb 1 05:56:08 2023 +0800

Remove OK macro from the code base

let's use OK from sys/types.h instead

Signed-off-by: Xiang Xiao 
---
 arch/arm/src/armv7-a/arm_l2cc_pl310.c | 6 --
 arch/arm/src/armv7-r/arm_l2cc_pl310.c | 6 --
 arch/arm/src/s32k1xx/s32k1xx_clockconfig.c| 6 --
 arch/arm/src/samd2l2/sam_lowputc.c| 4 
 arch/arm/src/samd5e5/sam_lowputc.c| 4 
 arch/risc-v/src/mpfs/mpfs_corepwm.c   | 4 
 arch/risc-v/src/mpfs/mpfs_ethernet.c  | 4 
 boards/arm/a1x/pcduino-a10/src/a1x_appinit.c  | 5 +
 boards/arm/am335x/beaglebone-black/src/am335x_appinit.c   | 5 +
 boards/arm/cxd56xx/spresense/src/cxd56_appinit.c  | 5 +
 boards/arm/dm320/ntosd-dm320/src/dm320_appinit.c  | 5 +
 boards/arm/kinetis/freedom-k28f/src/k28_appinit.c | 4 
 boards/arm/kinetis/freedom-k64f/src/k64_uid.c | 5 +
 boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_appinit.c | 5 +
 boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_appinit.c | 5 +
 boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_appinit.c | 5 +
 boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_appinit.c| 5 +
 boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_appinit.c   | 5 +
 boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_appinit.c  | 5 +
 boards/arm/rp2040/pimoroni-tiny2040/src/rp2040_appinit.c  | 6 ++
 boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_appinit.c | 6 ++
 boards/arm/rp2040/raspberrypi-pico/src/rp2040_appinit.c   | 6 ++
 boards/arm/rp2040/waveshare-rp2040-lcd-1.28/src/rp2040_appinit.c  | 6 ++
 boards/arm/s32k1xx/rddrone-bms772/src/s32k1xx_appinit.c   | 5 +
 boards/arm/s32k1xx/s32k118evb/src/s32k1xx_appinit.c   | 5 +
 boards/arm/s32k1xx/s32k144evb/src/s32k1xx_appinit.c   | 5 +
 boards/arm/s32k1xx/s32k146evb/src/s32k1xx_appinit.c   | 5 +
 boards/arm/s32k1xx/s32k148evb/src/s32k1xx_appinit.c   | 5 +
 boards/arm/s32k1xx/ucans32k146/src/s32k1xx_appinit.c  | 5 +
 boards/arm/sam34/arduino-due/src/sam_appinit.c| 5 +
 boards/arm/sam34/flipnclick-sam3x/src/sam_appinit.c   | 5 +
 boards/arm/sam34/sam3u-ek/src/sam_mmcsd.c | 5 +
 boards/arm/samd5e5/metro-m4/src/sam_appinit.c | 5 +
 boards/arm/samd5e5/same54-xplained-pro/src/sam_appinit.c  | 5 +
 boards/arm/stm32/axoloti/src/stm32_appinit.c  | 5 +
 boards/arm/stm32/b-g431b-esc1/src/stm32_appinit.c | 5 +
 boards/arm/stm32/nucleo-f103rb/src/stm32_appinit.c| 5 +
 boards/arm/stm32/nucleo-f207zg/src/stm32_appinitialize.c  | 5 +
 boards/arm/stm32/nucleo-f302r8/src/stm32_appinit.c| 5 +
 boards/arm/stm32/nucleo-f303re/src/stm32_uid.c| 5 +
 boards/arm/stm32/nucleo-f303ze/src/stm32_appinitialize.c  | 5 +
 boards/arm/stm32/nucleo-f410rb/src/stm32_appinit.c| 5 +
 boards/arm/stm32/nucleo-f446re/src/stm32_appinit.c| 5 +
 boards/arm/stm32/nucleo-f4x1re/src/stm32_appinit.c| 5 +
 boards/arm/stm32/nucleo-g431kb/src/stm32_appinit.c| 5 +
 boards/arm/stm32/nucleo-g431rb/src/stm32_appinit.c| 5 +
 boards/arm/stm32/olimex-stm32-e407/src/stm32_appinit.c| 5 +
 boards/arm/stm32/omnibusf4/src/stm32_appinit.c| 5 +
 boards/arm/stm32/omnibusf4/src/stm32_uid.c| 5 +
 boards/arm/stm32/stm3210e-eval/src/stm32_appinit.c| 5 +
 boards/arm/stm32/stm3240g-eval/src/stm32_appinit.c| 5 +
 boards/arm/stm32/stm32f3discovery/src/stm32_appinit.c | 5 +
 boards/arm/stm32/stm32f4discovery/src/stm32_appinit.c | 5 +
 boards/arm/stm32/stm32f4discovery/src/stm32_uid.c | 5 +
 boards/arm/stm32/stm32vldiscovery/src/stm32_appinit.c | 5 +
 boards/arm/stm32/viewtool-stm32f107/src/stm32_appinit.c   | 5 +
 boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_appinit.c  | 4 
 boards/arm/stm32h7/nucleo-h743zi/src

[nuttx-apps] branch master updated: testint/irtest: Remove ERROR macro

2023-02-02 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
 new 8cfcd274b testint/irtest: Remove ERROR macro
8cfcd274b is described below

commit 8cfcd274b2deff4217c123afb4102e1ac4f382c6
Author: Xiang Xiao 
AuthorDate: Wed Feb 1 07:53:51 2023 +0800

testint/irtest: Remove ERROR macro

Signed-off-by: Xiang Xiao 
---
 testing/irtest/cmd.cxx | 2 --
 1 file changed, 2 deletions(-)

diff --git a/testing/irtest/cmd.cxx b/testing/irtest/cmd.cxx
index c52cb4ff2..44d07f39f 100644
--- a/testing/irtest/cmd.cxx
+++ b/testing/irtest/cmd.cxx
@@ -37,8 +37,6 @@
  * Pre-processor Definitions
  /
 
-#define ERROR -1
-
 /
  * Private Data
  /



[nuttx] branch master updated: drivers/mmcsd: Fix kconfig error regarding MMCSD_IOCSUPPORT

2023-01-31 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new da83836da7 drivers/mmcsd: Fix kconfig error regarding MMCSD_IOCSUPPORT
da83836da7 is described below

commit da83836da79162e2a7c2426ea9a2ddfcd8fdeb92
Author: Ville Juven 
AuthorDate: Tue Jan 31 12:54:55 2023 +0200

drivers/mmcsd: Fix kconfig error regarding MMCSD_IOCSUPPORT

Something I noticed in CI:
drivers/mmcsd/Kconfig:32:warning: 'MMCSD_IOCSUPPORT': number is invalid
---
 drivers/mmcsd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmcsd/Kconfig b/drivers/mmcsd/Kconfig
index 6511a0c40b..4f8e2ff9c5 100644
--- a/drivers/mmcsd/Kconfig
+++ b/drivers/mmcsd/Kconfig
@@ -28,7 +28,7 @@ menuconfig MMCSD
 if MMCSD
 
 config MMCSD_IOCSUPPORT
-   int "Enable MMC/SD ioctl support"
+   bool "Enable MMC/SD ioctl support"
default y
---help---
Disable it to save some code size if required.



[nuttx] branch master updated (372fee9412 -> 55679aec5f)

2023-01-30 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 372fee9412 Added SocketCAN driver implementation to the tiva chip, 
modified the EK-TC1294XL launchpad board to use the new SocketCAN API
 add 55679aec5f drivers/camera: Support the private data for imgsensor and 
imgdata

No new revisions were added by this update.

Summary of changes:
 arch/arm/src/cxd56xx/cxd56_cisif.c | 131 ---
 arch/sim/src/sim/sim_video.c   | 209 +-
 drivers/video/isx012.c | 139 +++
 drivers/video/isx019.c | 766 -
 drivers/video/video.c  | 213 ---
 include/nuttx/video/imgdata.h  |  45 ++-
 include/nuttx/video/imgsensor.h|  75 +++-
 7 files changed, 857 insertions(+), 721 deletions(-)



[nuttx] branch master updated: watchdog:fix Kconfig typo

2023-01-30 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 6f2f62f4ce watchdog:fix Kconfig typo
6f2f62f4ce is described below

commit 6f2f62f4ce3ea2f3621a296b201b657fbc9057f5
Author: anjiahao 
AuthorDate: Mon Jan 30 20:55:06 2023 +0800

watchdog:fix Kconfig typo

Signed-off-by: anjiahao 
---
 drivers/timers/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/timers/Kconfig b/drivers/timers/Kconfig
index b0a86dd0bf..a1bc6abc08 100644
--- a/drivers/timers/Kconfig
+++ b/drivers/timers/Kconfig
@@ -356,7 +356,7 @@ config WATCHDOG_DEVPATH
 
 config CONFIG_WATCHDOG_MAGIC_V
bool "Watchdog Device Magic num"
-   default Y
+   default y
---help---
The watchdog can be stopped by writing 'V' to the watchdog's 
device node
 



[nuttx] branch master updated: libc/stream: fix syslogstream_addstring length error

2023-01-30 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 2466c07aa3 libc/stream: fix syslogstream_addstring length error
2466c07aa3 is described below

commit 2466c07aa3baf3fc96837b5c85685f068751ad8c
Author: yinshengkai 
AuthorDate: Mon Jan 30 17:05:29 2023 +0800

libc/stream: fix syslogstream_addstring length error

Signed-off-by: yinshengkai 
---
 libs/libc/stream/lib_syslogstream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libs/libc/stream/lib_syslogstream.c 
b/libs/libc/stream/lib_syslogstream.c
index 528f539974..9566d7cbbc 100644
--- a/libs/libc/stream/lib_syslogstream.c
+++ b/libs/libc/stream/lib_syslogstream.c
@@ -112,7 +112,7 @@ static int syslogstream_addstring(FAR struct 
lib_syslogstream_s *stream,
   do
 {
   int remain = CONFIG_IOB_BUFSIZE - iob->io_len;
-  remain = remain > len ? len : remain;
+  remain = remain > len - ret ? len - ret : remain;
   memcpy(iob->io_data + iob->io_len, buff + ret, remain);
   iob->io_len += remain;
   ret += remain;



[nuttx-apps] branch master updated: Enable TMPFS and NSH_QUOTE to get CONFIG_NSH_CMDPARMS working

2023-01-24 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
 new 4ed5bec47 Enable TMPFS and NSH_QUOTE to get CONFIG_NSH_CMDPARMS working
4ed5bec47 is described below

commit 4ed5bec472adfc3b196ccbeb343f5f991cdf39b5
Author: Alan Carvalho de Assis 
AuthorDate: Thu Jan 12 16:55:29 2023 -0300

Enable TMPFS and NSH_QUOTE to get CONFIG_NSH_CMDPARMS working
---
 nshlib/Kconfig | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nshlib/Kconfig b/nshlib/Kconfig
index 6a8a14362..c917ee86b 100644
--- a/nshlib/Kconfig
+++ b/nshlib/Kconfig
@@ -125,8 +125,9 @@ config NSH_QUOTE
 
 config NSH_CMDPARMS
bool "Enable commands as parameters"
-   default !DEFAULT_SMALL
+   default !DEFAULT_SMALL && NSH_QUOTE
depends on !DISABLE_MOUNTPOINT
+   depends on FS_TMPFS
---help---
If selected, then the output from commands, from file 
applications, and
from NSH built-in commands can be used as arguments to other
@@ -142,6 +143,8 @@ config NSH_CMDPARMS
Because this feature commits significant resources, it is 
disabled by
default.
 
+   This features requires TMPFS mounted at /tmp and NSH_QUOTE 
enabled.
+
 config NSH_MAXARGUMENTS
int "Maximum number of command arguments"
default 7



[nuttx] branch master updated (e166360e8d -> f49c20d28f)

2023-01-23 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from e166360e8d sched: Map both NZERO and PTHREAD_DEFAULT_PRIORITY to 
SCHED_PRIORITY_DEFAULT
 add f49c20d28f litex: System clock frequency selectable from Kconfig.

No new revisions were added by this update.

Summary of changes:
 arch/risc-v/src/litex/Kconfig | 6 ++
 arch/risc-v/src/litex/litex_clockconfig.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)



[nuttx] branch master updated: sched: Map both NZERO and PTHREAD_DEFAULT_PRIORITY to SCHED_PRIORITY_DEFAULT

2023-01-23 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new e166360e8d sched: Map both NZERO and PTHREAD_DEFAULT_PRIORITY to 
SCHED_PRIORITY_DEFAULT
e166360e8d is described below

commit e166360e8dfc86ba25addc5fd212c1ff1acbcf19
Author: Xiang Xiao 
AuthorDate: Sun Jan 22 01:42:53 2023 +0800

sched: Map both NZERO and PTHREAD_DEFAULT_PRIORITY to SCHED_PRIORITY_DEFAULT

to unify the default thread priority

Signed-off-by: Xiang Xiao 
---
 include/limits.h  | 4 ++--
 include/pthread.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/limits.h b/include/limits.h
index 4e4e59312f..98b7dc724e 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -281,10 +281,10 @@
 #define NL_TEXTMAX _POSIX2_LINE_MAX
 
 /* NZERO
- *   Default process priority. Minimum Acceptable Value: 128
+ *   Default process priority. Minimum Acceptable Value: 100
  */
 
-#define NZERO 128
+#define NZERO SCHED_PRIORITY_DEFAULT
 
 /* Required for asynchronous I/O */
 
diff --git a/include/pthread.h b/include/pthread.h
index 639badd12f..d7d01c2c89 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -117,7 +117,7 @@
 
 /* Default priority */
 
-#define PTHREAD_DEFAULT_PRIORITY  100
+#define PTHREAD_DEFAULT_PRIORITY  SCHED_PRIORITY_DEFAULT
 
 /* Cancellation states used by pthread_setcancelstate() */
 



[nuttx] branch master updated: pthread: Implement pthread_gettid_np

2023-01-23 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 55565a6099 pthread: Implement pthread_gettid_np
55565a6099 is described below

commit 55565a609926390fe52be55f54c24fa40a77a013
Author: Xiang Xiao 
AuthorDate: Sun Jan 22 00:36:51 2023 +0800

pthread: Implement pthread_gettid_np

which is provided by bionic libc:

https://android.googlesource.com/platform/bionic/+/master/libc/include/pthread.h#172

Signed-off-by: Xiang Xiao 
---
 include/pthread.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/pthread.h b/include/pthread.h
index 05616a54c6..639badd12f 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -525,7 +525,8 @@ void pthread_yield(void);
 
 /* A thread may obtain a copy of its own thread handle. */
 
-#define pthread_self() ((pthread_t)gettid())
+#define pthread_self()((pthread_t)gettid())
+#define pthread_gettid_np(thread) ((pid_t)(thread))
 
 /* Compare two thread IDs. */
 



[nuttx] branch master updated (6b1e0ad1c4 -> 82550887c2)

2023-01-18 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 6b1e0ad1c4 tm4c1294-launchpad/Kconfig: Fix warning: defaults for 
choice values not supported
 add 82550887c2 c++: Change the default value of CXX_STANDARD from c++17 to 
gnu++17

No new revisions were added by this update.

Summary of changes:
 libs/libxx/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)



[nuttx] branch master updated: tm4c1294-launchpad/Kconfig: Fix warning: defaults for choice values not supported

2023-01-18 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
 new 6b1e0ad1c4 tm4c1294-launchpad/Kconfig: Fix warning: defaults for 
choice values not supported
6b1e0ad1c4 is described below

commit 6b1e0ad1c421658226f7af119e6636d02bc7c1c1
Author: Xiang Xiao 
AuthorDate: Wed Jan 18 19:07:29 2023 +0800

tm4c1294-launchpad/Kconfig: Fix warning: defaults for choice values not 
supported

Signed-off-by: Xiang Xiao 
---
 boards/arm/tiva/tm4c1294-launchpad/Kconfig | 4 
 1 file changed, 4 deletions(-)

diff --git a/boards/arm/tiva/tm4c1294-launchpad/Kconfig 
b/boards/arm/tiva/tm4c1294-launchpad/Kconfig
index 6b28e98da6..15584a4f99 100644
--- a/boards/arm/tiva/tm4c1294-launchpad/Kconfig
+++ b/boards/arm/tiva/tm4c1294-launchpad/Kconfig
@@ -87,12 +87,10 @@ choice

 config TM4C1294_LAUNCHPAD_UART2_RX_A6
bool "Use A6 as UART Rx pin"
-   default n
depends on TIVA_UART2 && !TM4C1294_LAUNCHPAD_JUMPERS_CAN

 config TM4C1294_LAUNCHPAD_UART2_RX_D4
bool "Use D4 as UART Rx pin"
-   default n
depends on TIVA_UART2

 endchoice # UART2 Rx pin selection
@@ -104,12 +102,10 @@ choice

 config TM4C1294_LAUNCHPAD_UART2_TX_A7
bool "Use A7 as UART Tx pin"
-   default n
depends on TIVA_UART2 && !TM4C1294_LAUNCHPAD_JUMPERS_CAN

 config TM4C1294_LAUNCHPAD_UART2_TX_D5
bool "Use D5 as UART Tx pin"
-   default n
depends on TIVA_UART2

 endchoice # UART2 Tx pin selection



[nuttx-apps] branch master updated: Add *.su to .gitignore

2023-01-18 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
 new 44d064233 Add *.su to .gitignore
44d064233 is described below

commit 44d0642334e109ab056bf800520eb3330d19b00c
Author: Xiang Xiao 
AuthorDate: Thu Jan 19 10:11:29 2023 +0800

Add *.su to .gitignore

*.su is generated by gcc/clang when we pass -fstack-usage to them

Signed-off-by: Xiang Xiao 
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 9921eec3a..5988d370e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@
 *.src
 *.swp
 *.sym
+*.su
 *~
 .context
 .depend



[nuttx] branch master updated (11e401c0bc -> 138f3faeef)

2023-01-18 Thread jerpelea
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


from 11e401c0bc esp32[c3|s3]: Fix relative path in file header
 add 138f3faeef boards: sabre-6quad: Adjust TCP and UDP configurations

No new revisions were added by this update.

Summary of changes:
 boards/arm/imx6/sabre-6quad/configs/netknsh/defconfig | 1 -
 boards/arm/imx6/sabre-6quad/configs/netknsh_smp/defconfig | 1 -
 boards/arm/imx6/sabre-6quad/configs/netnsh_smp/defconfig  | 2 +-
 3 files changed, 1 insertion(+), 3 deletions(-)



<    1   2   3   4   5   6   7   8   9   >