MSX-USB icon indicating copy to clipboard operation
MSX-USB copied to clipboard

Installation adventures.

Open issalig opened this issue 3 years ago • 13 comments

I create this not to mix installation problems with other stuff.

issalig avatar Feb 08 '22 18:02 issalig

@cristianoag It asks for a repository

$ sudo apt-get build-dep openmsx
Leyendo lista de paquetes... Hecho
E: Debe poner algún URI «deb-src» en su «sources.list»

issalig avatar Feb 08 '22 18:02 issalig

Well, I finally compiled S0urceror's OpenMSX , in my system I needed sudo apt-get install tcl-dev not libtclcl1-dev I still have to setup download machine roms and more config stuff, but this will be tomorrow. Thanks @cristianoag for your help.

issalig avatar Feb 08 '22 19:02 issalig

Finally, I have everything working. I started a document not to loose all the steps https://github.com/issalig/MSX-USB/blob/master/installation.md It is still work in progress.

issalig avatar Feb 09 '22 10:02 issalig

I found a bug while I was checking my ch376s with https://github.com/S0urceror/MSX-USB/blob/master/test/usb_via_arduino/src/main.parallel.cpp

main_paralell crashed when printing iProd due to a small buffer https://github.com/S0urceror/MSX-USB/blob/2de667e102a2785ea67408f9beaa6fe030070103/test/usb_via_arduino/src/main.parallel.cpp#L1527

In get_string2 https://github.com/S0urceror/MSX-USB/blob/2de667e102a2785ea67408f9beaa6fe030070103/test/usb_via_arduino/src/main.parallel.cpp#L1084 data has size max_packet_size which is 64

But then in data_in_transfer, length is 255 and when being bzeroed it corrupts memory https://github.com/S0urceror/MSX-USB/blob/2de667e102a2785ea67408f9beaa6fe030070103/test/usb_via_arduino/src/main.parallel.cpp#L799

I fixed it by changing this line https://github.com/S0urceror/MSX-USB/blob/2de667e102a2785ea67408f9beaa6fe030070103/test/usb_via_arduino/src/main.parallel.cpp#L1084 to uint8_t* data=(uint8_t*) malloc (255)

Tell me if you are experiencing the same and I will propose a pull request.

issalig avatar Feb 09 '22 13:02 issalig

I believe that bus just a test program. You should focus on the drivers folder.

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


From: issalig @.> Sent: Wednesday, February 9, 2022 10:24:32 AM To: S0urceror/MSX-USB @.> Cc: Cristiano Goncalves @.>; Mention @.> Subject: Re: [S0urceror/MSX-USB] Installation adventures. (Issue #11)

I found a bug while I was checking my ch376s 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%7C9ae290889480474a132008d9ebcf8285%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637800098742589029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=erjA0z7eaBr1c2lu3R1bMcsIR3nJT0ZWuWo%2By%2FiV7d4%3D&reserved=0

main_paralell crashed when printing iProd due to a small buffer https://github.com/S0urceror/MSX-USB/blob/2de667e102a2785ea67408f9beaa6fe030070103/test/usb_via_arduino/src/main.parallel.cpp#L1527https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fblob%2F2de667e102a2785ea67408f9beaa6fe030070103%2Ftest%2Fusb_via_arduino%2Fsrc%2Fmain.parallel.cpp%23L1527&data=04%7C01%7C%7C9ae290889480474a132008d9ebcf8285%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637800098742589029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=PDxHPYlZcR8%2BleWyguBxu%2BtvYWEWs5VPucQD6oKm%2Bk8%3D&reserved=0

In get_string2 https://github.com/S0urceror/MSX-USB/blob/2de667e102a2785ea67408f9beaa6fe030070103/test/usb_via_arduino/src/main.parallel.cpp#L1084https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fblob%2F2de667e102a2785ea67408f9beaa6fe030070103%2Ftest%2Fusb_via_arduino%2Fsrc%2Fmain.parallel.cpp%23L1084&data=04%7C01%7C%7C9ae290889480474a132008d9ebcf8285%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637800098742589029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=U99ODtETcrZ%2BXzLp2fk5ElHRE%2B2dGgnn%2FnWOyiRWw8o%3D&reserved=0 data has size max_packet_size which is 64

But then in https://github.com/S0urceror/MSX-USB/blob/master/test/usb_via_arduino/src/main.parallel.cpp#L799https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fblob%2Fmaster%2Ftest%2Fusb_via_arduino%2Fsrc%2Fmain.parallel.cpp%23L799&data=04%7C01%7C%7C9ae290889480474a132008d9ebcf8285%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637800098742589029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=3cu%2F%2BuuVBFE94UdXzC4OD6IMKvXrb321X%2BalylmFr1Y%3D&reserved=0 length is 255 and when being bzeroed it corrupts memory.

I fixed it by changing https://github.com/S0urceror/MSX-USB/blob/2de667e102a2785ea67408f9beaa6fe030070103/test/usb_via_arduino/src/main.parallel.cpp#L1084https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FS0urceror%2FMSX-USB%2Fblob%2F2de667e102a2785ea67408f9beaa6fe030070103%2Ftest%2Fusb_via_arduino%2Fsrc%2Fmain.parallel.cpp%23L1084&data=04%7C01%7C%7C9ae290889480474a132008d9ebcf8285%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637800098742589029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=U99ODtETcrZ%2BXzLp2fk5ElHRE%2B2dGgnn%2FnWOyiRWw8o%3D&reserved=0 to uint8_t* data=(uint8_t*) malloc (255)

Tell me if you are experiencing the same.

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

cristianoag avatar Feb 09 '22 13:02 cristianoag

Yes, it is only to check wiring and if ch376s is responding and to get properties from the devices.

issalig avatar Feb 09 '22 14:02 issalig

I found a bug while I was checking my ch376s with https://github.com/S0urceror/MSX-USB/blob/master/test/usb_via_arduino/src/main.parallel.cpp

Good catch. Never happened here because the USB strings are usually not so long. I have now changed the setup package to request maximum 64 bytes as well.

And pushed the change back to GitHub.

S0urceror avatar Feb 09 '22 19:02 S0urceror

Finally, I have everything working. I started a document not to loose all the steps https://github.com/issalig/MSX-USB/blob/master/installation.md It is still work in progress.

Nice write up. Would you be okay to merge all your updated instructions with the main once you consider them finished?

S0urceror avatar Feb 09 '22 19:02 S0urceror

Yes of course, that's the idea. I will tell you when It is finished. Also i wrote info about programming the cpld and the flash so everything is documented.

issalig avatar Feb 09 '22 20:02 issalig

I had some problems with openMSX, for some reason it did not communicate with arduino. I compared sources of main.parallel which works correctly and ch376s.cc in openMSX and the main difference is that it does not call tcgetattr, thus I removed tcgetattr from ch376s.cc and now it works good for me.

Have you experienced this behaviour?

https://github.com/S0urceror/openMSX/blob/dd40674cb36805b95b444d464765004d234c7d4e/src/usb/ch376s.cc#L38

issalig avatar Feb 10 '22 15:02 issalig

Hi Issalig,

You can indeed safely remove this. Initially I retrieved the serial attributes, modified only the ones that need changing, and set them. Now that we have bzero afterwards all gets reset. No need to first retrieve the attributes.

Regards,

Mario

From: issalig @.> Date: Thursday, 10 February 2022 at 16:00 To: S0urceror/MSX-USB @.> Cc: S0urceror @.>, Comment @.> Subject: Re: [S0urceror/MSX-USB] Installation adventures. (Issue #11)

I had some problems with openMSX, for some reason it did not communicate with arduino. I compared sources of main.parallel which works correctly and ch376s.cc in openMSX and the main difference is that it does not call tcgetattr, thus I removed tcgetattr from ch376s.cc and now it works good for me.

Have you experienced this behaviour?

https://github.com/S0urceror/openMSX/blob/dd40674cb36805b95b444d464765004d234c7d4e/src/usb/ch376s.cc#L38

— Reply to this email directly, view it on GitHubhttps://github.com/S0urceror/MSX-USB/issues/11#issuecomment-1035022306, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABGC6KBBBYJ6JAEGZKW3TCDU2PHJTANCNFSM5N3JYU6Q. 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 commented.Message ID: @.***>

S0urceror avatar Feb 10 '22 15:02 S0urceror

I just write here as a reminder to change instructions (mainly paths and few other things) to make it work with recent @cristianoag linux support.

issalig avatar Mar 23 '22 15:03 issalig