Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

AM29LV065D FLASH read, erase, program?

Hi All,

Does anyone know how to read erase and program the AMD flash memory in ucLinux using C programs? (AM29LV065D or AM29LV128MH)

I use this memory for store uClinux FPGA SOF and user’s data.

Thanks in advance.

Best regards,

21 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Mike,

    ># mkdir /var/flash

    ># mount -t jffs2 /dev/mtdblock4 /var/flash -n

    Just remember that the character-mode driver and the block-mode driver don't map

    the minor number and partitions the same way -- probably to keep us from getting

    confused ;-)

    partition 0: mtdblock minor 0, mtd char minor 0, mtd char minor 1 (RO)

    partition 1: mtdblock minor 1, mtd char minor 2, mtd char minor 3 (RO)

    and so on ....

    > mount: wrong fs type, bad option, bad superblock on /dev/mtdblock4,

    > or too many mounted file systems

    The best way to get started is to erase the partition using a known good tool, like

    u-boot. An erased partition will mount just fine as an mtd block device -- it'll just be

    empty. Then you can copy some files to it, reset, remount ... and the files should be

    there. This is a real simple way to confirm proper operation of JFFS2 and the block

    driver. If this doesn't work, you'll need to check how you create the JFFS2 image

    (things like block size, endian-order, etc) and perhaps any problems with the

    mtd utils (e.g. erase).

    Regards,

    --Scott