Re: [I] rv-virt/knsh32 crashes after runing ELF app [nuttx]

2024-04-12 Thread via GitHub


yf13 closed issue #12123: rv-virt/knsh32 crashes after runing ELF app 
URL: https://github.com/apache/nuttx/issues/12123


-- 
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



Re: [I] rv-virt/knsh32 crashes after runing ELF app [nuttx]

2024-04-12 Thread via GitHub


yf13 commented on issue #12123:
URL: https://github.com/apache/nuttx/issues/12123#issuecomment-2053379333

   Duplicated with issue #11803.


-- 
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: 64ae20e5a4df5e2feedb7e48b9ccd7cbb790aa4f docs: 3ce84d1ba0e7bfd2c21ad79edb762d10ca4d289c

2024-04-12 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 3946fd43a Publishing web: 64ae20e5a4df5e2feedb7e48b9ccd7cbb790aa4f 
docs: 3ce84d1ba0e7bfd2c21ad79edb762d10ca4d289c
3946fd43a is described below

commit 3946fd43ac357a1610e54bec3c2be1844fe864d4
Author: Alin Jerpelea 
AuthorDate: Sat Apr 13 00:16:26 2024 +

Publishing web: 64ae20e5a4df5e2feedb7e48b9ccd7cbb790aa4f docs: 
3ce84d1ba0e7bfd2c21ad79edb762d10ca4d289c
---
 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 +-
 content/docs/12.2.0/index.html | 2 +-
 content/docs/12.2.0/searchindex.js | 2 +-
 content/docs/12.2.1/index.html | 2 +-
 content/docs/12.2.1/searchindex.js | 2 +-
 content/docs/12.3.0/index.html | 2 +-
 content/docs/12.3.0/searchindex.js | 2 +-
 content/docs/12.4.0/index.html | 2 +-
 content/docs/12.4.0/searchindex.js | 2 +-
 content/docs/12.5.0/index.html | 2 +-
 content/docs/12.5.0/searchindex.js | 2 +-
 content/docs/latest/index.html | 2 +-
 content/docs/latest/searchindex.js | 2 +-
 content/feed.xml   | 4 ++--
 29 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/content/docs/10.0.0/index.html b/content/docs/10.0.0/index.html
index 2e1104b7e..258ccf64f 100644
--- a/content/docs/10.0.0/index.html
+++ b/content/docs/10.0.0/index.html
@@ -131,7 +131,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: 12 April 24 at 00:10
+Last Updated: 13 April 24 at 00:09
 
 Table of 
Contents
 
diff --git a/content/docs/10.0.0/searchindex.js 
b/content/docs/10.0.0/searchindex.js
index 2027a268b..e3db510db 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/chara [...]
\ 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/chara [...]
\ 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 1c93cfa7f..2b65102b0 100644
--- a/content/docs/10.0.1/index.html
+++ b/content/docs/10.0.1/index.html
@@ -157,7 +157,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: 12 April 24 at 00:10
+Last Updated: 13 April 24 at 00:09
 
 Table of 
Contents
 
diff --git a/content/docs/10.0.1/searchindex.js 
b/content/docs/10.0.1/searchindex.js
index f23413eb2..20861d92e 

[PR] arch/risc-v: fix RV32 up_addrenv_destroy [nuttx]

2024-04-12 Thread via GitHub


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

   
   ## Summary
   This patch fixes [issue 12123(]https://github.com/apache/nuttx/issue/12123) 
for RV32, where the cleaning scan should be limited to user space only.
   
   ## Impact
   RV32 kernel mode
   
   ## Testing
   rv-virt/knsh32 with DEBUG_ASSERTIONS enabled.
   
   


-- 
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



Re: [PR] apps/nsh_commands: Use quit to poweroff [nuttx-apps]

2024-04-12 Thread via GitHub


acassis commented on PR #2355:
URL: https://github.com/apache/nuttx-apps/pull/2355#issuecomment-2052505222

   I tried to use "exit", but exit is already used internally to exit from nsh 
or telnet, where poweroff is used to turn-off the board


-- 
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



Re: [PR] apps/nsh_commands: Use quit to poweroff [nuttx-apps]

2024-04-12 Thread via GitHub


cederom commented on PR #2355:
URL: https://github.com/apache/nuttx-apps/pull/2355#issuecomment-2052497951

   Unix uses `exit` rather than `quit` can we change that to `exit` ?
   
   Also it would be nice to configure `exit` behavior to be `poweroff` or 
`reboot`..? 


-- 
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



Re: [PR] arch/arm/src/samv7/sam_qencoder.c: add support for GETINDEX ioctl call [nuttx]

2024-04-12 Thread via GitHub


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

   > I'm sorry for my inactivity, however I'm considering everything and I'll 
look into it further at the end of this week. Thanks for feedback.
   
   Don't worry! The most important is getting it working correctly!


-- 
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: canutils: Fix minor style issue found in canlib

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

acassis 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 9d67f3806 canutils: Fix minor style issue found in canlib
9d67f3806 is described below

commit 9d67f38062737d4aa0674f4d41f1942dfa993547
Author: Xiang Xiao 
AuthorDate: Sun Apr 7 13:28:07 2024 +0800

canutils: Fix minor style issue found in canlib

no functional change

Signed-off-by: Xiang Xiao 
---
 canutils/canlib/canlib_getbaud.c | 10 ++
 canutils/canlib/canlib_getloopback.c | 13 +++--
 canutils/canlib/canlib_getsilent.c   | 17 +
 canutils/canlib/canlib_setbaud.c |  7 +--
 canutils/canlib/canlib_setloopback.c |  8 +---
 canutils/canlib/canlib_setsilent.c   | 12 +++-
 include/canutils/canlib.h| 12 ++--
 7 files changed, 21 insertions(+), 58 deletions(-)

diff --git a/canutils/canlib/canlib_getbaud.c b/canutils/canlib/canlib_getbaud.c
index f8e2655c9..23965e70e 100644
--- a/canutils/canlib/canlib_getbaud.c
+++ b/canutils/canlib/canlib_getbaud.c
@@ -22,15 +22,10 @@
  * Included Files
  /
 
-#include 
-
 #include 
-
-#include 
-#include 
-#include 
 #include 
 #include 
+
 #include 
 
 /
@@ -63,10 +58,9 @@ int canlib_getbaud(int fd, FAR int *bauds)
   if (ret != OK)
 {
   canerr("CANIOC_GET_BITTIMING failed, errno=%d\n", errno);
-  return 0;
+  return ret;
 }
 
   *bauds = timings.bt_baud;
-
   return ret;
 }
diff --git a/canutils/canlib/canlib_getloopback.c 
b/canutils/canlib/canlib_getloopback.c
index 5c13614ca..f9ba5fdf3 100644
--- a/canutils/canlib/canlib_getloopback.c
+++ b/canutils/canlib/canlib_getloopback.c
@@ -22,16 +22,10 @@
  * Included Files
  /
 
-#include 
-
 #include 
-
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
+
 #include 
 
 /
