Close

USB Bootloader and USB HID works...

A project log for CM3 Board + Backend-Library + Bee Hive Monitor

An open solution enabling everone to build and maintain a IoT enabled sensor network. BeeStalker is the reference for you project!

johannwilhelmjohann.wilhelm 03/12/2017 at 19:330 Comments

...after spending a whole day on it... in the end the only error was neglecting these tiny bits moving the interrupt table to the bootloader region.

But now it finally works. I modified USBaspLoader (https://www.obdev.at/products/vusb/usbasploader.html ) to wait 2 seconds for new firmware and read the serial-string from eeprom. After applying some of my favourite voodoo forces, this fits inside the 2kb bootloader portion of the flash :) (just 2042 bytes)

I updated my USB spec (https://sites.google.com/a/beestalker.eu/beestalker/hardware/hardware/usb-spec) to something more serious...

[138600.097617] usb 1-4: USB disconnect, device number 8
[138602.066146] usb 1-4: new low-speed USB device number 9 using xhci_hcd
[138602.297004] usb 1-4: New USB device found, idVendor=16d0, idProduct=0cb9
[138602.297012] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[138602.297016] usb 1-4: Product: AAAAAAAAC+4ABxEB
[138602.297020] usb 1-4: Manufacturer: BeeStalker.eu
[138602.297024] usb 1-4: SerialNumber: 4QcDDAEAAAAAAAAA
[138605.355129] usb 1-4: USB disconnect, device number 9
[138610.614279] usb 1-4: new low-speed USB device number 10 using xhci_hcd
[138610.787694] usb 1-4: New USB device found, idVendor=16d0, idProduct=0cb9
[138610.787702] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[138610.787707] usb 1-4: Product: AAAAAAAAC+4ABxEA
[138610.787712] usb 1-4: Manufacturer: BeeStalker.eu
[138610.787716] usb 1-4: SerialNumber: 4QcDDAEAAAAAAAAA
You might notice these strange looking SerialNumber and Product strings...

These are BASE64 encoded binary strings. You can decode them using online tools like https://conv.darkbyte.ru/

So "4QcDDAEAAAAAAAAA" is actually "00 00 00 00 00 00 0b ee 00 07 11 01" where "00 00 00 00 00 00 0b ee" is my personal identifier and "00 07 11 01" is the bootloader of the UsbHx711 sensor. The "other" device ("AAAAAAAAC+4ABxEA") is the actual application part of the sensors software.

The serial is a bit more complicated: "4QcDDAEAAAAAAAAA" gives "e1 07 03 0c 01 00 00 00 00 00 00 00".

This is a serial number + compatibility flags.

I will need to tidy up everything befor I upload this to my gogs (I don't like github for some reasons... gogs is like github but you host your data yourself) server...

BTW idVendor=16d0, idProduct=0cb9 belong to me... MCS (www.mcselec.com) sells single PIDs for reasonable money. I'm going to use a single PID for all sensors... see the spec mentioned above how I want to do this.

73

Discussions