S0urceror / MSX-USB

Schematics, drivers, debug tools, to make USB devices on the MSX a reality
GNU General Public License v2.0
65 stars 18 forks source link

Some USB drives are not detected #9

Closed issalig closed 2 years ago

issalig commented 2 years ago

I have been able to connect with usb drives with the following values l usb -v | grep bEndpointAddress

WORK bEndpointAddress 0x01 EP 1 OUT bEndpointAddress 0x82 EP 2 IN

WORK bEndpointAddress 0x01 EP 1 OUT bEndpointAddress 0x81 EP 1 IN

DOES NOT WORK bEndpointAddress 0x81 EP 1 IN bEndpointAddress 0x02 EP 2 OUT

I checked the one that does not work under serial protocol ch376s and it works and for parallel I can read the FAT type so I assume hardware is ok and the problem is in the rom code.

I have modified the rom and I am printing the communication with ch376s for working and non working usbs. However, this is a tedious process (modify code,flash memory with tl866, extract memory, insert into cartridge, power up, test) and I do not still have a solution. How do you do the development? From the video you sent, it looks like you are simulating it, FPGA?

Excuse for my ignorance, but given for the use case that there is only one device, I think it should be an easier way to bind it to 1. Other projects just set address to 1 0x45 0x01, then select device 1 0x13 0x01 and configuration 1 0x49 0x01

I would like to contribute to your project by fixing this bug/feature but I do not know exactly where else to look.

S0urceror commented 2 years ago

I saw you mentioned this on your GitHub. I haven’t come across this but maybe my endpoints on all 5 or so usb sticks where all the same.

In my setup I have a CH376s module on a breadboard connected to a Teensy. The Teensy is just kind of a relay to the CH376s. Then I have patched OpenMSX to have a virtual MSXUSB cartridge that sends the commands to the Teensy.

This way it behaves like in a real MSX with some timing differences. This enables me to load up everything and also use the OpenMSX debugger. I even rolled my own version of Dezog so that I can step through my assembly code in Visual Studio Code.

Maybe I should make a full write up of this.

PS. I will make a Mac and Windows build of OpenMSX and share it on GitHub this way you can maybe also take the Arduino route and create an emulator.

PS2. While I’m at it I will also check what the endpoint issue is.

Get Outlook for iOShttps://aka.ms/o0ukef


From: issalig @.> Sent: Tuesday, December 28, 2021 11:45:14 PM To: S0urceror/MSX-USB @.> Cc: Subscribed @.***> Subject: [S0urceror/MSX-USB] USB drive support (Issue #9)

I have been able to connect with usb drives with the following values l usb -v | grep bEndpointAddress

WORK bEndpointAddress 0x01 EP 1 OUT bEndpointAddress 0x82 EP 2 IN WORK bEndpointAddress 0x01 EP 1 OUT bEndpointAddress 0x81 EP 1 IN

DOES NOT WORK bEndpointAddress 0x81 EP 1 IN bEndpointAddress 0x02 EP 2 OUT

I checked the one that does not work under serial protocol ch376s and it works for parallel I can read the FAT type so I assume hardware is ok and the problem is in the rom.

I have modified the rom and I am printing the communication with ch376s for working and non working usbs. However, this is a tedious process (modify code,flash memory with tl866, extract memory, insert into cartridge, power up, test) and I do not still have a solution. How do you do the development? From the video you sent, it looks like you are simulating it, FPGA?

— Reply to this email directly, view it on GitHubhttps://github.com/S0urceror/MSX-USB/issues/9, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABGC6KHHOVHFFFM3BVRKCJLUTI4XVANCNFSM5K44Q2NA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.***>

issalig commented 2 years ago

Wow, it is such a great development framework (mine is a poor-man framework: make, gedit, call PRINT and minipro :) ) and yes documenting is a good idea even that is the less interesting part. So I understand that the teensy is basically and USB to parallel link for the ch376s, neat.

If you like I can send you one of the problematic usbs as well as my pcb version so that you can test it. Just give me an address and you will have it in some days. This is also my way to thank you for the project.

S0urceror commented 2 years ago

This shows my setup in photo's. On the left the Teensy 3.5 and on the right the Teensy 2.0. These are 5v compatible Arduino type of boards.

IMG_0229 IMG_0232

Would be great to test the problematic devices and solve the issue. This way we solve it for everyone. I am happy to share my address with you but prefer to use email for that. Send me an email to the address found on msx.org and we'll exchange details.

S0urceror commented 2 years ago

Back to the topic. I have a couple of questions for you:

issalig commented 2 years ago
cristianoag commented 2 years ago

@issalig , I've been working with @S0urceror and had exactly the same issues you have. With his original code only one USB drive was working ok out of my 12. Then I made a small change on the code just to wait indefinitely for the CH376s interruption. S0urceror was following the specification and waiting 100 cycles for the interruption. I found out that some of the pen drives I have were a lot slower and were making the CH376 generate the interruption just after 1000 cycles. I then changed the code to loop until it gets the interruption and voila... 9 out of the 12 original set are now working ok. The other 3 are not even recognized by the CHS376.

I'm using S0urceror vNext code and changing the ch376_wait_status function. If you want to take a look on the change I made please check https://github.com/cristianoag/MSX-USB/blob/master/drivers/MsxUsbNext/generic/ch376s.c

Hope that helps.

issalig commented 2 years ago

That's great. I tried MsxusbNext and no device was recognised. Gonna check it asap.

cristianoag commented 2 years ago

Yes, I had that error as well. Format your USB stick with FAT16, copy a few DSK files and use this version https://github.com/cristianoag/MSX-USB/blob/master/drivers/MsxUsbNext/msx/dist/nextor.rom

It will recognize it and show the files ok.

From: issalig @.> Sent: Friday, February 4, 2022 5:14 PM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Comment @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

That's great. I tried MsxusbNext and no device was recognised. Gonna check it asap.

- Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fissues%2F9%23issuecomment-1030316353&data=04%7C01%7C%7C0362bb2f53d1403b871908d9e81adc23%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796024325846407%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=0tju%2FiVPmJFAAhz5zK5nLXXqBNgFk6Uv1GRexpwzs7M%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALSAPKQ2GODNWUEFARRH5CTUZQXP5ANCNFSM5K44Q2NA&data=04%7C01%7C%7C0362bb2f53d1403b871908d9e81adc23%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796024325846407%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2Bj0Dleojc8wS8DXrhSNvCgy6YeupJTVnT2vB3nG8eZc%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>

S0urceror commented 2 years ago

I've just pushed my latest MSXUSBNext updates to GitHub. Followed Cristiano's lead and removed the 100 time try-out counter as well. Beware this can lead to lock-ups when the CH376s decides to not respond at all. Let's test this in practise and see if we keep this or not.

issalig commented 2 years ago

I tried @S0urceror version which afaik currently is the same as @cristianoag and NOW it works with all my devices! Well done guys.

With a FAT12 if I select 1.Floppy disk it ends up with a "No enough memory" (which I suppose is correct) Pressing 2 says "Full disk mode" and everything works.

imagen

@cristianoag, as I am using a MSX1 with less that 128Kb, I cannot use FAT16 (which is supported by nextor in MSX1)

I am wondering if it could be added some SRAM memory to the board. As far as I know it would only be necessary a chip like HM628512A (for 512k) and some verilog code for the mapper as it is done for the rom, right?. I am a msx noob and I still need to understand this system well. If you can point me to the right direction I will be happy to hear from you.

cristianoag commented 2 years ago

Format the usb drive with fat16 and save a few dsk files. As you’re using msx1 I believe those need to be 720k in size. I think even with msx1 ch376 will be able to read all files and the code will mount your small dsk files as msx1 disks.

The issue I see now is because the menu is just for 9 files and with msx1 dsks and 4gb you may have hundreds of disks. lol

