2018-12-16 10:38 PM
i tried but it asking formate the device in my computer.
i am using #Stm32f103ret6 #USB #Mass-storage
2018-12-17 06: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()
};
2018-12-17 06: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.
2018-12-17 06:42 AM
That's not writing any data to the block number blk_addr, also seriously doubt blk_len = 0
2018-12-17 11:08 PM
in read /write operation blk_addr, blk_len alway it shows zero value.