[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9198: tools/nuttx-gdbinit: improve experience of gdb backend scripts

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9198:
URL: https://github.com/apache/nuttx/pull/9198#discussion_r1186641353


##
tools/nuttx-gdbinit:
##
@@ -455,7 +441,26 @@ define info_nxthreads
 end
 
 define nxcontinue
-  printf "nxcontinue\n"
   _restore_current_tcb
   continue
 end
+
+define info threads
+  info_nxthreads

Review Comment:
   let's change info_nxthreads to info nxthreads



##
tools/nuttx-gdbinit:
##
@@ -455,7 +441,26 @@ define info_nxthreads
 end
 
 define nxcontinue
-  printf "nxcontinue\n"
   _restore_current_tcb
   continue
 end
+
+define info threads
+  info_nxthreads
+end
+
+define thread
+  _save_current_tcb
+  if ($argc == 0)
+_running_task
+set $pid = $rtcb->pid
+  else
+set $pid = $arg0
+  end
+
+  nxthread $pid
+end
+
+define c
+  nxcontinue

Review Comment:
   let's change nxcontinue to c directly



##
tools/nuttx-gdbinit:
##
@@ -455,7 +441,26 @@ define info_nxthreads
 end
 
 define nxcontinue
-  printf "nxcontinue\n"
   _restore_current_tcb
   continue
 end
+
+define info threads
+  info_nxthreads
+end
+
+define thread
+  _save_current_tcb
+  if ($argc == 0)
+_running_task
+set $pid = $rtcb->pid
+  else
+set $pid = $arg0
+  end
+
+  nxthread $pid

Review Comment:
   let's change nxthread to thread directly



##
tools/nuttx-gdbinit:
##
@@ -406,36 +397,31 @@ define _switch_tcb_simx86
 end
 
 define _restore_current_tcb
-  # TODO: SMP
-  set $tcb = g_readytorun->head
-  _switch_tcb $tcb
+  _examine_target
+  _running_task
+  _switch_tcb $rtcb
   set $_current_tcb = 0x0
 end
 
 define nxthread
-  _examine_target
-  _save_current_tcb
-  set $hash = ($arg0 & ($_target_max_tasks - 1))
+  set $hash = ($arg0 & (g_npidhash - 1))
   set $tcb = g_pidhash[$hash]
   if ($tcb != 0x0)
+_switch_tcb $tcb
 _print_thread $tcb
-if ($argc == 1)
-  _switch_tcb $tcb
-end
 if ($argc == 2)
   if ($arg1 == 1)
-   _switch_tcb $tcb
-   where
+_switch_tcb $tcb
+where
   end
 end
   end
-  _restore_current_tcb
 end
 
 define nxthread_all_bt

Review Comment:
   remove nxthread_all_bt, we can use the standard command "thread apply all bt"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] anchao opened a new pull request, #9198: tools/nuttx-gdbinit: improve experience of gdb backend scripts

2023-05-05 Thread via GitHub


anchao opened a new pull request, #9198:
URL: https://github.com/apache/nuttx/pull/9198

   ## Summary
   
   1. tools/nuttx-gdbinit: improve experience of gdb backend scripts
   
   Redefine built-in command (info thread/thread/c) to compatible with 
developer habits
   
   Test board:
   ```bash
   ./tools/configure.sh -E lm3s6965-ek:qemu-flat
   ```
   1> start qemu:
   ```bash
   qemu-system-arm   -M lm3s6965evb   -device loader,file=nuttx   -serial 
mon:stdio   -nographic  -s
   ```
   2> gdb attach:
   ```bash
   gdb-multiarch -ix tools/nuttx-gdbinit nuttx -ex "target extended-remote 
localhost:1234"
   ```
   3> show thread info and callstack:
   
   ```bash
   | (gdb) info thread
   | * 0 Thread 0x20001548  (Name: Idle Task, State: Running, Priority: 0, 
Stack: 1000) PC: 0x9eee in up_idle()
   |   1 Thread 0x20005058  (Name: hpwork, State: Waiting,Semaphore, Priority: 
224, Stack: 1992) PC: 0xa124 in up_switch_context()
   |   2 Thread 0x20005c20  (Name: nsh_main, State: Waiting,Semaphore, 
Priority: 100, Stack: 2000) PC: 0xa124 in up_switch_context()
   |   3 Thread 0x20006b30  (Name: NTP daemon, State: Waiting,Semaphore, 
Priority: 100, Stack: 1952) PC: 0xa124 in up_switch_context()
   |   4 Thread 0x200086f0  (Name: telnetd, State: Waiting,Semaphore, Priority: 
100, Stack: 2008) PC: 0xa124 in up_switch_context()
   | (gdb) bt
   | #0  0x9eee in up_idle () at chip/common/tiva_idle.c:62
   | #1  0x3dd2 in nx_start () at init/nx_start.c:698
   | #2  0x0190 in __start () at chip/common/lmxx_tm4c_start.c:177
   | (gdb) thread 4
   |   4 Thread 0x200086f0  (Name: telnetd, State: Waiting,Semaphore, Priority: 
100, Stack: 2008) PC: 0xa124 in up_switch_context()
   | (gdb) bt
   | #0  up_switch_context (tcb=0x20001548 , 
rtcb=rtcb@entry=0x200086f0) at common/arm_switchcontext.c:95
   | #1  0x453a in nxsem_wait (sem=sem@entry=0x2000916c) at 
semaphore/sem_wait.c:176
   | #2  0x197e in _net_timedwait (sem=sem@entry=0x2000916c, 
interruptible=interruptible@entry=true, timeout=timeout@entry=4294967295) at 
utils/net_lock.c:101
   | #3  0x198e in net_sem_timedwait (sem=sem@entry=0x2000916c, 
timeout=timeout@entry=4294967295) at utils/net_lock.c:242
   | #4  0x1996 in net_sem_wait (sem=sem@entry=0x2000916c) at 
utils/net_lock.c:330
   | #5  0x00025f84 in psock_tcp_accept (psock=, addr=, addrlen=, newconn=newconn@entry=0x2000956c) at 
tcp/tcp_accept.c:274
   | #6  0x00025432 in inet_accept (psock=, addr=, addrlen=, newsock=0x20009568, flags=0) at 
inet/inet_sockif.c:1443
   | #7  0x00027a10 in psock_accept (psock=0x200044b8, 
addr=addr@entry=0x2000921c, addrlen=addrlen@entry=0x2000920c, 
newsock=newsock@entry=0x20009568, flags=flags@entry=0) at socket/accept.c:149
   | #8  0x00027a8c in accept4 (sockfd=sockfd@entry=3, 
addr=addr@entry=0x2000921c, addrlen=addrlen@entry=0x2000920c, 
flags=flags@entry=0) at socket/accept.c:280
   | #9  0x0002a256 in accept (sockfd=sockfd@entry=3, 
addr=addr@entry=0x2000921c, addrlen=addrlen@entry=0x2000920c) at 
net/lib_accept.c:50
   | #10 0x0001efaa in telnetd_daemon (config=config@entry=0x20009290) at 
telnetd_daemon.c:200
   | #11 0x0001e508 in telnetd_main (argc=1, argv=0x20008af8) at telnetd.c:98
   | #12 0x8486 in nxtask_startup (entrypt=0x1e4bd , 
entrypt@entry=0x1 , argc=1, argv=0x20008af8) at sched/task_startup.c:70
   | #13 0x56d2 in nxtask_start () at task/task_start.c:134
   | #14 0x in ?? ()
   | (gdb) c
   ```
   
   Signed-off-by: chao an 
   
   
   2. tools/nuttx-gdbinit: remove unsafed function call from script
   
   Some time nuttx will receive SIGSEGV while executing the function:
   
   ```bash
   | Thread 1 "nuttx" received signal SIGSEGV, Segmentation fault.
   | 0xf7bab4a0 in __sanitizer::common_flags_dont_use () from 
/lib/i386-linux-gnu/libasan.so.6
   | The program being debugged was signaled while in a function called from 
GDB.
   | GDB has restored the context to what it was before the call.
   | Evaluation of the expression containing the function
   | (up_check_tcbstack) will be abandoned.
   ```
   
   Signed-off-by: chao an 
   
   
   3. tools/nuttx-gdbinit: correct xcp context size
   
   Fix issue: https://github.com/apache/nuttx/issues/8616
   
   Signed-off-by: chao an 
   
   
   ## Impact
   
   N/A
   
   ## Testing
   
   ./tools/configure.sh -E lm3s6965-ek:qemu-flat


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[nuttx] branch master updated (9f8d418cd1 -> 37f318c038)

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

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


from 9f8d418cd1 forward: copy iob when broadcast forward
 add 276d1c8f48 esp32s3: Add support to RTC
 add 37f318c038 boards/esp32s3: Add RTC initialization

No new revisions were added by this update.

