Re: [PR] espressif[risc-v|xtensa]: Check events when reading PCNT counter value [nuttx]

2025-06-10 Thread via GitHub


Vajnar commented on code in PR #16491:
URL: https://github.com/apache/nuttx/pull/16491#discussion_r2137255677


##
arch/risc-v/src/common/espressif/esp_pcnt.c:
##


Review Comment:
   Hi @tmedicci, for the first question, yes that is the case. The probability 
is low, but the window of opportunity for obtaining wrong result is non-zero. 
The specific test, how to demonstrate the window of opportunity was proposed by 
@matiamic and is as follows:
   
   1. Modify the original `esp_pcnt_unit_get_count()` function as follows:
   ```
 flags = spin_lock_irqsave(&priv->lock);
 for (volatile int i = 0; i < 5; i++);  // short busy wait
 *ret = pcnt_ll_get_count(ctx.dev, priv->unit_id) +
 priv->accum_value;
 spin_unlock_irqrestore(&priv->lock, flags);
   ```
   2. Run the example `qe` application and rotate the quadrature encoder and 
the following sooner or later happens:
   ```
   qe_main: 705. 1960
   qe_main: 706. 1967
   qe_main: 707. 1973
   qe_main: 708. 1980
   qe_main: 709. 1986
   qe_main: 710. 1993
   qe_main: 711. 1000  // !!!
   qe_main: 712. 2006
   qe_main: 713. 2012
   qe_main: 714. 2018
   qe_main: 715. 2025
   qe_main: 716. 2031
   qe_main: 717. 2037
   ```
   For second question, 1) I don't think that's an issue. I did not use 
`CAPIOC_HANDLER` function during testing. For 2) it depends on use case, in my 
case that was not an issue.
   
   Setting the thresholds higher would certainly help, but is not a solution on 
it's own. The window of opportunity for obtaining wrong result would still be 
there.



-- 
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] fs/vfs: Separate file descriptors from file descriptions [nuttx]

2025-06-10 Thread via GitHub


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

   > > Fix the race condition issues pointed out by @xiaoxiang781216 and then 
this is fine to merge by me. I will not review this any longer as this is not 
my code anymore.
   > 
   > The new patch still follow your code base, but detail is refine since FS 
is a very important subsystem and this patch series change the life cycle 
management, so it's always good to have more expert to review and refine the 
patch.
   
   Yes, thanks for spending a substantial amount of time doing the review. I 
think this is ready to merge now. There is a practical reason why I cannot 
spend any more time with NuttX as I will be moving on to a different line of 
work very soon. This means this shall be my last contribution (of any kind) to 
this project.


-- 
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] espressif[risc-v|xtensa]: Check events when reading PCNT counter value [nuttx]

2025-06-10 Thread via GitHub


Vajnar commented on code in PR #16491:
URL: https://github.com/apache/nuttx/pull/16491#discussion_r2137284771


##
arch/risc-v/src/common/espressif/esp_pcnt.c:
##


Review Comment:
   cc: @ppisa 



-- 
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] fs/vfs: Separate file descriptors from file descriptions [nuttx]

2025-06-10 Thread via GitHub


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

   > Fix the race condition issues pointed out by @xiaoxiang781216 and then 
this is fine to merge by me. I will not review this any longer as this is not 
my code anymore.
   
   The new patch still follow your code base, but detail is refine since FS is 
a very important subsystem, so it's always good to have more expert to review 
and refine the patch.


-- 
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] fs/vfs: Separate file descriptors from file descriptions [nuttx]

2025-06-10 Thread via GitHub


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

   > Why are the original patches, _which we tested to be working correctly_, 
partially re-written in this PR, instead of pointing out if there were errors 
in those in the closed PR?
   > 
   > I completely disagree with this approach. Sorry to intervene, but _YOU 
CAN'T DO IT LIKE THIS_.
   > 
   > Please:
   > 
   > 1. Please re-open the previous PR
   > 
   
   it's closed by @pussuw , we are asking @pussuw giving @Donny9 to update that 
patch before creating a new one, bu @pussuw suggest us to create a new one.
   
   > 2. If there are _bugs_ or _architectural issues_ with that one, please 
point them out
   > 
   
   Most comments are fixed in this patch, if you really want I can repeat all 
comments in that pr again.
   
   > 3. Integrate that PR, it already went through a lengthy review, and we 
invested a lot of time in testing and reviewing that one in our organization(s)
   > 
   
   We also take huge time to review, refine and test @pussuw 's work, actually 
several bugs, uncompleted implementation and better approach update in this pr.
   
   > 4. If any bugs are found later * add new patches to fix them *
   > 
   
   But why not fix all found issues before merging it?
   
   > 
   > This current process makes no sense to me.
   
   


-- 
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] fs/vfs: Separate file descriptors from file descriptions [nuttx]

2025-06-10 Thread via GitHub


jlaitine commented on PR #16499:
URL: https://github.com/apache/nuttx/pull/16499#issuecomment-2957885073

   Why are the original patches, *which we tested to be working correctly*, 
partially re-written in this PR, instead of pointing out if there were errors 
in those in the closed PR?
   
   I completely disagree with this approach. Sorry to intervene, but *YOU CAN'T 
DO IT LIKE THIS*.
   
   Please:
   1) Please re-open the previous PR
   2) If there are *bugs* or *architectural issues* with that one, please point 
them out
   3) Integrate that PR, it already went through a lengthy review, and we 
invested a lot of time in testing and reviewing that one in our organization(s)
   4) If any bugs are found later * add new patches to fix them *
   
   This current process makes no sense to me.
   


-- 
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] RFC 5424 implementation for SYSLOG [nuttx]

2025-06-10 Thread via GitHub


tinnedkarma commented on code in PR #16493:
URL: https://github.com/apache/nuttx/pull/16493#discussion_r2137189292


##
drivers/syslog/vsyslog_rfc5424.c:
##
@@ -0,0 +1,262 @@
+/
+ * drivers/syslog/vsyslog_rfc5424.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * 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 "syslog.h"
+
+/
+ * Preprocessor definitions
+ /
+
+/* Get logging severity level from priority */
+
+#define SEVERITY(prio) ((prio) & 0x7)
+
+/* Get logging facility from priority */
+
+#define FACILITY(prio) (((prio) & (~0x7)) >> 3)
+
+/* RFC5424 NILVALUE encoding */
+
+#define NILVALUE "-"
+#define NILVALUE_SPACE NILVALUE " "
+
+/* RFC5424 timestamp format string (fractional seconds and 'Z' added by
+ * appending to format string)
+ */
+
+#define RFC_STRFTIME "%Y-%m-%dT%H:%M:%S"
+
+/* RFC5424 structured data options were selected */
+
+#if defined(CONFIG_SYSLOG_RFC5424_TIMEQUALITY)
+#define HAVE_RFC5424_SDATA 1
+#else
+#define HAVE_RFC5424_SDATA 0
+#endif /* defined(CONFIG_SYSLOG_RFC5424_TIMEQUALITY) || ... */
+
+/
+ * Private Data
+ /
+
+/
+ * Public Functions
+ /
+
+/
+ * Name: nx_vsyslog
+ *
+ * Description:
+ *   nx_vsyslog() handles the system logging system calls. It is functionally
+ *   equivalent to vsyslog() except that (1) the per-process priority
+ *   filtering has already been performed and the va_list parameter is
+ *   passed by reference.  That is because the va_list is a structure in
+ *   some compilers and passing of structures in the NuttX sycalls does
+ *   not work.
+ *
+ /
+
+int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
+{
+  struct lib_syslograwstream_s stream;
+  int ret = 0;
+#ifdef CONFIG_SYSLOG_PROCESS_NAME
+  FAR struct tcb_s *tcb = nxsched_self();
+#endif
+#ifdef CONFIG_SYSLOG_TIMESTAMP
+  struct timespec ts;
+  struct tm tm;
+  char date_buf[64];
+#endif
+#ifdef CONFIG_SYSLOG_RFC5424_HOSTNAME
+  char hostname_buf[HOST_NAME_MAX + 1];
+#endif
+
+  /* Wrap the low-level output in a stream object and let lib_vsprintf
+   * do the work.
+   */
+
+  lib_syslograwstream_open(&stream);
+
+#ifdef CONFIG_SYSLOG_TIMESTAMP
+  ts.tv_sec = 0;
+  ts.tv_nsec = 0;
+
+  memset(&tm, 0, sizeof(tm));

Review Comment:
   Small hint here.
   
   Using memset over structs may have some caveats, NuttX supports 8 to 32 bit 
architectures, so types will have different widths (int on atmega is 16bit 
while on stm32 is 32bit).
   Compiler optimization for speed also alters the size of the structs.
   Also, memset is "handled" at runtime, less compile time checks.
   
   My point is, for simple zero-initialization is safer to use `struct tm tm = 
{0}` (this will work only at declaration), it gets more compile time checks and 
will yield same 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



Re: [PR] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


raiden00pl commented on code in PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#discussion_r2137212888


##
arch/arm/src/stm32f0l0g0/hardware/stm32_adc.h:
##
@@ -240,27 +277,48 @@
 #define ADC_CHSELR_CHSEL16  (1 << 16)   /* Select channel 16 */
 #define ADC_CHSELR_CHSEL17  (1 << 17)   /* Select channel 17 */
 #define ADC_CHSELR_CHSEL18  (1 << 18)   /* Select channel 18 */
-#define ADC_CHSELR_CHSEL(ch)(1 << ch)
+#define ADC_CHSELR_CHSEL(ch)(1 << (ch))
+
+/* ADC channel selection alternate register
+ * Enabled when CHSELRMOD = 1 in ADC_CFGR1
+ */
+
+#if defined(CONFIG_ARCH_CHIP_STM32G0)
+#  define ADC_CHSELR_ALT_SQN(sqn, ch) ((ch) << (((sqn) - 1) * 4)) /* sqn = 
[0..8], ch = [0..14] */
+#endif
 
 #define ADC_DR_RDATA_SHIFT  (0)
 #define ADC_DR_RDATA_MASK   (0x << ADC_DR_RDATA_SHIFT)
 
+/* Analog watchdog 2/3 configuration register */
+
+#define ADC_AWDXCR_AWDXCHN(ch)  (1 << (ch)) /* ch = [0..18] */
+
+/* Calibration factor register */
+
+#define ADC_CALFACT_CALFACT_SHIFT   (0)
+#define ADC_CALFACT_CALFACT_MASK(0x7f << ADC_CALFACT_CALFACT_SHIFT)
+
 /* Common configuration register */
 
-#ifdef HAVE_ADC_VLCD
-#  define ADC_CCR_PRESC_SHIFT   (18)   /* ADC Prescaler */
-#  define ADC_CCR_PRESC_MASK(0xf << ADC_CCR_PRESC_SHIFT)
-#endif
+#define ADC_CCR_PRESC_SHIFT (18)   /* ADC Prescaler */
+#define ADC_CCR_PRESC_MASK  (0xf << ADC_CCR_PRESC_SHIFT)
+#  define ADC_CCR_PRESC_2   (1 << ADC_CCR_PRESC_SHIFT)

Review Comment:
   can we use the same names as in stm32h7? `ADC_CCR_PRESC_NOT_DIV`, 
`ADC_CCR_PRESC_DIV2` etc. It's more popular (stm32g4 definitions should be 
fixed someday)
   



