eerimoq / simba

Simba Embedded Programming Platform.
Other
341 stars 64 forks source link

Pro Micro blink example not working #208

Open mindforger opened 5 years ago

mindforger commented 5 years ago

Using Windows 10 with Arduino 1.8.9 here, searching for a solution to get multiple COM Ports + HID Keyboard/Mouse/Gamepad

downloaded the Board, selected Simba -> Pro Micro selected Examples -> Simba -> Blink

upload over a once Arduino Blink Sample

upload finishes, bootloader pops up, vanishes and is replaced with an unknown device due to an identification error and no LED blinking

i can revive the board by repeatedly hitting the reset button (added one for that purpose, bootloader reset can't work without proper serial port) and releasing in just the right moment when trying to flash back the arduino blink sample

so i am pretty sure the code does not work alltogehter (because of the not blinking LED) but i still get some sort of device recognized

VID 000 PID 0003

i also double checked to get a grip of your "pin_device" order (this should seriously be explained somewhere) that it is actually PC0 aka D17 aka RX LED and redid the Arduino Blink Example with it as it uses D13 by default and it does actually blink fine!

eerimoq commented 5 years ago

I'm sorry, but I don't have time to help you. I hope you figure it out.

mindforger commented 5 years ago

i guess i've seen something similar using the Raspberry Pi as GAdget, you seem to miss just a few bits of information on the usb descriptor to make it run under windows

edit1: can you hint me where i should search to compare your usb setup with the arduino one? they are working so i want to check if i can adapt

edit2: arduino is giving me a hard time to find their USB stuff :( but i found that you subclass and protocol are both zero, which i remember was part of the issue, but editing them in the board files to 0xEF02 and 0x01 like described here https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/enumeration-of-the-composite-parent-device did not help

edit3: https://github.com/arduino/Arduino/commit/40e7b1db39009123f019ecc0d3f4605bbc4a9158 found "something" but can't wrap my head around it :(

edit4: folding my hands, maybe somebody else can wrap it's head around it, i set class to 0x02, subclass to 0xef and protocol to 0x01 and also changed the PID to 0x8036 because leonardo shows as 0x8036 not 0x8037 in the original blink sample but i am still getting error device identification

maybe i have more luck with another attempt on HIDApi and SendFeatureReport to my BootKeyboard instead :) (currently the API only return -1 on sendFeatureReportbut since i am using JAva and JNA it may very well have changed the interface)