Not Related to LPCxpresso

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Not Related to LPCxpresso

250 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tanmay on Thu Mar 07 03:57:16 MST 2013
hi all,
My question is not related to lpcxpresso or even ARM.
I want to ask how one can find out memory size of flash memory devices???

When USB flash drives get connected to PC, PC shows its size. how it happens??? even in mobile phones when microSDHC cards are inserted, it shows its capacity.

Does anyone know that??
0 项奖励
3 回复数

244 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wrighflyer on Thu Mar 07 10:03:18 MST 2013
In the case of SD/MMC you can issue CMD9 which is SendCSD. Fields within that 128 bit register show the card capacity. A "format" routine will use this to work out the dimensions of the (probably FAT) filesystem it's going to put on the card.
0 项奖励

244 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by frame on Thu Mar 07 08:35:08 MST 2013
Simple.
Both the USB devices and the SD cards have an internal controller, which "knows" the size of attached Flash.
It is hardcoded into this controller firmware, as in this devices, the Flash size is not subject to change.
0 项奖励

244 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by stalisman on Thu Mar 07 05:16:36 MST 2013
The flash drive is a particulart type of USB 'device'.

When a USB device is connected to a USB 'Host' system it is interrogated by the host as to its capabilities. 

Each device has different capabilities, for example a printer can print a scanner can aquire and a flash drive can hold data.

The 'interrogation' allows the host to determine the 'size' of the flash drive.

Google 'usb  enumeratio'n if you want to go deeper into this.
0 项奖励