-
-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] add DFU runtime #858
base: master
Are you sure you want to change the base?
Conversation
The first thing that comes into my mind (having read the user manual for a bit), is that, you have to drop the system clock down from 108MHz to 96MHz (or overclock it to 120MHz if you are OK with running it out of spec) for USB to work, because the USB peripheral requires a 48MHz clock and the USB clock prescaler does not support 2.25. I don't know how much heavy-lifting the vendor board files have already done, but this may be something worth checking. |
@alvinhochun Thanks for the hint! |
I am struggling getting the USB interrupts to work, my interrupt handler is not being called at all. Maybe somebody with actual hardware knowledge could take a look? |
FUSB only controls the CC lines, so it wont touch the data lines. I can try and have a look see this weekend if I get time on Sunday (or before should time and sleep schedule allow) |
Ah, having a look quickly; how are you checking your interrupt handler (and therefore To rule out the function not linking you could try removing the Everything looks fairly sane otherwise :/ |
@Ralim thanks a lot! |
I'm not ignoring you I promise 😅
Welp yep that covers it. I'll try and give this a poke, though I'm not much wiser than you on this platform. All I'll be doing is squinting at the datasheet 😅 . I did have some sucsess with their other peripherals to compare against the stm32f103 datasheet too for where descriptions were missing as this chip seems to use a bunch of peripherals they used in their binary compatible mimic of the stm32f103.
Ah bummer, that would have been too simple. |
Did you test with QC disabled? If it messes with the D+/D- pins then USB enumeration probably wouldn't work. Though I don't know if this will cause the ISR to not get triggered. Have you got it to work with a plain USB gadget demo without the IronOS bits? |
@alvinhochun I tested with the FUSB302 not initialized. Is that enough? |
The FUSB302 only controls CC pins, its entirely separate to all of the QC negotiation over the USB data lines. You will need to disable the POW_QC configuration option and edit the gpio setup to ensure all QC io are put into input (high impedance mode) before you are able to do USB. QC should not kick in for around 2-3 seconds after startup, but a good point is raised that if your not setting all of the IO to input mode you wont get a usb connection. |
@t-8ch Please correct me if I am wrong, otherwise this can be closed. |
This is separate, this is so that the device shows up on USB during normal use (not bootloader mode) |
OK. |
Do not merge yet
Everything here currently only handles the Pinecil.
This introduces an USB runtime.
It exposes DFU runtime descriptors that can be used to perform firmware updates as discussed in #817 .
IronOS does not expose any data over USB.
IronOS is discoverable over USB.
This does currently not work. The PR is here for review and help.
Without this PR the Pinecil only throws errors in dmesg:
With this PR it is detected somewhat but still throws errors:
I guess something is wrong with the interrupt/timer setups.
Note:
This PR backports a few structures from 1.2.0 of the GD32VF103 firmware library.
(Also the examples there were used as reference)