MX25L6406E Flash chip
Orladin
Posts: 17
in Propeller 1
Has anyone ever used this flash chip with the propeller before? I have an ~8mb file I need to write to this chip and thought the propeller would be up for the task. I just figured there was no sense reinventing the wheel if someone had already written something to deal with this chip.
Here's a link to the datasheet.
Thanks!
Here's a link to the datasheet.
Thanks!
Comments
The problem with serial Flash are the large block sizes and that you have to deal with wear leveling and read/erase/modify in at least 4kB chunks.
BTW, that particular chip sounds like one of the very early ones I did, there are much better chips available now.
Otherwise there are SPI drivers too
Alright I have the flash chip out, have the file I need to flash into the chip on an SD card, and I'm ready to go. I did download the Tachyon files from your Dropbox, but I don't know enough about Forth to finish it off on my own. Let me know which of these files I need to load, and what the 3 extra lines to give it over the serial console are.
Again, thank you so much for your help with this!
I am just getting around to making a compatible binary for you to save having to load in the modules yourself so I will post the file and dropbox it as well as soon as I'm done.
Dropbox
For instance my test board has this pin configuration:
P25 = CLK
P26 = MOSI (SD DATA IN)
P27 = MISO (SD DATA OUT)
P24 = CS (no pullup)
Enter in this format with an ampersand prefix with the pin numbers separated by a decimal point and don't forget that you need at least one space between Forth words, that is the number and SDPINS. Check that it works for your board with "ls" and then BACKUP.
The binary only about 1k free which doesn't seem much but a lot gets done in that space although if you have a 64kB EEPROM or more you should run COMPACT, wait for that to finish, then BACKUP which gives you around 9k free (stacks of room for Tachyon!).
Default Tachyon session is 115200/8N1 and I prefer minicom for Linux or TeraTerm for WIndows.
If you want to have a look inside the Flash chip you can use the DUMP command (or its variants DUMPW DUMPL DUMPA) with a preceding SF to select serial Flash memory.
To program the Flash for 1MB from a file just open the file first then program: I could make that one action but I thought I'd keep it simple for the moment.
BTW, I instruction codes for your chip were the same as the Winbond chip I work with, the only real differences are normally in sector sizes etc but we are just dealing with the whole chip here.
Untested code- also via Dropbox for the very latest file.
Propeller .:.:--TACHYON--:.:. Forth V3.0 JUNO 300160922.1245
VER: Propeller .:.:--TACHYON--:.:. Forth V3.0 JUNO 300160922.1245
PCB: UNKNOWN (0)
FREQ: 80MHZ (PLLEN OSCEN XTAL1 PLL16X)
NAMES: $51EC...74DC for 8,944 bytes (+2,199)
CODE: $0930...4E21 for 17,649 bytes (+5,444)
RAM: 971 bytes free
BUILD: FIRMWARE BUILD DATE 967295:967295 BOOTS: 7 runtime 110
BOOT: EXTEND.boot
MODULES LOADED:
38DD: EASYFILE.fth SD card + FAT32 Virtual Memory Access File System Layer V1.2 16080711-2300
1840: EXTEND.fth Primary extensions to TACHYON kernel - 160828-1400
NO ROMS
&24.27.26.25 SDPINS ok
ls
Mounted CDC0.0962-0000.0000 0MB (0/cluster)
ok
Oh, also, the MicroSD card I'm using is a 2gb RiDATA, it's one I also purchased from Parallax so I think it should work.
Is there anything I need to change to get it to flash the whole 8mb file?
btw, serial chips may state their memory capacity in "bits" but they are all byte memories so I just think of it as 1MB. The software is setup to do a chip erase and then program 1MB albeit blindly. When I get to test this on a similar chip I may make some changes and enhancements.
The SF DUMPA is where I check the start of the Flash chips memory which seems to be programmed correctly with the text of the file.
Let me know how it goes, I have quite a few different types of chips here right up to 128Mb devices that i will try. I'm aiming to make this "just work". Some enhancements may be to automatically limit the memory range programmed to the lesser of the file or the device and also allow offsets.
Latest session dump
Just looking back over the conversation from last night I noticed something. The file I was flashing to the chip was 8 megabytes (8,388,672 bytes). Did that script flash the whole file, or just 1 megabyte?
Thank you again for all your help with this!
EDIT: added a VERIFY function which is automatically called when you PROGRAM a chip.
You may need to COMPACT EASYFILE.binary to free up some more memory before loading this extended FLASH.FTH
should you get a new one maybe make a copy of the real image first
Addit: to extend from 1 MB to 8 MB put in a ' 8 * ' see below
The Dropbox code reflects this change of course. (I just need to adjust the chip erase to sector erase)
EDIT: latest with 4KB sector erase (minimum)