-- 
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] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


raiden00pl commented on code in PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#discussion_r2137149183


##
arch/arm/src/stm32f0l0g0/hardware/stm32_adc.h:
##
@@ -108,9 +113,16 @@
 #define STM32_ADC1_CFGR2(STM32_ADC1_BASE + STM32_ADC_CFGR2_OFFSET)
 #define STM32_ADC1_SMPR (STM32_ADC1_BASE + STM32_ADC_SMPR_OFFSET)
 #define STM32_ADC1_TR   (STM32_ADC1_BASE + STM32_ADC_TR_OFFSET)
+#define STM32_ADC1_AWD2TR   (STM32_ADC1_BASE + STM32_ADC_AWD2TR_OFFSET)
 #define STM32_ADC1_CHSELR   (STM32_ADC1_BASE + STM32_ADC_CHSELR_OFFSET)
+#define STM32_ADC1_AWD3TR   (STM32_ADC1_BASE + STM32_ADC_AWD3TR_OFFSET)
 #define STM32_ADC1_DR   (STM32_ADC1_BASE + STM32_ADC_DR_OFFSET)
-#define STM32_ADC1_CCR  (STM32_ADC1_BASE + STM32_ADC_CCR_OFFSET)
+#define STM32_ADC1_AWD2CR   (STM32_ADC1_BASE + STM32_ADC_AWD2CR_OFFSET)
+#define STM32_ADC1_AWD3CR   (STM32_ADC1_BASE + STM32_ADC_AWD3CR_OFFSET)
+#define STM32_ADC1_CALFACT  (STM32_ADC1_BASE + 
STM32_ADC_CALFACT_OFFSET)
+#if defined(CONFIG_ARCH_CHIP_STM32G0)
+#  define STM32_ADC1_CCR  (STM32_ADC1_BASE + STM32_ADC_CCR_OFFSET)

Review Comment:
   I don't think this is true. Please remove STM32_ADC1_CCR, it's not used 
anyway



##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -1132,6 +1139,16 @@ static void adc_common_cfg(struct stm32_dev_s *priv)
   uint32_t clrbits = 0;
   uint32_t setbits = 0;
 
+#if defined(CONFIG_STM32F0L0G0_STM32G0)
+
+  /* G0 series maps CCR inside ADC1; access directly */

Review Comment:
   Remove this comment, its not true. CCR register is at offset 0x300, which is 
not ADC1 region (ADC1: 0x000-0x100, ADC2: 0x100-0x200, ADCCMN:0x300).



##
arch/arm/src/stm32f0l0g0/Kconfig:
##
@@ -3152,6 +3152,45 @@ config STM32F0L0G0_ADC1_DMA_CFG
---help---
0 - ADC1 DMA in One Shot Mode, 1 - ADC1 DMA in Circular Mode
 
+config STM32F0L0G0_ADC_OVERSAMPLE
+bool "Enable ADC hardware oversampling support"
+depends on STM32F0L0G0_ADC1 && (STM32F0L0G0_STM32L0 || STM32F0L0G0_STM32G0)

Review Comment:
   ccan we create hidden Kconfig option like `STM32F0L0G0_HAVE_ADC_OVERSAMPLE` 
and select this under `STM32F0L0G0_STM32L0` and `STM32F0L0G0_STM32G0` ?



##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -1132,6 +1139,16 @@ static void adc_common_cfg(struct stm32_dev_s *priv)
   uint32_t clrbits = 0;
   uint32_t setbits = 0;
 
+#if defined(CONFIG_STM32F0L0G0_STM32G0)
+
+  /* G0 series maps CCR inside ADC1; access directly */
+
+  clrbits |= ADC_CCR_PRESC_MASK | ADC_CCR_VREFEN | \
+ ADC_CCR_TSEN | ADC_CCR_VBATEN;
+  setbits |= ADC_CCR_PRESC_4 | ADC_CCR_VREFEN;

Review Comment:
   why hardcode PRESC_4 and always enable VREFEN? Can we select these 
automatically like in stm32h7 or stm32h5?
   



##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -2028,6 +2124,14 @@ static int adc_ioctl(struct adc_dev_s *dev, int cmd, 
unsigned long arg)
   break;
 }
 
+#if defined(CONFIG_STM32F0L0G0_STM32G0)

Review Comment:
   ifdef CONFIG_STM32F0L0G0_ADC_OVERSAMPLE



##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -1392,6 +1434,10 @@ static int adc_setup(struct adc_dev_s *dev)
 
   adc_configure(dev);
 
+#if defined(CONFIG_STM32F0L0G0_ADC_OVERSAMPLE)

Review Comment:
   ifdef



##
arch/arm/src/stm32f0l0g0/Kconfig:
##
@@ -3152,6 +3152,45 @@ config STM32F0L0G0_ADC1_DMA_CFG
---help---
0 - ADC1 DMA in One Shot Mode, 1 - ADC1 DMA in Circular Mode
 
+config STM32F0L0G0_ADC_OVERSAMPLE
+bool "Enable ADC hardware oversampling support"
+depends on STM32F0L0G0_ADC1 && (STM32F0L0G0_STM32L0 || STM32F0L0G0_STM32G0)

Review Comment:
   STM32C0 also support ADC oversampling



##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -1858,6 +1904,55 @@ static int adc_ioc_change_ints(struct adc_dev_s *dev, 
int cmd, bool arg)
 
   return ret;
 }
+#if defined(CONFIG_STM32F0L0G0_STM32G0) || defined(CONFIG_STM32F0L0G0_STM32L0)

Review Comment:
   ifdef CONFIG_STM32F0L0G0_ADC_OVERSAMPLE



-- 
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] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


raiden00pl commented on PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#issuecomment-2958118582

   hi @kywwilson11 @stbenn, are you planing to add support for TIMER triggering 
for ADC? I wanted to start working on it soon, so I'd like to make sure we 
don't duplicate our work :)


-- 
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 dependabot/pip/Documentation/requests-2.32.4 created (now 4eab4d141f)

2025-06-10 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/pip/Documentation/requests-2.32.4
in repository https://gitbox.apache.org/repos/asf/nuttx.git


  at 4eab4d141f build(deps): bump requests from 2.32.3 to 2.32.4 in 
/Documentation

No new revisions were added by this update.



Re: [PR] RFC 5424 implementation for SYSLOG [nuttx]

2025-06-10 Thread via GitHub


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


##
drivers/syslog/Kconfig:
##
@@ -140,61 +140,94 @@ config SYSLOG_INTBUFSIZE
 
 comment "Formatting options"
 
+config SYSLOG_RFC5424
+   bool "Standard syslog format (RFC 5424)"
+   default n
+   ---help---
+   Forces syslog logs to follow the RFC 5424 (syslog protocol) 
standard.
+   This allows for structured data elements, standard severity 
levels,
+   standard facilities, standard timestamps and other features 
that allow
+   syslogs to be compatible with other open source programs (such 
as
+   logging servers).
+
+if SYSLOG_RFC5424
+
+comment "RFC5424 options"
+
+config SYSLOG_RFC5424_HOSTNAME
+   bool "Enable hostname field"
+   default n
+   ---help---
+   Adds the HOSTNAME field to the RFC 5424 compatible syslog 
output.
+
+config SYSLOG_RFC5424_TIMEQUALITY
+   bool "timeQuality structured data"
+   depends on SYSLOG_TIMESTAMP

Review Comment:
   if so, it's fine to move SYSLOG_TIMESTAMP out of if/else/endif



-- 
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] [HELP] Why isn't multicast loopback switched on by default? [nuttx]

2025-06-10 Thread via GitHub


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

   POSIX-compliance isn't an option. It's also bad to add an option to control 
the minor default behavior, since only few people can remember them.


-- 
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] Add missing CFLAGS to the ELF guides [nuttx]

2025-06-10 Thread via GitHub


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

   ## Summary
   
   Following the current ELF guides 
([[1]](https://nuttx.apache.org/docs/12.9.0/guides/partially_linked_elf.html), 
[[2]](https://nuttx.apache.org/docs/12.9.0/guides/fully_linked_elf.html)) 
produces unusable binaries due to the lack of appropriate architecture flags in 
the Makefile. This PR adds them.
   
   The fix was originally proposed by @g2gps in apache/nuttx-apps#1828, and I 
applied it to both the partially-linked and fully-linked variants of the guide.
   
   ## Impact
   
   Following the updated guide will yield usable binaries.
   
   ## Testing
   
   These changes were tested on a custom Cortex-M0+ (RP2040) board using NuttX 
v12.8.0 as the baseline.
   
   Output of `arm-none-eabi-objdump -f ` when built without these 
changes (old guide):
   
   ```plaintext
   : file format elf32-littlearm
   architecture: armv4t, flags 0x0011:
   HAS_RELOC, HAS_SYMS
   start address 0x
   ```
   
   And when built with these changes (new guide):
   
   ```plaintext
   : file format elf32-littlearm
   architecture: armv6s-m, flags 0x0011:
   HAS_RELOC, HAS_SYMS
   start address 0x0001
   ```
   
   


-- 
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 dependabot/pip/Documentation/requests-2.32.4 deleted (was 4eab4d141f)

2025-06-10 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/pip/Documentation/requests-2.32.4
in repository https://gitbox.apache.org/repos/asf/nuttx.git


 was 4eab4d141f build(deps): bump requests from 2.32.3 to 2.32.4 in 
/Documentation

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



Re: [PR] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


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


##
arch/arm/src/stm32f0l0g0/Kconfig:
##
@@ -1505,6 +1505,10 @@ config STM32F0L0G0_HAVE_ADC1_DMA
bool
default n
 
+config STM32F0L0G0_HAVE_ADC_OVERSAMPLE
+bool
+default y if STM32F0L0G0_STM32L0 || STM32F0L0G0_STM32G0 || 
STM32F0L0G0_STM32C0

Review Comment:
   ```suggestion
   default STM32F0L0G0_STM32L0 || STM32F0L0G0_STM32G0 || STM32F0L0G0_STM32C0
   ```



-- 
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] build(deps): bump requests from 2.32.3 to 2.32.4 in /Documentation [nuttx]

2025-06-10 Thread via GitHub


xiaoxiang781216 closed pull request #16502: build(deps): bump requests from 
2.32.3 to 2.32.4 in /Documentation
URL: https://github.com/apache/nuttx/pull/16502


-- 
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] build(deps): bump requests from 2.32.3 to 2.32.4 in /Documentation [nuttx]

2025-06-10 Thread via GitHub


dependabot[bot] commented on PR #16502:
URL: https://github.com/apache/nuttx/pull/16502#issuecomment-2961038353

   OK, I won't notify you again about this release, but will get in touch when 
a new version is available. If you'd rather skip all updates until the next 
major or minor version, let me know by commenting `@dependabot ignore this 
major version` or `@dependabot ignore this minor version`. You can also ignore 
all major, minor, or patch releases for a dependency by adding an [`ignore` 
condition](https://docs.github.com/en/code-security/supply-chain-security/configuration-options-for-dependency-updates#ignore)
 with the desired `update_types` to your config file.
   
   If you change your mind, just re-open this PR and I'll resolve any conflicts 
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



(nuttx-website) branch asf-site updated: Publishing web: be40bd59e126a7ffe6ebacfb1b7682fcd8e89704 docs: 19eac98526beb7a76152564fe848c4a003dd70da

2025-06-10 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 14a2d3507 Publishing web: be40bd59e126a7ffe6ebacfb1b7682fcd8e89704 
docs: 19eac98526beb7a76152564fe848c4a003dd70da
14a2d3507 is described below

commit 14a2d35074a02eac09a445e0582f9338365bec09
Author: Alan Carvalho de Assis 
AuthorDate: Wed Jun 11 00:31:06 2025 +

Publishing web: be40bd59e126a7ffe6ebacfb1b7682fcd8e89704 docs: 
19eac98526beb7a76152564fe848c4a003dd70da
---
 content/docs/10.0.0/index.html | 2 +-
 content/docs/10.0.1/index.html | 2 +-
 content/docs/10.1.0/index.html | 2 +-
 content/docs/10.2.0/index.html | 2 +-
 content/docs/10.3.0/index.html | 2 +-
 content/docs/11.0.0/index.html | 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/12.5.1/index.html | 2 +-
 content/docs/12.5.1/searchindex.js | 2 +-
 content/docs/12.6.0/index.html | 2 +-
 content/docs/12.6.0/searchindex.js | 2 +-
 content/docs/12.7.0/index.html | 2 +-
 content/docs/12.7.0/searchindex.js | 2 +-
 content/docs/12.8.0/index.html | 2 +-
 content/docs/12.8.0/searchindex.js | 2 +-
 content/docs/12.9.0/index.html | 2 +-
 content/docs/12.9.0/searchindex.js | 2 +-
 content/docs/latest/index.html | 2 +-
 content/docs/latest/searchindex.js | 2 +-
 content/feed.xml   | 4 ++--
 33 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/content/docs/10.0.0/index.html b/content/docs/10.0.0/index.html
index ae48b9ed1..3470a9f8e 100644
--- a/content/docs/10.0.0/index.html
+++ b/content/docs/10.0.0/index.html
@@ -207,7 +207,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: 10 June 25 at 00:15
+Last Updated: 11 June 25 at 00:15
 
 Table of Contents
 
diff --git a/content/docs/10.0.1/index.html b/content/docs/10.0.1/index.html
index 5a505e0db..b9ed7973d 100644
--- a/content/docs/10.0.1/index.html
+++ b/content/docs/10.0.1/index.html
@@ -243,7 +243,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: 10 June 25 at 00:15
+Last Updated: 11 June 25 at 00:15
 
 Table of Contents
 
diff --git a/content/docs/10.1.0/index.html b/content/docs/10.1.0/index.html
index 54e5f76c5..33a7a58e8 100644
--- a/content/docs/10.1.0/index.html
+++ b/content/docs/10.1.0/index.html
@@ -243,7 +243,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 64-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: 10 June 25 at 00:15
+Last Updated: 11 June 25 at 00:15
 
 Table of Contents
 
diff --git a/content/docs/10.2.0/index.html b/content/docs/10.2.0/index.html
index 70af0be45..dfb6129a8 100644
--- a/content/docs/10.2.0/index.html
+++ b/content/docs/10.2.0/index.html
@@ -244,7 +244,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 64-bit microcontroller

Re: [I] [HELP] Why isn't multicast loopback switched on by default? [nuttx]

2025-06-10 Thread via GitHub


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

   Ok, but I see people lamenting the loss of options that allow NuttX to 
better suit small processors. Shouldn't we accommodate that somehow as NON 
default options?
   


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



[I] [BUG] nuttx-aware debugging with gdb: fail to load pynuttx `fs` module [nuttx]

2025-06-10 Thread via GitHub


sumpfralle opened a new issue, #16507:
URL: https://github.com/apache/nuttx/issues/16507

   ### Description / Steps to reproduce the issue
   
   I tried to follow the instructions for [nuttx-aware debugging with 
gdb](https://nuttx.apache.org/docs/latest/quickstart/debugging.html#with-gdb).
   
   In order to do so, I added this line to my project's `.gdbinit`:
   ```
   source nuttx/tools/pynuttx/gdbinit.py
   ```
   
   The config settings mentioned in the documentation are enabled:
   ```
   CONFIG_DEBUG_FEATURES=y
   CONFIG_DEBUG_FULLOPT=y
   CONFIG_DEBUG_SYMBOLS=y
   CONFIG_FS_PROCFS=y
   ```
   
   During the startup of gdb the following output was emitted:
   ```
   "/usr/bin/gdb-multiarch" --init-eval-command "set auto-load safe-path ." 
--init-eval-command 'set variable $gdb_device_path = 
"/dev/ttyACM_BMP_C0CAB21D_GDB,b230400,raw,echo=0"'  "nuttx/nuttx"
   GNU gdb (Debian 16.2-8) 16.2
   Copyright (C) 2024 Free Software Foundation, Inc.
   License GPLv3+: GNU GPL version 3 or later 
   This is free software: you are free to change and redistribute it.
   There is NO WARRANTY, to the extent permitted by law.
   Type "show copying" and "show warranty" for details.
   This GDB was configured as "x86_64-linux-gnu".
   Type "show configuration" for configuration details.
   For bug reporting instructions, please see:
   .
   Find the GDB manual and other documentation resources online at:
   .
   
   For help, type "help".
   Type "apropos word" to search for commands related to "word"...
   Reading symbols from nuttx/nuttx...
   Registering NuttX GDB commands from nuttx/tools/pynuttx/nxgdb
   set pagination off
   set python print-stack full
   "handle SIGUSR1 "nostop" "pass" "noprint"
   Load macro: /tmp/86a28cefd2a3107dc2762e60151d6bb2.json
   
if use thread command, please don't use 'continue', use 'c' instead !!!
if use thread command, please don't use 'step', use 's' instead !!!
   Ignore module: fs, error: int() argument must be a string, a bytes-like 
object or a real number, not 'NoneType'
   Traceback (most recent call last):
 File "nuttx/tools/pynuttx/nxgdb/__init__.py", line 54, in init_gdb_commands
   module = importlib.import_module(f"{__package__}.{m}")
 File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
   return _bootstrap._gcd_import(name[level:], package, level)
  ~~^^
 File "", line 1387, in _gcd_import
 File "", line 1360, in _find_and_load
 File "", line 1331, in _find_and_load_unlocked
 File "", line 935, in _load_unlocked
 File "", line 1026, in exec_module
 File "", line 488, in 
_call_with_frames_removed
 File "nuttx/tools/pynuttx/nxgdb/fs.py", line 43, in 
   CONFIG_NFILE_DESCRIPTORS_PER_BLOCK = int(
   utils.get_symbol_value("CONFIG_NFILE_DESCRIPTORS_PER_BLOCK")
   )
   TypeError: int() argument must be a string, a bytes-like object or a real 
number, not 'NoneType'
   ```
   
   I tried to investigate the exception and added the following lines to the 
referenced file `nxgdb/fs.py`:
   
   ```
   from .utils import g_symbol_cache
   for key, value in g_symbol_cache.items():
   print(f"{key}: {value}")
   ```
   
   I understood the variable `g_symbol_cache` to contain the parsed symbols 
(including configuration) in a dict. This dict that was accessed during the 
exception above.
   
   The above `print` loop resulted in the following output during the next 
start of gdb:
   
   ```
   ('CONFIG_SCHED_WORKQUEUE', 'nx_start'): None
   ('CONFIG_MM_BACKTRACE', 'nx_start'): None
   ('MM_MIN_CHUNK', 'mm_initialize'): None
   ('CONFIG_RAMLOG_SYSLOG', 'nx_start'): None
   ('CONFIG_SYSLOG_RPMSG', 'nx_start'): None
   ('STACK_COLOR', 'up_create_stack'): None
   ('CONFIG_SMP_NCPUS', 'nx_start'): None
   ('CONFIG_SMP', 'nx_start'): None
   ('CONFIG_DISABLE_MQUEUE', 'nx_start'): None
   ('CONFIG_PAGING', 'nx_start'): None
   ('CONFIG_SIG_SIGSTOP_ACTION', 'nx_start'): None
   ('CONFIG_RPMSG', 'nx_start'): None
   ('FSNODEFLAG_TYPE_MASK', 'nx_start'): None
   ('CONFIG_PSEUDOFS_FILE', 'nx_start'): None
   ('CONFIG_PSEUDOFS_ATTRIBUTES', 'nx_start'): None
   ```
   
   This looks like the `g_symbol_cache` variable is empty.
   
   At this stage I lack the understanding of the intended inner working of this 
code. Thus, I cannot advance without a few hints, what could have gone wrong 
here.
   
   Do you have an idea?
   
   ### On which OS does this issue occur?
   
   [OS: Linux]
   
   ### What is the version of your OS?
   
   Debian Trixie
   
   ### NuttX Version
   
   master
   
   ### Issue Architecture
   
   [Arch: arm]
   
   ### Issue Area
   
   [Area: Debugging]
   
   ### Host information
   
   NuttX CFLAGS:
 -Wstrict-prototypes
 -Wno-attributes
 -Wno-unknown-pragmas
 -Wno-psab

Re: [I] [BUG] nuttx-aware debugging with gdb: fail to load pynuttx `fs` module [nuttx]

2025-06-10 Thread via GitHub


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

   @XuNeo and @Donny9 could you look at this problem?


-- 
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] Update the ELF guides [nuttx]

2025-06-10 Thread via GitHub


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

   @nmaggioni please fix the documentation build error:
   
https://github.com/apache/nuttx/actions/runs/15573715022/job/43855943063?pr=16509


-- 
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] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


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


##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -1295,6 +1312,31 @@ static void adc_configure(struct adc_dev_s *dev)
   adc_dumpregs(priv);
 }
 
+ #if defined(CONFIG_STM32F0L0G0_ADC_OVERSAMPLE)
+
+/
+ * Name: adc_oversample
+ /
+
+static void adc_oversample(struct adc_dev_s *dev)

Review Comment:
   yes, 32/64bit arch/chip doesn't need FAR decorator and should be removed, 
only common code or 16bit arch need add FAR if needed.



-- 
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] [HELP] Why isn't multicast loopback switched on by default? [nuttx]

2025-06-10 Thread via GitHub


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

   This suggestion is only changing the default value, no size impact on the 
final image. ICMP already has an option and disabled by default.


-- 
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] Issue building ELF programs with no symbol table. [nuttx-apps]

2025-06-10 Thread via GitHub


acassis commented on issue #1828:
URL: https://github.com/apache/nuttx-apps/issues/1828#issuecomment-2959162090

   Hi @nmaggioni thank you for confirming the issue. Sure, all our 
documentation is located inside NuttX source code itself (Documentation/ 
folder). Please submit a PR with the fix.


-- 
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] [HELP] Why isn't multicast loopback switched on by default? [nuttx]

2025-06-10 Thread via GitHub


sastel commented on issue #16504:
URL: https://github.com/apache/nuttx/issues/16504#issuecomment-2959615664

   This Linux programming document from 1998 [Multicast 
Programming](https://tldp.org/HOWTO/Multicast-HOWTO-6.html) says in section 
_6.1 IP_MULTICAST_LOOP_ "Loopback is by default enabled.", so I find it strange 
that NuttX doesn't have at least a config by which it may be default 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] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


tinnedkarma commented on code in PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#discussion_r2138041392


##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -1295,6 +1312,31 @@ static void adc_configure(struct adc_dev_s *dev)
   adc_dumpregs(priv);
 }
 
+ #if defined(CONFIG_STM32F0L0G0_ADC_OVERSAMPLE)
+
+/
+ * Name: adc_oversample
+ /
+
+static void adc_oversample(struct adc_dev_s *dev)

Review Comment:
   Check line 1931 `static int adc_ioc_set_oversample(FAR struct adc_dev_s 
*dev, uint32_t arg)`



-- 
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] fs/vfs: Separate file descriptors from file descriptions [nuttx]

2025-06-10 Thread via GitHub


Donny9 commented on PR #16499:
URL: https://github.com/apache/nuttx/pull/16499#issuecomment-2959482238

   > please add a commit message to 
[0ec77cf](https://github.com/apache/nuttx/commit/0ec77cf1375923da6208322190849597075752ad)
 and change the title to tools/pynuttx: update fs.py base on new structure fd 
and file
   
   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



Re: [I] Actions list to improve NuttX quality and reliability [nuttx]

2025-06-10 Thread via GitHub


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

   Hi @NevynUK we didn't start it yet, but my initial idea was to took a look 
at coccinelle and frama-c, but yest cpp-check seems a nice option. Another 
option to take a look is SonarQube, the company behind it ran a test of NuttX 
source code and since it is open-source, maybe it could be possible to use it 
together with cpp-check for example.
   
   I think the problem with clang-format is because it is not able to check the 
NuttX style correctly, some people already tried to adapt it in the past, but 
it wasn't able to catch all the coding styles.


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



[I] [HELP] Why isn't multicast loopback switched on by default? [nuttx]

2025-06-10 Thread via GitHub


sastel opened a new issue, #16504:
URL: https://github.com/apache/nuttx/issues/16504

   ### Description
   
   @acassis I noticed recently that multicast loopback is disabled by default 
in NuttX. I have a pair of applications which when I run them on the same 
device using Linux, discover each other via multicast loopback. However when I 
run these applications on the same device using NuttX (kernel mode), they do 
not discover each other, even though applications on other devices can see 
their multicast traffic.
   
   In `nuttx/net/udp/udp_send.c`, you can see that there is support for 
`IP_MULTICAST_LOOP` in the code. I have the relevant options set in my 
defconfig, so if that bit is set then it should be looping back.
   
   It seems that `IP_MULTICAST_LOOP` is set by default in Linux, but in NuttX 
the bit is not set by default in `conn->sconn.s_options`.
   
   I have two questions based on this, and I'm hoping someone more 
knowledgeable than I about this stuff can help.
   1. Why doesn't NuttX set this bit by default?
   2. Should NuttX set this bit by default?
   
   I can use the sockets API to set this in my communications stack, but it 
isn't clear to me what is the right place to do it.
   
   ### Verification
   
   - [x] I have verified before submitting the report.


-- 
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.apache.org

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



(nuttx) branch master updated (5e94d4482b -> 19eac98526)

2025-06-10 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 5e94d4482b fs/vfs: check buffer count and pointer for iovec
 new 9d1b958524 sched/wdog: Remove the wd_start_period.
 new efe2af643f sched/wdog: Replace periodcial timer with the wd_start_next.
 new df183b6682 sched/wqueue: Remove the work_queue_period.
 new 19eac98526 sched: Add comments for wd_start_next and work_queue_next.

The 4 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:
 include/nuttx/wdog.h|  67 ++---
 include/nuttx/wqueue.h  |  29 +--
 sched/clock/clock_adjtime.c |   2 +-
 sched/clock/clock_perf.c|   2 +-
 sched/sched/sched_cpuload.c |   2 +-
 sched/sched/sched_profil.c  |   2 +-
 sched/timer/timer_settime.c |   2 +-
 sched/wdog/wd_start.c   |  73 +--
 sched/wqueue/kwork_queue.c  | 118 
 sched/wqueue/kwork_thread.c |  25 +-
 10 files changed, 121 insertions(+), 201 deletions(-)



(nuttx) 01/04: sched/wdog: Remove the wd_start_period.

2025-06-10 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 9d1b9585245d0ac1079e887b1166c6a8215619e9
Author: ouyangxiangzhen 
AuthorDate: Wed Jun 4 11:35:31 2025 +0800

sched/wdog: Remove the wd_start_period.

For better simplicity, this commit replaced the periodical wdog APIs with 
the more expressive wd_start_next. The wd_start_next restarts watchdog timer 
based on the last expiration time.

Signed-off-by: ouyangxiangzhen 
---
 include/nuttx/wdog.h  | 63 +++-
 sched/wdog/wd_start.c | 73 +--
 2 files changed, 22 insertions(+), 114 deletions(-)

diff --git a/include/nuttx/wdog.h b/include/nuttx/wdog.h
index 2e36047e34..10c8945238 100644
--- a/include/nuttx/wdog.h
+++ b/include/nuttx/wdog.h
@@ -99,13 +99,6 @@ struct wdog_s
   clock_texpired;/* Timer associated with the absolute time */
 };
 
-struct wdog_period_s
-{
-  struct wdog_s  wdog;   /* Watchdog */
-  clock_tperiod; /* Period time in ticks */
-  wdentry_t  func;   /* Wrapped function to execute when delay 
expires */
-};
-
 /
  * Pubic Function Prototypes
  /
@@ -271,10 +264,11 @@ int wd_start_abstick(FAR struct wdog_s *wdog, clock_t 
ticks,
  *
  /
 
-static inline int wd_start_realtime(FAR struct wdog_s *wdog,
-FAR const struct timespec *realtime,
-wdentry_t wdentry,
-wdparm_t arg)
+static inline_function
+int wd_start_realtime(FAR struct wdog_s *wdog,
+  FAR const struct timespec *realtime,
+  wdentry_t wdentry,
+  wdparm_t arg)
 {
 #ifdef CONFIG_CLOCK_TIMEKEEPING
   irqstate_t flags;
@@ -296,15 +290,15 @@ static inline int wd_start_realtime(FAR struct wdog_s 
*wdog,
 }
 
 /
- * Name: wd_start_period
+ * Name: wd_start_next
  *
  * Description:
- *   This function periodically adds a watchdog timer to the active timer.
+ *   This function restart watchdog timer based on the last expiration time.
+ *   It can be used to implement a periodic watchdog timer.
  *
  * Input Parameters:
  *   wdog - Pointer of the periodic watchdog.
  *   delay- Delayed time in system ticks.
- *   period   - Period in system ticks.
  *   wdentry  - Function to call on timeout.
  *   arg  - Parameter to pass to wdentry.
  *
@@ -320,8 +314,19 @@ static inline int wd_start_realtime(FAR struct wdog_s 
*wdog,
  *
  /
 
-int wd_start_period(FAR struct wdog_period_s *wdog, clock_t delay,
-clock_t period, wdentry_t wdentry, wdparm_t arg);
+static inline_function
+int wd_start_next(FAR struct wdog_s *wdog, clock_t delay,
+  wdentry_t wdentry, wdparm_t arg)
+{
+  /* Ensure delay is within the range the wdog can handle. */
+
+  if (delay > WDOG_MAX_DELAY)
+{
+  return -EINVAL;
+}
+
+  return wd_start_abstick(wdog, wdog->expired + delay, wdentry, arg);
+}
 
 /
  * Name: wd_cancel
@@ -341,32 +346,6 @@ int wd_start_period(FAR struct wdog_period_s *wdog, 
clock_t delay,
 
 int wd_cancel(FAR struct wdog_s *wdog);
 
-/
- * Name: wd_cancel_period
- *
- * Description:
- *   This function cancels a currently running periodic watchdog timer.
- *
- * Input Parameters:
- *   wdog_period - Pointer of the periodic watchdog.
- *
- * Returned Value:
- *   Zero (OK) is returned on success;  A negated errno value is returned to
- *   indicate the nature of any failure.
- *
- /
-
-static inline int wd_cancel_period(FAR struct wdog_period_s *wdog_period)
-{
-  if (!wdog_period)
-{
-  return -EINVAL;
-}
-
-  wdog_period->period = 0;
-  return wd_cancel(&wdog_period->wdog);
-}
-
 /
  * Name: wd_gettime
  *
diff --git a/sched/wdog/wd_start.c b/sched/wdog/wd_start.c
index 147f3c7a26..3850ccaf89 100644
--- a/sched/wdog/wd_start.c
+++ b/sched/wdog/wd_start.c
@@ -97,36 +97,6 @@ static unsigned int g_wdtimernested;
  * Private Functions
  /
 
-/
- * Name: wdentry_period
- *
- *

(nuttx) 04/04: sched: Add comments for wd_start_next and work_queue_next.

2025-06-10 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 19eac98526beb7a76152564fe848c4a003dd70da
Author: ouyangxiangzhen 
AuthorDate: Mon Jun 9 21:04:56 2025 +0800

sched: Add comments for wd_start_next and work_queue_next.

This commit added comments for newly added APIs wd_start_next and
work_queue_next.

Signed-off-by: ouyangxiangzhen 
---
 include/nuttx/wdog.h   | 6 +-
 include/nuttx/wqueue.h | 6 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/nuttx/wdog.h b/include/nuttx/wdog.h
index 10c8945238..016aacee4b 100644
--- a/include/nuttx/wdog.h
+++ b/include/nuttx/wdog.h
@@ -294,7 +294,11 @@ int wd_start_realtime(FAR struct wdog_s *wdog,
  *
  * Description:
  *   This function restart watchdog timer based on the last expiration time.
- *   It can be used to implement a periodic watchdog timer.
+ *   It can be used to implement a periodic watchdog timer. E.g, Call this
+ *   function instead of wd_start in the watchdog callback to restart the
+ *   next timer for better timing accuracy.
+ *   Note that calling this function outside the watchdog callback requires
+ *   the wdog->expired being set.
  *
  * Input Parameters:
  *   wdog - Pointer of the periodic watchdog.
diff --git a/include/nuttx/wqueue.h b/include/nuttx/wqueue.h
index f9b3470efe..73e8a0eb1e 100644
--- a/include/nuttx/wqueue.h
+++ b/include/nuttx/wqueue.h
@@ -414,7 +414,11 @@ int work_queue_wq(FAR struct kwork_wqueue_s *wqueue,
  *
  * Description:
  *   Queue work to be performed at a later time based on the last expiration
- *   time. This function must be called in the workqueue callback.
+ *   time. This function can be used to implement a periodic workqueue.
+ *   E.g, Call this function instead of work_queue in the work callback to
+ *   restart the next work for better timing accuracy.
+ *   Note that calling this function outside the work callback requires
+ *   the work->qtime being set.
  *
  * Input Parameters:
  *   qid- The work queue ID (must be HPWORK or LPWORK)



(nuttx) 03/04: sched/wqueue: Remove the work_queue_period.

2025-06-10 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 df183b668272dafb7e3e236fcbdf6d87ede6f3b9
Author: ouyangxiangzhen 
AuthorDate: Wed Jun 4 17:11:49 2025 +0800

sched/wqueue: Remove the work_queue_period.

For simplicity, better performance and lower memory-overhead, this commit 
replaced the periodical workqueue APIs with the more expressive 
work_queue_next. The work_queue_next restarts work based on the last expiration 
time.

Signed-off-by: ouyangxiangzhen 
---
 include/nuttx/wqueue.h  |  25 +++---
 sched/wqueue/kwork_queue.c  | 118 
 sched/wqueue/kwork_thread.c |  25 +-
 3 files changed, 86 insertions(+), 82 deletions(-)

diff --git a/include/nuttx/wqueue.h b/include/nuttx/wqueue.h
index 6eaefff597..f9b3470efe 100644
--- a/include/nuttx/wqueue.h
+++ b/include/nuttx/wqueue.h
@@ -251,7 +251,6 @@ struct work_s
 {
   struct list_node node;   /* Implements a double linked list */
   clock_t  qtime;  /* Time work queued */
-  clock_t  period; /* Periodical delay ticks */
   worker_t worker; /* Work callback */
   FAR void*arg;/* Callback argument */
 };
@@ -411,18 +410,11 @@ int work_queue_wq(FAR struct kwork_wqueue_s *wqueue,
   FAR void *arg, clock_t delay);
 
 /
- * Name: work_queue_period/work_queue_period_wq
+ * Name: work_queue_next/work_queue_next_wq
  *
  * Description:
- *   Queue work to be performed periodically.  All queued work will be
- *   performed on the worker thread of execution (not the caller's).
- *
- *   The work structure is allocated and must be initialized to all zero by
- *   the caller.  Otherwise, the work structure is completely managed by the
- *   work queue logic.  The caller should never modify the contents of the
- *   work queue structure directly.  If work_queue() is called before the
- *   previous work has been performed and removed from the queue, then any
- *   pending work will be canceled and lost.
+ *   Queue work to be performed at a later time based on the last expiration
+ *   time. This function must be called in the workqueue callback.
  *
  * Input Parameters:
  *   qid- The work queue ID (must be HPWORK or LPWORK)
@@ -434,18 +426,17 @@ int work_queue_wq(FAR struct kwork_wqueue_s *wqueue,
  *it is invoked.
  *   delay  - Delay (in clock ticks) from the time queue until the worker
  *is invoked. Zero means to perform the work immediately.
- *   period - Period (in clock ticks).
  *
  * Returned Value:
  *   Zero on success, a negated errno on failure
  *
  /
 
-int work_queue_period(int qid, FAR struct work_s *work, worker_t worker,
-  FAR void *arg, clock_t delay, clock_t period);
-int work_queue_period_wq(FAR struct kwork_wqueue_s *wqueue,
- FAR struct work_s *work, worker_t worker,
- FAR void *arg, clock_t delay, clock_t period);
+int work_queue_next(int qid, FAR struct work_s *work, worker_t worker,
+FAR void *arg, clock_t delay);
+int work_queue_next_wq(FAR struct kwork_wqueue_s *wqueue,
+   FAR struct work_s *work, worker_t worker,
+   FAR void *arg, clock_t delay);
 
 /
  * Name: work_queue_pri
diff --git a/sched/wqueue/kwork_queue.c b/sched/wqueue/kwork_queue.c
index ede28bb65c..75b5a7f5fd 100644
--- a/sched/wqueue/kwork_queue.c
+++ b/sched/wqueue/kwork_queue.c
@@ -45,18 +45,11 @@
  /
 
 /
- * Name: work_queue_period/work_queue_period_wq
+ * Name: work_queue_next/work_queue_next_wq
  *
  * Description:
- *   Queue work to be performed periodically.  All queued work will be
- *   performed on the worker thread of execution (not the caller's).
- *
- *   The work structure is allocated and must be initialized to all zero by
- *   the caller.  Otherwise, the work structure is completely managed by the
- *   work queue logic.  The caller should never modify the contents of the
- *   work queue structure directly.  If work_queue() is called before the
- *   previous work has been performed and removed from the queue, then any
- *   pending work will be canceled and lost.
+ *   Queue work to be performed at a later time based on the last expiration
+ *   time. This function must be called in the workqueue callback.
  *
  * Input Parameters:
  *   qid- The work queue ID (must be HPWORK or LPWORK)
@@ -68,20 +61,17 @@
  *it is invoked.
  *   delay  - Delay (in clock 

(nuttx) 02/04: sched/wdog: Replace periodcial timer with the wd_start_next.

2025-06-10 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 efe2af643f6362d5d461049e7f9b7ea67edb0eb5
Author: ouyangxiangzhen 
AuthorDate: Thu May 29 14:42:45 2025 +0800

sched/wdog: Replace periodcial timer with the wd_start_next.

This commit replaced periodical timer with the wd_start_next to improve the 
timing accuracy.

Signed-off-by: ouyangxiangzhen 
---
 sched/clock/clock_adjtime.c | 2 +-
 sched/clock/clock_perf.c| 2 +-
 sched/sched/sched_cpuload.c | 2 +-
 sched/sched/sched_profil.c  | 2 +-
 sched/timer/timer_settime.c | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sched/clock/clock_adjtime.c b/sched/clock/clock_adjtime.c
index 0effc2e241..c7028f4fd8 100644
--- a/sched/clock/clock_adjtime.c
+++ b/sched/clock/clock_adjtime.c
@@ -135,7 +135,7 @@ static int adjtime_start(long long adjust_usec)
   if (g_adjtime_ppb != 0)
 {
   wd_start(&g_adjtime_wdog, MSEC2TICK(CONFIG_CLOCK_ADJTIME_PERIOD_MS),
-  adjtime_wdog_callback, 0);
+   adjtime_wdog_callback, 0);
 }
   else
 {
diff --git a/sched/clock/clock_perf.c b/sched/clock/clock_perf.c
index 1fd9c46eb3..372b0d8d78 100644
--- a/sched/clock/clock_perf.c
+++ b/sched/clock/clock_perf.c
@@ -64,7 +64,7 @@ static void perf_update(wdparm_t arg)
   clock_t tick = (clock_t)LONG_MAX * TICK_PER_SEC / up_perf_getfreq();
 
   perf_gettime();
-  wd_start((FAR struct wdog_s *)arg, tick, perf_update, arg);
+  wd_start_next((FAR struct wdog_s *)arg, tick, perf_update, arg);
 }
 
 /
diff --git a/sched/sched/sched_cpuload.c b/sched/sched/sched_cpuload.c
index 9ded4668ac..f7811254a2 100644
--- a/sched/sched/sched_cpuload.c
+++ b/sched/sched/sched_cpuload.c
@@ -118,7 +118,7 @@ static void cpuload_callback(wdparm_t arg)
 {
   FAR struct wdog_s *wdog = (FAR struct wdog_s *)arg;
   nxsched_process_cpuload_ticks(CPULOAD_SAMPLING_PERIOD);
-  wd_start(wdog, CPULOAD_SAMPLING_PERIOD, cpuload_callback, arg);
+  wd_start_next(wdog, CPULOAD_SAMPLING_PERIOD, cpuload_callback, arg);
 }
 #endif
 
diff --git a/sched/sched/sched_profil.c b/sched/sched/sched_profil.c
index 40c276a0e7..5a07af9678 100644
--- a/sched/sched/sched_profil.c
+++ b/sched/sched/sched_profil.c
@@ -102,7 +102,7 @@ static void profil_timer_handler(wdparm_t arg)
 #endif
 
   profil_timer_handler_cpu(prof);
-  wd_start(&prof->timer, PROFTICK, profil_timer_handler, arg);
+  wd_start_next(&prof->timer, PROFTICK, profil_timer_handler, arg);
 }
 
 /
diff --git a/sched/timer/timer_settime.c b/sched/timer/timer_settime.c
index 656807fe82..f69c3fa83a 100644
--- a/sched/timer/timer_settime.c
+++ b/sched/timer/timer_settime.c
@@ -128,7 +128,7 @@ static inline void timer_restart(FAR struct posix_timer_s 
*timer,
*/
 
   frame = (delay + timer->pt_delay) / timer->pt_delay;
-  timer->pt_overrun = frame - 1;
+  timer->pt_overrun   = frame - 1;
   timer->pt_expected += frame * timer->pt_delay;
 
   wd_start_abstick(&timer->pt_wdog, timer->pt_expected,



Re: [PR] sched/wdog: Replace periodical timer with the wd_start_next. [nuttx]

2025-06-10 Thread via GitHub


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


-- 
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] RFC 5424 implementation for SYSLOG [nuttx]

2025-06-10 Thread via GitHub


linguini1 commented on code in PR #16493:
URL: https://github.com/apache/nuttx/pull/16493#discussion_r2138580797


##
drivers/syslog/Kconfig:
##
@@ -140,61 +140,94 @@ config SYSLOG_INTBUFSIZE
 
 comment "Formatting options"
 
+config SYSLOG_RFC5424
+   bool "Standard syslog format (RFC 5424)"
+   default n
+   ---help---
+   Forces syslog logs to follow the RFC 5424 (syslog protocol) 
standard.
+   This allows for structured data elements, standard severity 
levels,
+   standard facilities, standard timestamps and other features 
that allow
+   syslogs to be compatible with other open source programs (such 
as
+   logging servers).
+
+if SYSLOG_RFC5424
+
+comment "RFC5424 options"
+
+config SYSLOG_RFC5424_HOSTNAME
+   bool "Enable hostname field"
+   default n
+   ---help---
+   Adds the HOSTNAME field to the RFC 5424 compatible syslog 
output.
+
+config SYSLOG_RFC5424_TIMEQUALITY
+   bool "timeQuality structured data"
+   depends on SYSLOG_TIMESTAMP

Review Comment:
   No, it is an optional field. The only required field is the PRI field.



-- 
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] RFC 5424 implementation for SYSLOG [nuttx]

2025-06-10 Thread via GitHub


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


##
drivers/syslog/Kconfig:
##
@@ -140,61 +140,94 @@ config SYSLOG_INTBUFSIZE
 
 comment "Formatting options"
 
+config SYSLOG_RFC5424
+   bool "Standard syslog format (RFC 5424)"
+   default n
+   ---help---
+   Forces syslog logs to follow the RFC 5424 (syslog protocol) 
standard.
+   This allows for structured data elements, standard severity 
levels,
+   standard facilities, standard timestamps and other features 
that allow
+   syslogs to be compatible with other open source programs (such 
as
+   logging servers).
+
+if SYSLOG_RFC5424
+
+comment "RFC5424 options"
+
+config SYSLOG_RFC5424_HOSTNAME
+   bool "Enable hostname field"
+   default n
+   ---help---
+   Adds the HOSTNAME field to the RFC 5424 compatible syslog 
output.
+
+config SYSLOG_RFC5424_TIMEQUALITY
+   bool "timeQuality structured data"
+   depends on SYSLOG_TIMESTAMP

Review Comment:
   but timestamp is required by rfc5424?



-- 
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] riscv qemu-rv: fix kernel mapping by enabling CONFIG_MM_KMAP in knsh [nuttx]

2025-06-10 Thread via GitHub


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

   ## Summary
   
   * Enable CONFIG_MM_KMAP in the knsh defconfig for the QEMU RISC-V board. 
This change addresses kernel mapping issues when running in S-mode with the MMU 
enabled, as discussed in 
[apache/nuttx#16462](vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html).
 Without this option, background tasks such as ostest can cause kernel crashes 
due to missing kernel virtual memory mappings.*
   
   ## Impact
   
   *This change improves system stability for the qemu-rv/rv-virt:knsh 
configuration by ensuring proper kernel mapping support. It is especially 
important for multitasking scenarios and background process execution in S-mode 
with the MMU.*
   
   ## Testing
   
   *Tested by running ostest in the background (ostest &) and typing random 
keys in the NuttX shell. The system remains stable and does not crash, 
confirming that kernel mapping is functioning 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



Re: [I] [BUG] nxsem_wait_irq assertion failure [nuttx]

2025-06-10 Thread via GitHub


atr294 commented on issue #16462:
URL: https://github.com/apache/nuttx/issues/16462#issuecomment-2960924152

   @pussuw @acassis My apologies for the delay.
   
   It took me some time to get `CONFIG_MM_KMAP` working on my Litex target due 
to initial memory layout issues. After resolving those, I can confirm that 
enabling `CONFIG_MM_KMAP` fixes the problem. The system is now stable and works 
correctly on both QEMU and Litex.
   
   I've opened a PR for the `qemu-rv/rv-virt:knsh` configuration:
   
   [(https://github.com/apache/nuttx/pull/16508)]
   
   Thanks very much for the help!


-- 
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] Update the ELF guides [nuttx]

2025-06-10 Thread via GitHub


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

   ## Summary
   
   This PR extends and supersedes #16506 by offering a more extensive rewrite 
of both ELF guides: the contents have been updated for export packages 
generated by newer NuttX versions, some obsolete Bash idioms and Unix tools 
invocations have been replaced, some tips have been added, and the language has 
been uniformed.
   
   ## Impact
   
   These new revised guides should make building add-on ELF binaries more 
straightforward.
   
   ## Testing
   
   These changes were tested on a Linux host, targeting a custom Cortex-M0+ 
(RP2040) board using NuttX v12.8.0 as the baseline.
   
   
   


-- 
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] Add missing CFLAGS to the ELF guides [nuttx]

2025-06-10 Thread via GitHub


nmaggioni closed pull request #16506: Add missing CFLAGS to the ELF guides
URL: https://github.com/apache/nuttx/pull/16506


-- 
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] Add missing CFLAGS to the ELF guides [nuttx]

2025-06-10 Thread via GitHub


nmaggioni commented on PR #16506:
URL: https://github.com/apache/nuttx/pull/16506#issuecomment-2960937864

   Momentarily closing this in favor of the new related PR.


-- 
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] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


stbenn commented on PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#issuecomment-2959012006

   @raiden00pl We are not planning on adding timer trigger support, but Kyle is 
currently working on adding DMA support


-- 
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] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


raiden00pl commented on code in PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#discussion_r2137770211


##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -1295,6 +1312,31 @@ static void adc_configure(struct adc_dev_s *dev)
   adc_dumpregs(priv);
 }
 
+ #if defined(CONFIG_STM32F0L0G0_ADC_OVERSAMPLE)
+
+/
+ * Name: adc_oversample
+ /
+
+static void adc_oversample(struct adc_dev_s *dev)

Review Comment:
   FAR is not used in STM32 chips



-- 
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] fs/vfs: Separate file descriptors from file descriptions [nuttx]

2025-06-10 Thread via GitHub


Donny9 commented on code in PR #16499:
URL: https://github.com/apache/nuttx/pull/16499#discussion_r2137501582


##
fs/inode/fs_files.c:
##
@@ -587,37 +621,138 @@ int file_allocate_from_tcb(FAR struct tcb_s *tcb, FAR 
struct inode *inode,
 #endif
 }
 
+/
+ * Name: fdlist_allocate
+ *
+ * Description:
+ *   Allocate a struct fd instance and associate it with an empty file
+ *   instance. The difference between this function and
+ *   file_allocate_from_inode is that this function is only used for
+ *   placeholder purposes. Later, the caller will initialize the file entity
+ *   through the returned filep.
+ *
+ *   The fd allocated by this function can be released using fdlist_close.
+ *
+ *   After the function call is completed, it will hold a reference count
+ *   for the filep. Therefore, when the filep is no longer in use, it is
+ *   necessary to call file_put to release the reference count, in order
+ *   to avoid a race condition where the file might be closed during
+ *   this process.
+ *
+ * Returned Value:
+ *   Returns the file descriptor == index into the files array on success;
+ *   a negated errno value is returned on any failure.
+ *
+ /
+
+int fdlist_allocate(FAR struct fdlist *list, int oflags,
+int minfd, FAR struct file **filep)
+{
+  int fd;
+
+  *filep = fs_heap_zalloc(sizeof(struct file));
+  if (*filep == NULL)
+{
+  return -ENOMEM;
+}
+
+  fd = fdlist_dupfile(list, oflags, minfd, *filep);
+  if (fd < 0)
+{
+  fs_heap_free(*filep);

Review Comment:
   done~



##
fs/inode/fs_files.c:
##
@@ -587,37 +621,138 @@ int file_allocate_from_tcb(FAR struct tcb_s *tcb, FAR 
struct inode *inode,
 #endif
 }
 
+/
+ * Name: fdlist_allocate
+ *
+ * Description:
+ *   Allocate a struct fd instance and associate it with an empty file
+ *   instance. The difference between this function and
+ *   file_allocate_from_inode is that this function is only used for
+ *   placeholder purposes. Later, the caller will initialize the file entity
+ *   through the returned filep.
+ *
+ *   The fd allocated by this function can be released using fdlist_close.
+ *
+ *   After the function call is completed, it will hold a reference count
+ *   for the filep. Therefore, when the filep is no longer in use, it is
+ *   necessary to call file_put to release the reference count, in order
+ *   to avoid a race condition where the file might be closed during
+ *   this process.
+ *
+ * Returned Value:
+ *   Returns the file descriptor == index into the files array on success;
+ *   a negated errno value is returned on any failure.
+ *
+ /
+
+int fdlist_allocate(FAR struct fdlist *list, int oflags,
+int minfd, FAR struct file **filep)
+{
+  int fd;
+
+  *filep = fs_heap_zalloc(sizeof(struct file));
+  if (*filep == NULL)
+{
+  return -ENOMEM;
+}
+
+  fd = fdlist_dupfile(list, oflags, minfd, *filep);
+  if (fd < 0)
+{
+  fs_heap_free(*filep);
+}
+  else
+{
+  file_ref(*filep);

Review Comment:
   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



Re: [PR] fs/vfs: Separate file descriptors from file descriptions [nuttx]

2025-06-10 Thread via GitHub


Donny9 commented on PR #16499:
URL: https://github.com/apache/nuttx/pull/16499#issuecomment-2958604587

   > > > Fix the race condition issues pointed out by @xiaoxiang781216 and then 
this is fine to merge by me. I will not review this any longer as this is not 
my code anymore.
   > > 
   > > 
   > > The new patch still follow your code base, but detail is refine since FS 
is a very important subsystem and this patch series change the life cycle 
management, so it's always good to have more expert to review and refine the 
patch.
   > 
   > Yes, thanks for spending a substantial amount of time doing the review. I 
think this is ready to merge now. There is a practical reason why I cannot 
spend any more time with NuttX as I will be moving on to a different line of 
work very soon. This means this shall be my last contribution (of any kind) to 
this project.
   
   


-- 
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] fs/vfs: Separate file descriptors from file descriptions [nuttx]

2025-06-10 Thread via GitHub


Donny9 commented on PR #16499:
URL: https://github.com/apache/nuttx/pull/16499#issuecomment-2958601775

   @jlaitine 
   The changes made this time are indeed quite significant, involving 
modifications to the core relationship between file descriptors  and file 
structures. We've made over 140 adjustments internally, and including testing, 
it took us a week to complete. 
   
![image](https://github.com/user-attachments/assets/9757d2c1-eda6-42de-a440-68194508c5c4)
   
   Our original intention was always to improve the patch as much as possible. 
The new PR has been revised following @pussuw the previous approach, and also 
maintained the original contributor as the owner of the patch.


-- 
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] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


tinnedkarma commented on code in PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#discussion_r2137760993


##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -1295,6 +1312,31 @@ static void adc_configure(struct adc_dev_s *dev)
   adc_dumpregs(priv);
 }
 
+ #if defined(CONFIG_STM32F0L0G0_ADC_OVERSAMPLE)
+
+/
+ * Name: adc_oversample
+ /
+
+static void adc_oversample(struct adc_dev_s *dev)

Review Comment:
   Function missing FAR qualifier for pointers



-- 
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] build(deps): bump requests from 2.32.3 to 2.32.4 in /Documentation [nuttx]

2025-06-10 Thread via GitHub


dependabot[bot] opened a new pull request, #16502:
URL: https://github.com/apache/nuttx/pull/16502

   Bumps [requests](https://github.com/psf/requests) from 2.32.3 to 2.32.4.
   
   Release notes
   Sourced from https://github.com/psf/requests/releases";>requests's 
releases.
   
   v2.32.4
   2.32.4 (2025-06-10)
   Security
   
   CVE-2024-47081 Fixed an issue where a maliciously crafted URL and trusted
   environment will retrieve credentials for the wrong hostname/machine from a
   netrc file. (https://redirect.github.com/psf/requests/issues/6965";>#6965)
   
   Improvements
   
   Numerous documentation improvements
   
   Deprecations
   
   Added support for pypy 3.11 for Linux and macOS. (https://redirect.github.com/psf/requests/issues/6926";>#6926)
   Dropped support for pypy 3.9 following its end of support. (https://redirect.github.com/psf/requests/issues/6926";>#6926)
   
   
   
   
   Changelog
   Sourced from https://github.com/psf/requests/blob/main/HISTORY.md";>requests's 
changelog.
   
   2.32.4 (2025-06-10)
   Security
   
   CVE-2024-47081 Fixed an issue where a maliciously crafted URL and trusted
   environment will retrieve credentials for the wrong hostname/machine from a
   netrc file.
   
   Improvements
   
   Numerous documentation improvements
   
   Deprecations
   
   Added support for pypy 3.11 for Linux and macOS.
   Dropped support for pypy 3.9 following its end of support.
   
   
   
   
   Commits
   
   https://github.com/psf/requests/commit/021dc729f0b71a3030cefdbec7fb57a0e80a6cfd";>021dc72
 Polish up release tooling for last manual release
   https://github.com/psf/requests/commit/821770e822a20a21b207b3907ea83878bda1d396";>821770e
 Bump version and add release notes for v2.32.4
   https://github.com/psf/requests/commit/59f8aa2adf1d3d06bcbf7ce6b13743a1639a5401";>59f8aa2
 Add netrc file search information to authentication documentation (https://redirect.github.com/psf/requests/issues/6876";>#6876)
   https://github.com/psf/requests/commit/5b4b64c3467fd7a3c03f91ee641aaa348b6bed3b";>5b4b64c
 Add more tests to prevent regression of CVE 2024 47081
   https://github.com/psf/requests/commit/7bc45877a86192af77645e156eb3744f95b47dae";>7bc4587
 Add new test to check netrc auth leak (https://redirect.github.com/psf/requests/issues/6962";>#6962)
   https://github.com/psf/requests/commit/96ba401c1296ab1dda74a2365ef36d88f7d144ef";>96ba401
 Only use hostname to do netrc lookup instead of netloc
   https://github.com/psf/requests/commit/7341690e842a23cf18ded0abd9229765fa88c4e2";>7341690
 Merge pull request https://redirect.github.com/psf/requests/issues/6951";>#6951 from 
tswast/patch-1
   https://github.com/psf/requests/commit/6716d7c9f29df636643fa2489f98890216525cb0";>6716d7c
 remove links
   https://github.com/psf/requests/commit/a7e1c745dc23c18e836febd672416ed0c5d8d8ae";>a7e1c74
 Update docs/conf.py
   https://github.com/psf/requests/commit/c799b8167a13416833ad3b4f3298261a477e826f";>c799b81
 docs: fix dead links to kenreitz.org
   Additional commits viewable in https://github.com/psf/requests/compare/v2.32.3...v2.32.4";>compare 
view
   
   
   
   
   
   [![Dependabot compatibility 
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=requests&package-manager=pip&previous-version=2.32.3&new-version=2.32.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   
   Dependabot commands and options
   
   
   You can trigger Dependabot actions by commenting on this PR:
   - `@dependabot rebase` will rebase this PR
   - `@dependabot recreate` will recreate this PR, overwriting any edits that 
have been made to it
   - `@dependabot merge` will merge this PR after your CI passes on it
   - `@dependabot squash and merge` will squash and merge this PR after your CI 
passes on it
   - `@dependabot cancel merge` will cancel a previously requested merge and 
block automerging
   - `@dependabot reopen` will reopen this PR if it is closed
   - `@dependabot close` will close this PR and stop Dependabot recreating it. 
You can achieve the same result by closing it manually
   - `@dependabot show  ignore conditions` will show all of 
the ignore conditions of the specified dependency
   - `@dependabot ignore this major version` will close this PR and stop 
Dependabot creating any more for this major version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this minor version` will close this PR and stop 
Dependabot creating any more for this minor version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this dependency` will close this PR and stop 
Depe

Re: [PR] RFC 5424 implementation for SYSLOG [nuttx]

2025-06-10 Thread via GitHub


linguini1 commented on code in PR #16493:
URL: https://github.com/apache/nuttx/pull/16493#discussion_r2138226804


##
drivers/syslog/vsyslog_rfc5424.c:
##
@@ -0,0 +1,262 @@
+/
+ * drivers/syslog/vsyslog_rfc5424.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * 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 "syslog.h"
+
+/
+ * Preprocessor definitions
+ /
+
+/* Get logging severity level from priority */
+
+#define SEVERITY(prio) ((prio) & 0x7)
+
+/* Get logging facility from priority */
+
+#define FACILITY(prio) (((prio) & (~0x7)) >> 3)
+
+/* RFC5424 NILVALUE encoding */
+
+#define NILVALUE "-"
+#define NILVALUE_SPACE NILVALUE " "
+
+/* RFC5424 timestamp format string (fractional seconds and 'Z' added by
+ * appending to format string)
+ */
+
+#define RFC_STRFTIME "%Y-%m-%dT%H:%M:%S"
+
+/* RFC5424 structured data options were selected */
+
+#if defined(CONFIG_SYSLOG_RFC5424_TIMEQUALITY)
+#define HAVE_RFC5424_SDATA 1
+#else
+#define HAVE_RFC5424_SDATA 0
+#endif /* defined(CONFIG_SYSLOG_RFC5424_TIMEQUALITY) || ... */
+
+/
+ * Private Data
+ /
+
+/
+ * Public Functions
+ /
+
+/
+ * Name: nx_vsyslog
+ *
+ * Description:
+ *   nx_vsyslog() handles the system logging system calls. It is functionally
+ *   equivalent to vsyslog() except that (1) the per-process priority
+ *   filtering has already been performed and the va_list parameter is
+ *   passed by reference.  That is because the va_list is a structure in
+ *   some compilers and passing of structures in the NuttX sycalls does
+ *   not work.
+ *
+ /
+
+int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
+{
+  struct lib_syslograwstream_s stream;
+  int ret = 0;
+#ifdef CONFIG_SYSLOG_PROCESS_NAME
+  FAR struct tcb_s *tcb = nxsched_self();
+#endif
+#ifdef CONFIG_SYSLOG_TIMESTAMP
+  struct timespec ts;
+  struct tm tm;
+  char date_buf[64];
+#endif
+#ifdef CONFIG_SYSLOG_RFC5424_HOSTNAME
+  char hostname_buf[HOST_NAME_MAX + 1];
+#endif
+
+  /* Wrap the low-level output in a stream object and let lib_vsprintf
+   * do the work.
+   */
+
+  lib_syslograwstream_open(&stream);
+
+#ifdef CONFIG_SYSLOG_TIMESTAMP
+  ts.tv_sec = 0;
+  ts.tv_nsec = 0;
+
+  memset(&tm, 0, sizeof(tm));

Review Comment:
   Good tip! I do normally do this, but I'll admit that I avoid doing so on 
NuttX because the `checkpatch.sh` style checker enforces a very strange format 
for static initializers. Maybe I'll open an issue for that.



-- 
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] RFC 5424 implementation for SYSLOG [nuttx]

2025-06-10 Thread via GitHub


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


##
drivers/syslog/Kconfig:
##
@@ -140,61 +140,94 @@ config SYSLOG_INTBUFSIZE
 
 comment "Formatting options"
 
+config SYSLOG_RFC5424
+   bool "Standard syslog format (RFC 5424)"
+   default n
+   ---help---
+   Forces syslog logs to follow the RFC 5424 (syslog protocol) 
standard.
+   This allows for structured data elements, standard severity 
levels,
+   standard facilities, standard timestamps and other features 
that allow
+   syslogs to be compatible with other open source programs (such 
as
+   logging servers).
+
+if SYSLOG_RFC5424
+
+comment "RFC5424 options"
+
+config SYSLOG_RFC5424_HOSTNAME
+   bool "Enable hostname field"
+   default n
+   ---help---
+   Adds the HOSTNAME field to the RFC 5424 compatible syslog 
output.
+
+config SYSLOG_RFC5424_TIMEQUALITY
+   bool "timeQuality structured data"
+   depends on SYSLOG_TIMESTAMP

Review Comment:
   remove depends on to decouple rfc5424 from the native log style option



##
drivers/syslog/Kconfig:
##
@@ -140,61 +140,94 @@ config SYSLOG_INTBUFSIZE
 
 comment "Formatting options"
 
+config SYSLOG_RFC5424
+   bool "Standard syslog format (RFC 5424)"
+   default n
+   ---help---
+   Forces syslog logs to follow the RFC 5424 (syslog protocol) 
standard.
+   This allows for structured data elements, standard severity 
levels,
+   standard facilities, standard timestamps and other features 
that allow
+   syslogs to be compatible with other open source programs (such 
as
+   logging servers).
+
+if SYSLOG_RFC5424
+
+comment "RFC5424 options"
+
+config SYSLOG_RFC5424_HOSTNAME
+   bool "Enable hostname field"
+   default n
+   ---help---
+   Adds the HOSTNAME field to the RFC 5424 compatible syslog 
output.
+
+config SYSLOG_RFC5424_TIMEQUALITY
+   bool "timeQuality structured data"
+   depends on SYSLOG_TIMESTAMP
+   default n
+   ---help---
+   Enables the RFC 5424 'timeQuality' structured data element, 
which describes the
+   quality of the timestamp sent.
+
+endif # SYSLOG_RFC5424

Review Comment:
   let's change to else/endif:
   ```
   if SYSLOG_RFC5424
   
   comment "RFC5424 options"
   
   config SYSLOG_RFC5424_HOSTNAME
   ...
   else
   
   config SYSLOG_TIMESTAMP
   ...
   endif
   ```



##
drivers/syslog/Make.defs:
##
@@ -24,7 +24,14 @@
 # Include SYSLOG Infrastructure
 
 ifeq ($(CONFIG_SYSLOG),y)
-CSRCS += vsyslog.c syslog_channel.c
+
+ifeq ($(CONFIG_SYSLOG_RFC5424),y)
+  CSRCS += vsyslog_rfc5424.c
+else
+  CSRCS += vsyslog.c
+endif
+
+CSRCS += syslog_channel.c
 CSRCS += syslog_write.c syslog_flush.c

Review Comment:
   merge into one line



##
drivers/syslog/vsyslog_rfc5424.c:
##
@@ -0,0 +1,266 @@
+/
+ * drivers/syslog/vsyslog_rfc5424.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * 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 "syslog.h"
+
+/
+ * Preprocessor definitions
+ /
+
+/* Get logging severity level from priority */
+
+#define SEVERITY(prio) ((prio) & 0x7)
+
+/* Get logging facility from priority */
+
+#define FACILITY(prio) (((prio) & (~0x7)) >> 3)

Review Comment:
   let's define the follow official macro like glibc:
   ```
   #define LOG_PRIMASK0x07   /* mask to extract 
priority part (internal) */
   #define LOG_PRI(p)((p) & LO

Re: [PR] RFC 5424 implementation for SYSLOG [nuttx]

2025-06-10 Thread via GitHub


linguini1 commented on code in PR #16493:
URL: https://github.com/apache/nuttx/pull/16493#discussion_r2138440895


##
drivers/syslog/Kconfig:
##
@@ -140,61 +140,94 @@ config SYSLOG_INTBUFSIZE
 
 comment "Formatting options"
 
+config SYSLOG_RFC5424
+   bool "Standard syslog format (RFC 5424)"
+   default n
+   ---help---
+   Forces syslog logs to follow the RFC 5424 (syslog protocol) 
standard.
+   This allows for structured data elements, standard severity 
levels,
+   standard facilities, standard timestamps and other features 
that allow
+   syslogs to be compatible with other open source programs (such 
as
+   logging servers).
+
+if SYSLOG_RFC5424
+
+comment "RFC5424 options"
+
+config SYSLOG_RFC5424_HOSTNAME
+   bool "Enable hostname field"
+   default n
+   ---help---
+   Adds the HOSTNAME field to the RFC 5424 compatible syslog 
output.
+
+config SYSLOG_RFC5424_TIMEQUALITY
+   bool "timeQuality structured data"
+   depends on SYSLOG_TIMESTAMP

Review Comment:
   I would prefer to keep this, since I don't want to have a `SYSLOG_TIMESTAMP` 
option and a `SYSLOG_TIMESTAMP_RFC5424`. They both achieve the same thing: 
enabling timestamp in the syslog.
   
   I depend on it here because there's no reason to report time quality if the 
timestamp is disabled in the log.



-- 
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] [HELP] Why isn't multicast loopback switched on by default? [nuttx]

2025-06-10 Thread via GitHub


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

   Would it be an idea to add a "POSIX-compliance" Kconfig option, default yes. 
If disabled, a list of all the individual features that can be disabled is 
shown. As items are added to that list over time, we could try and encourage 
proper help explanations of the advantage gained if each that item is disabled?


-- 
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] improve libc/stream subsystem [nuttx]

2025-06-10 Thread via GitHub


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


##
libs/libc/stream/lib_mtdsostream.c:
##
@@ -0,0 +1,359 @@
+/
+ * libs/libc/stream/lib_mtdsostream.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 "libc.h"
+
+/
+ * Pre-processor Definitions
+ /
+
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_MTD)
+
+/
+ * Private Functions
+ /
+
+/
+ * Name: mtdsostream_flush
+ /
+
+static int mtdsostream_flush(FAR struct lib_sostream_s *self)
+{
+  FAR struct lib_mtdsostream_s *stream =
+(FAR struct lib_mtdsostream_s *)self;
+  FAR struct mtd_dev_s *mtd = stream->inode->u.i_mtd;
+  size_t erasesize = stream->geo.erasesize;
+  size_t nblkpererase = erasesize / stream->geo.blocksize;
+  int ret = OK;
+
+  if (self->nput % erasesize > 0)
+{
+  size_t sblock = self->nput / erasesize;
+
+  ret = MTD_ERASE(mtd, sblock, 1);
+  if (ret < 0)
+{
+  return ret;
+}
+
+  ret = MTD_BWRITE(mtd, sblock * nblkpererase,
+   nblkpererase, stream->cache);
+}
+
+  return ret;
+}
+
+/
+ * Name: mtdsostream_puts
+ /
+
+static ssize_t mtdsostream_puts(FAR struct lib_sostream_s *self,
+FAR const void *buf, size_t len)
+{
+  FAR struct lib_mtdsostream_s *stream =
+(FAR struct lib_mtdsostream_s *)self;
+  FAR struct mtd_dev_s *mtd = stream->inode->u.i_mtd;
+  size_t erasesize = stream->geo.erasesize;
+  size_t nblkpererase = erasesize / stream->geo.blocksize;
+  FAR const unsigned char *ptr = buf;
+  size_t remain = len;
+  ssize_t ret;
+
+  if (self->nput + len > erasesize * stream->geo.neraseblocks)
+{
+  return -ENOSPC;
+}
+
+  while (remain > 0)
+{
+  off_t sblock = self->nput / erasesize;
+  off_t offset = self->nput % erasesize;
+
+  if (offset > 0)
+{
+  size_t copying = offset + remain > erasesize ?
+   erasesize - offset : remain;
+
+  memcpy(stream->cache + offset, ptr, copying);
+
+  ptr+= copying;
+  offset += copying;
+  self->nput += copying;
+  remain -= copying;
+
+  if (offset == erasesize)
+{
+  ret = MTD_ERASE(mtd, sblock, 1);
+  if (ret < 0)
+{
+  return ret;
+}
+
+  ret = MTD_BWRITE(mtd, sblock * nblkpererase,
+   nblkpererase, stream->cache);
+  if (ret < 0)
+{
+  return ret;
+}
+}
+}
+  else if (remain < erasesize)
+{
+  ret = MTD_BREAD(mtd, sblock * nblkpererase,
+  nblkpererase, stream->cache);
+  if (ret < 0)
+{
+  return ret;
+}
+
+  memcpy(stream->cache, ptr, remain);
+  self->nput += remain;
+  remain  = 0;
+}
+  else
+{
+  size_t nblock = remain / erasesize;
+  size_t copying = nblock * erasesize;
+
+  ret = MTD_ERASE(mtd, sblock, nblock);
+  if (ret < 0)
+{
+   

Re: [PR] improve libc/stream subsystem [nuttx]

2025-06-10 Thread via GitHub


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


##
libs/libc/stream/lib_mtdoutstream.c:
##
@@ -342,18 +330,22 @@ int lib_mtdoutstream_open(FAR struct lib_mtdoutstream_s 
*stream,
   return -EINVAL;
 }
 
-  stream->cache = lib_malloc(stream->geo.erasesize);
-  if (stream->cache == NULL)
+#ifdef CONFIG_MTD_BYTE_WRITE

Review Comment:
   Please include a comment here, to explain the case of MTD_BYTE_WRITE enable 
and the case it is not enabled. It will help people to understand the goal of 
this part of the code



-- 
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] [HELP] Why isn't multicast loopback switched on by default? [nuttx]

2025-06-10 Thread via GitHub


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

   @sastel I think it is because NuttX try to only enable the minimal thinks 
possible. But things are changing, in the past we could enable or disable 
signals, until someone realized signal was a required by POSIX. Now we don't 
have option to disable signals. Although we got better compatibility we lose 
the ability to not use it in small microcontrollers.
   
   Maybe a better compromise is just enabling by default what is required by 
the POSIX standard but keep the option to disable it. I think multicast 
loopback could follow this approach.
   
   @wengzhe @xiaoxiang781216 @raiden00pl please comment


-- 
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] [HELP] Why isn't multicast loopback switched on by default? [nuttx]

2025-06-10 Thread via GitHub


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

   it's fine to enable multicast loop by default like 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



[I] [FEATURE] GSoC 2025 - Silicon Heaven Integration into the NuttX mainline [nuttx]

2025-06-10 Thread via GitHub


zdebanos opened a new issue, #16503:
URL: https://github.com/apache/nuttx/issues/16503

   ### Is your feature request related to a problem? Please describe.
   
   Dear NuttX community,
   
   I created this issue to serve as a place for the reporting of progress 
concerning my GSoC 2025 project *Firmware Upgrades over Silicon-Heaven Protocol 
for NXboot Demonstrated on pysimCoder* (link 
[here](https://summerofcode.withgoogle.com/programs/2025/projects/whPaBXY8)). I 
will try to post regularly about my progress.
   
   The primary goal of this project is to develop a practical firmware updater 
for NuttX that leverages the NXBoot bootloader. The updater will transfer 
firmware over the Silicon Heaven (SHV) protocol, a remote procedure call 
system. Another key objective is to implement SHV support for 
memory-constrained devices and adapt it for integration into NuttX, making it 
available for any application that utilizes SHV for remote procedure calls. The 
firmware updater will also be integrated into the pysimCoder project—a rapid 
control prototyping suite capable of generating NuttX-compatible code for 
control applications. This integration will simplify the development workflow 
and make rapid control prototyping more convenient.
   
   More details can be found in this 
[email](https://lists.apache.org/thread/mr0g2w7b2hwo2wt4tbrj5wgcyg02xhyn) I 
sent to the NuttX mailing list.
   
   ### Describe the solution you'd like
   
   .
   
   ### Describe alternatives you've considered
   
   .
   
   ### Verification
   
   - [x] I have verified before submitting the report.


-- 
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.apache.org

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



Re: [PR] Add ADC support for STM32G0 (along with oversampling) [nuttx]

2025-06-10 Thread via GitHub


tinnedkarma commented on code in PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#discussion_r2138057721


##
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##
@@ -1295,6 +1312,31 @@ static void adc_configure(struct adc_dev_s *dev)
   adc_dumpregs(priv);
 }
 
+ #if defined(CONFIG_STM32F0L0G0_ADC_OVERSAMPLE)
+
+/
+ * Name: adc_oversample
+ /
+
+static void adc_oversample(struct adc_dev_s *dev)

Review Comment:
   But now that I check, I see that most of the FAR usage in the kernel is in 
the common subsystems, and not in the arch directory



-- 
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] Add BLE config to esp32-sparrow [nuttx]

2025-06-10 Thread via GitHub


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

   ## Summary
   
   Added a configuration for ESP32-Sparrow kit with Bluetooth support 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