SD Card Access Issue

Discussion and questions about programming with Ultibo.
asjsmile
Posts: 12
Joined: Fri May 03, 2019 10:49 am

Re: SD Card Access Issue

Postby asjsmile » Mon May 20, 2019 11:34 am

Hi Ultibo Team,

=========================================================================

my action was just to follow your instructions as below.

1. Build latest RTL which ultibo provided in Github.
2. Create a new init-unit to enable GPIO FIQ.
3. Include init-unit as first item in my program.

then,
I have tested FIQ support for the GPIO driver in our board. ( CM3L )
and did double-check between before FIQ support and after FIQ support with SD card access.

the failure symptoms was disappeared only after FIQ support.

I have also tested with differenct frequency simultaneously per each GPIO interrupt.
It works well. each GPIO interrupt presented proper response.
( ex : GPIO42 : input 60Hz => result : 60.00419998, GPIO43 : input 70Hz => result : 70.03046417 )

really thanks a lot for your fast support.

=========================================================================

I have another question.

As i said before, we are now trying to test USB drive. but we failed to get a D:\.

we have included the units such as USB, DWCOTG, Storage, FileSystem and FATFS units, or just include the RaspberryPi3 unit.

the result was same we can't get a D"\ for USB disk, but the test in RPI3B can find D:\ and works well.


we have tested after modification the example project " 08-FileHandling", we have just changed debug part.
for you information

Code: Select all

program FileHandling;

{$mode objfpc}{$H+}

{ Example 08 File Handling                                                     }
{                                                                              }
{  This example demonstrates just a few basic functions of file handling which }
{  is a major topic in itself.                                                 }
{                                                                              }
{  For more information on all of the available file function see the Ultibo   }
{  Wiki or the Free Pascal user guide.                                         }
{                                                                              }
{  To compile the example select Run, Compile (or Run, Build) from the menu.   }
{                                                                              }
{  Once compiled copy the kernel7.img file to an SD card along with the        }
{  firmware files and use it to boot your Raspberry Pi.                        }
{                                                                              }
{  Raspberry Pi 3B/3B+/3A+ version                                             }
{   What's the difference? See Project, Project Options, Config and Target.    }

{Declare some units used by this example.}
uses
  GlobalConst,
  GlobalTypes,
  Platform,
  Threads,
  Console,
  Framebuffer,
  BCM2837,
  SysUtils,
  Classes,     {Include the common classes}
  FileSystem,  {Include the file system core and interfaces}
  FATFS,       {Include the FAT file system driver}
  MMC,         {Include the MMC/SD core to access our SD card}

  // USB,
  DWCOTG,
  // Devices,
  // Ultibo,

  // Logging,         {Include the logging unit for the console logging window}
  // Console,         {Include the console unit to access the default console device}
  // ConsoleShell,    {This unit provides the console shell window}
  // ShellFileSystem, {This unit adds the file system commands (DIR, COPY, DEL etc)}

  DebugConsol_driver,

  BCM2710;     {And also include the MMC/SD driver for the Raspberry Pi}

const
 SYS = 0;

{A window handle plus a couple of others.}
var
 Count:Integer;
 Filename:String;
 SearchRec:TSearchRec;
 StringList:TStringList;
 FileStream:TFileStream;
 WindowHandle:TWindowHandle;

  BoardSel, on : Byte;

begin

    BoardSel := 0;          // 0 : CM3L Case, 1 : RPi3B Case

    if BoardSel = 0 then begin
    // CM3L Case

        Sleep(20000);

        Buffer_Create;
        Sleep(10);

        {Output the message}
        DebugConsol_Data_Add( SYS, 'Welcome to Example 08 File Handling');
        DebugConsol_TX_Process;

        {We may need to wait a couple of seconds for any drive to be ready}
        DebugConsol_Data_Add( SYS, 'Waiting for drive D:\');
        DebugConsol_TX_Process;

   end
    else begin
    // RPi3B Case

        {Create our window}
        WindowHandle:=ConsoleWindowCreate(ConsoleDeviceGetDefault,CONSOLE_POSITION_FULL,True);

        {Output the message}
        ConsoleWindowWriteLn(WindowHandle,'Welcome to Example 08 File Handling');
        ConsoleWindowWriteLn(WindowHandle,'');

        {We may need to wait a couple of seconds for any drive to be ready}
        ConsoleWindowWriteLn(WindowHandle,'Waiting for drive D:\');

    end;

    Sleep(2000);
    while not DirectoryExists('D:\') do
    begin
        {Sleep for a second}
        Sleep(1000);
    end;

    if BoardSel = 0 then begin
    // CM3L Case
        DebugConsol_Data_Add( SYS, 'D:\ drive is ready');
        DebugConsol_Data_Add( SYS, '');
        DebugConsol_TX_Process;

        ////////////////////////////
        {First let's list the contents of the SD card. We can guess that it will be C:\
            drive because we didn't include the USB host driver.}
        DebugConsol_Data_Add( SYS, 'Contents of drive D:\');
        DebugConsol_Data_Add( SYS, '');
        DebugConsol_TX_Process;

        {To list the contents we need to use FindFirst/FindNext, start with FindFirst}
        // if FindFirst('C:\*.*',faAnyFile,SearchRec) = 0 then
        if FindFirst('D:\*.*',faAnyFile,SearchRec) = 0 then
        begin
            {If FindFirst succeeds it will return 0 and we can proceed with the search}
            repeat
                {Print the file found to the screen}
                DebugConsol_Data_Add( SYS, 'Filename is ' + SearchRec.Name + ' - Size is ' + IntToStr(SearchRec.Size) + ' - Time is ' + DateTimeToStr(FileDateToDateTime(SearchRec.Time)));
                DebugConsol_TX_Process;

                {We keep calling FindNext until there are no more files to find}
            until FindNext(SearchRec) <> 0;
        end
        else begin // sj_test
            DebugConsol_Data_Add( SYS, 'Error #01');
            DebugConsol_Data_Add( SYS, '');
            DebugConsol_TX_Process;
        end;

        {After any call to FindFirst, you must call FindClose or else memory will be leaked}
        FindClose(SearchRec);
        DebugConsol_Data_Add( SYS, '');
        DebugConsol_TX_Process;

        {Let's try creating a file and writing some text to it, we'll assign our filename
            to a variable.}
        Filename:='D:\Example 08 File Handling.txt';

        {We should check if the file exists first before trying to create it}
        DebugConsol_Data_Add( SYS, 'Checking to see if ' + Filename + ' exists');
        DebugConsol_Data_Add( SYS, '');
        DebugConsol_TX_Process;
        if FileExists(Filename) then
        begin
            {If it does exist we can delete it}
            DebugConsol_Data_Add( SYS, 'Deleting the file ' + Filename);
            DebugConsol_Data_Add( SYS, '');
            DebugConsol_TX_Process;
            // DeleteFile(Filename);
        end;

        {Now create the file, let's use a TFileStream class to do this. We pass both the
            filename and the mode to TFileStream. fmCreate tells it to create a new file.}
        DebugConsol_Data_Add( SYS, 'Creating a new file ' + Filename);
        DebugConsol_Data_Add( SYS, '');
        DebugConsol_TX_Process;
        {TFileStream will raise an exception if creating the file fails}

        try

            FileStream:=TFileStream.Create(Filename,fmCreate);

            {We've created the file, now we need to write some content to it, we can use
                a TStringList for that but there are many other ways as well.}
            StringList:=TStringList.Create;

            {Add some text to our string list}
            StringList.Add('Example 08 File Handling');
            StringList.Add('This is a test file created by the example');
            StringList.Add('Here is a another line of text as well.');

            {Since TStringList has a SaveToStream method, we can just call that to write
                all the strings to our new file.}
            DebugConsol_Data_Add( SYS, 'Saving the TStringList to the file');
            DebugConsol_TX_Process;
            StringList.SaveToStream(FileStream);

            {With that done we can close the file and free the string list}
            DebugConsol_Data_Add( SYS, 'Closing the file');
            DebugConsol_Data_Add( SYS, '');
            DebugConsol_TX_Process;
            FileStream.Free;
            StringList.Free;

            {Did it work? Let's open the file and display it on screen to see.}
            DebugConsol_Data_Add( SYS, 'Opening the file ' + Filename);
            DebugConsol_TX_Process;

            try
                FileStream:=TFileStream.Create(Filename,fmOpenReadWrite);

                {Recreate our string list}
                StringList:=TStringList.Create;

                {And use LoadFromStream to read it}
                DebugConsol_Data_Add( SYS, 'Loading the TStringList from the file');
                DebugConsol_TX_Process;
                StringList.LoadFromStream(FileStream);

                {Iterate the strings and print them to the screen}
                DebugConsol_Data_Add( SYS, 'The contents of the file are:');
                DebugConsol_TX_Process;
                for Count:=0 to StringList.Count - 1 do
                begin
                    DebugConsol_Data_Add( SYS,StringList.Strings[Count]);
                    DebugConsol_TX_Process;
                end;

                {Close the file and free the string list again}
                DebugConsol_Data_Add( SYS, 'Closing the file');
                DebugConsol_Data_Add( SYS, '');
                DebugConsol_TX_Process;
                FileStream.Free;
                StringList.Free;

                {If you remove the SD card and put in back in your computer, you should see the
                    file "Example 08 File Handling.txt" on it. If you open it in a notepad you should
                    see the contents exactly as they appeared on screen.}

            except
                {TFileStream couldn't open the file}
                DebugConsol_Data_Add( SYS, 'Failed to open the file ' + Filename);
                DebugConsol_TX_Process;
            end;
        except
            {Something went wrong creating the file}
            DebugConsol_Data_Add( SYS, 'Failed to create the file ' + Filename);
            DebugConsol_TX_Process;
            Sleep(1000);
        end;

        ////////////////////////////

   end
   else begin
    // RPi3B Case
        // ConsoleWindowWriteLn(WindowHandle,'C:\ drive is ready');
        ConsoleWindowWriteLn(WindowHandle,'D:\ drive is ready');
        ConsoleWindowWriteLn(WindowHandle,'');

        {First let's list the contents of the SD card. We can guess that it will be C:\
            drive because we didn't include the USB host driver.}
        ConsoleWindowWriteLn(WindowHandle,'Contents of drive D:\');

        {To list the contents we need to use FindFirst/FindNext, start with FindFirst}
        // if FindFirst('C:\*.*',faAnyFile,SearchRec) = 0 then
        if FindFirst('D:\*.*',faAnyFile,SearchRec) = 0 then   // sj_test
        begin
            {If FindFirst succeeds it will return 0 and we can proceed with the search}
            repeat
            {Print the file found to the screen}
            ConsoleWindowWriteLn(WindowHandle,'Filename is ' + SearchRec.Name + ' - Size is ' + IntToStr(SearchRec.Size) + ' - Time is ' + DateTimeToStr(FileDateToDateTime(SearchRec.Time)));

            {We keep calling FindNext until there are no more files to find}
            until FindNext(SearchRec) <> 0;
        end
        else begin // sj_test
            ConsoleWindowWriteLn(WindowHandle,'Error #01');
        end;

        {After any call to FindFirst, you must call FindClose or else memory will be leaked}
        FindClose(SearchRec);
        ConsoleWindowWriteLn(WindowHandle,'');

        {Let's try creating a file and writing some text to it, we'll assign our filename
            to a variable.}
        Filename:='D:\Example 08 File Handling.txt'; // sj_test

        {We should check if the file exists first before trying to create it}
        ConsoleWindowWriteLn(WindowHandle,'Checking to see if ' + Filename + ' exists');
        if FileExists(Filename) then
        begin
            {If it does exist we can delete it}
            ConsoleWindowWriteLn(WindowHandle,'Deleting the file ' + Filename);
            // DeleteFile(Filename);
        end;

        {Now create the file, let's use a TFileStream class to do this. We pass both the
            filename and the mode to TFileStream. fmCreate tells it to create a new file.}
            ConsoleWindowWriteLn(WindowHandle,'Creating a new file ' + Filename);

        {TFileStream will raise an exception if creating the file fails}
        try
            FileStream:=TFileStream.Create(Filename,fmCreate);

            {We've created the file, now we need to write some content to it, we can use
                a TStringList for that but there are many other ways as well.}
            StringList:=TStringList.Create;

            {Add some text to our string list}
            StringList.Add('Example 08 File Handling');
            StringList.Add('This is a test file created by the example');
            StringList.Add('Here is a another line of text as well.');

            {Since TStringList has a SaveToStream method, we can just call that to write
                all the strings to our new file.}
            ConsoleWindowWriteLn(WindowHandle,'Saving the TStringList to the file');
            StringList.SaveToStream(FileStream);

            {With that done we can close the file and free the string list}
            ConsoleWindowWriteLn(WindowHandle,'Closing the file');
            ConsoleWindowWriteLn(WindowHandle,'');
            FileStream.Free;
            StringList.Free;

            {Did it work? Let's open the file and display it on screen to see.}
            ConsoleWindowWriteLn(WindowHandle,'Opening the file ' + Filename);

            try
                FileStream:=TFileStream.Create(Filename,fmOpenReadWrite);

                {Recreate our string list}
                StringList:=TStringList.Create;

                {And use LoadFromStream to read it}
                ConsoleWindowWriteLn(WindowHandle,'Loading the TStringList from the file');
                StringList.LoadFromStream(FileStream);

                {Iterate the strings and print them to the screen}
                ConsoleWindowWriteLn(WindowHandle,'The contents of the file are:');

                for Count:=0 to StringList.Count - 1 do
                begin
                    ConsoleWindowWriteLn(WindowHandle,StringList.Strings[Count]);
                end;

                {Close the file and free the string list again}
                ConsoleWindowWriteLn(WindowHandle,'Closing the file');
                ConsoleWindowWriteLn(WindowHandle,'');
                FileStream.Free;
                StringList.Free;

                {If you remove the SD card and put in back in your computer, you should see the
                    file "Example 08 File Handling.txt" on it. If you open it in a notepad you should
                    see the contents exactly as they appeared on screen.}
            except
                {TFileStream couldn't open the file}
                ConsoleWindowWriteLn(WindowHandle,'Failed to open the file ' + Filename);
            end;
        except
            {Something went wrong creating the file}
            ConsoleWindowWriteLn(WindowHandle,'Failed to create the file ' + Filename);
        end;
   end;

    {Halt the thread}
    ThreadHalt(0);
end.


In H/W, the CM3L connected with LAN9514,
there is one upstream is conected with CM3L USB D+,D-,

there are 4 downstearm ( D2P,D2N ~ D5P,D5N ),
the D2P/N is connected PL2303 for debug console,
the D3P/N is connected USB disk,
the D4P/N is OPEN,
the D5P/N is OPEN,
and 1xEthernet is PoE Magnetics (Hx2019).

i don't want to push, just ask any kind advice on that.
hope your understanding.

and thanks again for your support.

=========================================================================

SJ
User avatar
Ultibo
Site Admin
Posts: 2217
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: SD Card Access Issue

Postby Ultibo » Tue May 21, 2019 2:35 am

asjsmile wrote:It works well. each GPIO interrupt presented proper response.
( ex : GPIO42 : input 60Hz => result : 60.00419998, GPIO43 : input 70Hz => result : 70.03046417 )

That's a great result, thanks for letting us know.

asjsmile wrote:As i said before, we are now trying to test USB drive. but we failed to get a D:\.

we have included the units such as USB, DWCOTG, Storage, FileSystem and FATFS units, or just include the RaspberryPi3 unit.

the result was same we can't get a D"\ for USB disk, but the test in RPI3B can find D:\ and works well.

Since the same project works on a Pi3B that seems to rule out any problem with the test, the Ultibo RTL has a lot of debug logging available and looking at what is output while enumerating and initializing the USB disk would be the obvious next step.

There are multiple logging options available (serial, console, file, syslog etc) depending on what you have access to, it looks to me like you are using some custom logging for your own purpose (DebugConsol_Data_Add etc), is that using serial or something else?

What would be the most convenient option for you to obtain some logging output from the RTL?

Also is the USB disk permanently attached to the CM3 or can you plug and unplug it as required? For example would it be possible to plug in the USB disk after the system is started in order to capture the logging events?

Let me know what options you have available for testing so we can work out the best way to proceed.
Ultibo.org | Make something amazing
https://ultibo.org
asjsmile
Posts: 12
Joined: Fri May 03, 2019 10:49 am

Re: SD Card Access Issue

Postby asjsmile » Tue May 21, 2019 12:36 pm

Since the same project works on a Pi3B that seems to rule out any problem with the test,
the Ultibo RTL has a lot of debug logging available and looking at what is output while enumerating and initializing the USB disk would be the obvious next step.

There are multiple logging options available (serial, console, file, syslog etc) depending on what you have access to,
it looks to me like you are using some custom logging for your own purpose (DebugConsol_Data_Add etc), is that using serial or something else?


=> Yes, that's serial ( RS232 )

What would be the most convenient option for you to obtain some logging output from the RTL?


=> there is no video output,
i don't know how to use file, syslog, do you mean save a file or syslog in sd card ? if yes, it's possble.
and we can also use serial ( RS232 ).

I think serial would be best.
Also is the USB disk permanently attached to the CM3 or can you plug and unplug it as required?
For example would it be possible to plug in the USB disk after the system is started in order to capture the logging events?


=> Yes, we can plug in after system started.
In test mode, we can plug and unplug it freely.
but it's not mandatory.
plug and unplug will happen under power off.
asjsmile
Posts: 12
Joined: Fri May 03, 2019 10:49 am

Re: SD Card Access Issue

Postby asjsmile » Wed May 22, 2019 8:09 am

Hi Ultibo Team,

Base on your explanation in previous posting,

I have found some information related with debug logging in forum.
and I have tried and studied with example project ( "09-LogOutput" ).

Finally, i have successed to get a syslog messages from target board with CM3L.
( USB Plug in after system initialized. )

Would you please check the below log messages, then advise on that.

Code: Select all

START
00000085 - 0034B9E0:0 - Message no 1 sent at 30-12-99 00:00:18
00000086 - 0034B9E0:0 - Message no 2 sent at 30-12-99 00:00:18
00000087 - 0034B9E0:0 - Message no 3 sent at 30-12-99 00:00:18
00000088 - 0034B9E0:0 - Message no 4 sent at 30-12-99 00:00:19
00000089 - 0034B9E0:0 - Message no 5 sent at 30-12-99 00:00:19
0000008A - 0034B9E0:0 - Message no 6 sent at 30-12-99 00:00:19
0000008B - 0034B9E0:0 - Message no 7 sent at 30-12-99 00:00:19
0000008C - 0034B9E0:0 - Message no 8 sent at 30-12-99 00:00:19
0000008D - 0034B9E0:0 - Message no 9 sent at 30-12-99 00:00:20
0000008E - 0034B9E0:0 - Message no 10 sent at 30-12-99 00:00:20
0000008F - 0034B9E0:0 - Message no 11 sent at 30-12-99 00:00:20
00000090 - 0034B9E0:0 - Message no 12 sent at 30-12-99 00:00:21
00000091 - 0034B9E0:0 - Message no 13 sent at 30-12-99 00:00:21
00000092 - 0034B9E0:0 - Message no 14 sent at 30-12-99 00:00:21
00000093 - 0034B9E0:0 - Message no 15 sent at 30-12-99 00:00:21
00000094 - 0034B9E0:0 - Message no 16 sent at 30-12-99 00:00:21
00000095 - 0034B9E0:0 - Message no 17 sent at 30-12-99 00:00:22
00000096 - 0034B9E0:0 - Message no 18 sent at 30-12-99 00:00:22
00000097 - 0034B9E0:0 - Message no 19 sent at 30-12-99 00:00:22
00000098 - 0034B9E0:0 - Message no 20 sent at 30-12-99 00:00:22
00000099 - 0034B9E0:0 - Message no 21 sent at 30-12-99 00:00:22
0000009A - 0034B9E0:0 - Message no 22 sent at 30-12-99 00:00:23
0000009B - 0034B9E0:0 - Message no 23 sent at 30-12-99 00:00:23
0000009C - 0034B9E0:0 - Message no 24 sent at 30-12-99 00:00:23
0000009D - 0034B9E0:0 - Message no 25 sent at 30-12-99 00:00:23
0000009E - 0034B9E0:0 - Message no 26 sent at 30-12-99 00:00:24
0000009F - 0034B9E0:0 - Message no 27 sent at 30-12-99 00:00:24
000000A0 - 0034B9E0:0 - Message no 28 sent at 30-12-99 00:00:24
000000A1 - 0034B9E0:0 - Message no 29 sent at 30-12-99 00:00:24
000000A2 - 0034B9E0:0 - Message no 30 sent at 30-12-99 00:00:24
000000A3 - 0034B9E0:0 - Message no 31 sent at 30-12-99 00:00:24
000000A4 - 0034B9E0:0 - Message no 32 sent at 30-12-99 00:00:24
000000A5 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000A6 - 00924EF0:1 - Device: Registered device (Handle=01D8DF78 Class=DEVICE_CLASS_USB Name=USB4)
000000A7 - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000A8 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000A9 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000AA - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000AB - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000AC - 00924EF0:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000AD - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000AE - 00924EF0:1 - Device: Deregistered device (Handle=01D8DF78 Class=DEVICE_CLASS_USB Name=USB4)
000000AF - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000B0 - 00924EF0:1 - Device: Registered device (Handle=01D8E4A4 Class=DEVICE_CLASS_USB Name=USB4)
000000B1 - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000B2 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000B3 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000B4 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000B5 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000B6 - 00924EF0:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000B7 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000B8 - 00924EF0:1 - Device: Deregistered device (Handle=01D8E4A4 Class=DEVICE_CLASS_USB Name=USB4)
000000B9 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000BA - 00924EF0:1 - Device: Registered device (Handle=01D8EFD8 Class=DEVICE_CLASS_USB Name=USB4)
000000BB - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000BC - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000BD - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000BE - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000BF - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000C0 - 00924EF0:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000C1 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000C2 - 00924EF0:1 - Device: Deregistered device (Handle=01D8EFD8 Class=DEVICE_CLASS_USB Name=USB4)
000000C3 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000C4 - 00924EF0:1 - Device: Registered device (Handle=01D8E0A0 Class=DEVICE_CLASS_USB Name=USB4)
000000C5 - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000C6 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000C7 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000C8 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000C9 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000CA - 00924EF0:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000CB - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000CC - 00924EF0:1 - Device: Deregistered device (Handle=01D8E0A0 Class=DEVICE_CLASS_USB Name=USB4)
000000CD - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000CE - 00924EF0:1 - Device: Registered device (Handle=01D8E4BC Class=DEVICE_CLASS_USB Name=USB4)
000000CF - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000D0 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000D1 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000D2 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000D3 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000D4 - 00924EF0:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000D5 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000D6 - 00924EF0:1 - Device: Deregistered device (Handle=01D8E4BC Class=DEVICE_CLASS_USB Name=USB4)
000000D7 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000D8 - 00924EF0:1 - Device: Registered device (Handle=01D8E018 Class=DEVICE_CLASS_USB Name=USB4)
000000D9 - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000DA - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000DB - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000DC - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000DD - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000DE - 00924EF0:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000DF - 0034B9E0:0 - Message no 33 sent at 30-12-99 00:00:27
000000E0 - 0034B9E0:0 - Message no 34 sent at 30-12-99 00:00:27
000000E1 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000E2 - 00924EF0:1 - Device: Deregistered device (Handle=01D8E018 Class=DEVICE_CLASS_USB Name=USB4)
000000E3 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000E4 - 00924EF0:1 - Device: Registered device (Handle=01D90B20 Class=DEVICE_CLASS_USB Name=USB4)
000000E5 - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000E6 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000E7 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000E8 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000E9 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000EA - 00924EF0:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000EB - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000EC - 00924EF0:1 - Device: Deregistered device (Handle=01D90B20 Class=DEVICE_CLASS_USB Name=USB4)
000000ED - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000EE - 00924EF0:1 - Device: Registered device (Handle=01D91034 Class=DEVICE_CLASS_USB Name=USB4)
000000EF - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000F0 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000F1 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000F2 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000F3 - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000F4 - 00924EF0:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000F5 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000F6 - 00924EF0:1 - Device: Deregistered device (Handle=01D91034 Class=DEVICE_CLASS_USB Name=USB4)
000000F7 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000F8 - 00924EF0:1 - Device: Registered device (Handle=01D8E004 Class=DEVICE_CLASS_USB Name=USB4)
000000F9 - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000FA - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000FB - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000FC - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000FD - 00924EF0:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000FE - 00924EF0:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000FF - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
00000100 - 00924EF0:1 - Device: Deregistered device (Handle=01D8E004 Class=DEVICE_CLASS_USB Name=USB4)
00000101 - 00924EF0:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
00000102 - 00924EF0:1 - Device: Registered device (Handle=01D8DF94 Class=DEVICE_CLASS_USB Name=USB4)
00000103 - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3

The rest is omitted.



SJ
User avatar
Ultibo
Site Admin
Posts: 2217
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: SD Card Access Issue

Postby Ultibo » Wed May 22, 2019 10:08 am

asjsmile wrote:Finally, i have successed to get a syslog messages from target board with CM3L.
( USB Plug in after system initialized. )

Hello SJ,

That's exactly what we need to see. I was in the process of creating a small example to show how to hook up logging to your Debug Console function but since you have it working now we'll come back to that if needed.

Obviously this error is what is preventing you from seeing drive D:\ in your test
[ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL

Reading the device descriptor is almost the very first thing that is done when a new USB device is detected.

The line in the log that stands out immediately is this
000000A7 - 00924EF0:1 - USB: Device2: Hub: New full-speed device connected to port 3

When it says full-speed it means a USB 1.1 device which apart from being very slow would be at least 10 to 15 years old if that is real.

Can you try a couple of things to make sense of what is shown in the log,

1. Does the same test on the RPi3 show full-speed or high-speed for the same USB disk?

2. If you try one or more other USB disks do they show as full-speed or high-speed?

3. If you have another device that is known to be USB 2.0 such as a hub, what does the log show when you plug that in? (Don't test with a keyboard or mouse as many of them really are USB 1.0 or USB 1.1)

The reason I want to confirm that is because while both full and low-speed devices should work without any issue I think it is unlikely that you have an actual full-speed (USB 1.1) disk (I haven't seen one for a very long time) and if the USB host is reporting the device as full-speed when it is really high-speed then it might indicate a problem with timing or interference with the USB bus.

Let us know how you go.
Ultibo.org | Make something amazing
https://ultibo.org
asjsmile
Posts: 12
Joined: Fri May 03, 2019 10:49 am

Re: SD Card Access Issue

Postby asjsmile » Thu May 23, 2019 8:45 am

Hello Ultibo team,

1. Does the same test on the RPi3 show full-speed or high-speed for the same USB disk?
2. If you try one or more other USB disks do they show as full-speed or high-speed?

=> i have tested 3 usb disks. all usb disks show high-speed on the Rpi3, but all usb disks show full-speed on my target Board.
3. If you have another device that is known to be USB 2.0 such as a hub, what does the log show when you plug that in?
(Don't test with a keyboard or mouse as many of them really are USB 1.0 or USB 1.1)

=> i'msorry that i don't have another device to test.

for your information
the belows are the log messages with 3 USB disk on RPI3, My target board with CM3L.

Code: Select all

***  Log Messages = USB disk 1 on RPI3  ***

START
0000006D - 0034B9E0:0 - Message no 1 sent at 30-12-99 00:00:03
0000006E - 0034B9E0:0 - Message no 2 sent at 30-12-99 00:00:03
0000006F - 0034B9E0:0 - Message no 3 sent at 30-12-99 00:00:03
00000070 - 0034B9E0:0 - Message no 4 sent at 30-12-99 00:00:04
00000071 - 0034B9E0:0 - Message no 5 sent at 30-12-99 00:00:04
00000072 - 0034B9E0:0 - Message no 6 sent at 30-12-99 00:00:04
00000073 - 00928AE0:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
00000074 - 00928AE0:1 - Device: Registered device (Handle=01D6F640 Class=DEVICE_CLASS_USB Name=USB3)
00000075 - 00928AE0:1 - USB: Device2: Hub: New high-speed device connected to port 4
00000076 - 00928AE0:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
00000077 - 0034B9E0:0 - Message no 7 sent at 30-12-99 00:00:05
00000078 - 00928AE0:1 - USB: Device4: Attaching high-speed USB 2.1 Mass Storage class device (Mass Storage Device) (idVendor=8564 idProduct=1000)
00000079 - 00928AE0:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACH)
0000007A - 00928AE0:1 - USB: Device4: Storage: Max LUN = 0
0000007B - 0034B9E0:0 - Message no 8 sent at 30-12-99 00:00:05
0000007C - 00928AE0:1 - Device: Sending device notification (Name=Storage1 Class=DEVICE_CLASS_STORAGE Notification=DEVICE_NOTIFICATION_REGISTER)
0000007D - 00928AE0:1 - Device: Registered device (Handle=01D70B8C Class=DEVICE_CLASS_STORAGE Name=Storage1)
0000007E - 00928AE0:1 - Device: Sending device notification (Name=Storage1 Class=DEVICE_CLASS_STORAGE Notification=DEVICE_NOTIFICATION_INSERT)
0000007F - 00928AE0:1 - USB: Bound USB Mass Storage Driver to high-speed USB 2.1 Mass Storage class device (Mass Storage Device) (idVendor=8564 idProduct=1000) (Interface=0)
00000080 - 00928AE0:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_BIND)
00000081 - 0034B9E0:0 - Message no 9 sent at 30-12-99 00:00:06
00000082 - 0034B9E0:0 - Message no 10 sent at 30-12-99 00:00:06
00000083 - 0034B9E0:0 - Message no 11 sent at 30-12-99 00:00:06
00000084 - 0034B9E0:0 - Message no 12 sent at 30-12-99 00:00:07
00000085 - 0034B9E0:0 - Message no 13 sent at 30-12-99 00:00:07
00000086 - 0034B9E0:0 - Message no 14 sent at 30-12-99 00:00:07
00000087 - 0034B9E0:0 - Message no 15 sent at 30-12-99 00:00:07


Code: Select all

***  Log Messages = USB disk 2 on RPI3  ***

START
0000006D - 0034B9E0:0 - Message no 1 sent at 30-12-99 00:00:03
0000006E - 0034B9E0:0 - Message no 2 sent at 30-12-99 00:00:03
0000006F - 0034B9E0:0 - Message no 3 sent at 30-12-99 00:00:03
00000070 - 0034B9E0:0 - Message no 4 sent at 30-12-99 00:00:04
00000071 - 0034B9E0:0 - Message no 5 sent at 30-12-99 00:00:04
00000072 - 0034B9E0:0 - Message no 6 sent at 30-12-99 00:00:04
00000073 - 0034B9E0:0 - Message no 7 sent at 30-12-99 00:00:05
00000074 - 0034B9E0:0 - Message no 8 sent at 30-12-99 00:00:05
00000075 - 00926994:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
00000076 - 00926994:1 - Device: Registered device (Handle=01D6E1C4 Class=DEVICE_CLASS_USB Name=USB3)
00000077 - 00926994:1 - USB: Device2: Hub: New high-speed device connected to port 4
00000078 - 00926994:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
00000079 - 00926994:1 - USB: Device4: Attaching high-speed USB 2.1 Mass Storage class device (Cruzer Blade) (idVendor=0781 idProduct=5567)
0000007A - 00926994:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACH)
0000007B - 00926994:1 - USB: Device4: Storage: Max LUN = 0
0000007C - 00926994:1 - Device: Sending device notification (Name=Storage1 Class=DEVICE_CLASS_STORAGE Notification=DEVICE_NOTIFICATION_REGISTER)
0000007D - 00926994:1 - Device: Registered device (Handle=01D6FCA4 Class=DEVICE_CLASS_STORAGE Name=Storage1)
0000007E - 00926994:1 - Device: Sending device notification (Name=Storage1 Class=DEVICE_CLASS_STORAGE Notification=DEVICE_NOTIFICATION_INSERT)
0000007F - 00926994:1 - USB: Bound USB Mass Storage Driver to high-speed USB 2.1 Mass Storage class device (Cruzer Blade) (idVendor=0781 idProduct=5567) (Interface=0)
00000080 - 00926994:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_BIND)
00000081 - 0034B9E0:0 - Message no 9 sent at 30-12-99 00:00:06
00000082 - 0034B9E0:0 - Message no 10 sent at 30-12-99 00:00:06
00000083 - 0034B9E0:0 - Message no 11 sent at 30-12-99 00:00:06
00000084 - 0034B9E0:0 - Message no 12 sent at 30-12-99 00:00:07
00000085 - 0034B9E0:0 - Message no 13 sent at 30-12-99 00:00:07
00000086 - 0034B9E0:0 - Message no 14 sent at 30-12-99 00:00:07
00000087 - 0034B9E0:0 - Message no 15 sent at 30-12-99 00:00:07


Code: Select all

*** Log Messages = USB disk 3 on RPI3   ***

START
0000006D - 0034B9E0:0 - Message no 1 sent at 30-12-99 00:00:03
0000006E - 0034B9E0:0 - Message no 2 sent at 30-12-99 00:00:03
0000006F - 0034B9E0:0 - Message no 3 sent at 30-12-99 00:00:03
00000070 - 0034B9E0:0 - Message no 4 sent at 30-12-99 00:00:04
00000071 - 0034B9E0:0 - Message no 5 sent at 30-12-99 00:00:04
00000072 - 0034B9E0:0 - Message no 6 sent at 30-12-99 00:00:04
00000073 - 009275E0:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
00000074 - 009275E0:1 - Device: Registered device (Handle=01D6E20C Class=DEVICE_CLASS_USB Name=USB3)
00000075 - 009275E0:1 - USB: Device2: Hub: New high-speed device connected to port 4
00000076 - 009275E0:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
00000077 - 0034B9E0:0 - Message no 7 sent at 30-12-99 00:00:05
00000078 - 009275E0:1 - USB: Device4: Attaching high-speed USB 2.0 Mass Storage class device (USB Mass Storage Device) (idVendor=1307 idProduct=0165)
00000079 - 009275E0:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACH)
0000007A - 009275E0:1 - USB: Device4: Storage: Max LUN = 0
0000007B - 009275E0:1 - Device: Sending device notification (Name=Storage1 Class=DEVICE_CLASS_STORAGE Notification=DEVICE_NOTIFICATION_REGISTER)
0000007C - 009275E0:1 - Device: Registered device (Handle=01D6F90C Class=DEVICE_CLASS_STORAGE Name=Storage1)
0000007D - 009275E0:1 - Device: Sending device notification (Name=Storage1 Class=DEVICE_CLASS_STORAGE Notification=DEVICE_NOTIFICATION_INSERT)
0000007E - 009275E0:1 - USB: Bound USB Mass Storage Driver to high-speed USB 2.0 Mass Storage class device (USB Mass Storage Device) (idVendor=1307 idProduct=0165) (Interface=0)
0000007F - 009275E0:1 - Device: Sending device notification (Name=USB3 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_BIND)
00000080 - 0034B9E0:0 - Message no 8 sent at 30-12-99 00:00:05
00000081 - 0034B9E0:0 - Message no 9 sent at 30-12-99 00:00:06
00000082 - 0034B9E0:0 - Message no 10 sent at 30-12-99 00:00:06
00000083 - 0034B9E0:0 - Message no 11 sent at 30-12-99 00:00:06
00000084 - 0034B9E0:0 - Message no 12 sent at 30-12-99 00:00:07
00000085 - 0034B9E0:0 - Message no 13 sent at 30-12-99 00:00:07
00000086 - 0034B9E0:0 - Message no 14 sent at 30-12-99 00:00:07
00000087 - 0034B9E0:0 - Message no 15 sent at 30-12-99 00:00:07


Code: Select all

*** Log Messages = USB disk 1 on my Target board with CM3L   ***

START
0000008C - 0034B9E0:0 - Message no 1 sent at 30-12-99 00:00:18
0000008D - 0034B9E0:0 - Message no 2 sent at 30-12-99 00:00:18
0000008E - 0034B9E0:0 - Message no 3 sent at 30-12-99 00:00:18
0000008F - 0034B9E0:0 - Message no 4 sent at 30-12-99 00:00:18
00000090 - 0034B9E0:0 - Message no 5 sent at 30-12-99 00:00:19
00000091 - 0034B9E0:0 - Message no 6 sent at 30-12-99 00:00:19
00000092 - 0076A1CC:2 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_UP)
00000093 - 0034B9E0:0 - Message no 7 sent at 30-12-99 00:00:19
00000094 - 0034B9E0:0 - Message no 8 sent at 30-12-99 00:00:20
00000095 - 0034B9E0:0 - Message no 9 sent at 30-12-99 00:00:20
00000096 - 007264BC:1 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_DOWN)
00000097 - 0034B9E0:0 - Message no 10 sent at 30-12-99 00:00:20
00000098 - 0034B9E0:0 - Message no 11 sent at 30-12-99 00:00:20
00000099 - 0034B9E0:0 - Message no 12 sent at 30-12-99 00:00:21
0000009A - 0034B9E0:0 - Message no 13 sent at 30-12-99 00:00:21
0000009B - 0034B9E0:0 - Message no 14 sent at 30-12-99 00:00:21
0000009C - 0034B9E0:0 - Message no 15 sent at 30-12-99 00:00:21
0000009D - 0034B9E0:0 - Message no 16 sent at 30-12-99 00:00:22
0000009E - 007264BC:1 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_UP)
0000009F - 0034B9E0:0 - Message no 17 sent at 30-12-99 00:00:22
000000A0 - 0034B9E0:0 - Message no 18 sent at 30-12-99 00:00:22
000000A1 - 0076A1CC:2 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_DOWN)
000000A2 - 0034B9E0:0 - Message no 19 sent at 30-12-99 00:00:23
000000A3 - 0034B9E0:0 - Message no 20 sent at 30-12-99 00:00:23
000000A4 - 0034B9E0:0 - Message no 21 sent at 30-12-99 00:00:23
000000A5 - 0034B9E0:0 - Message no 22 sent at 30-12-99 00:00:23
000000A6 - 0034B9E0:0 - Message no 23 sent at 30-12-99 00:00:23
000000A7 - 0034B9E0:0 - Message no 24 sent at 30-12-99 00:00:24
000000A8 - 0034B9E0:0 - Message no 25 sent at 30-12-99 00:00:24
000000A9 - 007264BC:1 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_UP)
000000AA - 0034B9E0:0 - Message no 26 sent at 30-12-99 00:00:25
000000AB - 0034B9E0:0 - Message no 27 sent at 30-12-99 00:00:25
000000AC - 00922754:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000AD - 00922754:1 - Device: Registered device (Handle=01DA103C Class=DEVICE_CLASS_USB Name=USB4)
000000AE - 00922754:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000AF - 00922754:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000B0 - 00922754:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000B1 - 00922754:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000B2 - 0076A1CC:2 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_DOWN)
000000B3 - 00922754:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000B4 - 00922754:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000B5 - 00922754:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000B6 - 00922754:1 - Device: Deregistered device (Handle=01DA103C Class=DEVICE_CLASS_USB Name=USB4)
000000B7 - 00922754:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000B8 - 00922754:1 - Device: Registered device (Handle=01DA14E4 Class=DEVICE_CLASS_USB Name=USB4)
000000B9 - 00922754:1 - USB: Device2: Hub: New full-speed device connected to port 3

The rest is omitted.


Code: Select all

*** Log Messages = USB disk 2 on my Target board with CM3L   ***

00000085 - 0034B9E0:0 - Message no 1 sent at 30-12-99 00:00:18
00000086 - 0034B9E0:0 - Message no 2 sent at 30-12-99 00:00:18
00000087 - 0034B9E0:0 - Message no 3 sent at 30-12-99 00:00:18
00000088 - 0034B9E0:0 - Message no 4 sent at 30-12-99 00:00:18
00000089 - 0034B9E0:0 - Message no 5 sent at 30-12-99 00:00:19
0000008A - 0034B9E0:0 - Message no 6 sent at 30-12-99 00:00:19
0000008B - 0034B9E0:0 - Message no 7 sent at 30-12-99 00:00:19
0000008C - 0034B9E0:0 - Message no 8 sent at 30-12-99 00:00:19
0000008D - 0034B9E0:0 - Message no 9 sent at 30-12-99 00:00:19
0000008E - 0034B9E0:0 - Message no 10 sent at 30-12-99 00:00:20
0000008F - 0034B9E0:0 - Message no 11 sent at 30-12-99 00:00:20
00000090 - 0034B9E0:0 - Message no 12 sent at 30-12-99 00:00:20
00000091 - 0034B9E0:0 - Message no 13 sent at 30-12-99 00:00:21
00000092 - 0034B9E0:0 - Message no 14 sent at 30-12-99 00:00:21
00000093 - 00923B2C:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
00000094 - 00923B2C:1 - Device: Registered device (Handle=01D86A50 Class=DEVICE_CLASS_USB Name=USB4)
00000095 - 00923B2C:1 - USB: Device2: Hub: New full-speed device connected to port 3
00000096 - 00923B2C:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
00000097 - 00923B2C:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
00000098 - 00923B2C:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
00000099 - 00923B2C:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
0000009A - 00923B2C:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
0000009B - 00923B2C:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
0000009C - 00923B2C:1 - Device: Deregistered device (Handle=01D86A50 Class=DEVICE_CLASS_USB Name=USB4)
0000009D - 00923B2C:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
0000009E - 00923B2C:1 - Device: Registered device (Handle=01D86A50 Class=DEVICE_CLASS_USB Name=USB4)
0000009F - 00923B2C:1 - USB: Device2: Hub: New full-speed device connected to port 3

The rest is omitted.


Code: Select all

*** Log Messages = USB disk 3 on my Target board with CM3L   ***

START
0000008C - 0034B9E0:0 - Message no 1 sent at 30-12-99 00:00:18
0000008D - 0034B9E0:0 - Message no 2 sent at 30-12-99 00:00:18
0000008E - 0034B9E0:0 - Message no 3 sent at 30-12-99 00:00:19
0000008F - 0034B9E0:0 - Message no 4 sent at 30-12-99 00:00:19
00000090 - 0034B9E0:0 - Message no 5 sent at 30-12-99 00:00:19
00000091 - 0034B9E0:0 - Message no 6 sent at 30-12-99 00:00:19
00000092 - 0034B9E0:0 - Message no 7 sent at 30-12-99 00:00:19
00000093 - 0076A1CC:2 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_UP)
00000094 - 0034B9E0:0 - Message no 8 sent at 30-12-99 00:00:19
00000095 - 0034B9E0:0 - Message no 9 sent at 30-12-99 00:00:20
00000096 - 0034B9E0:0 - Message no 10 sent at 30-12-99 00:00:20
00000097 - 0034B9E0:0 - Message no 11 sent at 30-12-99 00:00:20
00000098 - 007264BC:1 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_DOWN)
00000099 - 0034B9E0:0 - Message no 12 sent at 30-12-99 00:00:20
0000009A - 0034B9E0:0 - Message no 13 sent at 30-12-99 00:00:20
0000009B - 0034B9E0:0 - Message no 14 sent at 30-12-99 00:00:21
0000009C - 0034B9E0:0 - Message no 15 sent at 30-12-99 00:00:21
0000009D - 0034B9E0:0 - Message no 16 sent at 30-12-99 00:00:21
0000009E - 0034B9E0:0 - Message no 17 sent at 30-12-99 00:00:21
0000009F - 0034B9E0:0 - Message no 18 sent at 30-12-99 00:00:21
000000A0 - 0034B9E0:0 - Message no 19 sent at 30-12-99 00:00:22
000000A1 - 0076A1CC:2 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_UP)
000000A2 - 0034B9E0:0 - Message no 20 sent at 30-12-99 00:00:22
000000A3 - 0034B9E0:0 - Message no 21 sent at 30-12-99 00:00:22
000000A4 - 007264BC:1 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_DOWN)
000000A5 - 0034B9E0:0 - Message no 22 sent at 30-12-99 00:00:23
000000A6 - 0034B9E0:0 - Message no 23 sent at 30-12-99 00:00:23
000000A7 - 0034B9E0:0 - Message no 24 sent at 30-12-99 00:00:23
000000A8 - 0034B9E0:0 - Message no 25 sent at 30-12-99 00:00:23
000000A9 - 0034B9E0:0 - Message no 26 sent at 30-12-99 00:00:23
000000AA - 0034B9E0:0 - Message no 27 sent at 30-12-99 00:00:24
000000AB - 0034B9E0:0 - Message no 28 sent at 30-12-99 00:00:24
000000AC - 0034B9E0:0 - Message no 29 sent at 30-12-99 00:00:24
000000AD - 007264BC:1 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_UP)
000000AE - 0034B9E0:0 - Message no 30 sent at 30-12-99 00:00:24
000000AF - 0034B9E0:0 - Message no 31 sent at 30-12-99 00:00:25
000000B0 - 0034B9E0:0 - Message no 32 sent at 30-12-99 00:00:25
000000B1 - 0034B9E0:0 - Message no 33 sent at 30-12-99 00:00:25
000000B2 - 0076A1CC:2 - Device: Sending device notification (Name=Network0 Class=DEVICE_CLASS_NETWORK Notification=DEVICE_NOTIFICATION_DOWN)
000000B3 - 0034B9E0:0 - Message no 34 sent at 30-12-99 00:00:25
000000B4 - 0034B9E0:0 - Message no 35 sent at 30-12-99 00:00:26
000000B5 - 0034B9E0:0 - Message no 36 sent at 30-12-99 00:00:26
000000B6 - 0092386C:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000B7 - 0092386C:1 - Device: Registered device (Handle=01D9A7D8 Class=DEVICE_CLASS_USB Name=USB4)
000000B8 - 0092386C:1 - USB: Device2: Hub: New full-speed device connected to port 3
000000B9 - 0092386C:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_ATTACHING)
000000BA - 0092386C:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000BB - 0092386C:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000BC - 0092386C:1 - [ERROR] USB: Device0: Failed to read start of device descriptor: USB_STATUS_HARDWARE_STALL
000000BD - 0092386C:1 - [ERROR] USB: Device2: Hub: Failed to attach new device to port 3: USB_STATUS_HARDWARE_STALL
000000BE - 0092386C:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_DEREGISTER)
000000BF - 0092386C:1 - Device: Deregistered device (Handle=01D9A7D8 Class=DEVICE_CLASS_USB Name=USB4)
000000C0 - 0092386C:1 - Device: Sending device notification (Name=USB4 Class=DEVICE_CLASS_USB Notification=DEVICE_NOTIFICATION_REGISTER)
000000C1 - 0092386C:1 - Device: Registered device (Handle=01D9A878 Class=DEVICE_CLASS_USB Name=USB4)
000000C2 - 0092386C:1 - USB: Device2: Hub: New full-speed device connected to port 3

