In effort to remove USB firmware driver's dependance on .data/.bss Started by fixing bug that wasn't allowing USB_BTABLE to be relocatable Was neglecting byte addressing vs usb_buff[] array indexing of 16bit half words. Still have 4 bytes of .bss for usbMsgPtr, need to modify the communication protocol between application code and usb code to move/remove this pointer out of .bss there are 4 bytes of usb_buff ram available for it to be moved into but need to ensure only 16bit access is made. Once that's done can separate usb code from application code and have usb code only interrupt driven, with application code polling. Then the usb code can sniff out firmware update packets and update application code behind it's back. Removed logging of transfer count since it wasn't being used num_bytes_expecting isn't used but breaks device descriptors if cut for some reason... so I just moved it and kept it... Another weird issue is after reflashing the mcu via stlink the first inlretro.exe excecution fails due to some usb error. Not sure if it's related to the usb code changes I just made, or possibly some other recent updates to inlretro executable..? I think this issue has existed forever, but was hard to pin down and always went away after a reset. |
||
|---|---|---|
| .. | ||
| stm_init.c | ||
| stm_init.h | ||
| usb_descriptors.h | ||
| usbstm.c | ||
| usbstm.h | ||