-
Notifications
You must be signed in to change notification settings - Fork 51
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
Faster SWD by using SPI port #9
Comments
|
Can the ESP32 do SPI from 1 to at least 8 bits. Then doing SWD should be doable. Otherwise fast bitbanging can also get you a long way. |
According to the page below it seems like it should be possible to send/receive 'frames' that are shorter than 8 bits. |
The page tells: "The Device will still receive 8 bits with 3 additional “random” bits, so the reading must be performed correctly." Random bits in a strict protocol are not good ;-( |
My take away from that is that it will just shift in the number of bits requested and the data in register for the other bits are to be considered random. |
FYI: I've been porting this to ESP32, and I've moved to using the SPI driver. My implementation is up at xobs@f386d25 and currently suffers from a number of problems:
These are not insurmountable problems, and I intend to rewrite the SPI interface so that it uses lower-level constructs rather than the Espressif drivers, which do a lot of locking, unlocking, and allocating. I believe when it says that it will receive additional "random" bits, what it means is that it inhibits the SPI_CLK line output but the SPI block still clocks in those bits. As a result, the additional bits are effectively So far I've managed to communicate with a SAMD09 board via an ESP32 using this setup. I've dumped memory, done a |
I do not understand why a bitbang approach should be less reliable. |
I'm not sure. It felt like a pulse synchronizer issue that I was running into on ESP32 where GPIO inputs and outputs weren't synchronized despite the presence of There's also the issue of disabling interrupts, which seems like it can adversely impact wifi on the single-core ESP8266. Using SPI would mean avoiding the need to disable interrupts, which should give you more reliable networking. |
@xobs Appreciate both of your efforts, just wanted to make sure you’d seen this: https://github.com/flipperdevices/blackmagic-esp32-s2 |
I hadn't seen that -- it's very handy, and I might take their SPI code. |
Don't know if you've seen this.
https://www.pcbway.com/blog/technology/OpenOCD_on_Raspberry_Pi__Better_with_SWD_on_SPI.html
It's for the OpenOCD codebase but the underlying SWD 'bus' is the same so the same should be possible using an ESP8266 instead of an raspberry pi. It might be quite some work to get up and running so I understand if it won't be implemented.
Just wanted to let you know if you needed an interesting challenge ;-)
The text was updated successfully, but these errors were encountered: