ALFLAT 2 can't get response back

I sent C1 command to the “ALFLAT 2 @ FW 2.0.0” module.
But, even if I waits for 2 minutes, there is no response at some times when a reply “!00” isn’t returning.

An access lamp of the USB memory goes off, so writing in should end. And this moment the USB memory was removed,"!00" is returning.
Without operating a USB memory, can’t it be settled?

-Connection by I2C 95.2 kHz
-USB memory
Transcend JetFlash790 8GB
EMTEC CLICK2.0 8GB

@ Tiff -
Look like you sent STOP instead START condition when you started the transfers!

@ Dat -

Thank you for your reply.

Add the picture when getting a reaction.
I think there is no difference in a last picture and the contents which are being sent.

Please tell me whether which part seems to be sending STOP.

@ Tiff -

Are you using USB port 0 or 1?
if using the PHY HS exist on the board then you have to use HS if the port is 1.

@ Dat -

Hi, Dat.

I using the port 0.
Initialize command is also I U0:

My tested command is

  1. Sending V … for check connection
    read v2.0.0!00
  2. IU0:
    read !00
  3. O1A>U0:\R20160518.csv
    read !00
  4. W1>95
    read !00
  5. ABCD…
    read $00000095 and !00
  6. C1
    Not always responce !00, sometimes can not get back nothing.

Thank you.

@ Tiff -

Can you please try some below:

  • At step 6, instead of sending “C 1” to close handle, send V command and try to get the response.
  • If the “V” command response OK, then send “C 1” command, sleep 5 seconds then read the response.
  • If there is no thing response, take your USB off and check data, are they correct?

Do you mean sometime it is OK, sometime not?

@ Dat -

Thank you for your reply.
I’ll try picking up the V command before the C 1 command.

Not always responce !00, sometimes can not get back nothing.
Do you mean sometime it is OK, sometime not?
Yes. Sometime is get !00, but sometime are not.

@ Dat -

I tried the new command set, the V command before the C 1.
ALFLAT came to reply !00 :slight_smile:

Was it necessary to wait for 5 seconds after C 1?
I’ll repeat the steps of times of the writing USB flash, and make sure of stability.

Thank you.

…Try to writing in was continued, when exceeding 120 times to data write, a reply of initialization has disappeared. It’s seen as the same pattern.
After the send the command, the current state has begun to receive reaction from 10 msec.
Initialization command and other commands are also need sleep time?

@ Tiff -

  • Initialize media
  • Open/Close/Flush a handle
  • Format, get free size…
    Typically, those commands require delay. It hard to say how much exactly, because depends on your media. But closing a handle should not take 5 seconds, at least I haven’t seen any case like that.
    There is data ready pin, you can check that pin.
    Please try this:
  • Send close command
  • Instead of wait for 5 seconds to get !00, wait for 1 second then disconnect your media, don’t care about !00
  • Check data, are they correct?

@ Dat -

Does writing in of data and !00 succeed? I watch this, and most suitable for a sleep-time will be tried.

Thank you.

@ Dat -

  • Initialize media
  • Open/Close/Flush a handle
  • Format, get free size…
    I have decided to take sleep time for 2 seconds to these commands.
    Another command is set as ALFLAT2 modules to 0.5 seconds, and get move stably.

My problem was settled by sleep time above-mentioned.
I’m thankful for advice for a solution. Thank you.

@ Tiff -

[quote]- Initialize media

  • Open/Close/Flush a handle
  • Format, get free size…
    I have decided to take sleep time for 2 seconds to these commands.[/quote]

Try to poll the response. There will be problem if hard code for 2 seconds:

  • Flush or Close may not get enough time if there are large data in the buffer need to be flushed (few MB)
  • Format doesn’t work completely . 2 Seconds not enough to format a device that is lager than a GB.
  • Initialize usually be OK within 2 seconds, but not 100%.