@@ -64,10 +58,9 @@ int canlib_getloopback(int fd, FAR bool *loopback)
   if (ret != OK)
 {
   canerr("CANIOC_GET_CONNMODES failed, errno=%d\n", errno);
-  return FALSE;
+  return ret;
 }
 
-  *loopback = (bool)connmodes.bm_loopback;
-
+  *loopback = connmodes.bm_loopback;
   return ret;
 }
diff --git a/canutils/canlib/canlib_getsilent.c 
b/canutils/canlib/canlib_getsilent.c
index 10af602a4..ffb4abfed 100644
--- a/canutils/canlib/canlib_getsilent.c
+++ b/canutils/canlib/canlib_getsilent.c
@@ -22,16 +22,10 @@
  * Included Files
  /
 
-#include 
-
 #include 
-
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
+
 #include 
 
 /
@@ -45,8 +39,8 @@
  *   Wrapper for CANIOC_GET_CONNMODES.
  *
  * Input Parameter:
- *   fd   - file descriptor of an opened can device
- *   loopback - pointer to a buffer to store the current silent mode state.
+ *   fd - file descriptor of an opened can device
+ *   silent - pointer to a buffer to store the current silent mode state.
  *
  * Returned Value:
  *   Zero (OK) is returned on success.  Otherwise -1 (ERROR)
@@ -64,10 +58,9 @@ int canlib_getsilent(int fd, FAR bool *silent)
   if (ret != OK)
 {
   canerr("CANIOC_GET_CONNMODES failed, errno=%d\n", errno);
-  return FALSE;
+  return ret;
 }
 
-  *silent = (bool)connmodes.bm_silent;
-
+  *silent = connmodes.bm_silent;
   return ret;
 }
diff --git a/canutils/canlib/canlib_setbaud.c b/canutils/canlib/canlib_setbaud.c
index c2e9c3086..0b4fa322a 100644
--- a/canutils/canlib/canlib_setbaud.c
+++ b/canutils/canlib/canlib_setbaud.c
@@ -22,15 +22,10 @@
  * Included Files
  /
 
-#include 
-
 #include 
-
-#include 
-#include 
-#include 
 #include 
 #include 
+
 #include 
 
 /
diff --git a/canutils/canlib/canlib_setloopback.c 
b/canutils/canlib/canlib_setloopback.c
index f97cc792c..bc88956c8 100644
--- a/canutils/canlib/canlib_setloopback.c
+++ b/canutils/canlib/canlib_setloopback.c
@@ -22,16 +22,10 @@
  * Included Files
  /
 
-#include 
-
 #include 
-
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
+
 #include 
 
 /
diff --git a/canutils/canlib/canlib_setsilent.c 
b/canutils/canlib/canlib_setsilent.c
index 5a1978571..da05f01b1 100644
--- a/canutils/canlib/canlib_setsilent.c
+++ 

Re: [PR] canutils: Fix minor style issue found in canlib [nuttx-apps]

2024-04-12 Thread via GitHub


acassis merged PR #2347:
URL: https://github.com/apache/nuttx-apps/pull/2347


-- 
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



Re: [PR] mtd_config_fs: support align size test [nuttx-apps]

2024-04-12 Thread via GitHub


acassis commented on PR #2354:
URL: https://github.com/apache/nuttx-apps/pull/2354#issuecomment-2052303412

   @zhaoxingyu12 Please include comments in the commit log, explaining the 
previous issue.


-- 
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



Re: [PR] mtd_config_fs: support align size test [nuttx-apps]

2024-04-12 Thread via GitHub


acassis commented on code in PR #2354:
URL: https://github.com/apache/nuttx-apps/pull/2354#discussion_r1563027745


##
testing/mtd_config_fs/mtd_config_fs_test_main.c:
##
@@ -513,6 +523,18 @@ static void test_nvs_corrupt_expire(struct mtdnvs_ctx_s 
*ctx)
   goto test_fail;
 }
 
+  padding_size = NVS_ALIGN_UP(sizeof(TEST_KEY1) + sizeof(TEST_DATA1))
+- sizeof(TEST_KEY1) - sizeof(TEST_DATA1);