Summary of changes:
 arch/xtensa/src/esp32s3/Kconfig|4 +
 arch/xtensa/src/esp32s3/Make.defs  |7 +
 arch/xtensa/src/esp32s3/esp32s3_rtc.c  | 2773 
 arch/xtensa/src/esp32s3/esp32s3_rtc.h  |  769 ++
 arch/xtensa/src/esp32s3/esp32s3_rtc_lowerhalf.c|  555 
 arch/xtensa/src/esp32s3/esp32s3_rtc_lowerhalf.h|   56 +
 arch/xtensa/src/esp32s3/esp32s3_rtcheap.c  |  195 ++
 arch/xtensa/src/esp32s3/esp32s3_rtcheap.h  |  149 ++
 arch/xtensa/src/esp32s3/hardware/esp32s3_rtccntl.h |   75 +-
 arch/xtensa/src/esp32s3/hardware/esp32s3_soc.h |   10 +
 arch/xtensa/src/esp32s3/hardware/regi2c_bbpll.h|  192 ++
 arch/xtensa/src/esp32s3/hardware/regi2c_ctrl.h |   69 +
 arch/xtensa/src/esp32s3/hardware/regi2c_dig_reg.h  |   59 +
 arch/xtensa/src/esp32s3/hardware/regi2c_lp_bias.h  |   48 +
 .../xtensa/esp32s3/common/scripts/esp32s3_rom.ld   |8 +-
 .../esp32s3/esp32s3-devkit/src/esp32s3_bringup.c   |   15 +
 16 files changed, 4970 insertions(+), 14 deletions(-)
 create mode 100644 arch/xtensa/src/esp32s3/esp32s3_rtc.c
 create mode 100644 arch/xtensa/src/esp32s3/esp32s3_rtc.h
 create mode 100644 arch/xtensa/src/esp32s3/esp32s3_rtc_lowerhalf.c
 create mode 100644 arch/xtensa/src/esp32s3/esp32s3_rtc_lowerhalf.h
 create mode 100644 arch/xtensa/src/esp32s3/esp32s3_rtcheap.c
 create mode 100644 arch/xtensa/src/esp32s3/esp32s3_rtcheap.h
 create mode 100644 arch/xtensa/src/esp32s3/hardware/regi2c_bbpll.h
 create mode 100644 arch/xtensa/src/esp32s3/hardware/regi2c_ctrl.h
 create mode 100644 arch/xtensa/src/esp32s3/hardware/regi2c_dig_reg.h
 create mode 100644 arch/xtensa/src/esp32s3/hardware/regi2c_lp_bias.h



[GitHub] [nuttx] xiaoxiang781216 merged pull request #9110: esp32s3: Add RTC support

2023-05-05 Thread via GitHub


xiaoxiang781216 merged PR #9110:
URL: https://github.com/apache/nuttx/pull/9110


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9138: libc/string: select arch's libc for kernel/userspace optionally

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#discussion_r1186610846


##
libs/libc/machine/arm/armv7-a/gnu/arch_memchr.S:
##
@@ -66,6 +66,10 @@
  *
  /
 
+#include "libc.h"
+
+#if (LIBC_BUILD_FUNCTION == 0)

Review Comment:
   ROM optimized version may have some limitation, but the assembly optimized 
version doesn't. So, it is not good to forbid the user select the assembly 
version. For example, esp32s3 could avoid lose the userspace performance lose 
in protected build by linking with: 
https://github.com/apache/nuttx/tree/master/libs/libc/machine/xtensa.
   These function are very critical for graphics/media application.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9138: libc/string: select arch's libc for kernel/userspace optionally

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#discussion_r1186610846


##
libs/libc/machine/arm/armv7-a/gnu/arch_memchr.S:
##
@@ -66,6 +66,10 @@
  *
  /
 
+#include "libc.h"
+
+#if (LIBC_BUILD_FUNCTION == 0)

Review Comment:
   ROM optimized version may have some limitation, but the assembly optimized 
version doesn't. So, it is not good to forbid the user select the assembly 
version. For example, esp32s3 could avoid lose the userspace performance lose 
in protected build by linking with: 
https://github.com/apache/nuttx/tree/master/libs/libc/machine/xtensa



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx-apps] xiaoxiang781216 commented on pull request #1740: Added example for Bosch BMP280 pressure sensor

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on PR #1740:
URL: https://github.com/apache/nuttx-apps/pull/1740#issuecomment-1537010445

   @fdcavalcanti you can try this tool directly:
   https://github.com/apache/nuttx-apps/blob/master/system/uorb/listener.c


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9103: arch/riscv: Fixed FPU register error

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9103:
URL: https://github.com/apache/nuttx/pull/9103#discussion_r1186596036


##
arch/risc-v/src/common/riscv_macros.S:
##
@@ -227,8 +222,15 @@
   REGLOAD  t0, REG_INT_CTX(\out)
   li   t1, MSTATUS_FS
   and  t2, t0, t1
-  li   t1, MSTATUS_FS_INIT
-  ble  t2, t1, 1f
+  li   t1, MSTATUS_FS_DIRTY
+  bne  t2, t1, 1f
+
+  /* Reset FS bit to MSTATUS_FS_CLEAN */
+  li   t1, MSTATUS_FS_CLEAN

Review Comment:
   > Would it be possible to save FPU registers into the tcb again and 
save/restore FPU state only when a switch out/in happens?
   
   Yes, it could be, but it waste the memory for thread which never use FPU.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] SunJun8 commented on a diff in pull request #9103: arch/riscv: Fixed FPU register error

2023-05-05 Thread via GitHub


SunJun8 commented on code in PR #9103:
URL: https://github.com/apache/nuttx/pull/9103#discussion_r1186594368


##
arch/risc-v/src/common/riscv_macros.S:
##
@@ -227,8 +222,15 @@
   REGLOAD  t0, REG_INT_CTX(\out)
   li   t1, MSTATUS_FS
   and  t2, t0, t1
-  li   t1, MSTATUS_FS_INIT
-  ble  t2, t1, 1f
+  li   t1, MSTATUS_FS_DIRTY
+  bne  t2, t1, 1f
+
+  /* Reset FS bit to MSTATUS_FS_CLEAN */
+  li   t1, MSTATUS_FS_CLEAN

Review Comment:
   > 4. Thread 2 switch in use FPU and thread 1 FPU context(hardware register) 
is destroyed
   > 5. Thread 1 switch in again, but can't restore the FPU context
   
   During "5. Thread 1 switch in", the FS bit is in a clean state. Even if the 
FPU registers have been corrupted at this point, would it have any unknown 
impact on the possible execution of FPU instructions by Thread 1?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx-apps] fdcavalcanti opened a new pull request, #1740: Added example for Bosch BMP280 pressure sensor

2023-05-05 Thread via GitHub


fdcavalcanti opened a new pull request, #1740:
URL: https://github.com/apache/nuttx-apps/pull/1740

   ## Summary
   Added BMP280 example to apps.
   Currently, there is a BMP180/280 example which reads from _/dev/press0_. It 
is not compatible with BMP280 since the driver binds to 
_/dev/uorb/sensor_baro0_.
   
   ## Impact
   New example add to apps/example.
   
   ## Testing
   Tested on the BMP280 I2C sensor using a Tiva TM4C board. No issues noticed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[nuttx-website] branch asf-site updated: Publishing web: 6b97f0b7d9c9541ec77f08b188cf82e4a808a573 docs: 9f8d418cd1691711a762dc980b2ea7f1a04fffa8

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

github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/nuttx-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
 new 70cf3ee7 Publishing web: 6b97f0b7d9c9541ec77f08b188cf82e4a808a573 
docs: 9f8d418cd1691711a762dc980b2ea7f1a04fffa8
70cf3ee7 is described below

commit 70cf3ee7c0240ce68cade3c05db7545d2b8e12db
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Sat May 6 00:11:52 2023 +

Publishing web: 6b97f0b7d9c9541ec77f08b188cf82e4a808a573 docs: 
9f8d418cd1691711a762dc980b2ea7f1a04fffa8
---
 content/docs/10.0.0/index.html |   2 +-
 content/docs/10.0.0/searchindex.js |   2 +-
 content/docs/10.0.1/index.html |   2 +-
 content/docs/10.0.1/searchindex.js |   2 +-
 content/docs/10.1.0/index.html |   2 +-
 content/docs/10.1.0/searchindex.js |   2 +-
 content/docs/10.2.0/index.html |   2 +-
 content/docs/10.2.0/searchindex.js |   2 +-
 content/docs/10.3.0/index.html |   2 +-
 content/docs/10.3.0/searchindex.js |   2 +-
 content/docs/11.0.0/index.html |   2 +-
 content/docs/11.0.0/searchindex.js |   2 +-
 content/docs/12.0.0/index.html |   2 +-
 content/docs/12.0.0/searchindex.js |   2 +-
 content/docs/12.1.0/index.html |   2 +-
 content/docs/12.1.0/searchindex.js |   2 +-
 .../esp32s3/boards/esp32s3-devkit/index.rst.txt|  32 +
 content/docs/latest/index.html |   2 +-
 content/docs/latest/objects.inv| Bin 45728 -> 45758 bytes
 .../esp32s3/boards/esp32s3-devkit/index.html   |  31 
 content/docs/latest/searchindex.js |   2 +-
 content/feed.xml   |   4 +--
 22 files changed, 83 insertions(+), 20 deletions(-)

diff --git a/content/docs/10.0.0/index.html b/content/docs/10.0.0/index.html
index 99bcb188..3911c046 100644
--- a/content/docs/10.0.0/index.html
+++ b/content/docs/10.0.0/index.html
@@ -133,7 +133,7 @@ by following these 
 NuttX Documentation
 NuttX is a real-time operating system (RTOS) with an emphasis on standards 
compliance and small footprint. Scalable from 8-bit to 32-bit microcontroller 
environments, the primary governing standards in NuttX are Posix and ANSI 
standards. Additional standard APIs from Unix and other common RTOS’s (such as 
VxWorks) are adopted for functionality not available under these standards, or 
for functionality that is not appropriate for deeply-embedded environments 
(such as fork()).
-Last Updated: 05 May 23 at 00:09
+Last Updated: 06 May 23 at 00:08
 
 Table of 
Contents
 
diff --git a/content/docs/10.0.0/searchindex.js 
b/content/docs/10.0.0/searchindex.js
index 1801845e..90b07ea4 100644
--- a/content/docs/10.0.0/searchindex.js
+++ b/content/docs/10.0.0/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["applications/index","boards/index","components/binfmt","components/drivers/block/index","components/drivers/character/analog","components/drivers/character/can","components/drivers/character/index","components/drivers/character/keypad","components/drivers/character/pwm","components/drivers/character/quadrature","components/drivers/character/rtc","components/drivers/character/serial","components/drivers/character/timer","components/drivers/character/touchscreen
 [...]
\ No newline at end of file
+Search.setIndex({docnames:["applications/index","boards/index","components/binfmt","components/drivers/block/index","components/drivers/character/analog","components/drivers/character/can","components/drivers/character/index","components/drivers/character/keypad","components/drivers/character/pwm","components/drivers/character/quadrature","components/drivers/character/rtc","components/drivers/character/serial","components/drivers/character/timer","components/drivers/character/touchscreen
 [...]
\ No newline at end of file
diff --git a/content/docs/10.0.1/index.html b/content/docs/10.0.1/index.html
index 650ff311..fdc03be8 100644
--- a/content/docs/10.0.1/index.html
+++ b/content/docs/10.0.1/index.html
@@ -149,7 +149,7 @@ by following these 
 NuttX Documentation
 NuttX is a real-time operating system (RTOS) with an emphasis on standards 
compliance and small footprint. Scalable from 8-bit to 32-bit microcontroller 
environments, the primary governing standards in NuttX are Posix and ANSI 
standards. Additional standard APIs from Unix and other common RTOS’s (such as 
VxWorks) are adopted for functionality not available under these standards, or 
for functionality that is not appropriate for deeply-embedded environments 
(such as fork()).
-Last Updated: 05 May 23 at 00:09

[GitHub] [nuttx] acassis commented on a diff in pull request #9195: icmpv6: add SOCK_RAW type support

2023-05-05 Thread via GitHub


acassis commented on code in PR #9195:
URL: https://github.com/apache/nuttx/pull/9195#discussion_r1186514966


##
net/icmpv6/icmpv6.h:
##
@@ -97,13 +97,19 @@ struct icmpv6_conn_s
*/
 
   struct iob_queue_s readahead;  /* Read-ahead buffering */
+  struct icmp6_filter filter;/* ICMP6 type filter */

Review Comment:
   Understood, thank you @xiaoxiang781216 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] pussuw commented on a diff in pull request #9103: arch/riscv: Fixed FPU register error

2023-05-05 Thread via GitHub


pussuw commented on code in PR #9103:
URL: https://github.com/apache/nuttx/pull/9103#discussion_r1186509924


##
arch/risc-v/src/common/riscv_macros.S:
##
@@ -227,8 +222,15 @@
   REGLOAD  t0, REG_INT_CTX(\out)
   li   t1, MSTATUS_FS
   and  t2, t0, t1
-  li   t1, MSTATUS_FS_INIT
-  ble  t2, t1, 1f
+  li   t1, MSTATUS_FS_DIRTY
+  bne  t2, t1, 1f
+
+  /* Reset FS bit to MSTATUS_FS_CLEAN */
+  li   t1, MSTATUS_FS_CLEAN

Review Comment:
   Would it be possible to save FPU registers into the tcb again and 
save/restore FPU state only when a switch out/in happens?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] tmedicci commented on a diff in pull request #9138: libc/string: select arch's libc for kernel/userspace optionally

2023-05-05 Thread via GitHub


tmedicci commented on code in PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#discussion_r1186461126


##
libs/libc/machine/arm/armv7-a/gnu/arch_memchr.S:
##
@@ -66,6 +66,10 @@
  *
  /
 
+#include "libc.h"
+
+#if (LIBC_BUILD_FUNCTION == 0)

Review Comment:
   > Note: LIBC_ARCH_PREVENT_xxx should prevent only the rom function, but not 
assembler optimized version.
   
   I didn't get it. Currently, it prevents any libc implementation other than 
NuttX's to be used. So, if `LIBC_ARCH_PREVENT_xxx` is selected, NuttX's C 
software version will be used. Please note that `_MEMCHR` selects 
`LIBC_ARCH_MEMCHR` automatically, so the guards in `libs/libc/machine/` 
files avoid both being built if `_MEMCHR` is selected.
   
   That is the intended behavior: ROM-defined and optimized versions are 
treated "equally" on this PR. The idea is to prevent them to be used in 
kernel/userspace (and build NuttX's version, instead).
   
   Do you mean to change this behavior?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] tmedicci commented on a diff in pull request #9138: libc/string: select arch's libc for kernel/userspace optionally

2023-05-05 Thread via GitHub


tmedicci commented on code in PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#discussion_r1186461126


##
libs/libc/machine/arm/armv7-a/gnu/arch_memchr.S:
##
@@ -66,6 +66,10 @@
  *
  /
 
+#include "libc.h"
+
+#if (LIBC_BUILD_FUNCTION == 0)

Review Comment:
   > Note: LIBC_ARCH_PREVENT_xxx should prevent only the rom function, but not 
assembler optimized version.
   
   I didn't get it. Currently, it prevents any libc implementation other than 
NuttX's to be used. So, if `LIBC_ARCH_PREVENT_xxx` is selected, NuttX's C 
software version will be used. Please note that `_MEMCHR` selects 
`LIBC_ARCH_MEMCHR` automatically, so the guards in `libs/libc/machine/` 
files avoid both being built.
   
   That is the intended behavior: ROM-defined and optimized versions are 
treated "equally" on this PR. The idea is to prevent them to be used in 
kernel/userspace (and build NuttX's version, instead).
   
   Do you mean to change this behavior?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] tmedicci commented on a diff in pull request #9138: libc/string: select arch's libc for kernel/userspace optionally

2023-05-05 Thread via GitHub


tmedicci commented on code in PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#discussion_r1186461126


##
libs/libc/machine/arm/armv7-a/gnu/arch_memchr.S:
##
@@ -66,6 +66,10 @@
  *
  /
 
+#include "libc.h"
+
+#if (LIBC_BUILD_FUNCTION == 0)

Review Comment:
   > Note: LIBC_ARCH_PREVENT_xxx should prevent only the rom function, but not 
assembler optimized version.
   
   I didn't get it. Currently, it prevents any libc implementation other than 
NuttX's to be used. So, if `LIBC_ARCH_PREVENT_xxx` is selected, NuttX's C 
software version will be used. Please note that `_MEMCHR` selects 
`LIBC_ARCH_MEMCHR` automatically, so the guards in `libs/libc/machine/` 
files avoid both being built.
   
   That is the intended behavior: ROM-defined and optimized versions are 
treated "equally" on this PR.
   
   Do you mean to change this behavior?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9195: icmpv6: add SOCK_RAW type support

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9195:
URL: https://github.com/apache/nuttx/pull/9195#discussion_r1186457284


##
net/icmpv6/icmpv6.h:
##
@@ -97,13 +97,19 @@ struct icmpv6_conn_s
*/
 
   struct iob_queue_s readahead;  /* Read-ahead buffering */
+  struct icmp6_filter filter;/* ICMP6 type filter */

Review Comment:
   @acassis because icmp6_filter is public struct defined by FreeBSD/Linux, all 
code which use raw socket will break(just like you can't change pthread_t to 
pthread_s).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9195: icmpv6: add SOCK_RAW type support

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9195:
URL: https://github.com/apache/nuttx/pull/9195#discussion_r1186457284


##
net/icmpv6/icmpv6.h:
##
@@ -97,13 +97,19 @@ struct icmpv6_conn_s
*/
 
   struct iob_queue_s readahead;  /* Read-ahead buffering */
+  struct icmp6_filter filter;/* ICMP6 type filter */

Review Comment:
   @acassis because icmp6_filter is public struct defined by FreeBSD/Linux, 
just like you can't change pthread_t to pthread_s.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9195: icmpv6: add SOCK_RAW type support

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9195:
URL: https://github.com/apache/nuttx/pull/9195#discussion_r1186457284


##
net/icmpv6/icmpv6.h:
##
@@ -97,13 +97,19 @@ struct icmpv6_conn_s
*/
 
   struct iob_queue_s readahead;  /* Read-ahead buffering */
+  struct icmp6_filter filter;/* ICMP6 type filter */

Review Comment:
   Because icmp6_filter is public struct defined by FreeBSD/Linux.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9103: arch/riscv: Fixed FPU register error

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9103:
URL: https://github.com/apache/nuttx/pull/9103#discussion_r1186454071


##
arch/risc-v/src/common/riscv_macros.S:
##
@@ -227,8 +222,15 @@
   REGLOAD  t0, REG_INT_CTX(\out)
   li   t1, MSTATUS_FS
   and  t2, t0, t1
-  li   t1, MSTATUS_FS_INIT
-  ble  t2, t1, 1f
+  li   t1, MSTATUS_FS_DIRTY
+  bne  t2, t1, 1f
+
+  /* Reset FS bit to MSTATUS_FS_CLEAN */
+  li   t1, MSTATUS_FS_CLEAN

Review Comment:
   but this change makes the thread fail to restore the FPU context in the 
following case:
   
   1. Thread 1 use FPU and then switch out(FPU save with dirty flag)
   2. Thread 1 switch in some time later(FPU restore with clean flag)
   3. Thread 1 doesn't use FPU in this time and switch out(skip FPU saving)
   4. Thread 2 switch in use FPU and thread 1 FPU context(hardware register) is 
destroyed
   5. Thread 1 switch in again, but can't restore the FPU context
   
   So, the root cause is that https://github.com/apache/nuttx/pull/5731 move 
the storage of context from tcb to stack, and then we can't save FPU once but 
restore FPU multiple time because the stack(FPU saved here) may be modified 
after the thread resume the execution.
   
   To fix this problem, we need save/restore FPU context every time if 
MSTATUS_FS doesn't equal MSTATUS_FS_INIT.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9103: arch/riscv: Fixed FPU register error

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9103:
URL: https://github.com/apache/nuttx/pull/9103#discussion_r1186454071


##
arch/risc-v/src/common/riscv_macros.S:
##
@@ -227,8 +222,15 @@
   REGLOAD  t0, REG_INT_CTX(\out)
   li   t1, MSTATUS_FS
   and  t2, t0, t1
-  li   t1, MSTATUS_FS_INIT
-  ble  t2, t1, 1f
+  li   t1, MSTATUS_FS_DIRTY
+  bne  t2, t1, 1f
+
+  /* Reset FS bit to MSTATUS_FS_CLEAN */
+  li   t1, MSTATUS_FS_CLEAN

Review Comment:
   but this change makes the thread fail to restore the FPU context in the 
following case:
   
   1. Thread 1 use FPU and then switch out(FPU save with dirty flag)
   2. Thread 1 switch in some time later(FPU restore with clean flag)
   3. Thread 1 doesn't use FPU in this time and switch out(skip FPU saving)
   4. Thread 2 swith in use FPU and thread 1 FPU context(hardware register) is 
destroyed
   5. Thread 1 switch in again, but can't restore the FPU context
   
   So, the root cause is that https://github.com/apache/nuttx/pull/5731 move 
the storage of context from tcb to stack, and then we can't save FPU one time 
but restore FPU multiple time because the stack(FPU saved here) may be modified 
after the thread resume the execution.
   
   To fix this problem, we need save/restore FPU context every time if 
MSTATUS_FS doesn't equal MSTATUS_FS_INIT.



##
arch/risc-v/src/common/riscv_macros.S:
##
@@ -227,8 +222,15 @@
   REGLOAD  t0, REG_INT_CTX(\out)
   li   t1, MSTATUS_FS
   and  t2, t0, t1
-  li   t1, MSTATUS_FS_INIT
-  ble  t2, t1, 1f
+  li   t1, MSTATUS_FS_DIRTY
+  bne  t2, t1, 1f
+
+  /* Reset FS bit to MSTATUS_FS_CLEAN */
+  li   t1, MSTATUS_FS_CLEAN

Review Comment:
   but this change makes the thread fail to restore the FPU context in the 
following case:
   
   1. Thread 1 use FPU and then switch out(FPU save with dirty flag)
   2. Thread 1 switch in some time later(FPU restore with clean flag)
   3. Thread 1 doesn't use FPU in this time and switch out(skip FPU saving)
   4. Thread 2 switch in use FPU and thread 1 FPU context(hardware register) is 
destroyed
   5. Thread 1 switch in again, but can't restore the FPU context
   
   So, the root cause is that https://github.com/apache/nuttx/pull/5731 move 
the storage of context from tcb to stack, and then we can't save FPU one time 
but restore FPU multiple time because the stack(FPU saved here) may be modified 
after the thread resume the execution.
   
   To fix this problem, we need save/restore FPU context every time if 
MSTATUS_FS doesn't equal MSTATUS_FS_INIT.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9103: arch/riscv: Fixed FPU register error

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9103:
URL: https://github.com/apache/nuttx/pull/9103#discussion_r1186454071


##
arch/risc-v/src/common/riscv_macros.S:
##
@@ -227,8 +222,15 @@
   REGLOAD  t0, REG_INT_CTX(\out)
   li   t1, MSTATUS_FS
   and  t2, t0, t1
-  li   t1, MSTATUS_FS_INIT
-  ble  t2, t1, 1f
+  li   t1, MSTATUS_FS_DIRTY
+  bne  t2, t1, 1f
+
+  /* Reset FS bit to MSTATUS_FS_CLEAN */
+  li   t1, MSTATUS_FS_CLEAN

Review Comment:
   but this change makes the thread fail to restore the FPU context in the 
following case:
   
   1. Thread 1 use FPU and then switch out(FPU save with dirty flag)
   2. Thread 1 switch in some time later(FPU restore with clean flag)
   3. Thread 1 doesn't use FPU in this time and switch out(skip FPU saving)
   4. Thread 2 swith in use FPU and thread 1 FPU context is destroyed
   5. Thread 1 switch in again, but can't restore the FPU context
   
   So, the root cause is that https://github.com/apache/nuttx/pull/5731 move 
the storage of context from tcb to stack, and then we can't save FPU one time 
but restore FPU multiple time because the stack(FPU saved here) may be modified 
after the thread resume the execution.
   
   To fix this problem, we need save/restore FPU context every time if 
MSTATUS_FS doesn't equal MSTATUS_FS_INIT.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx-apps] xiaoxiang781216 commented on pull request #1623: Replace the unsafe function(strcat, sprintf) with the safe one(strlcat, snprintf)

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on PR #1623:
URL: https://github.com/apache/nuttx-apps/pull/1623#issuecomment-1536678322

   ping @jerpelea 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx-apps] xiaoxiang781216 merged pull request #1739: spitool: add support for 32-bit SPI BUS width

2023-05-05 Thread via GitHub


xiaoxiang781216 merged PR #1739:
URL: https://github.com/apache/nuttx-apps/pull/1739


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[nuttx-apps] branch master updated: spitool: add support for 32-bit SPI BUS width

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

xiaoxiang 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 be55ea786 spitool: add support for 32-bit SPI BUS width
be55ea786 is described below

commit be55ea7869daa1a2ebbe3015e8a812261c7440af
Author: Radek Pesina 
AuthorDate: Fri May 5 10:23:32 2023 +1000

spitool: add support for 32-bit SPI BUS width

Link: https://git.motec.com.au/id/I62920d28ab9804d52d25af3bcdd0f1ceb87be93f
---
 system/spi/spi_common.c |  2 +-
 system/spi/spi_exch.c   | 12 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/system/spi/spi_common.c b/system/spi/spi_common.c
index 0f9cc4dba..906b4d1f0 100644
--- a/system/spi/spi_common.c
+++ b/system/spi/spi_common.c
@@ -192,7 +192,7 @@ int spitool_common_args(FAR struct spitool_s *spitool, FAR 
char **arg)
 
   case 'w':
 ret = arg_decimal(arg, );
-if (value != 8 && value != 16)
+if (value != 8 && value != 16 && value != 32)
   {
 goto out_of_range;
   }
diff --git a/system/spi/spi_exch.c b/system/spi/spi_exch.c
index 4d8d10c8f..31db5d83e 100644
--- a/system/spi/spi_exch.c
+++ b/system/spi/spi_exch.c
@@ -124,10 +124,14 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, 
FAR char **argv)
 {
   spitool_printf(spitool, "%02X ", txdata[d]);
 }
-  else
+  else if (spitool->width <= 16)
 {
   spitool_printf(spitool, "%04X ", ((uint16_t *)txdata)[d]);
 }
+  else
+{
+  spitool_printf(spitool, "%08" PRIX32 " ", ((uint32_t *)txdata)[d]);
+}
 }
 
   spitool_printf(spitool, "\n");
@@ -175,10 +179,14 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, 
FAR char **argv)
 {
   spitool_printf(spitool, "%02X ", rxdata[d]);
 }
-  else
+  else if (spitool->width <= 16)
 {
   spitool_printf(spitool, "%04X ", ((uint16_t *)rxdata)[d]);
 }
+  else
+{
+  spitool_printf(spitool, "%08" PRIX32 " ", ((uint32_t *)rxdata)[d]);
+}
 }
 
   spitool_printf(spitool, "\n");



[GitHub] [nuttx] acassis commented on issue #9182: W25QxxJV driver does behave correctly for 1 GB flash

2023-05-05 Thread via GitHub


acassis commented on issue #9182:
URL: https://github.com/apache/nuttx/issues/9182#issuecomment-1536675100

   Good point @ALTracer I think probably it is 1Gbit, it is not common to find 
1GiB SPI NOR Flash


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on pull request #8726: Replace the unsafe function(strcat, sprintf) with the safe one(strlcat, snprintf)

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on PR #8726:
URL: https://github.com/apache/nuttx/pull/8726#issuecomment-1536674882

   @jerpelea this patch replaces all well-known unsafe c function with the safe 
replacement, which should be understand by most developers.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[nuttx] branch master updated: forward: copy iob when broadcast forward

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

xiaoxiang 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 9f8d418cd1 forward: copy iob when broadcast forward
9f8d418cd1 is described below

commit 9f8d418cd1691711a762dc980b2ea7f1a04fffa8
Author: zhanghongyu 
AuthorDate: Sun Apr 23 20:22:18 2023 +0800

forward: copy iob when broadcast forward

since iob offload, ipvx_dev_forward will remove d_iob, if there are multiple
devices, d_iob will be NULL when dev_forward is entered second time. and the
device that receives the packet cannot process the packet after forwarding 
it
so the iob copy is added.

Signed-off-by: zhanghongyu 
---
 net/ipforward/ipv4_forward.c | 24 
 net/ipforward/ipv6_forward.c | 24 
 2 files changed, 48 insertions(+)

diff --git a/net/ipforward/ipv4_forward.c b/net/ipforward/ipv4_forward.c
index 7fc7e2d61b..23a8da7418 100644
--- a/net/ipforward/ipv4_forward.c
+++ b/net/ipforward/ipv4_forward.c
@@ -341,6 +341,7 @@ int ipv4_forward_callback(FAR struct net_driver_s *fwddev, 
FAR void *arg)
 {
   FAR struct net_driver_s *dev = (FAR struct net_driver_s *)arg;
   FAR struct ipv4_hdr_s *ipv4;
+  FAR struct iob_s *iob;
   int ret;
 
   DEBUGASSERT(fwddev != NULL);
@@ -360,6 +361,24 @@ int ipv4_forward_callback(FAR struct net_driver_s *fwddev, 
FAR void *arg)
 
   if (fwddev != dev)
 {
+  /* Backup the forward IP packet */
+
+  iob = iob_tryalloc(true);
+  if (iob == NULL)
+{
+  nerr("ERROR: iob alloc failed when forward broadcast\n");
+  return -ENOMEM;
+}
+
+  iob_reserve(iob, CONFIG_NET_LL_GUARDSIZE);
+  ret = iob_clone_partial(dev->d_iob, dev->d_iob->io_pktlen, 0,
+  iob, 0, true, false);
+  if (ret < 0)
+{
+  iob_free_chain(iob);
+  return ret;
+}
+
   /* Recover the pointer to the IPv4 header in the receiving device's
* d_buf.
*/
@@ -371,9 +390,14 @@ int ipv4_forward_callback(FAR struct net_driver_s *fwddev, 
FAR void *arg)
   ret = ipv4_dev_forward(dev, fwddev, ipv4);
   if (ret < 0)
 {
+  iob_free_chain(iob);
   nwarn("WARNING: ipv4_dev_forward failed: %d\n", ret);
   return ret;
 }
+
+  /* Restore device iob with backup iob */
+
+  netdev_iob_replace(dev, iob);
 }
 
   return OK;
diff --git a/net/ipforward/ipv6_forward.c b/net/ipforward/ipv6_forward.c
index 0787a7593e..f60988da49 100644
--- a/net/ipforward/ipv6_forward.c
+++ b/net/ipforward/ipv6_forward.c
@@ -468,6 +468,7 @@ int ipv6_forward_callback(FAR struct net_driver_s *fwddev, 
FAR void *arg)
 {
   FAR struct net_driver_s *dev = (FAR struct net_driver_s *)arg;
   FAR struct ipv6_hdr_s *ipv6;
+  FAR struct iob_s *iob;
   int ret;
 
   DEBUGASSERT(fwddev != NULL);
@@ -487,6 +488,24 @@ int ipv6_forward_callback(FAR struct net_driver_s *fwddev, 
FAR void *arg)
 
   if (fwddev != dev)
 {
+  /* Backup the forward IP packet */
+
+  iob = iob_tryalloc(true);
+  if (iob == NULL)
+{
+  nerr("ERROR: iob alloc failed when forward broadcast\n");
+  return -ENOMEM;
+}
+
+  iob_reserve(iob, CONFIG_NET_LL_GUARDSIZE);
+  ret = iob_clone_partial(dev->d_iob, dev->d_iob->io_pktlen, 0,
+  iob, 0, true, false);
+  if (ret < 0)
+{
+  iob_free_chain(iob);
+  return ret;
+}
+
   /* Recover the pointer to the IPv6 header in the receiving device's
* d_buf.
*/
@@ -498,9 +517,14 @@ int ipv6_forward_callback(FAR struct net_driver_s *fwddev, 
FAR void *arg)
   ret = ipv6_dev_forward(dev, fwddev, ipv6);
   if (ret < 0)
 {
+  iob_free_chain(iob);
   nwarn("WARNING: ipv6_dev_forward failed: %d\n", ret);
   return ret;
 }
+
+  /* Restore device iob with backup iob */
+
+  netdev_iob_replace(dev, iob);
 }
 
   return OK;



[GitHub] [nuttx] xiaoxiang781216 merged pull request #9196: forward: copy iob when broadcast forward

2023-05-05 Thread via GitHub


xiaoxiang781216 merged PR #9196:
URL: https://github.com/apache/nuttx/pull/9196


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9138: libc/string: select arch's libc for kernel/userspace optionally

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#discussion_r1186422857


##
libs/libc/libc.h:
##
@@ -53,6 +55,14 @@
 
 #define LIB_BUFLEN_UNKNOWN INT_MAX
 
+#if defined(CONFIG_BUILD_PROTECTED) && \
+((defined(CONFIG_LIBC_ARCH_PREVENT_USER) && !defined(__KERNEL__)) || \
+(defined(CONFIG_LIBC_ARCH_PREVENT_KERNEL) && defined(__KERNEL__)))
+#  define LIBC_BUILD_FUNCTION 1
+#else
+#  define LIBC_BUILD_FUNCTION 0

Review Comment:
   remvove, let's check if defined(LIBC_BUILD_FUNCTION)?



##
libs/libc/machine/arm/armv7-a/gnu/arch_memchr.S:
##
@@ -66,6 +66,10 @@
  *
  /
 
+#include "libc.h"
+
+#if (LIBC_BUILD_FUNCTION == 0)

Review Comment:
   #ifdef LIBC_BUILD_FUNCTION
   and other similar place.
   Note: LIBC_ARCH_PREVENT_xxx should prevent only the rom function, but not 
assembler optimized version.



##
libs/libc/libc.h:
##
@@ -53,6 +55,14 @@
 
 #define LIB_BUFLEN_UNKNOWN INT_MAX
 
+#if defined(CONFIG_BUILD_PROTECTED) && \

Review Comment:
   #if !defined(CONFIG_BUILD_FLAT)



##
libs/libc/string/lib_memcpy.c:
##
@@ -34,7 +36,7 @@
  * Name: memcpy
  /
 
-#ifndef CONFIG_LIBC_ARCH_MEMCPY
+#if !defined(CONFIG_LIBC_ARCH_MEMCPY) || (LIBC_BUILD_FUNCTION)

Review Comment:
   #if defined(LIBC_BUILD_FUNCTION) && !defined(CONFIG_LIBC_ARCH_MEMCPY)
   and other similar place



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 opened a new pull request, #9197: boards/sim: Enable more sanitizer check when enable

2023-05-05 Thread via GitHub


xiaoxiang781216 opened a new pull request, #9197:
URL: https://github.com/apache/nuttx/pull/9197

   ## Summary
   
   to catch more runtime usage error
   
   ## Impact
   
   when enable ASAN/UBSAN
   
   ## Testing
   
   sim:asan


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] acassis commented on a diff in pull request #9195: icmpv6: add SOCK_RAW type support

2023-05-05 Thread via GitHub


acassis commented on code in PR #9195:
URL: https://github.com/apache/nuttx/pull/9195#discussion_r1186414653


##
net/icmpv6/icmpv6.h:
##
@@ -97,13 +97,19 @@ struct icmpv6_conn_s
*/
 
   struct iob_queue_s readahead;  /* Read-ahead buffering */
+  struct icmp6_filter filter;/* ICMP6 type filter */

Review Comment:
   Question: why `icmp6_filter` is not defined as `icmp6_filter_s` since it is 
a struct?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] acassis commented on pull request #9110: esp32s3: Add RTC support