The rest is omitted.


SJ
User avatar
Ultibo
Site Admin
Posts: 2217
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: SD Card Access Issue

Postby Ultibo » Thu May 23, 2019 11:53 pm

asjsmile wrote:=> i have tested 3 usb disks. all usb disks show high-speed on the Rpi3, but all usb disks show full-speed on my target Board.

That seems quite definitive, while it would be interesting to see what other devices show it would also be interesting to see what the LAN9514 and Hub device are detected as. There are ways to do that test by delaying the starting of the USB subsystem itself until you have logging available (obviously syslog would not work so it would have to be serial) and then starting the USB host in order to record all of the startup events in the log.

The bigger issue here is that the detection of full-speed versus high-speed is not something that is controlled by the software at all, the USB host reports it to us in the port status field after a device is attached and the reset process has been completed.

If you have a look at this page it explains how high-speed negotiation works and even shows what the communication between the device and the host should look like, if you have a high-speed USB host with a high-speed USB hub then it seems likely that the reason the USB disk is being detected as full-speed is due to a communication issue at the bus level.

We're happy to help with further testing but at this point it seems like you need to look closer at the hardware design in order to confirm that things are working as they should be.

Let us know what you find.

PS. We now have a CM3 and CM3L with a CMIO development board and we tested plugging in all sorts of combinations of low/full/high speed devices with and without a hub and every combination seems to work correctly.
Ultibo.org | Make something amazing
https://ultibo.org
asjsmile
Posts: 12
Joined: Fri May 03, 2019 10:49 am

Re: SD Card Access Issue

Postby asjsmile » Tue May 28, 2019 10:40 am

Dear Ultibo team,

Now, this issue has been solved.

As you explained, the problem was wrong bus condition in H/W

We made lines shorter and same length for both DP and DM.
we can see USB disk at D:\.
i have tested several times and compared with SD card access.
there is no problem and 2~4 times faster than SD card.

Thanks again for your support.

Best regards
SJ
User avatar
Ultibo
Site Admin
Posts: 2217
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: SD Card Access Issue

Postby Ultibo » Tue May 28, 2019 11:14 pm

asjsmile wrote:As you explained, the problem was wrong bus condition in H/W

We made lines shorter and same length for both DP and DM.
we can see USB disk at D:\.
i have tested several times and compared with SD card access.
there is no problem and 2~4 times faster than SD card.

That's a fantastic result SJ, thanks for letting us know.

Good luck with your project.
Ultibo.org | Make something amazing
https://ultibo.org

Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest