• Visit https://www.embeddedcomputers.net/ for Hardware; Software and all other things related to FlashcatUSB

Code to put flash in auto-select mode is failing

H2Deetoo

New Member
Hi guys,

As a first test, I am patching the FlashCatUsb software to be able to put a (NOR) flash into auto-select mode.
I am writing 3 bytes to the specified addresses, then reading back 7 databytes from flash.
The resulting byte are from the normal flash contents, not the bytes which are expected from auto-select (manufact id, flash id, etc).

Here is the code I'm using:

'Disable automatic reset!
Dim NOR_FLASH As MFP_Flash = DirectCast(memDev.FCUSB.EXT_IF.MyFlashDevice, MFP_Flash)
NOR_FLASH.RESET_ENABLED = False

data_out(0) = &HAA
result = memDev.FCUSB.EXT_IF.WriteData(&H555, data_out)

data_out(0) = &H55
result = memDev.FCUSB.EXT_IF.WriteData(&H2AA, data_out)

data_out(0) = &H90
result = memDev.FCUSB.EXT_IF.WriteData(&H555, data_out)

data_read = memDev.FCUSB.EXT_IF.ReadData(&H0, 7)

I haven't done any measuring yet but could it be that CS is inactivated between commands?

Anybody got any idea what else could be failing?
I'm posting here because I don't know where else to get support.


Regards,
H2Deetoo
 
First, you have to call memDev.FCUSB.EXT_IF.DeviceInit()
Then, you can execute commands like this using the WriteAddressData() function.

example:
WriteAddressData(&H555, &HAA)
WriteAddressData(&H2AA, &H55)
WriteAddressData(&H555, &H90)

Then to read raw data from the device:
ReadBulk_NOR(ADDRESS,COUNT)
 
It was an old topic, and at that time the needed commands weren't available, now they are.
 
Back
Top