On Tue, Mar 10, 2020 at 11:48 PM wangxinyu...@163.com
<wangxinyu...@163.com> wrote:
>
> hello
>
> I want to discuss about the nand flash and filesystem support.  I turned into 
> nuttx because
> I have a linux background and RTOS like freertos is most likely a bare OS 
> kernel ,porting
> exist things is annoying such as filesystem and POSIX interface etc.
> Some introduction of my situation and motivation:
> I'm trying to do porting the Nuttx onto the alientek apollo STM32F429 board.
> It's their website:
> http://www.alientek.com
> Their development board is very hot here in China, but it's a pity the 
> website is in Chinese Language only.
> I worked based onstm32f429i-disco and what I have done:
> a.uart
> b.external sdram
> c.led
> all works fine. Next step I want to get the Nand flash working with some 
> filesystem. Nand flash is Micron
> MT29F4G08.I realized that nuttx have no filesystem for nand on the shelf and 
> the exist filesystem have to
> do some changes to fit nand flash.I want a more mature filesystem which I can 
> think of from linux
> is something  based on mtd like jiffs2 or YAFFS2.Maybe ubifs is better but 
> It's not based on the mtd and more complex.

What's issue make you can't use SmartFS/LittleFS/SPIFFS directly on
MT29F4G08? From my experience, there isn't much difference between
NAND flash and NOR flash if the hardware can do ECC correction
automatically.

> I choosed YAFFS2 In fact the porting to Nuttx is pretty easy after I decided 
> to port YAFFS2 with its direct mode.
> Next step I  configured the FMC and got the FMC talk to nand correctly. Later 
> I choose to use the driver file
> mtd_nand.c later I find I have to implement the method in the nand_raw.h for 
> the lowest talking to nand in
> order to get all filesystem software stack working. I have a pause here and 
> looking forward to your advice
> for such topics:
> a. Could I benefit from Linux as I don't want to reinvent the wheel ? what 
> can I do to minium the effort ? Can we have a better sturcture?
> b. Should I put the raw_nand method drivers/mtd/ or the board specific 
> folder?I think I should put in the mtd folder for micron specific

Put it to arch/../src/... if it's specific for NAND controller on SoC,
or put it to drivers/mtd/ if it's specific to external NAND flash
vendor.

> c. license of YAFFS2 is GPL which would pollute the nuttx BSD license, what 
> is your advice? I have to link it with library format ?

GPL code can't upstream. It's fine to use it in your project, but you
need public all your source code per GPL requirement. If you don't
want to public your own code, nuttx/fs/userfs could help you to
isolate GPL code from BSD code.

> d. does someone have other working solutions for nand flash filesystem ?

SmartFS/LittleFS/SPIFFS/NXFFS is designed for the flash storage in
mind, all of them is bultin supported by NuttX, why not try they
first?

> e. As I understand, the raw nand filesystem is always a big headache for many 
> rtos, if you don't choose linux you only have very
> limited options for free use, FAT is a obvious option but you have to working 
> on the FTL level by yourself. It is meaningful to
> choose raw nand for low cost electronic product other than sd-card 
> competitable storgage.
>

> What's your opinion ?
>
>
>
> Best
>

Reply via email to