Time to rethink the menu!

Get Outlook for iOShttps://aka.ms/o0ukef


From: issalig @.> Sent: Saturday, February 5, 2022 3:11:27 PM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

I tried @S0urcerorhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=6Ap9mndgqOmCbv6o5iejEkuHnHs2EkMBUlOAx4MsfZY%3D&reserved=0 version which afaik currently is the same as @cristianoaghttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcristianoag&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1XBHHMUkX8Gu7A4w87PjrmWVUwXDeVv8%2B2G1zYIx%2BTo%3D&reserved=0 and NOW it works! Well done guys.

With a FAT12 if I select 1.Floppy disk it ends up with a "No enough memory" (which I suppose is correct) Pressing 2 says "Full disk mode" and everything works.

[imagen]https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F7136948%2F152653218-c58301f0-0db0-49d5-b3ae-e6cdb3b4b287.png&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=28fmJGRkxETc6WbGoiak9XNvmnhe5hj%2By%2FBaMw7HXaE%3D&reserved=0

@cristianoaghttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcristianoag&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1XBHHMUkX8Gu7A4w87PjrmWVUwXDeVv8%2B2G1zYIx%2BTo%3D&reserved=0, as I am using a MSX1 with less that 128Kb, I cannot use FAT16 (which is supported by nextor in MSX1)

I am wondering if it could be added some SRAM memory to the board. As far as I know it would only be necessary a chip like HM628512A (for 512k) and some verilog code for the mapper as it is done for the rom, right?. I am a msx noob and I still need to understand this system well. If you can point me to the right direction I will be happy to hear from you.

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fissues%2F9%23issuecomment-1030672437&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=4oHG0Hz1O6lmJG%2BxyONrpg12BrUYwHE8T9DRh47ADlk%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALSAPKR4J4NALG5APJJMO6TUZVR47ANCNFSM5K44Q2NA&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=uf1Tw0qIvLO3pVKCo0rPly8w0suvZnWMrrShkZUxspw%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

S0urceror commented 2 years ago

Happy to get this news Issalig!

The floppy option should continue the normal boot sequence and detect the built-in floppy. But if you don’t have one this fails probably. Let me check if we can do this a bit more gracefully.

720KB disk images saved as .DSK files in the root or DSKS folder of the FAT16/32 formatted USB drive should appear as a nice list under options 1. and 2.

I keep updating MSXUSBNext the next couple of weeks so keep an eye out for some updates. The following I want to do:

On the cartridge you should be able to include SRAM but you need probably a bigger Altera with more pins for this. If you want it to be compatible with the MSX2 mapper it needs to listen to address 0xFFFF and for that you need all address lines A0 to A15 and the MEMRQ signal. With a piece of software from Konamiman you can then use all the memory banks on the MSX1 as well. Alternatively you can implement the MegaRAM system or even simpler distribute 256KBs of RAM across 4 subslots. Sofarom support MSX2 compatible mappers and MegaRAM compatible expansions.

From: issalig @.> Date: Saturday, 5 February 2022 at 19:11 To: S0urceror/MSX-USB @.> Cc: S0urceror @.>, Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

I tried @S0urcerorhttps://github.com/S0urceror version which afaik currently is the same as @cristianoaghttps://github.com/cristianoag and NOW it works! Well done guys.

With a FAT12 if I select 1.Floppy disk it ends up with a "No enough memory" (which I suppose is correct) Pressing 2 says "Full disk mode" and everything works.

[imagen]https://user-images.githubusercontent.com/7136948/152653218-c58301f0-0db0-49d5-b3ae-e6cdb3b4b287.png

@cristianoaghttps://github.com/cristianoag, as I am using a MSX1 with less that 128Kb, I cannot use FAT16 (which is supported by nextor in MSX1)

I am wondering if it could be added some SRAM memory to the board. As far as I know it would only be necessary a chip like HM628512A (for 512k) and some verilog code for the mapper as it is done for the rom, right?. I am a msx noob and I still need to understand this system well. If you can point me to the right direction I will be happy to hear from you.

— Reply to this email directly, view it on GitHubhttps://github.com/S0urceror/MSX-USB/issues/9#issuecomment-1030672437, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABGC6KCA2XQBKDEUEHYP42DUZVR47ANCNFSM5K44Q2NA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

S0urceror commented 2 years ago

I have updated the menu to have 26 entries A-Z. I will try to get some navigation implemented and include an option to change the disk from Basic. Then you can mount all dsks files you want.

From: Cristiano Goncalves @.> Date: Saturday, 5 February 2022 at 20:43 To: S0urceror/MSX-USB @.> Cc: S0urceror @.>, Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9) Format the usb drive with fat16 and save a few dsk files. As you’re using msx1 I believe those need to be 720k in size. I think even with msx1 ch376 will be able to read all files and the code will mount your small dsk files as msx1 disks.

The issue I see now is because the menu is just for 9 files and with msx1 dsks and 4gb you may have hundreds of disks. lol

Time to rethink the menu!

Get Outlook for iOShttps://aka.ms/o0ukef


From: issalig @.> Sent: Saturday, February 5, 2022 3:11:27 PM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

I tried @S0urcerorhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=6Ap9mndgqOmCbv6o5iejEkuHnHs2EkMBUlOAx4MsfZY%3D&reserved=0 version which afaik currently is the same as @cristianoaghttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcristianoag&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1XBHHMUkX8Gu7A4w87PjrmWVUwXDeVv8%2B2G1zYIx%2BTo%3D&reserved=0 and NOW it works! Well done guys.

With a FAT12 if I select 1.Floppy disk it ends up with a "No enough memory" (which I suppose is correct) Pressing 2 says "Full disk mode" and everything works.

[imagen]https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F7136948%2F152653218-c58301f0-0db0-49d5-b3ae-e6cdb3b4b287.png&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=28fmJGRkxETc6WbGoiak9XNvmnhe5hj%2By%2FBaMw7HXaE%3D&reserved=0

@cristianoaghttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcristianoag&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1XBHHMUkX8Gu7A4w87PjrmWVUwXDeVv8%2B2G1zYIx%2BTo%3D&reserved=0, as I am using a MSX1 with less that 128Kb, I cannot use FAT16 (which is supported by nextor in MSX1)

I am wondering if it could be added some SRAM memory to the board. As far as I know it would only be necessary a chip like HM628512A (for 512k) and some verilog code for the mapper as it is done for the rom, right?. I am a msx noob and I still need to understand this system well. If you can point me to the right direction I will be happy to hear from you.

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fissues%2F9%23issuecomment-1030672437&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=4oHG0Hz1O6lmJG%2BxyONrpg12BrUYwHE8T9DRh47ADlk%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALSAPKR4J4NALG5APJJMO6TUZVR47ANCNFSM5K44Q2NA&data=04%7C01%7C%7Cecfe4c0e4aec47f7eada08d9e8d2ee97%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637796814922809265%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=uf1Tw0qIvLO3pVKCo0rPly8w0suvZnWMrrShkZUxspw%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/S0urceror/MSX-USB/issues/9#issuecomment-1030687490, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABGC6KAA5WA5ARVP72R2DC3UZV4XRANCNFSM5K44Q2NA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

issalig commented 2 years ago

That's great @S0urceror, I created a FAT16 partitiion with several (4) dsks and it works under MSX1. @cristianoag at the beginning I did not understand how it worked, now I understand that the rom interprets dsk file. Well done!

About the delay that for some usbs is long and for others short I was thinking about a calibrarion method, I mean, start with short delay and if it does not work increase it until usb is detected (it can be a maximum of course that will say, no usb detected) Then store this time as the device response time and use it for all the session. What do you think?

This weekend I have no free time (I am studying for a Portuguese exam but maybe reading MSX brazilian forums could work both for studying and for procrastinating, nice! ) but in the middle of the week I hope to get some time and study the new msxusbnext development you've done is the last days and try to see if this calibration idea could work.

S0urceror commented 2 years ago

Just implemented CALL MOUNTDSK in BASIC. This shows the selection again and allows you to choose another disk image. Disk images are in the root folder or in the DSKS folder of the FAT16/32 formatted USB drive.

issalig commented 2 years ago

I noticed there the system was super-slow, characters appeared >500ms after the keypress. I am not sure if this is related to the delay introduced here or some problem with my machine. https://github.com/S0urceror/MSX-USB/blob/master/drivers/MsxUsbNext/generic/ch376s.c#L58

I will look into it with more detail.

S0urceror commented 2 years ago

No, you shouldn't have any problems with keypresses. What I changed here is not to exit the wait routine after 100 attempts. In some cases with older USB devices this is too fast. But again that has nothing to do with keypresses.

Where you talking about keypresses in general like in DOS or BASIC? Or the response after pressing the key to select an image after the start screen?

cristianoag commented 2 years ago

That loop has nothing to do with decay after keypresses as those don't generate/wait for CH376 interruptions. It is something else...

From: S0urceror @.> Sent: Monday, February 7, 2022 2:03 PM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

No, you shouldn't have any problems with keypresses. What I changed here is not to exit the wait routine after 100 attempts. In some cases with older USB devices this is too fast. But again that has nothing to do with keypresses.

Where you talking about keypresses in general like in DOS or BASIC? Or the response after pressing the key to select an image after the start screen?

- Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fissues%2F9%23issuecomment-1031699002&data=04%7C01%7C%7C1a9985ac90ad4234c8b508d9ea5ba0cb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637798501529447092%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Oy%2FsJxQNCO6LlpiSz0AkPgRd01cdvUkkSOOxFdAhP2s%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALSAPKUJWWYGVF67TCIUO3LUZ73KNANCNFSM5K44Q2NA&data=04%7C01%7C%7C1a9985ac90ad4234c8b508d9ea5ba0cb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637798501529447092%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=14OQKqC9tIHPcL9E02TJ7%2Fw4mmr1%2BqzXYQ2%2BSWSTdEs%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.**@.>>

issalig commented 2 years ago

It is both with BASIC and MSDOS when I press a key it take a lot to appear in the screen. IDK, maybe some bad contact in the cartridge slot causes some signal. And yes, I am almost sure is just related to my machine.

issalig commented 2 years ago

Got some time and I am trying to compile msxusbnext (under linux) but for some reason when compiling msx folder I find .lk files are not generated.

Makefile dry.run shows these commands but I cannot see any specific to .lk or .ihx

$ make -n
sdasz80 -o objs/msxromcrt0.rel msxromcrt0.s 
sdcc --verbose -mz80 -c -DNODEBUG -o objs/driver.rel driver.c 
sdcc --verbose -mz80 -c -DNODEBUG -o objs/ch376s.rel ../generic/ch376s.c    
sdcc --verbose -mz80 -c -DNODEBUG -o objs/hal.rel hal.c 
sdcc --verbose -mz80 -c -DNODEBUG -o objs/usbdisk.rel ../generic/usbdisk.c  
sdcc -mz80 --code-loc 0x4200 --data-loc 0xc800 --no-std-crt0 -o build/driver.ihx objs/msxromcrt0.rel objs/driver.rel objs/ch376s.rel objs/hal.rel objs/usbdisk.rel 
hex2bin -e rom build/driver.ihx
sjasmplus --fullpath --raw=build/chgbnk.bin --sym=build/chgbnk.sym --lst=build/chgbnk.lst chgbnk.asm 
sjasmplus --fullpath --raw=build/extra1k.dat --sym=build/extra1k.sym --lst=build/extra1k.lst extra1k.asm
./kernel/mknexrom ./kernel/Nextor-2.1.0.base.dat ./dist/nextor.rom \
                        /d:./build/driver.rom /m:./build/chgbnk.bin \
                        /e:./build/extra1k.dat

The error occurs in the line sdcc -mz80 --code-loc 0x4200 --data-loc 0xc800 --no-std-crt0 -o build/driver.ihx objs/msxromcrt0.rel objs/driver.rel objs/ch376s.rel objs/hal.rel objs/usbdisk.rel

sdcc: Generating code...
sdcc: Calling assembler...
sdcc: sdasz80 -plosgffw objs/usbdisk.rel objs/usbdisk.asm
sdcc -mz80 --code-loc 0x4200 --data-loc 0xc800 --no-std-crt0 -o build/driver.ihx objs/msxromcrt0.rel objs/driver.rel objs/ch376s.rel objs/hal.rel objs/usbdisk.rel 
at 1: error 4: 'fopen' failed on file 'build/driver.lk'
make: *** [Makefile:43: build/driver.ihx] Error 1

Also I had to pass and argument, in my case true to this line because compiler reports an error. https://github.com/S0urceror/MSX-USB/blob/2de667e102a2785ea67408f9beaa6fe030070103/drivers/MsxUsbNext/macos/main.c#L31

cristianoag commented 2 years ago

You need to create the build folders. I already ported the makefiles and everything needed to Linux. Also did the changes to makefiles to use gcc, etc. check my GitHub.

Get Outlook for iOShttps://aka.ms/o0ukef


From: issalig @.> Sent: Tuesday, February 8, 2022 7:16:53 AM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

Got some time and I am trying to compile msxusbnext (under linux) but for some reason when compiling msx folder I find .lk files are not generated.

Makefile dry.run shows this commands but I cannot see any specific to .lk or .ihx

$ make -n sdasz80 -o objs/msxromcrt0.rel msxromcrt0.s sdcc --verbose -mz80 -c -DNODEBUG -o objs/driver.rel driver.c sdcc --verbose -mz80 -c -DNODEBUG -o objs/ch376s.rel ../generic/ch376s.c sdcc --verbose -mz80 -c -DNODEBUG -o objs/hal.rel hal.c sdcc --verbose -mz80 -c -DNODEBUG -o objs/usbdisk.rel ../generic/usbdisk.c sdcc -mz80 --code-loc 0x4200 --data-loc 0xc800 --no-std-crt0 -o build/driver.ihx objs/msxromcrt0.rel objs/driver.rel objs/ch376s.rel objs/hal.rel objs/usbdisk.rel hex2bin -e rom build/driver.ihx sjasmplus --fullpath --raw=build/chgbnk.bin --sym=build/chgbnk.sym --lst=build/chgbnk.lst chgbnk.asm sjasmplus --fullpath --raw=build/extra1k.dat --sym=build/extra1k.sym --lst=build/extra1k.lst extra1k.asm ./kernel/mknexrom ./kernel/Nextor-2.1.0.base.dat ./dist/nextor.rom \ /d:./build/driver.rom /m:./build/chgbnk.bin \ /e:./build/extra1k.dat

The error occurs in the line sdcc -mz80 --code-loc 0x4200 --data-loc 0xc800 --no-std-crt0 -o build/driver.ihx objs/msxromcrt0.rel objs/driver.rel objs/ch376s.rel objs/hal.rel objs/usbdisk.rel

sdcc: Generating code... sdcc: Calling assembler... sdcc: sdasz80 -plosgffw objs/usbdisk.rel objs/usbdisk.asm sdcc -mz80 --code-loc 0x4200 --data-loc 0xc800 --no-std-crt0 -o build/driver.ihx objs/msxromcrt0.rel objs/driver.rel objs/ch376s.rel objs/hal.rel objs/usbdisk.rel at 1: error 4: 'fopen' failed on file 'build/driver.lk' make: *** [Makefile:43: build/driver.ihx] Error 1

Also I had to pass and argument, in my case true to this line because compiler reports an error. https://github.com/S0urceror/MSX-USB/blob/2de667e102a2785ea67408f9beaa6fe030070103/drivers/MsxUsbNext/macos/main.c#L31https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fblob%2F2de667e102a2785ea67408f9beaa6fe030070103%2Fdrivers%2FMsxUsbNext%2Fmacos%2Fmain.c%23L31&data=04%7C01%7C%7Cb728b13cf5c3490a18dd08d9eaec2136%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799122158061008%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=XwiFwyZQOCMy%2BHsbCxZNqnbB4q%2FSWc%2FW0bgE2J6EPBU%3D&reserved=0

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fissues%2F9%23issuecomment-1032440156&data=04%7C01%7C%7Cb728b13cf5c3490a18dd08d9eaec2136%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799122158061008%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Aa6a05VMOLvq4qRDqzNzgfIyNQq9g5S0GKgunX%2Bjk8k%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALSAPKXDKW5EVQ4VODEYY6DU2DURLANCNFSM5K44Q2NA&data=04%7C01%7C%7Cb728b13cf5c3490a18dd08d9eaec2136%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799122158061008%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=qd98KnCnyWVBsvWXoK2PChvLPVLBBXm3XilyhvHurPg%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

issalig commented 2 years ago

Yes, I had the build folder, but the problem is I am able to compile the linux folder but not the msx folder. Can you try rm obj/* and make from the msx folder?

cristianoag commented 2 years ago

Mine work just fine. I also changed the makefile to clean everything appropriately.

Get Outlook for iOShttps://aka.ms/o0ukef


From: issalig @.> Sent: Tuesday, February 8, 2022 8:16:04 AM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

Yes, I had the build folder, but the problem is I am able to compile the linux folder but not the msx folder. Can you try rm obj/* and make from the msx folder?

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fissues%2F9%23issuecomment-1032494515&data=04%7C01%7C%7C109f01252f9a413a4bf308d9eaf46586%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799157665730302%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=KuLtV8LSeOSaPY1LiOQWQSY%2BbOkCZn6pkczgc3WIV84%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALSAPKTTQCEHF7DNU3H2OIDU2D3PJANCNFSM5K44Q2NA&data=04%7C01%7C%7C109f01252f9a413a4bf308d9eaf46586%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799157665730302%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=wixR6HJ3QIRETEdi%2BxpxRoeJJ7AcC2ZtEORMxV8zEL4%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

issalig commented 2 years ago

Now it works, toolchain ready!

cristianoag commented 2 years ago

Now you need to build this.

20220205_011647106_iOS

From: issalig @.> Sent: Tuesday, February 8, 2022 10:03 AM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

Now it works, toolchain ready!

- Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fissues%2F9%23issuecomment-1032583908&data=04%7C01%7C%7C09e4ad16c6da4c6ffea608d9eb034621%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799221561564180%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=QSB1NmpRe7jzvVeoyPM3Yt6Bv%2Borxqpon86bVbAadxU%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALSAPKVQ7GOLWRZ3CVGRYOTU2EH6TANCNFSM5K44Q2NA&data=04%7C01%7C%7C09e4ad16c6da4c6ffea608d9eb034621%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799221561564180%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=fnK0UNF4X%2FlHGf9Q8f8yS6u31VfzYDY2nidRPfMBZ34%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.**@.>>

issalig commented 2 years ago

So you flash the arduino with https://github.com/S0urceror/MSX-USB/blob/master/test/usb_via_arduino/src/main.parallel.cpp And then how do you connect it to OpenMSX?

cristianoag commented 2 years ago

No. Use this sketch MSX-USB/noobtocol.parallel.ino at master * S0urceror/MSX-USB (github.com)https://github.com/S0urceror/MSX-USB/blob/master/hardware/arduino/noobtocol.parallel/noobtocol.parallel.ino.

Configure the pins accordingly and change the CH_** on the sketch depending on how many you have available/board/etc.

Then you need to edit the xml of the machine you are going to use to emulate and include:

From: issalig @.> Sent: Tuesday, February 8, 2022 2:03 PM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

So you flash the arduino with https://github.com/S0urceror/MSX-USB/blob/master/test/usb_via_arduino/src/main.parallel.cpphttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fblob%2Fmaster%2Ftest%2Fusb_via_arduino%2Fsrc%2Fmain.parallel.cpp&data=04%7C01%7C%7C2b5f2752a41f485c1ab408d9eb24dc52%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799365813245380%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Y%2B4eH5l3H%2FhiMYOiu9lAWY1aPS6Hzzv0%2FWcPh9lG8SQ%3D&reserved=0 And then how do you connect it to OpenMSX?

- Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fissues%2F9%23issuecomment-1032848038&data=04%7C01%7C%7C2b5f2752a41f485c1ab408d9eb24dc52%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799365813245380%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=tFEz4ZZhZcKGytMDrzxZyDJdyhvH1evOda1qDI%2FWiOE%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALSAPKVFYT2PEOP5YG7ODWDU2FEEFANCNFSM5K44Q2NA&data=04%7C01%7C%7C2b5f2752a41f485c1ab408d9eb24dc52%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799365813245380%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=C6g%2F%2FNuBIBV%2FKe6KOpeA0SxK0F6LLLXKflC6twvsmdo%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.**@.>>

issalig commented 2 years ago

I have downloaded OpenMSX from S0urceror and trying to compile it. @cristianoag I am having problems with libtclcl1-dev
I install them through

sudo apt-get install  libtclcl1-dev

but then ./configure does not find them

  Tcl:              no

[EDIT] I solved libsdl2-ttf-dev looking at the log derived/x86_64-linux-opt/config/probe.log and including libfreetype-dev which is also needed.

cristianoag commented 2 years ago

Run

sudo apt-get build-dep openmsx

Get Outlook for iOShttps://aka.ms/o0ukef


From: issalig @.> Sent: Tuesday, February 8, 2022 3:37:52 PM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Mention @.> Subject: Re: [S0urceror/MSX-USB] Some USB drives are not detected (Issue #9)

I have downloaded OpenMSX from S0urceror and trying to compile it. @cristianoaghttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcristianoag&data=04%7C01%7C%7C65cbe20c2a064483bd3108d9eb321df4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799422752076510%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2BhumIoqo6hyiWf4ulQt3jJfHD0YD5Sri0Ouj5NUWhxc%3D&reserved=0 I am having problems with libdsl2-ttf-dev and libtclcl1-dev I install them through

sudo apt-get install libdsl2-ttf-dev and libtclcl1-dev

but then ./configure does not find them

... SDL2: version 2.0.10 SDL2_ttf: no Tcl: no zlib: version 1.2.11 ...

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fissues%2F9%23issuecomment-1032937644&data=04%7C01%7C%7C65cbe20c2a064483bd3108d9eb321df4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799422752232723%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=jxzIFSvbMJue8XNltw0E7i6AAOuPCxsQ7b5b7hZ8IaM%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALSAPKRV5R5WI4MI7MBNCBDU2FPIBANCNFSM5K44Q2NA&data=04%7C01%7C%7C65cbe20c2a064483bd3108d9eb321df4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637799422752232723%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=FFIhGmgSwU4P5KeG0KEi8TlsAj9jF1Tb%2BayxP7hn3MA%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

issalig commented 2 years ago

I am gonna move installation problems from this issue not to fill this one with other things https://github.com/S0urceror/MSX-USB/issues/11

S0urceror commented 2 years ago

I have just released v0.3 of MSXUSBNext for you to try. v0.3-nxt

issalig commented 2 years ago

Tested it and it works great!

cristianoag commented 2 years ago

It is working ok here as well. With all my pendrives. I think we can close this one.

S0urceror commented 2 years ago

Good to see that MSXUSBNext alleviates most of the issues the low-level MSXUSB had with some drives. Closing this issue now.