You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Fotis Panagiotopoulos <f....@gmail.com> on 2022/01/24 11:07:10 UTC

SD Card in Simulation

Hello,

I am working on a system that uses an SD card to read various files.
I am also using the simulator for testing this firmware.

I would like to test the parts of the system that read and parse these
files, so I need a way to simulate the SD card.

Is there any way to achieve this?

Ideally, I would like to mount a directory of the host system directly in
NuttX.
Or maybe select a set of files to be included in compile time?

Thank you!

Re: SD Card in Simulation

Posted by Fotis Panagiotopoulos <f....@gmail.com>.
Hostfs is exactly what I need. Thank you!

On Mon, Jan 24, 2022, 17:21 Sebastien Lorquet <se...@lorquet.fr> wrote:

> Hi
>
> The closest way to achieve this, eg if you want to exercise the SD
> drivers, would be to simulate a SPI/SD device that the main SD driver
> could talk to.
>
> The simulated SPI or SD would have to get,recognize and execute SD
> commands, and it would get its storage from the host disk or memory.
>
> This is a bit cumbersome, so if only a more functional file storage is
> required, romfs or hostfs could be enough.
>
> Sebastien
>
> Le 24/01/2022 à 12:07, Fotis Panagiotopoulos a écrit :
> > Hello,
> >
> > I am working on a system that uses an SD card to read various files.
> > I am also using the simulator for testing this firmware.
> >
> > I would like to test the parts of the system that read and parse these
> > files, so I need a way to simulate the SD card.
> >
> > Is there any way to achieve this?
> >
> > Ideally, I would like to mount a directory of the host system directly in
> > NuttX.
> > Or maybe select a set of files to be included in compile time?
> >
> > Thank you!
> >
>

Re: SD Card in Simulation

Posted by Sebastien Lorquet <se...@lorquet.fr>.
Hi

The closest way to achieve this, eg if you want to exercise the SD 
drivers, would be to simulate a SPI/SD device that the main SD driver 
could talk to.

The simulated SPI or SD would have to get,recognize and execute SD 
commands, and it would get its storage from the host disk or memory.

This is a bit cumbersome, so if only a more functional file storage is 
required, romfs or hostfs could be enough.

Sebastien

Le 24/01/2022 à 12:07, Fotis Panagiotopoulos a écrit :
> Hello,
>
> I am working on a system that uses an SD card to read various files.
> I am also using the simulator for testing this firmware.
>
> I would like to test the parts of the system that read and parse these
> files, so I need a way to simulate the SD card.
>
> Is there any way to achieve this?
>
> Ideally, I would like to mount a directory of the host system directly in
> NuttX.
> Or maybe select a set of files to be included in compile time?
>
> Thank you!
>

Re: SD Card in Simulation

Posted by Peter Kalbus <pt...@mailbox.org.INVALID>.
Hi Fotis,

you use the ROMFS feature to include files directly on the image … it depends on some external tool called ‚genromfs‘

You may check for ROMFS and ROMFSETC in the configuration and documentation.

/Piet



> Am 24.01.2022 um 12:07 schrieb Fotis Panagiotopoulos <f....@gmail.com>:
> 
> Hello,
> 
> I am working on a system that uses an SD card to read various files.
> I am also using the simulator for testing this firmware.
> 
> I would like to test the parts of the system that read and parse these
> files, so I need a way to simulate the SD card.
> 
> Is there any way to achieve this?
> 
> Ideally, I would like to mount a directory of the host system directly in
> NuttX.
> Or maybe select a set of files to be included in compile time?
> 
> Thank you!



Re: SD Card in Simulation

Posted by Xiang Xiao <xi...@gmail.com>.
You can try HostFS.

On Mon, Jan 24, 2022 at 7:07 PM Fotis Panagiotopoulos <f....@gmail.com>
wrote:

> Hello,
>
> I am working on a system that uses an SD card to read various files.
> I am also using the simulator for testing this firmware.
>
> I would like to test the parts of the system that read and parse these
> files, so I need a way to simulate the SD card.
>
> Is there any way to achieve this?
>
> Ideally, I would like to mount a directory of the host system directly in
> NuttX.
> Or maybe select a set of files to be included in compile time?
>
> Thank you!
>