Re: [Article] Boot NuttX from Network with U-Boot and TFTP

2023-07-13 Thread Alan C. Assis
On 7/13/23, Nathan Hartman  wrote:
> On Thu, Jul 13, 2023 at 12:24 PM Gregory Nutt  wrote:
>>
>>
>> > Maybe you could that a look in the minnsh PoC, it was running on MCU
>> > with less than 16KB Flash and 8KB RAM. As you can see in the image it
>> > is using less than 2KB RAM:
>>
>> To get to the minimal size, that configuration also depended on the
>> ability to disabled file system support (and, in the longer run, on the
>> development of a HAL).  There is no HAL and the option to disable the
>> file system has been removed.
>
>
> This is one of the reasons I think we should not be too eager to
> remove Kconfig options. I know that we have many Kconfig options and
> it can be frustrating to maintain sometimes, but there are times when
> we really need a minimalistic build, such as to implement a bootloader
> app. Also, other ideas could be implemented that will benefit from
> minimalistic builds.
>

I agree!

But what is done, is done! Probably now adding those options back (to
remove things not needed by a bootloader) will be more difficult.

Maybe instead of removing the virtual file system we could try to
reduce its size, these tips are good to find which functions need to
be optimized:

https://acassis.wordpress.com/2015/04/27/how-to-verify-which-functions-are-eating-space-in-an-elf-file/

BR,

Alan


Re: [Article] Boot NuttX from Network with U-Boot and TFTP

2023-07-13 Thread Nathan Hartman
On Thu, Jul 13, 2023 at 12:24 PM Gregory Nutt  wrote:
>
>
> > Maybe you could that a look in the minnsh PoC, it was running on MCU
> > with less than 16KB Flash and 8KB RAM. As you can see in the image it
> > is using less than 2KB RAM:
>
> To get to the minimal size, that configuration also depended on the
> ability to disabled file system support (and, in the longer run, on the
> development of a HAL).  There is no HAL and the option to disable the
> file system has been removed.


This is one of the reasons I think we should not be too eager to
remove Kconfig options. I know that we have many Kconfig options and
it can be frustrating to maintain sometimes, but there are times when
we really need a minimalistic build, such as to implement a bootloader
app. Also, other ideas could be implemented that will benefit from
minimalistic builds.

Cheers,
Nathan


Re: [Article] Boot NuttX from Network with U-Boot and TFTP

2023-07-13 Thread Gregory Nutt




Maybe you could that a look in the minnsh PoC, it was running on MCU
with less than 16KB Flash and 8KB RAM. As you can see in the image it
is using less than 2KB RAM:


To get to the minimal size, that configuration also depended on the 
ability to disabled file system support (and, in the longer run, on the 
development of a HAL).  There is no HAL and the option to disable the 
file system has been removed.





Re: [Article] Boot NuttX from Network with U-Boot and TFTP

2023-07-13 Thread Alan C. Assis
Hi Nathan,

On 7/13/23, Nathan Hartman  wrote:
> Hi Lup,
>
> Excellent article, as always!
>
> On Thu, Jul 13, 2023 at 10:38 AM Alan C. Assis  wrote:
>> In NuttX case it is easier because we can do it without the bootloader!
>
> There was a recent discussion about using a minimal build of NuttX
> itself as a bootloader, which would load a more full-featured build of
> NuttX.
>
> One of the advantages of doing this would be reduced driver
> development, since the same implementation of network, USB, and/or
> serial drivers, and other board support, could be shared between the
> "bootloader" build of NuttX and the "real" build of NuttX. It is a
> very cool idea and one that I think is very much worth exploring.
>
> Meanwhile, having information about how to do it with u-boot comes in
> very handy, too.
>

Maybe you could that a look in the minnsh PoC, it was running on MCU
with less than 16KB Flash and 8KB RAM. As you can see in the image it
is using less than 2KB RAM:

https://live.staticflickr.com/7659/18013069041_0c570fd40b_h.jpg

But as Mr. Greg noticed it needs to be reimplemented the write way,
with up_getc() using interruptions instead busy wait.

BR,

Alan


Re: [Article] Boot NuttX from Network with U-Boot and TFTP

2023-07-13 Thread Nathan Hartman
Hi Lup,

Excellent article, as always!

On Thu, Jul 13, 2023 at 10:38 AM Alan C. Assis  wrote:
> In NuttX case it is easier because we can do it without the bootloader!

There was a recent discussion about using a minimal build of NuttX
itself as a bootloader, which would load a more full-featured build of
NuttX.

One of the advantages of doing this would be reduced driver
development, since the same implementation of network, USB, and/or
serial drivers, and other board support, could be shared between the
"bootloader" build of NuttX and the "real" build of NuttX. It is a
very cool idea and one that I think is very much worth exploring.

Meanwhile, having information about how to do it with u-boot comes in
very handy, too.

Oh, that discussion was called "Bootloaders other than u-boot?" and
started on July 1st, 2023... Archived here:

https://lists.apache.org/thread/wx0yqx7t1vw9os9psv1y8dcpcto5vpc7

or here:

https://www.mail-archive.com/dev@nuttx.apache.org/msg10109.html

Some of the key messages in that thread:

https://lists.apache.org/thread/fh1k3ln45hqv1p9v8539hcxmkjwm3oyg

https://lists.apache.org/thread/jfyxv7hksv7ftkrt2n0xg9zmrs4z386j

Cheers,
Nathan


Re: [Article] Boot NuttX from Network with U-Boot and TFTP

2023-07-13 Thread Alan C. Assis
Hi Lup,

That is very nice! I never tested TFTP on NuttX, but I used to boot
Linux/uCLinux using it, downloading the kernel image inside the
bootloader:

https://acassis.wordpress.com/2009/03/19/solved-dbug-bootloader-network-problem/

In NuttX case it is easier because we can do it without the bootloader!

BR,

Alan

On 7/13/23, Lee, Lup Yuen  wrote:
> Testing NuttX can get painfully tedious on a Single-Board Computer...
> Swapping, reflashing and rebooting a MicroSD Card, again and again and
> again! (Like how we tested NuttX on PinePhone)
>
> Thankfully there’s a better way: Booting NuttX over the Local Network, with
> U-Boot Bootloader and TFTP! In this article we’ll configure TFTP Network
> Boot for testing NuttX on the new Star64 JH7110 RISC-V SBC...
>
> https://lupyuen.codeberg.page/articles/tftp.html
>
> Lup
>


[Article] Boot NuttX from Network with U-Boot and TFTP

2023-07-12 Thread Lee, Lup Yuen
Testing NuttX can get painfully tedious on a Single-Board Computer...
Swapping, reflashing and rebooting a MicroSD Card, again and again and
again! (Like how we tested NuttX on PinePhone)

Thankfully there’s a better way: Booting NuttX over the Local Network, with
U-Boot Bootloader and TFTP! In this article we’ll configure TFTP Network
Boot for testing NuttX on the new Star64 JH7110 RISC-V SBC...

https://lupyuen.codeberg.page/articles/tftp.html

Lup