Example program for USBMSD device (USB Flashdisk) library using AT45DBxx serial flash storage chip. Works with 2, 4, 8, 16, 32 and 64 Mbit chips within AT45DBxx
Dependencies: USBDevice USBMSD_AT45 mbed
Revision 0:42f27224d4d7, committed 2012-10-27
- Comitter:
- llumpu
- Date:
- Sat Oct 27 14:37:34 2012 +0000
- Commit message:
- Initial release
Changed in this revision
diff -r 000000000000 -r 42f27224d4d7 USBDevice.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Sat Oct 27 14:37:34 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/llumpu/code/USBDevice/#e771bcb4627d
diff -r 000000000000 -r 42f27224d4d7 USBMSD_AT45.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBMSD_AT45.lib Sat Oct 27 14:37:34 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/llumpu/code/USBMSD_AT45/#c0dc2df7c9fe
diff -r 000000000000 -r 42f27224d4d7 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Oct 27 14:37:34 2012 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "USBMSD_AT45.h" + +USBMSD_AT45 Flash(p5, p6, p7, p8, 512); // Mosi, Miso, Sclk, CS, Size of block being transported over USB + // each time. Can be 512, 1024, 2048, 4096. Best is to select same + // size as AT45DBxx SRAM buffer size. If page size of flash is not + // binary 2^N (256, 512, 1024 bytes) but is 264, 528 or 1056 bytes + // before each write we read block being written to SRAM then rewrite + // part of them with data from host and write whole SRAM buffer back + // to flash. This avoids to data being rewritten in other blocks + // we actually do not write to. +int main() { + + while(1) { + + // Do something else here + + } +}
diff -r 000000000000 -r 42f27224d4d7 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Oct 27 14:37:34 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc \ No newline at end of file