-
Notifications
You must be signed in to change notification settings - Fork 1k
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
stm32f4: USB support for STM32F446, STMF32469 #681
Conversation
@davids5 can you please confirm if this work for you? also, the code should work on previously working hardware. |
yes, if i see as per F469 ds, it is violating. |
also, the code good isnt because it handle the bit 21 very casually instead of handling it carefuly. |
@karlp - Will this be merged to master? |
My basic opinion is that it's not ideal, but it's probably the best short term solution until the driver layer can get refactored a bit to make more of this optional and api, rather than just hard coded. |
@karlp - Agreed - https://en.wikipedia.org/wiki/Perfect_is_the_enemy_of_good So what's holding up you from merging it and the RCC changes @ChuckM did? I'm not sure if you realize it but, my original code and ChuckM changes fix the library violating the PLL configurations on the exiting F4 procs. It's critical to get in. It was setting reserved bits to 0 Which is legal value for the F4. |
slakaðu á aðeins |
Ekki að hjálpa Karli |
@davids5 i have a made changes that you would love to have. |
Hi, How does unicore-mx relate to libopencm3? - If it is not drop-in replacement - I have no way to test it for you. If you want to fork PX4/Bootloader and rework it to build with unicore-mx. I will test it for you. David |
@karlp - now that the RCC changes are in. Would you please merge these 8 lines of code to master. |
Yep, it's on my list. |
@karlp any ETA? |
I've made excellent progress on my own work this week, best in weeks, so it's looking good. |
@karlp That is great to hear! Does that mean this PR will be this week? |
@karlp - I am running out of runway - do you have an ETA on merging this? |
It's still my understanding that this has a very short and well established workaround in user application code, namely,
after calling usbd_init. This is why I've not been treating it as any sort of critical priority. I still think I'd rather get driver private data/driver parameters, to handle both this difference, and critical problems like working with the wrong number of endpoints, or failing to handle control requests, that sort of thing. This affects L4 usb FS as well, I just checked it has CID = 0x2000 there too. |
If that will work. It sounds like a least resistance solution. FWIW I just finished fixing an L4 USB device driver in Nuttx. The fifio PKTSTS was not the same sequencing as the F4 or the F7. After an Out setup, the next in setup never triggered a setup completed PKTSTS or an EP setup IRQ |
It's what's being used here pretty well https://github.com/ChuckM/stm32f469i/tree/master/demos/usb_cdcacm clearly the dwc_otg driver needs more refactoring for not just f469. The in/out sequencing sounds like another issue though. |
Thank you @karlp. I recently found the solution to the lost FIFO words (where the lib had that delay) - In my case it was related to disabling NAK in the SETUP received PKTSTS service and it corrupted the FIFO which would loose a word - Delaying the CNAK change to the SETUP DONE PKTSTS fixed the issue on the F7 and F4 for the NuttX USB device drivers. But It did not work on the L4. I really worry that the Synopsys USB core microcode is unstable. It seems far from stable and there are many race conditions. I have never seen a clear set of documentation on how to interact with it to avoid the races. |
kuldeep doesn't like this, quoting from irc:
|
Addressing : kuldeep doesn't like this, quoting from irc: 11:17 < kuldeep> karlp, DO NOT merge this PR libopencm3#681 11:17 < kuldeep> this will break stuff in future 11:17 < kuldeep> see insane-adding-machines/unicore-mx@f38ac88 11:19 < kuldeep> karlp, the "==" comparision will haunt peoples.
Per your request is now >= |
was there any particular reason to close this that I missed? Do you mind if I reopen it to keep track of it? |
|
merged in cf80e2b |
This supersedes #676
This has been tested on STM32F469 and STM32F427