BertoldVdb / ms-tools

Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips.
MIT License
122 stars 12 forks source link

Support for MS2130 #3

Closed matiaspl closed 1 year ago

matiaspl commented 1 year ago

There's a new chip by the same vendor that is capable of 4:2:2 YUV HDMI capture over USB3 (and USB2 in MJPEG), the MS2130. Is there any chance of extending ms-tools to support that one too (provided the HID backend has been reused)? I have a capture device that uses it but it's currently not recogniized by ms-tools.

BertoldVdb commented 1 year ago

Hello,

Maybe.

Can you give me remote access to a system with this device plugged in?

What do you see when you run the current code in debug mode?

Sincerely, Bertold

Op zo 6 nov. 2022 13:59 schreef Mateusz Starzak @.***>:

There's a new chip by the same vendor that is capable of 4:2:2 YUV capture over USB3, the MS2130. Is there any chance of extending ms-tools to support that one too (provided the HID backend has been reused)? I have a capture device that uses it but it's currently not recogniized by ms-tools.

— Reply to this email directly, view it on GitHub https://github.com/BertoldVdb/ms-tools/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQILGPMXEPCLRW45F2B45TWG62TRANCNFSM6AAAAAARYOCMR4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

BertoldVdb commented 1 year ago

Can you point me to a device with this chip I can buy?

Op zo 6 nov. 2022 14:26 schreef Bertold Van den Bergh < @.***>:

Hello,

Maybe.

Can you give me remote access to a system with this device plugged in?

What do you see when you run the current code in debug mode?

Sincerely, Bertold

Op zo 6 nov. 2022 13:59 schreef Mateusz Starzak @.***

:

There's a new chip by the same vendor that is capable of 4:2:2 YUV capture over USB3, the MS2130. Is there any chance of extending ms-tools to support that one too (provided the HID backend has been reused)? I have a capture device that uses it but it's currently not recogniized by ms-tools.

— Reply to this email directly, view it on GitHub https://github.com/BertoldVdb/ms-tools/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQILGPMXEPCLRW45F2B45TWG62TRANCNFSM6AAAAAARYOCMR4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

matiaspl commented 1 year ago

Sure, I can do both :) https://www.aliexpress.com/item/1005004883158574.html

I'll PM you the access details.

matiaspl commented 1 year ago
[root@pc-mateusz cli]# ./cli --vid=345f --pid=2130 list-regions --log-level 5
HAL(3): ROMOut:   00b5f8000000000000
HAL(3): ROMIn:    00b5f8000000000000
Failed to create HAL Unsupported device found
BertoldVdb commented 1 year ago

I took a look at the firmware in the SPI flash and it seems to have the same debug interface as the other MSxxxx chips. It is extended with many more commands though.

matiaspl commented 1 year ago

Dumping the rom and writing it back would be a good start. The "open" firmware enables e.g. 4K low-fps capture which the "stock" doesn't have but I'd like to get back to where I started "just in case".

BertoldVdb commented 1 year ago

What "open" firmware do you mean? I found these two firmwares: https://github.com/YuzukiHD/YuzukiLOHCC-PRO/tree/master/Firmware https://github.com/ultrasemier/ms213x_community/tree/master/firmware

Note that it seems this chip does not use a ROM with the debug interface implementation. It seems possible to flash a firmware that will not allow further flash access. I wonder what the IC will do without valid firmware in the flash.

I bought this dongle, but it will take some time to arrive.

matiaspl commented 1 year ago

I was referring to the one by YuzukiHD - he mentions the 4K mode on the project page IIRC

matiaspl commented 1 year ago

I haven't seen the second repo, thanks for the link!

BertoldVdb commented 1 year ago

I have received the dongle, I will look at it on Saturday.

BertoldVdb commented 1 year ago

Initial support for the MS2130 was added.

Flash IO: (Note that the chip also seems to support a 64kB EEPROM for firmware storage, if this is the case use EEPROM instead of FLASH) Write: ./cli --log-level=7 write-file --verify FLASH 0 YuzukiLOHCCPro.bin Read: ./cli --log-level=7 read FLASH 0 --filename=/tmp/flash.bin

Memory regions: RAM | 65536 | IRAM | 256 | RAM.0000 EEPROM | 65536 | USERCONFIG | 48 | RAM.1FD0 SFR | 128 | B7_0 | 65536 | B7_1 | 65536 | B9 | 512 | FLASH | 65536 |

GPIO support should work as well.

BertoldVdb commented 1 year ago

Did it work for you?

matiaspl commented 1 year ago

Yes, works great. Thank you @BertoldVdb!

BertoldVdb commented 1 year ago

Perfect, could you email me the original firmware for the dongle (vandenbergh@bertold.org), I accidentally deleted it while implementing the flash access.

matiaspl commented 1 year ago

Sure! Doing it right now.

parbzip commented 1 year ago

original firmware for the dongle (parbzip@sute.jp), I accidentally deleted it while implementing the flash access.