-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some USB drives are not detected #9
Comments
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 iOS<https://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 GitHub<#9>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABGC6KHHOVHFFFM3BVRKCJLUTI4XVANCNFSM5K44Q2NA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://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: ***@***.***>
|
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. 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. |
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. 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. |
Back to the topic. I have a couple of questions for you:
|
|
@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. |
That's great. I tried MsxusbNext and no device was recognised. Gonna check it asap. |
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. |
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) @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. |
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:
* CALL CHGDSK command in BASIC to show the boot menu again and select another disk image.
* Hot-swapping multi-disk volumes.
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 @S0urceror<https://github.com/S0urceror> version which afaik currently is the same as @cristianoag<https://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>
@cristianoag<https://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 GitHub<#9 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABGC6KCA2XQBKDEUEHYP42DUZVR47ANCNFSM5K44Q2NA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://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: ***@***.***>
|
That's great @S0urceror, I created a FAT16 partitiion with several (4) dsks and it works under MSX1. 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) 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. |
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. |
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. I will look into it with more detail. |
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? |
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 GitHub<https://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 unsubscribe<https://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: ***@***.******@***.***>>
|
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. |
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
The error occurs in the line
Also I had to pass and argument, in my case MSX-USB/drivers/MsxUsbNext/macos/main.c Line 31 in 2de667e
|
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 iOS<https://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#L31<https://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 GitHub<https://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 unsubscribe<https://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: ***@***.***>
|
Yes, I had the build folder, but the problem is I am able to compile the linux folder but not the msx folder. |
Now it works, toolchain ready! |
So you flash the arduino with https://github.com/S0urceror/MSX-USB/blob/master/test/usb_via_arduino/src/main.parallel.cpp |
I have downloaded OpenMSX from S0urceror and trying to compile it.
but then
[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. |
I am gonna move installation problems from this issue not to fill this one with other things #11 |
I have just released v0.3 of MSXUSBNext for you to try. v0.3-nxt |
Tested it and it works great! |
It is working ok here as well. With all my pendrives. I think we can close this one. |
Good to see that MSXUSBNext alleviates most of the issues the low-level MSXUSB had with some drives. Closing this issue now. |
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.
The text was updated successfully, but these errors were encountered: