Re: Is there a way to have NSH loaded as the init task from an sd card?

2022-07-16 Thread Alan Carvalho de Assis
Hi Nimish,

I don't think NuttX supports booting directly to an init or other
ENTRYPOINT in SD card. I will be surprised and happy to discover it is
possible.

But you can boot from Flash and use the initscript to mount the SDCard and
run an application from it. Maybe it will help you to achieve your goal.

BR,

Alan

On Friday, July 15, 2022, Nimish Telang  wrote:

> I’m trying to load nsh as the init task from an SD card on the SPRESENSE
> CXD5602 board (a FLAT build). Normally it just calls nsh_main from the user
> init function when INIT_ENTRYPOINT is defined.
>
> I’m not able to determine which combination of symtab options, if any, I
> should use with the init filename option; when I have NSH create it there’s
> a symbol typing clash in the auto-generated symtab_apps.c
>
> symtab_apps.c:282:11: error: conflicting type qualifiers for 'g_nsymbols'
>   282 | const int CONFIG_SYSTEM_NSH_SYMTAB_COUNTNAME =
> sizeof(CONFIG_SYSTEM_NSH_SYMTAB_ARRAYNAME) / sizeof(struct symtab_s);
>   |   ^~
> symtab_apps.c:37:14: note: previous declaration of 'g_nsymbols' with type
> 'void *'
>37 | extern void *g_nsymbols;
>
> In effect, I’d like to be able to have the board boot up with NSH to do
> some configuration via a script, then have the NSH memory be clear for the
> executable.
>
> Nimish
>
>
>
>
>


Re: Is there a way to have NSH loaded as the init task from an sd card?

2022-07-16 Thread Gregory Nutt




I don't think NuttX supports booting directly to an init or other
ENTRYPOINT in SD card. I will be surprised and happy to discover it is
possible.


Yes it is possible it is included in the design.  Controlled by and 
CONFIG_INIT_FILE and CONFIG_INIT_FILEPATH ; the relevant start-up code 
is: 
https://github.com/apache/incubator-nuttx/blob/master/sched/init/nx_bringup.c#L295


That is the normal way NSH (or any init process) is started in the 
KERNEL build mode.


Nimish's problem has to do with symbol tables, not missing functionality.




Re: CRC32 what gives?

2022-07-16 Thread Nimish Telang
https://github.com/madler/crcany is what I have been using to make one off CRC 
implementations. Consolidating the various ones into a single library might be 
useful.

From: Alan Carvalho de Assis 
Date: Friday, July 15, 2022 at 7:31 PM
To: dev@nuttx.apache.org 
Subject: Re: CRC32 what gives?
We also have CRC4 used by MS5611 barometer sensor. It should be nice to
have all available in the kernel

On Friday, July 15, 2022, Nimish Telang  wrote:

> Whichever one is chosen, there should be a table-free implementation for
> code size reasons. FWIW there are more crc implementations in the zmodem
> app: https://github.com/apache/incubator-nuttx-apps/blob/
> master/system/zmodem/host/crc16.c
>
>
>
> From: Sebastien Lorquet 
> Date: Friday, July 15, 2022 at 4:13 PM
> To: dev@nuttx.apache.org 
> Subject: Re: CRC32 what gives?
> @Nathan:
>
> Yes, of course.
>
> @Alan:
>
> Of course not, the structure passed to init can be set up to describe
> the required algorithm.
>
> But the partial update situation can be useful for protocols where the
> message is fragmented (eg radio transceivers with short FIFOs), or where
> only some fields enter the crc (I have seen this happen several times).
> you cant call the global crc() function on several buffers in sequence
> if bits are inverted on crc output.
>
> Sebastien
>
> On 7/15/22 20:21, Nathan Hartman wrote:
> > On Fri, Jul 15, 2022 at 1:40 PM Alan Carvalho de Assis
> >  wrote:
> >> Hi Sebastien, I think we don't need these three functions for each
> >> CRC, just one like in the Linux kernel is enough:
> >>
> >> https://www.kernel.org/doc/htmldocs/kernel-api/API-crc-ccitt.html
> >>
> >> BR,
> >>
> >> Alan
> >
> > Could have one generic function and then thin wrappers that call it
> > with the correct parameters for different uses.
> >
> > Cheers,
> > Nathan
>