Review Comment:
   ```suggestion
   - sizeof(TEST_KEY1) - sizeof(TEST_DATA1);



-- 
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



[PR] apps/nsh_commands: Use exit/quit to poweroff [nuttx-apps]

2024-04-12 Thread via GitHub


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

   ## Summary
   Currently new users when try to run NuttX using the SIM get stuck into 
simulator, because they have no idea that poweroff command is used to leave it. 
Let use KISS approach and use quit and exit as alias to poweroff command.
   ## Impact
   Make it easier to user to leave SIM
   ## Testing
   sim
   


-- 
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



Re: [PR] apps/lvgl: upgrade to lvgl version v9 [nuttx-apps]

2024-04-12 Thread via GitHub


acassis commented on PR #2312:
URL: https://github.com/apache/nuttx-apps/pull/2312#issuecomment-2052244492

   > it's resolved internally by osource: 
https://docs.zephyrproject.org/latest/build/kconfig/extensions.html
   
   Interesting, but it doesn't solve all the issue, because the LVGL confirm 
only will show up to users after the tarball is downloaded. That only will 
happen in the building phase.
   
   Also it is incompatible with kconfig-frontend (Kconflib has some issue, if 
you search for CONFIG_SYMBOL it will not find, you need to search only for 
SYMBOL, kconfig-frontend works with both).
   
   @XuNeo maybe an alternative is just create an empty lvgl repository with 
only the Kconfig from LVGL 9.x, then before the tarball is decompressed we 
remove the fake lvgl and will be created again when the tarball is extracted.


-- 
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



Re: [PR] apps/lvgl: upgrade to lvgl version v9 [nuttx-apps]

2024-04-12 Thread via GitHub


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

   it's resolved internally by osource:
   https://docs.zephyrproject.org/latest/build/kconfig/extensions.html


-- 
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



[PR] Improvements relating to SAMA5 TSD driver [nuttx]

2024-04-12 Thread via GitHub


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

   ## Summary
   Ongoing work using the SAMA5(D2) touchscreen device demonstrated a number of 
shortcomings with the existing driver, as well as finding a few style errors.
   
   The main issue was poor touch response as well as interactions with the ADC 
functions when used in conjunction with the TSD, so there are changes that 
improve that, although in the end not all may have been necessary but they do 
make the driver a little more flexible and more predictable in its behaviour.
   
   ## Impact
   Intended that the changes are benign and would not affect anyone using the 
driver already in a negative way
   
   ## Testing
   Custom board with a SAMA5D27C-D1G and 800x480 LCD with resistive touch.
   
   


-- 
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



Re: [PR] apps/lvgl: upgrade to lvgl version v9 [nuttx-apps]

2024-04-12 Thread via GitHub


acassis commented on PR #2312:
URL: https://github.com/apache/nuttx-apps/pull/2312#issuecomment-2052077509

   > I'm not an expert on NuttX, so please forgive me the silly question: why 
don't you have the same issue with other 3rd party libraries used in NuttX? I 
think LVGL uses Kconfig in a rather standard way, which should be similar to 
other libs in this regard.
   
   Hi @kisvegabor, the issue is because when "make menuconfig" runs it expects 
the Kconfig to exist with the options to let users to select it. This is a 
classic chicken/egg dilemma. I think we don't have issues with other libs 
because none of then uses Kconfig.
   
   If Kconfig front-end was dynamic and let to run scripts when user just 
select a lib, we could download LVGL after user select he wants it, then the 
Kconfig from LVGL could be extracted and used inside menuconfig.
   
   @XuNeo any update?


-- 
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) 02/02: arch and board esp32c3-legacy: Add optional iCE40 FPGA loading support

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

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

commit 3ce84d1ba0e7bfd2c21ad79edb762d10ca4d289c
Author: Jakub Janousek 
AuthorDate: Thu Mar 21 16:29:22 2024 +0100

arch and board esp32c3-legacy: Add optional iCE40 FPGA loading support

Signed-off-by: Jakub Janousek 
---
 arch/risc-v/src/esp32c3-legacy/Kconfig |  25 +++
 arch/risc-v/src/esp32c3-legacy/Make.defs   |   4 +
 arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.c | 214 +
 arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.h |  91 +
 .../common/include/esp32c3_board_ice40.h   |  70 +++
 boards/risc-v/esp32c3-legacy/common/src/Make.defs  |   4 +
 .../common/src/esp32c3_board_ice40.c   |  82 
 .../esp32c3-devkit/src/esp32c3_bringup.c   |   9 +
 8 files changed, 499 insertions(+)

diff --git a/arch/risc-v/src/esp32c3-legacy/Kconfig 
b/arch/risc-v/src/esp32c3-legacy/Kconfig
index 2e9bdae0b7..99d3140341 100644
--- a/arch/risc-v/src/esp32c3-legacy/Kconfig
+++ b/arch/risc-v/src/esp32c3-legacy/Kconfig
@@ -516,6 +516,31 @@ endif # ESP32C3_SPI2
 
 endmenu # SPI configuration
 
+menu "iCE40 Configuration"
+   depends on SPI_ICE40
+
+config ESP32C3_ICE40_CSPIN
+   int "iCE40 CS Pin"
+   default 6
+   range 0 21
+
+config ESP32C3_ICE40_CDONEPIN
+   int "iCE40 CDONE Pin"
+   default 0
+   range 0 21
+
+config ESP32C3_ICE40_CRSTPIN
+   int "iCE40 CRST Pin"
+   default 1
+   range 0 21
+
+config ESP32C3_ICE40_SPI_PORT
+   int "iCE40 SPI port number"
+   default 2
+   range 0 5
+
+endmenu
+
 menu "UART configuration"
depends on ESP32C3_UART
 
diff --git a/arch/risc-v/src/esp32c3-legacy/Make.defs 
b/arch/risc-v/src/esp32c3-legacy/Make.defs
index 23ad159619..73ed5f3330 100644
--- a/arch/risc-v/src/esp32c3-legacy/Make.defs
+++ b/arch/risc-v/src/esp32c3-legacy/Make.defs
@@ -181,6 +181,10 @@ ifeq ($(CONFIG_ESP32C3_BROWNOUT_DET),y)
 CHIP_CSRCS += esp32c3_brownout.c
 endif
 
+ifeq ($(CONFIG_SPI_ICE40),y)
+CHIP_CSRCS += esp32c3_ice40.c
+endif
+
 ifeq ($(CONFIG_ESP32C3_WIRELESS),y)
 WIRELESS_DRV_UNPACK = esp-wireless-drivers-3rdparty
 WIRELESS_DRV_ID = 45701c0
diff --git a/arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.c 
b/arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.c
new file mode 100644
index 00..823c4e15d8
--- /dev/null
+++ b/arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.c
@@ -0,0 +1,214 @@
+/
+ * arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.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 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "esp32c3_spi.h"
+#include "hardware/esp32c3_spi.h"
+
+#include "hardware/esp32c3_gpio.h"
+#include "hardware/esp32c3_gpio_sigmap.h"
+
+#include "esp32c3_ice40.h"
+
+#include "esp32c3_gpio.h"
+
+#include 
+
+/
+ * Private Function Prototypes
+ /
+
+static void ice40_reset(struct ice40_dev_s *dev, bool reset);
+static void ice40_select(struct ice40_dev_s *dev, bool select);
+static bool ice40_get_status(struct ice40_dev_s *dev);
+
+/
+ * Private Data
+ /
+
+static const struct ice40_ops_s ice40_ops =
+{
+  .reset = ice40_reset,
+  .select = ice40_select,
+  .get_status = ice40_get_status,
+};
+
+struct esp32c3_ice40_dev_s
+{
+  struct ice40_dev_s base;
+  uint16_t cdone_gpio;
+  uint16_t crst_gpio;
+  

(nuttx) branch master updated (932c41debb -> 3ce84d1ba0)

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

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


from 932c41debb net/nat: Remove unnecessary logic in inbound logic
 new 23c6b5b07d drivers/spi: Add support for FPGA iCE40 bitstream loading.
 new 3ce84d1ba0 arch and board esp32c3-legacy: Add optional iCE40 FPGA 
loading support

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:
 arch/risc-v/src/esp32c3-legacy/Kconfig |  25 ++
 arch/risc-v/src/esp32c3-legacy/Make.defs   |   4 +
 arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.c | 214 +++
 arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.h |  91 +
 .../common/include/esp32c3_board_ice40.h   |  21 +-
 boards/risc-v/esp32c3-legacy/common/src/Make.defs  |   4 +
 .../common/src/esp32c3_board_ice40.c}  |  56 ++-
 .../esp32c3-devkit/src/esp32c3_bringup.c   |   9 +
 drivers/spi/Kconfig|   8 +
 drivers/spi/Make.defs  |   4 +
 drivers/spi/ice40.c| 411 +
 include/nuttx/fs/ioctl.h   |   6 +
 .../nuttx/spi/ice40.h  |  92 ++---
 13 files changed, 862 insertions(+), 83 deletions(-)
 create mode 100644 arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.c
 create mode 100644 arch/risc-v/src/esp32c3-legacy/esp32c3_ice40.h
 copy arch/arm/src/cxd56xx/cxd56_geofence.h => 
boards/risc-v/esp32c3-legacy/common/include/esp32c3_board_ice40.h (79%)
 copy boards/{arm/s32k1xx/rddrone-bms772/src/s32k1xx_i2c.c => 
risc-v/esp32c3-legacy/common/src/esp32c3_board_ice40.c} (61%)
 create mode 100644 drivers/spi/ice40.c
 copy boards/xtensa/esp32/common/src/esp32_board_wlan.c => 
include/nuttx/spi/ice40.h (59%)



Re: [PR] drivers/spi: Add support for FPGA iCE40 bitstream loading. [nuttx]

2024-04-12 Thread via GitHub


acassis merged PR #12012:
URL: https://github.com/apache/nuttx/pull/12012


-- 
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



Re: [PR] drivers/spi: Add support for FPGA iCE40 bitstream loading. [nuttx]

2024-04-12 Thread via GitHub


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

   Thank you very much @janouja !!!


-- 
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) 01/02: drivers/spi: Add support for FPGA iCE40 bitstream loading.

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

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

commit 23c6b5b07d61bed5506f5df285c4baea9666017d
Author: Jakub Janousek 
AuthorDate: Thu Mar 21 16:11:55 2024 +0100

drivers/spi: Add support for FPGA iCE40 bitstream loading.

Tested on ICE-V-Wireless board.

Signed-off-by: Jakub Janousek 
---
 drivers/spi/Kconfig   |   8 +
 drivers/spi/Make.defs |   4 +
 drivers/spi/ice40.c   | 411 ++
 include/nuttx/fs/ioctl.h  |   6 +
 include/nuttx/spi/ice40.h |  93 +++
 5 files changed, 522 insertions(+)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index fae2211d59..e9bb16af5b 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -234,6 +234,14 @@ config SPI_DRIVER
this driver is to support SPI testing.  It is not suitable for 
use
in any real driver application.
 
+config SPI_ICE40
+   bool "SPI iCE40 driver"
+   default n
+   depends on SPI_EXCHANGE
+   ---help---
+   Enable support for a character driver at /dev/ice40-[N] for the 
iCE40 FPGA.
+   This driver is intended for uploading the bitsream to the FPGA.
+
 config SPI_BITBANG
bool "SPI bit-bang device"
default n
diff --git a/drivers/spi/Make.defs b/drivers/spi/Make.defs
index f5600a368d..acfdf113a9 100644
--- a/drivers/spi/Make.defs
+++ b/drivers/spi/Make.defs
@@ -29,6 +29,10 @@ ifeq ($(CONFIG_SPI_EXCHANGE),y)
   endif
 endif
 
+ifeq ($(CONFIG_SPI_ICE40),y)
+  CSRCS += ice40.c
+endif
+
 ifeq ($(CONFIG_SPI_SLAVE_DRIVER),y)
   CSRCS += spi_slave_driver.c
 endif
diff --git a/drivers/spi/ice40.c b/drivers/spi/ice40.c
new file mode 100644
index 00..50b318b59e
--- /dev/null
+++ b/drivers/spi/ice40.c
@@ -0,0 +1,411 @@
+/
+ * drivers/spi/ice40.c
+ *
+ * Licensed 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 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/
+ * Private Function Prototypes
+ /
+
+/* Character driver methods */
+
+static int ice40_open(FAR struct file *filep);
+
+static int ice40_close(FAR struct file *filep);
+
+static ssize_t ice40_read(FAR struct file *filep, FAR char *buffer,
+   size_t buflen);
+static ssize_t ice40_write(FAR struct file *filep, FAR const char *buffer,
+size_t buflen);
+static int ice40_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
+
+/* Helper functions */
+
+static int ice40_init_fpga(FAR struct ice40_dev_s *dev);
+
+static int ice40_writeblk(FAR struct ice40_dev_s *dev,
+   FAR const char *buffer,
+   size_t buflen);
+
+static int ice40_endwrite(FAR struct ice40_dev_s *dev);
+
+/
+ * Private Data
+ /
+
+static const struct file_operations g_ice40_fops =
+{
+  ice40_open,  /* open */
+  ice40_close, /* close */
+  ice40_read,  /* read */
+  ice40_write, /* write */
+  NULL,/* seek */
+  ice40_ioctl, /* ioctl */
+};
+
+/
+ * Private Functions
+ /
+
+/
+ * Name: ice40_open
+ *
+ * Description:
+ *  This function is called whenever the ICE40 device is opened.
+ *
+ /
+
+static int
+ice40_open(FAR struct file *filep)
+{
+  FAR struct inode *inode = filep->f_inode;
+  FAR struct ice40_dev_s *dev = inode->i_private;
+
+  DEBUGASSERT(dev != NULL);
+
+  if 

(nuttx) branch master updated (62a4799409 -> 932c41debb)

2024-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 62a4799409 video/vnc: add vnc_fb_register
 new 17584eaa4f net/nat: Rename `struct ipv*_nat_entry` to 
`ipv*_nat_entry_t`
 new 932c41debb net/nat: Remove unnecessary logic in inbound logic

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:
 net/nat/ipv4_nat.c   | 99 ++--
 net/nat/ipv4_nat_entry.c | 29 +++---
 net/nat/ipv6_nat.c   | 87 +++---
 net/nat/ipv6_nat_entry.c | 29 +++---
 net/nat/nat.h| 15 +---
 5 files changed, 123 insertions(+), 136 deletions(-)



(nuttx) 01/02: net/nat: Rename `struct ipv*_nat_entry` to `ipv*_nat_entry_t`

2024-04-12 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 17584eaa4f0b37e6c4d3edefa33b3b55201f9af6
Author: Zhe Weng 
AuthorDate: Tue Mar 19 16:30:33 2024 +0800

net/nat: Rename `struct ipv*_nat_entry` to `ipv*_nat_entry_t`

I found `struct ipv*_nat_entry` is missing `_s` suffix, but the name is too 
long in some cases, so maybe `ipv*_nat_entry_t` could be better.

Signed-off-by: Zhe Weng 
---
 net/nat/ipv4_nat.c   | 92 
 net/nat/ipv4_nat_entry.c | 29 ---
 net/nat/ipv6_nat.c   | 80 -
 net/nat/ipv6_nat_entry.c | 29 ---
 net/nat/nat.h| 15 
 5 files changed, 123 insertions(+), 122 deletions(-)

diff --git a/net/nat/ipv4_nat.c b/net/nat/ipv4_nat.c
index ac4e6e45a1..d5a3edb3a4 100644
--- a/net/nat/ipv4_nat.c
+++ b/net/nat/ipv4_nat.c
@@ -60,11 +60,11 @@
  * Private Function Prototypes
  /
 
-static FAR struct ipv4_nat_entry *
+static FAR ipv4_nat_entry_t *
 ipv4_nat_inbound_internal(FAR struct ipv4_hdr_s *ipv4,
   enum nat_manip_type_e manip_type);
 
-static FAR struct ipv4_nat_entry *
+static FAR ipv4_nat_entry_t *
 ipv4_nat_outbound_internal(FAR struct net_driver_s *dev,
FAR struct ipv4_hdr_s *ipv4,
enum nat_manip_type_e manip_type);
@@ -180,16 +180,16 @@ static void ipv4_nat_port_adjust(FAR uint16_t *l4chksum,
  /
 
 #ifdef CONFIG_NET_TCP
-static FAR struct ipv4_nat_entry *
+static FAR ipv4_nat_entry_t *
 ipv4_nat_inbound_tcp(FAR struct ipv4_hdr_s *ipv4,
  enum nat_manip_type_e manip_type)
 {
-  FAR struct tcp_hdr_s  *tcp   = L4_HDR(ipv4);
-  FAR uint16_t  *external_ip   = MANIP_IPADDR(ipv4, manip_type);
-  FAR uint16_t  *external_port = MANIP_PORT(tcp, manip_type);
-  FAR uint16_t  *peer_ip   = PEER_IPADDR(ipv4, manip_type);
-  FAR uint16_t  *peer_port = PEER_PORT(tcp, manip_type);
-  FAR struct ipv4_nat_entry *entry =
+  FAR struct tcp_hdr_s *tcp   = L4_HDR(ipv4);
+  FAR uint16_t *external_ip   = MANIP_IPADDR(ipv4, manip_type);
+  FAR uint16_t *external_port = MANIP_PORT(tcp, manip_type);
+  FAR uint16_t *peer_ip   = PEER_IPADDR(ipv4, manip_type);
+  FAR uint16_t *peer_port = PEER_PORT(tcp, manip_type);
+  FAR ipv4_nat_entry_t *entry =
  ipv4_nat_inbound_entry_find(IP_PROTO_TCP,
  net_ip4addr_conv32(external_ip),
  *external_port,
@@ -233,17 +233,17 @@ ipv4_nat_inbound_tcp(FAR struct ipv4_hdr_s *ipv4,
  /
 
 #ifdef CONFIG_NET_UDP
-static FAR struct ipv4_nat_entry *
+static FAR ipv4_nat_entry_t *
 ipv4_nat_inbound_udp(FAR struct ipv4_hdr_s *ipv4,
  enum nat_manip_type_e manip_type)
 {
-  FAR struct udp_hdr_s  *udp   = L4_HDR(ipv4);
-  FAR uint16_t  *external_ip   = MANIP_IPADDR(ipv4, manip_type);
-  FAR uint16_t  *external_port = MANIP_PORT(udp, manip_type);
-  FAR uint16_t  *peer_ip   = PEER_IPADDR(ipv4, manip_type);
-  FAR uint16_t  *peer_port = PEER_PORT(udp, manip_type);
-  FAR uint16_t  *udpchksum;
-  FAR struct ipv4_nat_entry *entry =
+  FAR struct udp_hdr_s *udp   = L4_HDR(ipv4);
+  FAR uint16_t *external_ip   = MANIP_IPADDR(ipv4, manip_type);
+  FAR uint16_t *external_port = MANIP_PORT(udp, manip_type);
+  FAR uint16_t *peer_ip   = PEER_IPADDR(ipv4, manip_type);
+  FAR uint16_t *peer_port = PEER_PORT(udp, manip_type);
+  FAR uint16_t *udpchksum;
+  FAR ipv4_nat_entry_t *entry =
  ipv4_nat_inbound_entry_find(IP_PROTO_UDP,
  net_ip4addr_conv32(external_ip),
  *external_port,
@@ -287,14 +287,14 @@ ipv4_nat_inbound_udp(FAR struct ipv4_hdr_s *ipv4,
  /
 
 #ifdef CONFIG_NET_ICMP
-static FAR struct ipv4_nat_entry *
+static FAR ipv4_nat_entry_t *
 ipv4_nat_inbound_icmp(FAR struct ipv4_hdr_s *ipv4,
   enum nat_manip_type_e manip_type)
 {
-  FAR struct icmp_hdr_s *icmp = L4_HDR(ipv4);
-  FAR uint16_t  *external_ip = MANIP_IPADDR(ipv4, manip_type);
-  FAR uint16_t  *peer_ip = PEER_IPADDR(ipv4, manip_type);
-  FAR struct ipv4_nat_entry *entry;
+  FAR struct icmp_hdr_s *icmp = 

(nuttx) 02/02: net/nat: Remove unnecessary logic in inbound logic

2024-04-12 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 932c41debbf18fa8210e6c33891aa6aab61605a8
Author: Zhe Weng 
AuthorDate: Fri Apr 12 10:21:44 2024 +0800

net/nat: Remove unnecessary logic in inbound logic

Finish https://github.com/apache/nuttx/pull/12116#discussion_r1560880897

Signed-off-by: Zhe Weng 
---
 net/nat/ipv4_nat.c | 9 +
 net/nat/ipv6_nat.c | 9 +
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/net/nat/ipv4_nat.c b/net/nat/ipv4_nat.c
index d5a3edb3a4..60098a5a00 100644
--- a/net/nat/ipv4_nat.c
+++ b/net/nat/ipv4_nat.c
@@ -744,14 +744,7 @@ void ipv4_nat_inbound(FAR struct net_driver_s *dev,
   if (IFF_IS_NAT(dev->d_flags) &&
   net_ipv4addr_hdrcmp(ipv4->destipaddr, >d_ipaddr))
 {
-  FAR ipv4_nat_entry_t *entry =
-  ipv4_nat_inbound_internal(ipv4, NAT_MANIP_DST);
-  if (!entry)
-{
-  /* Inbound without entry is OK (e.g. towards NuttX itself), skip. */
-
-  return;
-}
+  ipv4_nat_inbound_internal(ipv4, NAT_MANIP_DST);
 }
 }
 
diff --git a/net/nat/ipv6_nat.c b/net/nat/ipv6_nat.c
index 6331ffed89..a77132040c 100644
--- a/net/nat/ipv6_nat.c
+++ b/net/nat/ipv6_nat.c
@@ -634,14 +634,7 @@ void ipv6_nat_inbound(FAR struct net_driver_s *dev,
   if (IFF_IS_NAT(dev->d_flags) &&
   NETDEV_IS_MY_V6ADDR(dev, ipv6->destipaddr))
 {
-  FAR ipv6_nat_entry_t *entry =
-  ipv6_nat_inbound_internal(ipv6, NAT_MANIP_DST);
-  if (!entry)
-{
-  /* Inbound without entry is OK (e.g. towards NuttX itself), skip. */
-
-  return;
-}
+  ipv6_nat_inbound_internal(ipv6, NAT_MANIP_DST);
 }
 }
 



Re: [PR] net/nat: Minor code optimizations [nuttx]

2024-04-12 Thread via GitHub


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


-- 
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



Re: [I] When i use cmake to build sim:libcxxtest, it display undefined reference to `NXpthread_setspecific' [nuttx]

2024-04-12 Thread via GitHub


xuxin930 commented on issue #12127:
URL: https://github.com/apache/nuttx/issues/12127#issuecomment-2051512036

   > I haven't had a chance to look for the cause of this problem yet. I'm not 
sure if this problem only occurs for me on arch linux
   
   Okay, let me check the toolchain file settings and compile otpions settings 
again.
   


-- 
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



Re: [I] When i use cmake to build sim:libcxxtest, it display undefined reference to `NXpthread_setspecific' [nuttx]

2024-04-12 Thread via GitHub


raiden00pl commented on issue #12127:
URL: https://github.com/apache/nuttx/issues/12127#issuecomment-2051474749

   @xuxin930 good find. 
   
   Another problem I have with this configuration (and with libcxx in general) 
is a lot of warnings during compilation.
   It looks like compiler flags from here doesn't work: 
https://github.com/apache/nuttx/blob/62a47994090860b8daea0ab61121bcbcd4448ff1/libs/libxx/libcxx.cmake#L99-L124
 
   I haven't had a chance to look for the cause of this problem yet. I'm not 
sure if this problem only occurs for me on arch 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



Re: [I] When i use cmake to build sim:libcxxtest, it display undefined reference to `NXpthread_setspecific' [nuttx]

2024-04-12 Thread via GitHub


xuxin930 commented on issue #12127:
URL: https://github.com/apache/nuttx/issues/12127#issuecomment-2051432820

   hi @raiden00pl @xiaoxiang781216 
   my guess is that the redefined symbols for sim in cmake do not have an `if 
block`.
   let me fix it
   
   
https://github.com/apache/nuttx/blob/62a47994090860b8daea0ab61121bcbcd4448ff1/arch/sim/src/nuttx-names.in#L99-L112
   
https://github.com/apache/nuttx/blob/62a47994090860b8daea0ab61121bcbcd4448ff1/cmake/nuttx_redefine_symbols.cmake#L78-L94


-- 
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: video/vnc: add vnc_fb_register

2024-04-12 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 62a4799409 video/vnc: add vnc_fb_register
62a4799409 is described below

commit 62a47994090860b8daea0ab61121bcbcd4448ff1
Author: jianglianfang 
AuthorDate: Thu Nov 9 16:12:37 2023 +0800

video/vnc: add vnc_fb_register

To optimize the initialization of vnc, change it to vnc_fb_register.

Signed-off-by: jianglianfang 
---
 boards/arm/samv7/samv71-xult/src/sam_bringup.c |  12 ++
 boards/sim/sim/sim/src/sim_bringup.c   |  12 ++
 drivers/video/fb.c |  48 -
 drivers/video/vnc/vnc_fbdev.c  | 244 +++--
 graphics/nxmu/nxmu_start.c |  21 +++
 include/nuttx/compiler.h   |   6 +
 include/nuttx/video/fb.h   |  28 ++-
 include/nuttx/video/vnc.h  |  36 
 8 files changed, 224 insertions(+), 183 deletions(-)

diff --git a/boards/arm/samv7/samv71-xult/src/sam_bringup.c 
b/boards/arm/samv7/samv71-xult/src/sam_bringup.c
index 9339e54980..dd9f87c388 100644
--- a/boards/arm/samv7/samv71-xult/src/sam_bringup.c
+++ b/boards/arm/samv7/samv71-xult/src/sam_bringup.c
@@ -61,6 +61,10 @@
 #  include 
 #endif
 
+#ifdef CONFIG_VNCSERVER
+#  include 
+#endif
+
 #if defined(HAVE_RTC_DS) || defined(HAVE_RTC_PCF85263)
 #  include 
 #  include 
@@ -562,11 +566,19 @@ int sam_bringup(void)
 #ifdef CONFIG_VIDEO_FB
   /* Initialize and register the LCD framebuffer driver */
 
+#  ifdef CONFIG_VNCSERVER
+  ret = vnc_fb_register(0);
+  if (ret < 0)
+{
+  syslog(LOG_ERR, "ERROR: vnc_fb_register() failed: %d\n", ret);
+}
+#  else
   ret = fb_register(0, 0);
   if (ret < 0)
 {
   syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", ret);
 }
+#  endif
 #endif
 
   /* If we got here then perhaps not all initialization was successful, but
diff --git a/boards/sim/sim/sim/src/sim_bringup.c 
b/boards/sim/sim/sim/src/sim_bringup.c
index 5bfd71ddd9..8c7fecbd25 100644
--- a/boards/sim/sim/sim/src/sim_bringup.c
+++ b/boards/sim/sim/sim/src/sim_bringup.c
@@ -61,6 +61,10 @@
 #include 
 #endif
 
+#ifdef CONFIG_VNCSERVER
+#  include 
+#endif
+
 #if defined(CONFIG_INPUT_BUTTONS_LOWER) && defined(CONFIG_SIM_BUTTONS)
 #include 
 #endif
@@ -288,11 +292,19 @@ int sim_bringup(void)
 #ifdef CONFIG_VIDEO_FB
   /* Initialize and register the simulated framebuffer driver */
 
+#  ifdef CONFIG_VNCSERVER
+  ret = vnc_fb_register(0);
+  if (ret < 0)
+{
+  syslog(LOG_ERR, "ERROR: vnc_fb_register() failed: %d\n", ret);
+}
+#  else
   ret = fb_register(0, 0);
   if (ret < 0)
 {
   syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", ret);
 }
+#  endif
 #endif
 
 #ifdef CONFIG_SIM_CAMERA
diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index 5dcb9b4164..20ad585e56 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -1610,51 +1610,3 @@ errout_with_fb:
   kmm_free(fb);
   return ret;
 }
-
-/
- * Name: fb_register
- *
- * Description:
- *   Register the framebuffer character device at /dev/fbN where N is the
- *   display number if the devices supports only a single plane.  If the
- *   hardware supports multiple color planes, then the device will be
- *   registered at /dev/fbN.M where N is the again display number but M
- *   is the display plane.
- *
- * Input Parameters:
- *   display - The display number for the case of boards supporting multiple
- * displays or for hardware that supports multiple
- * layers (each layer is consider a display).  Typically zero.
- *   plane   - Identifies the color plane on hardware that supports separate
- * framebuffer "planes" for each color component.
- *
- * Returned Value:
- *   Zero (OK) is returned success; a negated errno value is returned on any
- *   failure.
- *
- /
-
-int fb_register(int display, int plane)
-{
-  FAR struct fb_vtable_s *vtable;
-  int ret;
-
-  /* Initialize the frame buffer device. */
-
-  ret = up_fbinitialize(display);
-  if (ret < 0)
-{
-  gerr("ERROR: up_fbinitialize() failed for display %d: %d\n",
-   display, ret);
-  return ret;
-}
-
-  vtable = up_fbgetvplane(display, plane);
-  if (vtable == NULL)
-{
-  gerr("ERROR: up_fbgetvplane() failed, vplane=%d\n", plane);
-  return -EINVAL;
-}
-
-  return fb_register_device(display, plane, vtable);
-}
diff --git a/drivers/video/vnc/vnc_fbdev.c b/drivers/video/vnc/vnc_fbdev.c
index 49c2681840..85d148bf8f 100644
--- a/drivers/video/vnc/vnc_fbdev.c
+++ b/drivers/video/vnc/vnc_fbdev.c
@@ -581,102 +581,6 @@ static inline int vnc_wait_start(int display)
  * 

Re: [PR] video/vnc: add vnc_fb_register [nuttx]

2024-04-12 Thread via GitHub


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


-- 
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



Re: [PR] irq: irq_cpu_locked can be remove [nuttx]

2024-04-12 Thread via GitHub


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


-- 
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: irq: All irq_cpu_locked is called in the critical_section, and the parameter is the current cpu id. so it must return false, We can safely delete.

2024-04-12 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 82acf6e6a7 irq: All irq_cpu_locked is called in the critical_section, 
and the parameter is the current cpu id. so it must return false, We can safely 
delete.
82acf6e6a7 is described below

commit 82acf6e6a7b834978444671ac707efe48ce8ec2b
Author: hujun5 
AuthorDate: Wed Nov 29 17:19:36 2023 +0800

irq: All irq_cpu_locked is called in the critical_section, and the 
parameter is the current cpu id.
so it must return false, We can safely delete.

Signed-off-by: hujun5 
---
 sched/irq/irq.h   | 27 --
 sched/irq/irq_csection.c  | 74 ---
 sched/sched/sched_addreadytorun.c |  2 +-
 sched/sched/sched_mergepending.c  |  6 ++--
 sched/sched/sched_setpriority.c   |  2 +-
 sched/sched/sched_unlock.c|  2 +-
 6 files changed, 5 insertions(+), 108 deletions(-)

diff --git a/sched/irq/irq.h b/sched/irq/irq.h
index 7088249c5d..b1be90ea85 100644
--- a/sched/irq/irq.h
+++ b/sched/irq/irq.h
@@ -150,33 +150,6 @@ void irq_initialize(void);
 
 int irq_unexpected_isr(int irq, FAR void *context, FAR void *arg);
 
-/
- * Name:  irq_cpu_locked
- *
- * Description:
- *   Test if the IRQ lock set OR if this CPU holds the IRQ lock
- *   There is an interaction with pre-emption controls and IRQ locking:
- *   Even if the pre-emption is enabled, tasks will be forced to pend if
- *   the IRQ lock is also set UNLESS the CPU starting the task is the
- *   holder of the IRQ lock.
- *
- * Input Parameters:
- *   rtcb - Points to the blocked TCB that is ready-to-run
- *
- * Returned Value:
- *   true  - IRQs are locked by a different CPU.
- *   false - IRQs are unlocked OR if they are locked BUT this CPU
- *   is the holder of the lock.
- *
- *   Warning: This values are volatile at only valid at the instance that
- *   the CPU set was queried.
- *
- /
-
-#ifdef CONFIG_SMP
-bool irq_cpu_locked(int cpu);
-#endif
-
 /
  * Name: irq_foreach
  *
diff --git a/sched/irq/irq_csection.c b/sched/irq/irq_csection.c
index 83c4a65f7b..d4525d4760 100644
--- a/sched/irq/irq_csection.c
+++ b/sched/irq/irq_csection.c
@@ -608,80 +608,6 @@ void leave_critical_section(irqstate_t flags)
 }
 #endif
 
-/
- * Name:  irq_cpu_locked
- *
- * Description:
- *   Test if the IRQ lock set OR if this CPU holds the IRQ lock
- *   There is an interaction with pre-emption controls and IRQ locking:
- *   Even if the pre-emption is enabled, tasks will be forced to pend if
- *   the IRQ lock is also set UNLESS the CPU starting the task is the
- *   holder of the IRQ lock.
- *
- * Input Parameters:
- *   cpu - Points to which cpu
- *
- * Returned Value:
- *   true  - IRQs are locked by a different CPU.
- *   false - IRQs are unlocked OR if they are locked BUT this CPU
- *   is the holder of the lock.
- *
- *   Warning: This values are volatile at only valid at the instance that
- *   the CPU set was queried.
- *
- /
-
-#ifdef CONFIG_SMP
-bool irq_cpu_locked(int cpu)
-{
-  cpu_set_t irqset;
-
-  /* g_cpu_irqset is not valid in early phases of initialization */
-
-  if (nxsched_get_initstate() < OSINIT_OSREADY)
-{
-  /* We are still single threaded.  In either state of g_cpu_irqlock,
-   * the correct return value should always be false.
-   */
-
-  return false;
-}
-
-  /* Test if g_cpu_irqlock is locked.  We don't really need to use check
-   * g_cpu_irqlock to do this, we can use the g_cpu_set.
-   *
-   * Sample the g_cpu_irqset once.  That is an atomic operation.  All
-   * subsequent operations will operate on the sampled cpu set.
-   */
-
-  irqset = (cpu_set_t)g_cpu_irqset;
-  if (irqset != 0)
-{
-  /* Some CPU holds the lock.  So g_cpu_irqlock should be locked.
-   * Return false if the 'cpu' is the holder of the lock; return
-   * true if g_cpu_irqlock is locked, but this CPU is not the
-   * holder of the lock.
-   */
-
-  return ((irqset & (1 << cpu)) == 0);
-}
-
-  /* No CPU holds the lock */
-
-  else
-{
-  /* In this case g_cpu_irqlock should be unlocked.  However, if
-   * the lock was established in the interrupt handler AND there are
-   * no bits set in g_cpu_irqset, that probably means only that
-   * critical section was established from an interrupt handler.
-   * Return false in either case.
-   */
-
-  return false;
-}
-}
-#endif
-
 

Re: [I] When i use cmake to build sim:libcxxtest, it display undefined reference to `NXpthread_setspecific' [nuttx]

2024-04-12 Thread via GitHub


xuxin930 commented on issue #12127:
URL: https://github.com/apache/nuttx/issues/12127#issuecomment-2051272902

   > @xuxin930 could you check why cmake is different from make?
   
   sure, I'm working on 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



Re: [I] When i use cmake to build sim:libcxxtest, it display undefined reference to `NXpthread_setspecific' [nuttx]

2024-04-12 Thread via GitHub


xiaoxiang781216 commented on issue #12127:
URL: https://github.com/apache/nuttx/issues/12127#issuecomment-2051263298

   @xuxin930 could you check why cmake is different from make?


-- 
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: sched/irq: remove scheduling check in csection

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

archer 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 1b068b0d4b sched/irq: remove scheduling check in csection
1b068b0d4b is described below

commit 1b068b0d4b70a1204d0282569affe54cdeb2f07c
Author: hujun5 
AuthorDate: Wed Apr 10 10:06:27 2024 +0800

sched/irq: remove scheduling check in csection

1. The critical section does not prevent task scheduling
2. If the critical section is in sched_lock, there is no need to check,
   scheduling is not going to happen
3. If sched_lock is in the critical section, sched_unlock will also
   trigger scheduling without waiting for the exit of the critical section
4. After exiting the critical section, if there is an interrupt,
   the scheduling will be automatically triggered

Signed-off-by: hujun5 
---
 sched/irq/irq_csection.c | 29 -
 1 file changed, 29 deletions(-)

diff --git a/sched/irq/irq_csection.c b/sched/irq/irq_csection.c
index b56ab2375d..83c4a65f7b 100644
--- a/sched/irq/irq_csection.c
+++ b/sched/irq/irq_csection.c
@@ -550,35 +550,6 @@ void leave_critical_section(irqstate_t flags)
   DEBUGASSERT(spin_is_locked(_cpu_irqlock) &&
   (g_cpu_irqset & (1 << cpu)) != 0);
 
-  /* Check if releasing the lock held by this CPU will unlock the
-   * critical section.
-   */
-
-  if ((g_cpu_irqset & ~(1 << cpu)) == 0)
-{
-  /* Yes.. Check if there are pending tasks and that pre-
-   * emption is also enabled.  This is necessary because we
-   * may have deferred the nxsched_merge_pending() call in
-   * sched_unlock() because we were within a critical
-   * section then.
-   */
-
-  if (list_pendingtasks()->head != NULL &&
-  !nxsched_islocked_global())
-{
-  /* Release any ready-to-run tasks that have collected
-   * in g_pendingtasks.  NOTE: This operation has a very
-   * high likelihood of causing this task to be switched
-   * out!
-   */
-
-  if (nxsched_merge_pending())
-{
-  up_switch_context(this_task(), rtcb);
-}
-}
-}
-
   /* Now, possibly on return from a context switch, clear our
* count on the lock.  If all CPUs have released the lock,
* then unlock the global IRQ spinlock.



Re: [PR] sched/irq: remove scheduling check in csection [nuttx]

2024-04-12 Thread via GitHub


anchao merged PR #12115:
URL: https://github.com/apache/nuttx/pull/12115


-- 
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



Re: [I] When i use cmake to build sim:libcxxtest, it display undefined reference to `NXpthread_setspecific' [nuttx]

2024-04-12 Thread via GitHub


shikoumuzi commented on issue #12127:
URL: https://github.com/apache/nuttx/issues/12127#issuecomment-2051239325

   > you have to set CONFIG_TLS_NELEM > 0 . It's strange that this problem 
doesn't occur for make.
   
   thank you for your reply,That's a good way for me to solve the problem  
   
   I found that whatever macro definition "in thread.h" encapsulates a layer of 
"pthread_key_", "tss_key" and other TLS-related functions. It's strange why 
make can exclude these functions, but cmake can't


-- 
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: net: Optimize TCP/UDP port selection

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

archer 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 e543a8086e net: Optimize TCP/UDP port selection
e543a8086e is described below

commit e543a8086e2a2f91b562308ebf3957b4ceaa8e08
Author: Zhe Weng 
AuthorDate: Fri Apr 12 11:11:54 2024 +0800

net: Optimize TCP/UDP port selection

Optimize TCP/UDP port selection, and fix possibly dead loop.

Finish discussion in 
https://github.com/apache/nuttx/pull/12116#discussion_r1560851977

Note:
Linux also uses EADDRINUSE for failing in finding a portno, according to 
https://man7.org/linux/man-pages/man2/bind.2.html

Signed-off-by: Zhe Weng 
---
 net/nat/nat.c | 23 --
 net/tcp/tcp_conn.c| 28 ++
 net/udp/udp.h |  3 +++
 net/udp/udp_conn.c| 46 ++-
 net/udp/udp_sendto_buffered.c |  5 +
 net/utils/utils.h | 41 ++
 6 files changed, 91 insertions(+), 55 deletions(-)

diff --git a/net/nat/nat.c b/net/nat/nat.c
index edf3bd88a0..454efd516b 100644
--- a/net/nat/nat.c
+++ b/net/nat/nat.c
@@ -32,25 +32,10 @@
 #include "nat/nat.h"
 #include "tcp/tcp.h"
 #include "udp/udp.h"
+#include "utils/utils.h"
 
 #ifdef CONFIG_NET_NAT
 
-/
- * Pre-processor Definitions
- /
-
-#define NEXT_PORT(nport, hport) \
-  do \
-{ \
-  ++(hport); \
-  if ((hport) >= CONFIG_NET_DEFAULT_MAX_PORT || \
-  (hport) < CONFIG_NET_DEFAULT_MIN_PORT) \
-{ \
-  (hport) = CONFIG_NET_DEFAULT_MIN_PORT; \
-} \
-  (nport) = HTONS(hport); \
-} while (0)
-
 /
  * Private Functions
  /
@@ -86,7 +71,7 @@ static uint16_t nat_port_select_without_stack(
   uint16_t hport = NTOHS(portno);
   while (nat_port_inuse(domain, protocol, ip, portno))
 {
-  NEXT_PORT(portno, hport);
+  NET_PORT_NEXT_NH(portno, hport);
   if (portno == local_port)
 {
   /* We have looped back, failed. */
@@ -308,7 +293,7 @@ uint16_t nat_port_select(FAR struct net_driver_s *dev,
   while (icmp_findconn(dev, id) ||
  nat_port_inuse(domain, IP_PROTO_ICMP, external_ip, id))
 {
-  NEXT_PORT(id, hid);
+  NET_PORT_NEXT_NH(id, hid);
   if (id == local_port)
 {
   /* We have looped back, failed. */
@@ -334,7 +319,7 @@ uint16_t nat_port_select(FAR struct net_driver_s *dev,
   while (icmpv6_active(id) ||
  nat_port_inuse(domain, IP_PROTO_ICMP6, external_ip, id))
 {
-  NEXT_PORT(id, hid);
+  NET_PORT_NEXT_NH(id, hid);
   if (id == local_port)
 {
   /* We have looped back, failed. */
diff --git a/net/tcp/tcp_conn.c b/net/tcp/tcp_conn.c
index 1deac8d001..1ffa35fa0e 100644
--- a/net/tcp/tcp_conn.c
+++ b/net/tcp/tcp_conn.c
@@ -583,38 +583,30 @@ int tcp_selectport(uint8_t domain,
 
   if (g_last_tcp_port == 0)
 {
-  net_getrandom(_last_tcp_port, sizeof(uint16_t));
-
-  g_last_tcp_port = g_last_tcp_port %
-(CONFIG_NET_DEFAULT_MAX_PORT -
- CONFIG_NET_DEFAULT_MIN_PORT + 1);
-  g_last_tcp_port += CONFIG_NET_DEFAULT_MIN_PORT;
+  NET_PORT_RANDOM_INIT(g_last_tcp_port);
 }
 
   if (portno == 0)
 {
+  uint16_t loop_start = g_last_tcp_port;
+
   /* No local port assigned. Loop until we find a valid listen port
-   * number that is not being used by any other connection. NOTE the
-   * following loop is assumed to terminate but could not if all
-   * 32000-4096+1 ports are in used (unlikely).
+   * number that is not being used by any other connection.
*/
 
   do
 {
   /* Guess that the next available port number will be the one after
-   * the last port number assigned. Make sure that the port number
-   * is within range.
+   * the last port number assigned.
*/
 
-  ++g_last_tcp_port;
-
-  if (g_last_tcp_port > CONFIG_NET_DEFAULT_MAX_PORT ||
-  g_last_tcp_port < CONFIG_NET_DEFAULT_MIN_PORT)
+  NET_PORT_NEXT_NH(portno, g_last_tcp_port);
+  if (g_last_tcp_port == loop_start)
 {
-  g_last_tcp_port = CONFIG_NET_DEFAULT_MIN_PORT;
-}
+  /* We have looped back, failed. */
 
-  portno = HTONS(g_last_tcp_port);
+ 

Re: [PR] net: Optimize TCP/UDP port selection [nuttx]

2024-04-12 Thread via GitHub


anchao merged PR #12129:
URL: https://github.com/apache/nuttx/pull/12129


-- 
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



Re: [PR] net/nat: Minor code optimizations [nuttx]

2024-04-12 Thread via GitHub


wengzhe commented on PR #12130:
URL: https://github.com/apache/nuttx/pull/12130#issuecomment-2051165902

   Pushing to retrigger the CI which seems failing in an unrelated position.


-- 
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