2013-07-29 01:41 AM
Hi,
I want to make project NAND FLASH + STM32F4 DISCOVERY + USB MASS STORAGE, but isnt't easy ))I have any examples (Discovery\Open407V-D\USB HS Examples\Project\USB_Device_Examples\MSC) with MSC, but it works with SD card. Can anybody help me with port this example to NAND FLASH ??? #nand-flash-msc #help-!=-do-it-for2013-08-08 04:34 AM
I thought that the Projects will be interesting to you and other users and you can help me with it. I do not even know where to start porting, there is so many levels, I have never engaged in this.
2013-08-08 05:13 AM
Basically you want us to do your work. If you dont know where to start then you need to go one step back and find easier example you can/would port. I dont know if you wrote the code for USB or just pasted the example, but you can try changing USB code from eval board to your board - and same process will apply for NAND flash.
2013-08-08 05:18 AM
''but you can try changing USB code from eval board to your board- and same process will apply for NAND flash'' - i know it ;)
Come on, you can not help me2013-08-08 05:45 AM
I think we're all plenty busy with our own projects to do yours for you. The level of help you're asking for is pretty burdensome, and you haven't really made any meaningful contribution to the community/forum.
Start by getting the NAND access routines working with your configuration, basic stuff like Read/Write/Erase2013-08-08 06:07 AM
ok, can you say me, if i'll replace routines of SD with routines of FLASH in that code
[code]int8_t STORAGE_Read (uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len){ if( SD_ReadMultiBlocks (buf, blk_addr * 512, 512, blk_len) != 0) { return -1; }#ifndef USE_STM3210C_EVAL SD_WaitReadOperation(); while (SD_GetStatus() != SD_TRANSFER_OK);#endif return 0;}[/code]it will work???2013-08-08 09:04 AM
For it to work the routines you substitute will need to have equivalent function. The READ will be relatively easy, and something you should test/validate outside the USB MSC first.
WRITE will be more problematic to emulate on the NAND because you will need to read the original NAND erasable unit, erase the NAND, insert the blocks you need to update/change, then write the whole new unit to the NAND. This is a technique often referred to as deblocking. The blocks the MSC works on are likely 512 bytes (sector), the minimum erase unit/block on the NAND is likely 128 Kbytes, your code will need to deal with this disparity, and perhaps cache and lazy-write blocks back to the NAND so you don't destroy it with unnecessary erase/write cycles. ie the MSC gets 256 single block writes to different locations within the same NAND erase unit. The MSC interface is also going to want to know/report the capacity of the NAND device. A search of the SD functions and structures used should be illustrative of what the MSC interface requires.2015-12-13 12:20 AM
Hi clive,
I'm sorry to bother you all the time, but I could not figure it out.I set up a 1-second timer and I want to save the variable every second.How do I create a loop in the main??I'll be glad, if you help me..2015-12-13 12:21 AM
I ask for MSC USB.
2015-12-13 06:06 AM
Can we start this as a new thread, it's a bit off-topic in this older one. See ''New'' button, top left just above the listing of threads in the main page.
2015-12-13 09:16 AM
Of course clive :)
https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM32Discovery%2fHow%20can%20I%20write%20every%20second%20with%20USB%20MSC%20STM32f105&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47B...