2023-05-05 Thread via GitHub


acassis commented on PR #9110:
URL: https://github.com/apache/nuttx/pull/9110#issuecomment-1536650666

   Fixed! Thank you very much @pkarashchenko !!!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #9136: xtensa/esp32s3: Support octal lines mode SPIRAM

2023-05-05 Thread via GitHub


pkarashchenko commented on code in PR #9136:
URL: https://github.com/apache/nuttx/pull/9136#discussion_r1186229428


##
arch/xtensa/src/esp32s3/esp32s3_psram_octal.c:
##
@@ -0,0 +1,647 @@
+/
+ * arch/xtensa/src/esp32s3/esp32s3_psram_octal.c
+ *
+ * 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.
+ *
+ /
+
+/
+ * Included Files
+ /
+
+#include 
+#include 
+#include 
+#include 
+
+#include "xtensa.h"
+
+#include "esp32s3_gpio.h"
+#include "esp32s3_psram.h"
+#include "esp32s3_spi_timing.h"
+
+#include "hardware/esp32s3_spi_mem_reg.h"
+#include "hardware/esp32s3_iomux.h"
+#include "hardware/esp32s3_gpio.h"
+#include "hardware/esp32s3_gpio_sigmap.h"
+#include "rom/esp32s3_spiflash.h"
+#include "rom/esp32s3_opi_flash.h"
+
+/
+ * Pre-processor Definitions
+ /
+
+#define OPI_PSRAM_SYNC_READ 0x
+#define OPI_PSRAM_SYNC_WRITE0x8080
+#define OPI_PSRAM_REG_READ  0x4040
+#define OPI_PSRAM_REG_WRITE 0xC0C0
+#define OCT_PSRAM_RD_CMD_BITLEN 16
+#define OCT_PSRAM_WR_CMD_BITLEN 16
+#define OCT_PSRAM_ADDR_BITLEN   32
+#define OCT_PSRAM_RD_DUMMY_BITLEN   (2 * (10 - 1))
+#define OCT_PSRAM_WR_DUMMY_BITLEN   (2 * (5 - 1))
+
+#define OCT_PSRAM_CS_SETUP_TIME 3
+#define OCT_PSRAM_CS_HOLD_TIME  3
+#define OCT_PSRAM_CS_HOLD_DELAY 2
+
+/
+ * Private Types
+ /
+
+struct opi_psram_reg
+{
+union mr0_u
+  {
+struct
+  {
+uint8_t drive_str: 2;
+uint8_t read_latency: 3;
+uint8_t lt: 1;
+uint8_t rsvd0_1: 2;
+  };
+
+uint8_t val;
+  }
+mr0;
+
+union mr1_u
+  {
+struct
+  {
+uint8_t vendor_id: 5;
+uint8_t rsvd0_2: 3;
+  };
+
+uint8_t val;
+  }
+mr1;

Review Comment:
   need to fix style here (2 spaces indentation)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] ldube commented on pull request #9166: wireless/bluetooth: Support removable bluetooth modules.

2023-05-05 Thread via GitHub


ldube commented on PR #9166:
URL: https://github.com/apache/nuttx/pull/9166#issuecomment-1536420835

   Confirmed. Renaming locally generates the same error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] ldube commented on pull request #9166: wireless/bluetooth: Support removable bluetooth modules.

2023-05-05 Thread via GitHub


ldube commented on PR #9166:
URL: https://github.com/apache/nuttx/pull/9166#issuecomment-1536416419

   > > @acassis No. I pushed several changes after creating the pull request. I 
am in sync with ldube:master and 
[839109f](https://github.com/apache/nuttx/commit/839109f482ea84b9c5c79d7aa141822e11f05e9a)
 builds without issues on my machine.
   > 
   > Can you build the sim/nimble config? I think some of these changes are not 
compatible for example txstatus is behind the host config flag
   > 
   I think that is why. I don't understand why this 
CONFIG_WIRELESS_BLUETOOTH_HOST feature has to impose itself on such a simple 
little BLE stack. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] btashton commented on pull request #9166: wireless/bluetooth: Support removable bluetooth modules.

2023-05-05 Thread via GitHub


btashton commented on PR #9166:
URL: https://github.com/apache/nuttx/pull/9166#issuecomment-1536374013

   > @acassis No. I pushed several changes after creating the pull request. I 
am in sync with ldube:master and 839109f482ea84b9c5c79d7aa141822e11f05e9a 
builds without issues on my machine.
   
   Can you build the sim/nimble config? I think some of these changes are not 
compatible for example txstatus is behind the host config flag
   
   
https://github.com/apache/nuttx/blob/839109f482ea84b9c5c79d7aa141822e11f05e9a/wireless/bluetooth/bt_hcicore.h#L72-L105


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] ldube commented on pull request #9166: wireless/bluetooth: Support removable bluetooth modules.

2023-05-05 Thread via GitHub


ldube commented on PR #9166:
URL: https://github.com/apache/nuttx/pull/9166#issuecomment-1536366609

   @acassis No. I pushed several changes after creating the pull request. I am 
in sync with ldube:master and 839109f482ea84b9c5c79d7aa141822e11f05e9a builds 
without issues on my machine.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] tmedicci commented on pull request #9138: libc/string: select arch's libc for kernel/userspace optionally

2023-05-05 Thread via GitHub


tmedicci commented on PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#issuecomment-1536254585

   > @tmedicci Please, rebase to resolve new conflicts.
   
   done!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] gustavonihei commented on pull request #9138: libc/string: select arch's libc for kernel/userspace optionally

2023-05-05 Thread via GitHub


gustavonihei commented on PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#issuecomment-1536239638

   @tmedicci Please, rebase to resolve new conflicts.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] tmedicci commented on pull request #9138: libc/string: select arch's libc for kernel/userspace optionally

2023-05-05 Thread via GitHub


tmedicci commented on PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#issuecomment-1536237327

   @xiaoxiang781216 and @pkarashchenko , could you please take a look?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] acassis commented on pull request #9166: wireless/bluetooth: Support removable bluetooth modules.

2023-05-05 Thread via GitHub


acassis commented on PR #9166:
URL: https://github.com/apache/nuttx/pull/9166#issuecomment-1536224866

   @ldube did you see these errors?
   ```
   bluetooth/bt_hcicore.c: In function 'hci_tx_kthread':
   Error: bluetooth/bt_hcicore.c:988:17: error: 'struct bt_dev_s' has no member 
named 'tx_status'
 988 |   for (; g_btdev.tx_status == OK; )
 | ^
   Error: bluetooth/bt_hcicore.c:1021:18: error: 'struct bt_dev_s' has no 
member named 'tx_status'
1021 |   if (g_btdev.tx_status == OK)
 |  ^
   Error: bluetooth/bt_hcicore.c:1036:10: error: 'struct bt_dev_s' has no 
member named 'tx_status'
1036 |   g_btdev.tx_status = ESHUTDOWN;
 |  ^
   bluetooth/bt_hcicore.c: In function 'cmd_queue_init':
   Error: bluetooth/bt_hcicore.c:1456:10: error: 'struct bt_dev_s' has no 
member named 'tx_status'
1456 |   g_btdev.tx_status = OK;
 |  ^
   bluetooth/bt_hcicore.c: In function 'cmd_queue_deinit':
   Error: bluetooth/bt_hcicore.c:1486:10: error: 'struct bt_dev_s' has no 
member named 'tx_status'
1486 |   g_btdev.tx_status = ENOTCONN;
 |  ^
   Error: bluetooth/bt_hcicore.c:1497:9: error: implicit declaration of 
function 'bt_hci_cmd_create' [-Werror=implicit-function-declaration]
1497 |   buf = bt_hci_cmd_create(BT_HCI_OP_RESET, 0);
 | ^
   Error: bluetooth/bt_hcicore.c:1497:7: error: assignment to 'struct bt_buf_s 
*' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
1497 |   buf = bt_hci_cmd_create(BT_HCI_OP_RESET, 0);
 |   ^
   Error: bluetooth/bt_hcicore.c:1509:17: error: 'struct bt_dev_s' has no 
member named 'tx_status'
1509 |   while (g_btdev.tx_status == ENOTCONN)
 | ^
   bluetooth/bt_hcicore.c: In function 'bt_initialize':
   Error: bluetooth/bt_hcicore.c:1568:3: error: 'g_callback_list' undeclared 
(first use in this function)
1568 |   g_callback_list = NULL;
 |   ^~~
   bluetooth/bt_hcicore.c:1568:3: note: each undeclared identifier is reported 
only once for each function it appears in
   Error: bluetooth/bt_hcicore.c:1569:3: error: 'g_scan_dev_found_cb' 
undeclared (first use in this function)
1569 |   g_scan_dev_found_cb = NULL;
 |   ^~~
   cc1: all warnings being treated as errors
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9040: [SYSLOG] avoid concurrent modification by other tasks

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9040:
URL: https://github.com/apache/nuttx/pull/9040#discussion_r1186039297


##
drivers/syslog/syslog_write.c:
##
@@ -62,6 +62,13 @@ static ssize_t syslog_default_write(FAR const char *buffer, 
size_t buflen)
 
   if (up_interrupt_context() || sched_idletask())
 {
+#ifdef CONFIG_SYSLOG_INTBUFFER
+  if (up_interrupt_context())
+{
+  sched_lock();

Review Comment:
   but sched_lock can't use to protect the shared resource in SMP case.
   please reference https://github.com/apache/nuttx/issues/3600 and 
https://github.com/apache/nuttx/issues/3352



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9040: [SYSLOG] avoid concurrent modification by other tasks

2023-05-05 Thread via GitHub


xiaoxiang781216 commented on code in PR #9040:
URL: https://github.com/apache/nuttx/pull/9040#discussion_r1186039297


##
drivers/syslog/syslog_write.c:
##
@@ -62,6 +62,13 @@ static ssize_t syslog_default_write(FAR const char *buffer, 
size_t buflen)
 
   if (up_interrupt_context() || sched_idletask())
 {
+#ifdef CONFIG_SYSLOG_INTBUFFER
+  if (up_interrupt_context())
+{
+  sched_lock();

Review Comment:
   but sched_lock can't use to protect the shared resource in SMP case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] chenzhihong007 commented on issue #5020: ramdisk can be created,but mkfatfs /dev/ram0 falied with errno = 6

2023-05-05 Thread via GitHub


chenzhihong007 commented on issue #5020:
URL: https://github.com/apache/nuttx/issues/5020#issuecomment-1536072611

   I got it, thank you very much! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[nuttx] branch master updated (31b2f9c40c -> bd122915f0)

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

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


from 31b2f9c40c syslog: add syslog option definition
 add bd122915f0 xtensa/esp32s3: Support octal lines mode SPIRAM

No new revisions were added by this update.

Summary of changes:
 .../xtensa/esp32s3/boards/esp32s3-devkit/index.rst |  32 +
 arch/xtensa/src/esp32s3/Kconfig|  23 +
 arch/xtensa/src/esp32s3/Make.defs  |  11 +-
 arch/xtensa/src/esp32s3/esp32s3_allocateheap.c |  12 +
 arch/xtensa/src/esp32s3/esp32s3_psram_octal.c  | 647 +
 .../{esp32s3_psram.c => esp32s3_psram_quad.c}  |   2 +-
 arch/xtensa/src/esp32s3/esp32s3_spi_timing.c   | 366 
 arch/xtensa/src/esp32s3/esp32s3_spi_timing.h   | 170 ++
 arch/xtensa/src/esp32s3/esp32s3_spiram.c   |  24 +-
 arch/xtensa/src/esp32s3/esp32s3_spiram.h   |  16 +
 arch/xtensa/src/esp32s3/esp32s3_start.c|   9 +
 .../src/esp32s3/hardware/esp32s3_spi_mem_reg.h |   6 +-
 arch/xtensa/src/esp32s3/rom/esp32s3_opi_flash.h|   1 -
 arch/xtensa/src/esp32s3/rom/esp32s3_spiflash.h |  25 +-
 .../configs/{random => psram_octal}/defconfig  |   7 +-
 .../configs/{watchdog => psram_quad}/defconfig |   8 +-
 16 files changed, 1332 insertions(+), 27 deletions(-)
 create mode 100644 arch/xtensa/src/esp32s3/esp32s3_psram_octal.c
 rename arch/xtensa/src/esp32s3/{esp32s3_psram.c => esp32s3_psram_quad.c} (99%)
 create mode 100644 arch/xtensa/src/esp32s3/esp32s3_spi_timing.c
 create mode 100644 arch/xtensa/src/esp32s3/esp32s3_spi_timing.h
 copy boards/xtensa/esp32s3/esp32s3-devkit/configs/{random => 
psram_octal}/defconfig (90%)
 copy boards/xtensa/esp32s3/esp32s3-devkit/configs/{watchdog => 
psram_quad}/defconfig (92%)



[GitHub] [nuttx] xiaoxiang781216 merged pull request #9136: xtensa/esp32s3: Support octal lines mode SPIRAM

2023-05-05 Thread via GitHub


xiaoxiang781216 merged PR #9136:
URL: https://github.com/apache/nuttx/pull/9136


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[nuttx] branch master updated: syslog: add syslog option definition

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

xiaoxiang 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 31b2f9c40c syslog: add syslog option definition
31b2f9c40c is described below

commit 31b2f9c40c41267094957c4edf1c2f7b07f367e3
Author: zhanghongyu 
AuthorDate: Fri Apr 14 21:55:51 2023 +0800

syslog: add syslog option definition

adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu 
---
 include/syslog.h | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/include/syslog.h b/include/syslog.h
index a391eee11c..0a7ae81e13 100644
--- a/include/syslog.h
+++ b/include/syslog.h
@@ -52,6 +52,13 @@
  *   LOG_PID  - Include PID with each message.
  */
 
+#define LOG_PID 0x01/* log the pid with each message */
+#define LOG_CONS0x02/* log on the console if errors in sending */
+#define LOG_ODELAY  0x04/* delay open until first syslog() (default) */
+#define LOG_NDELAY  0x08/* don't delay open */
+#define LOG_NOWAIT  0x10/* don't wait for console forks: DEPRECATED */
+#define LOG_PERROR  0x20/* log to stderr as well */
+
 /* Note: openlog() is not currently supported */
 
 /* The facility argument is used to specify what type of program is logging
@@ -162,9 +169,8 @@ extern "C"
  *
  /
 
-#if 0 /* Not supported */
-void openlog(FAR const char *ident, int option, int facility);
-#endif
+/* Not supported */
+#define openlog(i, o, f) {(void)(i); (void)(o); (void)(f);}
 
 /
  * Name: closelog
@@ -176,9 +182,8 @@ void openlog(FAR const char *ident, int option, int 
facility);
  *
  /
 
-#if 0 /* Not supported */
-void closelog(void);
-#endif
+/* Not supported */
+#define closelog()
 
 /
  * Name: syslog and vsyslog



[GitHub] [nuttx] xiaoxiang781216 merged pull request #9176: syslog: add syslog option definition

2023-05-05 Thread via GitHub


xiaoxiang781216 merged PR #9176:
URL: https://github.com/apache/nuttx/pull/9176


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] TimJTi commented on issue #5020: ramdisk can be created,but mkfatfs /dev/ram0 falied with errno = 6

2023-05-05 Thread via GitHub


TimJTi commented on issue #5020:
URL: https://github.com/apache/nuttx/issues/5020#issuecomment-1535999653

   From menuconfig, type a forward slash and it will open a search function. 
Type MKFATFS and it will show you that FSUTILS_MKFATFS is what you need, and it 
is dependent on FS_FAT etc. It even tells you if those dependencies are enabled.
   

   
   You can type the number of the relevant search result (1, in this case) and 
it will take you directly to the menuconfig entry, assuming the dependencies 
allow it to be visible.
   

   
   HTH!
   

   
   From: chenzhihong007 ***@***.***> 
   Sent: Friday, May 5, 2023 9:55 AM
   To: apache/nuttx ***@***.***>
   Cc: Subscribed ***@***.***>
   Subject: Re: [apache/nuttx] ramdisk can be created,but mkfatfs /dev/ram0 
falied with errno = 6 (Issue #5020)
   

   
   In my case, nsh can't found mkfatfs command. How can I configuration to 
enable mkfatfs? Thank you!


 
   
   —
   Reply to this email directly, view it on GitHub 
 , or 
unsubscribe 

 .
   You are receiving this because you are subscribed to this thread.  

 Message ID: ***@***.*** ***@***.***> >
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] klxing commented on pull request #2987: STM32H7: Add new FDCAN driver

2023-05-05 Thread via GitHub


klxing commented on PR #2987:
URL: https://github.com/apache/nuttx/pull/2987#issuecomment-1535998254

   > ## Summary
   > This is a draft PR. Style checks will fail and there is still some code 
that needs to be cleaned up and reviewed. I want to get this out in the open so 
others can get eyes on it.
   > 
   > The STM32H7 FDCAN block is a significant departure from the F7 and F4, so 
a lot has changed here. Fortunately, the SAMv7 series of chips use a nearly 
identical version of this IP, so that driver served as the starting point. The 
major difference between this controller and the one present in the F7 and F4 
is the presence of the Message RAM. This is a 10 kB block of SRAM dedicated 
entirely to the FDCAN block and shared by the two independent FDCAN 
controllers. Each controller instantiates RX/TX FIFOs and buffers here to hold 
CAN messages. Also instantiated here are separate sets of filters for standard 
and extended length ID messages. The layout of the message ram is incredibly 
important to the proper operation of the controllers, so it is imperative that 
the driver get this right. The layout of the message RAM is fully configurable 
by the user via menuconfig. To help prevent invalid configurations, each config 
option has appropriate limits and a compile-time check ensures that t
 he limits of the message RAM are not exceeded.
   > 
   > In its current state, the driver is functioning properly, but there is 
room for considerable improvement. Things that work:
   > 
   > * Both controllers function and can be individually configured
   > * Blocking and non-blocking operation both work as expected
   > * Standard and extended ID messages can be sent and received
   > * Hardware FIFOs for RX and TX
   > * Hardware loopback mode
   > * Classic CAN mode
   > 
   > ## Impact
   > Adds a shiny new driver!
   > 
   > ## Testing
   > Used the can example app to send a few thousand extended and standard 
length ID messages per test. I ran several of these tests in both blocking and 
non-blocking mode. I also tested using the FDCAN controller's built in hardware 
loopback as well as between two separate boards running the can example app. As 
as side note, I had to modify the can example app to get this to work properly, 
so I should probably commit that too.
   > 
   > The driver has also been used to send and receive standard length ID 
messages to CAN-based device controllers. These were sent alongside extended ID 
messages passed by UAVCAN without issue.
   > 
   > ## Important notes and things that need to be worked on
   > * There are a number of things that need to be addressed; these items are 
marked with REVIST comments
   > * I am uncertain about whether the message RAM is cacheable. The memory 
mapped address falls within the peripheral device space, which as far as I can 
tell is uncacheable. I could be wrong about this, but the driver currently 
seems to work as expected without any cache coherency operations in play.
   > * The fdcan_reserve_buffer() function did not support non-blocking 
operation in the SAMv7 version of this driver. In that variation, the function 
utilized the nxsem_wait() function and looped until it was able to grab a 
buffer semaphore. I changed this over to nxsem_trywait() and then immediately 
return. The return code is inspected by fdcan_send(); if < 0, that function 
returns without sending the desired data. This prevents the driver from 
blocking when the hardware TX FIFO is full.
   > * There is a single RCC reset line for the FDCAN block, meaning both 
controllers are reset together. The fdcan_reset() function currently makes use 
of this, which is no good if you have another piece of software controlling the 
device as well (Lookin' at you PX4 UAVCAN :p ). A better approach to resetting 
a single controller would be to put it into the init state and manually set all 
registers to the reset value. I have not done this yet.
   > * I have not tested the busoff recovery functionality brought over from 
the SAMv7 driver
   > * I have not tested whether IOCTL commands for adding and deleting filters 
works. I have only tested the driver working in the default "accept everything, 
reject nothing" mode.
   > * I have not tested FD mode or bit rate switching. The code and Kconfig 
options are present for it.
   > * I have not tested whether the TX hardware queue mode works, but the 
implementation was brought over from the SAMv7 driver
   > * Remote request support is not currently implemented
   
   Hi, is there any example code that I can refer to send/receive classic CAN 
messages on stm32h7?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] pussuw commented on pull request #9103: arch/riscv: Fixed FPU register error

2023-05-05 Thread via GitHub


pussuw commented on PR #9103:
URL: https://github.com/apache/nuttx/pull/9103#issuecomment-1535984368

   > > Now I think I understand what might be going on, and indeed the problem 
is that we save and restore the registers even if a context switch does not 
happen.
   > > I now remember what has happened, we needed to do this change #5905 
because restoring the next task's FPU registers from the stack did not work 
with CONFIG_ARCH_ADDRENV=y because the wrong address environment was in use 
(stack virtual address points to wrong context).
   > > My suggestion is that we try again to do the lazy FPU save / restore 
only when a context switch happens, not when an exception is taken. What do you 
think @xiaoxiang781216 @SunJun8 ?
   > 
   > @pussuw My patch aims to address the following issue: after completing 
exception handling when the FS bit in mstatus is not dirty, the fpu registers 
are still restored, leading to incorrect fpu register values. My patch does not 
change the timing of saving and restoring fpu registers, but ensures that fpu 
registers are only restored when the FS bit is dirty.
   
   @SunJun8 Yes I understand and it fixes loading the wrong registers. But IMHO 
the problem is that we use the lazy FPU feature incorrectly.
   
   It is fine by me to merge this patch, it looks good to me. But it fixes a 
problem we should not have in the first place. We have to keep in mind that the 
current lazy FPU implementation in RISC-V does extra work. FPU needs 
save/restore ONLY when the context changes. Maybe I can make an issue for it ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] SunJun8 commented on pull request #9103: arch/riscv: Fixed FPU register error

2023-05-05 Thread via GitHub


SunJun8 commented on PR #9103:
URL: https://github.com/apache/nuttx/pull/9103#issuecomment-1535966141

   > Now I think I understand what might be going on, and indeed the problem is 
that we save and restore the registers even if a context switch does not happen.
   > 
   > I now remember what has happened, we needed to do this change #5905 
because restoring the next task's FPU registers from the stack did not work 
with CONFIG_ARCH_ADDRENV=y because the wrong address environment was in use 
(stack virtual address points to wrong context).
   > 
   > My suggestion is that we try again to do the lazy FPU save / restore only 
when a context switch happens, not when an exception is taken. What do you 
think @xiaoxiang781216 @SunJun8 ?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] SunJun8 closed pull request #9103: arch/riscv: Fixed FPU register error

2023-05-05 Thread via GitHub


SunJun8 closed pull request #9103: arch/riscv: Fixed FPU register error
URL: https://github.com/apache/nuttx/pull/9103


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] chenzhihong007 commented on issue #5020: ramdisk can be created,but mkfatfs /dev/ram0 falied with errno = 6

2023-05-05 Thread via GitHub


chenzhihong007 commented on issue #5020:
URL: https://github.com/apache/nuttx/issues/5020#issuecomment-1535940027

   In my case, nsh can't found mkfatfs command. How can I configuration to 
enable mkfatfs? Thank you!
   
![image](https://user-images.githubusercontent.com/109498998/236416066-e17894a3-7346-4191-b94a-134514378e1a.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] zhhyu7 opened a new pull request, #9196: forward: copy iob when broadcast forward

2023-05-05 Thread via GitHub


zhhyu7 opened a new pull request, #9196:
URL: https://github.com/apache/nuttx/pull/9196

   ## Summary
   since iob offload, ipvx_dev_forward will remove d_iob, if there are multiple 
devices, d_iob will be NULL when dev_forward is entered second time. and the 
device that receives the packet cannot process the packet after forwarding it. 
so the iob copy is added.
   ## Impact
   
   ## Testing
   sim:local
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] zhhyu7 commented on pull request #9176: syslog: add syslog option definition

2023-05-05 Thread via GitHub


zhhyu7 commented on PR #9176:
URL: https://github.com/apache/nuttx/pull/9176#issuecomment-1535931005

   @xiaoxiang781216 , I went back to the implementation of the macro 
definition, it looks like there are no compilation issues now. please review, 
thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[nuttx] branch master updated (d6747dd6ad -> 26e2e1e32f)

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

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


from d6747dd6ad libc/armv8-m: fix build break if MVE is disabled
 add 26e2e1e32f net/udp: Remove wrong check in udp_readahead

No new revisions were added by this update.

Summary of changes:
 net/udp/udp_recvfrom.c | 2 --
 1 file changed, 2 deletions(-)



[GitHub] [nuttx] pkarashchenko merged pull request #9194: net/udp: Remove wrong check in udp_readahead

2023-05-05 Thread via GitHub


pkarashchenko merged PR #9194:
URL: https://github.com/apache/nuttx/pull/9194


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] zhhyu7 opened a new pull request, #9195: icmpv6: add SOCK_RAW type support

2023-05-05 Thread via GitHub


zhhyu7 opened a new pull request, #9195:
URL: https://github.com/apache/nuttx/pull/9195

   The third-party library we are porting will send and receive ICMPV6 messages 
(router_advert / router_solicit / neighbor_advert / neighbor_solicit etc.) from 
the user space itself, so we added the SOCK_RAW related implementation for 
ICMPV6.
   
   ## Summary
   
   ## Impact
   
   ## Testing
   sim:local
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] wengzhe opened a new pull request, #9194: net/udp: Remove wrong check in udp_readahead

2023-05-05 Thread via GitHub


wengzhe opened a new pull request, #9194:
URL: https://github.com/apache/nuttx/pull/9194

   ## Summary
   - Before IOB offload, `srcaddr` / `src_addr_size` / `ifindex` are written 
into IOB by `iob_trycopyin`, so `io_pktlen > 0` is always true, this check is 
correct at that time. (It won't fail with zero-length UDP datagram.)
   - After IOB offload, `srcaddr` / `src_addr_size` / `ifindex` are written 
into offset 0, without increasing `io_pktlen`. So this check will fail with 
zero-length UDP datagram now.
   - We need to support zero-length UDP datagram and this check is unnecessary 
at this point.
 - 
https://stackoverflow.com/questions/5307031/how-to-detect-receipt-of-a-0-length-udp-datagram
 - 
https://github.com/apache/nuttx/blob/nuttx-12.1.0/net/udp/udp_callback.c#L214
   
   ## Impact
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nuttx] jerpelea merged pull request #9193: libc/armv8-m: fix build break if MVE is disabled

2023-05-05 Thread via GitHub


jerpelea merged PR #9193:
URL: https://github.com/apache/nuttx/pull/9193


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[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(-)