Homebrew WIP libusbhsfs - USB Mass Storage Class Host + Filesystem Mounter static library.

  • Thread starter Thread starter DarkMatterCore
  • Start date Start date
  • Views Views 46,609
  • Replies Replies 189
  • Likes Likes 61
Just a question - why to patch usb module directly, if boot2 loads and hooks settings before usb. Why not patch there setting, not the module itself?
 
Just a question - why to patch usb module directly, if boot2 loads and hooks settings before usb. Why not patch there setting, not the module itself?
Not really, nope. The boot2 reimplementation from Atmosphère is launched after both USB and FS - all it does is call LaunchPostSdCardBootPrograms() and return right away.

LaunchPostSdCardBootPrograms() then proceeds to launch the rest of the sysmodules, using the AdditionalLaunchPrograms array. At that point, it's already too late to enable USB 3.0 support using the settings flag - I did try hardcoding the flag into ams_mitm, but it didn't work.
 
Meh, I should just integrate usb 3.0 enable shit into ams. I'll do that today.

Merged usb 3.0 enable stuff into ams-master, from next release onwards usb!usb30_force_enabled in system_settings.ini will work as expected when booting via fusee.

Hekate will need to get support for this to work when booting via hekate, I'll contact CTCaer about it.
 
Merged usb 3.0 enable stuff into ams-master, from next release onwards usb!usb30_force_enabled in system_settings.ini will work as expected when booting via fusee.

Hekate will need to get support for this to work when booting via hekate, I'll contact CTCaer about it.
Thank you for going out of your way and making it easier for anyone to enable this flag. I truly appreciate it.

I also saw you added a new config item to Exosphère - a very nice addition, indeed.
 
I see

--------------------- MERGED ---------------------------

How can I check that setting applied at correct time?

Atmosphere with latest commit, usb30_force_enabled in config, loaded through fusee, but USBView still shows:
Is Port User Connectable: yes
Is Port Debug Capable: no
Companion Port Number: 1
Companion Hub Symbolic Link Name: USB#ROOT_HUB30#5&4087d53&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
Protocols Supported:
USB 1.1: yes
USB 2.0: yes
USB 3.0: no
 
I see

--------------------- MERGED ---------------------------

How can I check that setting applied at correct time?

Atmosphere with latest commit, usb30_force_enabled in config, loaded through fusee, but USBView still shows:
Is Port User Connectable: yes
Is Port Debug Capable: no
Companion Port Number: 1
Companion Hub Symbolic Link Name: USB#ROOT_HUB30#5&4087d53&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
Protocols Supported:
USB 1.1: yes
USB 2.0: yes
USB 3.0: no
Are you properly setting USB3 device, configuration, interface and endpoint descriptors? Are you sure you're using a USB3-capable USB-C cable?
 
setting device through latest libnx usb_comms.
the same cable and port shows usb3: yes for external drive.

--------------------- MERGED ---------------------------

Also, AFAIK system first selects highest available speed reported by device and only after that asks for descriptors.

--------------------- MERGED ---------------------------

Test also simpliest:
Code:
int main(int argc, char **argv)
{
    consoleInit(NULL);

    usbCommsInitialize();

    // Main loop
    while(appletMainLoop())
    {
        //Scan all the inputs. This should be done once for each frame
        hidScanInput();

        //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
        u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);

        if (kDown & KEY_PLUS) break; // break in order to return to hbmenu

        consoleUpdate(NULL);
    }

    consoleExit(NULL);
    return 0;
}
 
Try manually setting up USB3 descriptors. Personally, I'm not too fond of using usbComms - I prefer to manually deal with the descriptors myself.

--------------------- MERGED ---------------------------

By the way, you can check if the USB3 flag is enabled by checking the new SMC config item via splGetConfigItem().
 
setting device through latest libnx usb_comms.
the same cable and port shows usb3: yes for external drive.

--------------------- MERGED ---------------------------

Also, AFAIK system first selects highest available speed reported by device and only after that asks for descriptors.

--------------------- MERGED ---------------------------

Test also simpliest:
Code:
int main(int argc, char **argv)
{
    consoleInit(NULL);

    usbCommsInitialize();

    // Main loop
    while(appletMainLoop())
    {
        //Scan all the inputs. This should be done once for each frame
        hidScanInput();

        //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
        u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);

        if (kDown & KEY_PLUS) break; // break in order to return to hbmenu

        consoleUpdate(NULL);
    }

    consoleExit(NULL);
    return 0;
}

You should not use libnx usbcomms, for multiple reasons. I see it as really just proof of concept code.
 
You can access it at any moment from HOS via spl.
I mean, then this flag reflect this value read while boot2 process, not later by set.mitm.

You should not use libnx usbcomms, for multiple reasons. I see it as really just proof of concept code.
I know that. I think it enough just to test USB3 capabilities.

--------------------- MERGED ---------------------------

@DarkMatterCore do you have example of correct USB3 Device descriptor?
 
You should not use libnx usbcomms, for multiple reasons. I see it as really just proof of concept code.

as the author of the libnx usbcomms code, pretty much this. I don't recommend using it.

USB 3.0 definitely works fine with usb:ds, when testing with the work-in-progress ams.tma code:

upload_2021-3-3_6-16-40.png


and the flag retrieved via spl will tell you if support is enabled, I don't know why you're confused about when it's set/etc. It's set by fusee, and never changeable without editing system_settings.ini and rebooting.
 

Site & Scene News

Popular threads in this forum