BTW, do we have a driver for MT25Q? I can't see one.  Is it compatible with
the M25P series?

On Tue, Aug 24, 2021 at 5:50 PM Abdelatif Guettouche <
abdelatif.guettou...@gmail.com> wrote:

> > but I can't find the way to either mount it, or "probe" it, or anything,
> from nuttx.
>
>
> The sequence to initialise the flash and mount NXFFS should look like the
> following (to be adapted for chip and device):
>
> spi = stm32_spibus_initialize(1);
>   if (!spi)
>     {
>       ferr("ERROR: Failed to initialize SPI port 2\n");
>       return -ENODEV;
>     }
>
>   mtd = w25_initialize(spi);
>   if (!mtd)
>     {
>       ferr("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH
> driver\n");
>       return -ENODEV;
>     }
>
>   ret = nxffs_initialize(mtd);
>   if (ret < 0)
>     {
>       ferr("ERROR: NXFFS initialization failed: %d\n", -ret);
>       return ret;
>     }
>
> ret = nx_mount(NULL, "/mnt", "nxffs", 0, NULL);
>  if (ret < 0)
>    {
>        ret = nx_mount(NULL, "/mnt", "nxffs", 0, "forceformat");
>        if (ret < 0)
>          {
>              ferr("ERROR: Failed to mount the FS volume: %d\n", errno);
>             return ret;
>           }
>    }
>
>
> On Tue, Aug 24, 2021 at 6:39 PM Tim <t...@jti.uk.com.invalid> wrote:
>
>> Hi Alan,
>>
>> >Hi Tim,
>> >
>> >On 8/24/21, Tim <t...@jti.uk.com> wrote:
>> >>
>> >>>Then before try to setup the NXFFS you need to confirm that the Flash
>> >>>NOR  was detected correctly.
>> >>
>> >> How, in code or from the nsh, do I do that? I know the chip works as
>> >> I've used it (for example) for u-boot environment variables with no
>> >> issue, but I can't find the way to either mount it, or "probe" it, or
>> >> anything, from nuttx. It doesn’t appear as a /dev.
>> >>
>> >
>> >You can enable the CONFIG_DEBUG_FS_* to see the mtd debug messages. It
>> will
>> >tell you want is going on.
>> >
>> Yes, I have done that of course, but get no messages. I am sure this is
>> simply because there is no code being called to register the driver as I
>> can't find an example for any other boards that looks relevant :(
>>
>>

Reply via email to