how to acess internal flash as mass storage device
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-16 10:38 PM
i tried but it asking formate the device in my computer.
i am using #Stm32f103ret6​ #USB​ #Mass-storage​
- Labels:
-
STM32F1 Series
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-17 6:34 AM
in read and write functions what i need to write to formate my device [total 256 pages,each page 2k 512kb= flash memory]
i am using page 6 so i am formating page6 is it enough to formate myy device or completly formate my device memory
init_fs()
{
EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES;
EraseInitStruct.Banks =FLASH_BASE;
EraseInitStruct.PageAddress=FLASH_USER_START_ADDR; // page 6 i am using to read/write
EraseInitStruct.NbPages = 1;
}
in write functuon
int8_t STORAGE_Write_FS (uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len) //(blk_addr=0, blk_len=0)
{
HAL_FLASH_Unlock();
HAL_FLASHEx_Erase(&EraseInitStruct, &pageError);
HAL_FLASH_Lock()
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-17 6:38 AM
I think You need to go right back to basics and understand how the flash is organised in the processor and how to read and write to it and how you would implement a driver for it.
you will only be able to use the FAT12 storage because of the limited about of space available, but you need to write the driver fully before you continue any further.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-17 6:42 AM
That's not writing any data to the block number blk_addr, also seriously doubt blk_len = 0
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-17 11:08 PM
in read /write operation blk_addr, blk_len alway it shows zero value.

- « Previous
-
- 1
- 2
- Next »