Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi posix6973,
> Sorry, still don’t understand could you explain in detail or show me how to > configure the system? You already did configure the system:<div class='quotetop'>QUOTE </div> --- Quote Start --- Creating 4 MTD partitions on "Altera NDK flash (AMD)": 0x00200000-0x00600000 : "romfs/jffs2" 0x00000000-0x00200000 : "loader/kernel" 0x00600000-0x00700000 : "User configuration" 0x00700000-0x00800000 : "safe configuration"[/b] --- Quote End --- And ... <div class='quotetop'>QUOTE </div> --- Quote Start --- It looks like you are using two different mtd mapping drivers. Take a look at: drivers/mtd/maps/altera.c. drivers/mtd/maps/nios_romfs.c[/b] --- Quote End --- Review the source code. Look at the partition maps with attention to the mask_flags field of the mtd_partition structures. This field should _not_ include MTD_WRITEABLE if you want the partition to be writeable. Make sure your map matches your actual hardware. Enable the character mode device driver (CONFIG_MTD_CHAR) in the kernel and create an inode for the character mode driver (major: 90, minor: partition number).<div class='quotetop'>QUOTE </div> --- Quote Start --- You have two choices: (1) Create the device inodes by hand using mknod, then run mkfs.jffs2 (2) Create a device table file and use the -D, --devtable option to mkfs.jffs2[/b] --- Quote End --- Then for example:int fd;
fd = open ("/dev/mtd0", O_RDWR);
etc. If you need details, examples, info: <div class='quotetop'>QUOTE </div> --- Quote Start --- See the following: include/mtd/mtd-abi.h drivers/mtd/mtdchar.c You might want to review the mtd-utils code as well.[/b] --- Quote End --- Regards, --Scott