Skip to content
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

Unable to get esp32_passthrough working #4

Closed
InternetUnexplorer opened this issue Nov 20, 2022 · 5 comments
Closed

Unable to get esp32_passthrough working #4

InternetUnexplorer opened this issue Nov 20, 2022 · 5 comments

Comments

@InternetUnexplorer
Copy link

InternetUnexplorer commented Nov 20, 2022

Note
This is outdated, see below comments!

Hi there, I'm having trouble programming the ESP32 on my ULX3S v3.0.8 v3.1.7 85k (came with ESP32-WROVER-E pre-attached).

I've tried esp32_passthru from here, as well as the bitstreams in ulx3s-bin/passthru/passthru-v20-85f, ulx3s-bin/dfu/85f-v20, and ulx3s-bin/dfu/85f-v317. I've programmed each to flash and disconnected/reconnected the ULX3S to make sure, but the ESP32 won't enter download mode; it keeps running the program (currently MicroPython) without interruption.

I think I've narrowed it down to not being able to reset the ESP32; as I understand it driving wifi_en low should disable it completely:

module ulx3s_passthru_wifi(
    output wire ftdi_rxd,
    input  wire ftdi_txd,
    output wire wifi_rxd,
    input  wire wifi_txd,
    inout  wire wifi_en
);
    assign ftdi_rxd = wifi_txd;
    assign wifi_rxd = ftdi_txd;
    assign wifi_en = 1'b0;
endmodule

However, with this minimal example the ESP32 is still enabled and I can access it via serial; wifi_en seems to have no effect! And if the ESP32 can't be reset, I don't see how one can enter download mode, which is probably why passthru isn't working?

I'm able to get it into download mode by using jumper J3, but this is kind of impractical since it takes a few tries to get it working and I'd like to program the ESP32 a lot as I'm testing things out.

@InternetUnexplorer
Copy link
Author

So, it turns out my board is actually a v3.1.7 (even though fujprog says it's a v3.0.8), thanks to @goran-mahovlic for pointing that out. I'm able to program using ulx3s-bin/dfu/85f-v317 now, although it fails some of the time (which is probably why I didn't realize it worked when I tested it). I'm still confused by the wifi_en behavior though, does it work differently on v3.1.7?

@InternetUnexplorer
Copy link
Author

Okay, it turned out I forgot to copy the v316 constraints file to my little example above; enabling/disabling the ESP32 with wifi_en seems to work now. Sorry for the confusion and many thanks again to Goran for helping me with this!

Flashing is still very unreliable though (about 50/50), and I'm not sure what I'm doing wrong (I'm going to try to get another cable today to see if that improves things). Do you have any advice for how to improve it/where to find more information about how the flashing process works?

@InternetUnexplorer
Copy link
Author

Ok, one more update (sorry), now that I have the new constraints file I was able to get everything working reliably with just following:

assign ftdi_rxd = wifi_txd;
assign wifi_rxd = ftdi_txd;
assign wifi_en = ftdi_nrts;
assign wifi_gpio0 = ftdi_ndtr;

Now esptool.py is able to enter download mode on the first try every time, and everything seems to work! I don't have the ESP32 connected to anything else yet, but this is all I need for now so I'll close this issue :)

I'm still not sure what all of the extra stuff esp32_passthru is doing means, but I can figure that out later. I'm guessing it's probably at least somewhat related to programming the FPGA from the ESP32?

@emard
Copy link
Owner

emard commented Nov 21, 2022 via email

@InternetUnexplorer
Copy link
Author

InternetUnexplorer commented Nov 22, 2022

Thanks a bunch for the explanation! Programming the FPGA with DFU definitely seems nice (fujprog is a bit slow), so I might study the passthru code further in the future if I have time to experiment with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants