What's the fastest form of debug output?

SparkyNZ
Posts: 48
Joined: Thu Jan 04, 2024 9:01 pm

What's the fastest form of debug output?

Postby SparkyNZ » Mon Jan 15, 2024 8:15 am

I'm using serial at the moment for debug output. Is there a faster way of getting debug output? I'm outputting debug from an emulated 6502 and the serial is slowing things down quite a bit.

ESP_Sprite
Posts: 9577
Joined: Thu Nov 26, 2015 4:08 am

Re: What's the fastest form of debug output?

Postby ESP_Sprite » Mon Jan 15, 2024 8:36 am

Depends. You can set serial to a faster baud rate, that would net you more speed. If your chip supports it, you can also switch to USB-serial-JTAG or USB-OTG; those two are also faster.

SparkyNZ
Posts: 48
Joined: Thu Jan 04, 2024 9:01 pm

Re: What's the fastest form of debug output?

Postby SparkyNZ » Mon Jan 15, 2024 11:43 am

ESP_Sprite wrote:
Mon Jan 15, 2024 8:36 am
Depends. You can set serial to a faster baud rate, that would net you more speed. If your chip supports it, you can also switch to USB-serial-JTAG or USB-OTG; those two are also faster.
I'm using a ESP-WROOM-32. I don't think I have a JTAG interface on this chip? Having said that, this post viewtopic.php?t=10044 refers to it here: https://www.espressif.com/sites/default ... eet_en.pdf

Image

I have a "USB Blaster" clone for my FPGA boards..

I need to do some JTAG research (and I should be sleeping now). What would be the overall JTAG debug setup - the ESP32, some wiring to a JTAG header, connect to the USB Blaster and use OpenOCD?

SparkyNZ
Posts: 48
Joined: Thu Jan 04, 2024 9:01 pm

Re: What's the fastest form of debug output?

Postby SparkyNZ » Mon Jan 15, 2024 11:55 am

ESP_Sprite wrote:
Mon Jan 15, 2024 8:36 am
Depends. You can set serial to a faster baud rate, that would net you more speed. If your chip supports it, you can also switch to USB-serial-JTAG or USB-OTG; those two are also faster.
From here: https://docs.espressif.com/projects/esp ... index.html
The quickest and most convenient way to start with JTAG debugging is by using ESP-WROVER-KIT. Each version of this development board has JTAG interface already built in. No need for an external JTAG adapter and extra wiring/cable to connect JTAG to ESP32. ESP-WROVER-KIT is using FT2232H JTAG interface operating at 20 MHz clock speed, which is difficult to achieve with an external adapter.


Does that mean that any WROVER board is capable of providing JTAG over USB without the need for USB Blaster etc? So any WROVER devkit board I may find on Aliexpress such as this one would work?

Image

ESP_Sprite
Posts: 9577
Joined: Thu Nov 26, 2015 4:08 am

Re: What's the fastest form of debug output?

Postby ESP_Sprite » Tue Jan 16, 2024 1:29 am

I was referring to USB-serial-JTAG, which is an integrated peripheral later ESP32 chips have that allow you to directly connect it to an USB port. You can get speeds approaching 12MBit with that, which is nice and fast compared to UARTs.

I wouldn't go the JTAG way; I'm not sure if protocol overhead makes that any faster than pure serial, especially with a relatively slow adapter like an USB blaster. I'd simply increase the baudrate: I think you can go up to 1MBit with that hardware, which is 9x as fast as the default 115200 baud setting.

SparkyNZ
Posts: 48
Joined: Thu Jan 04, 2024 9:01 pm

Re: What's the fastest form of debug output?

Postby SparkyNZ » Tue Jan 16, 2024 7:16 pm

ESP_Sprite wrote:
Tue Jan 16, 2024 1:29 am
I was referring to USB-serial-JTAG, which is an integrated peripheral later ESP32 chips have that allow you to directly connect it to an USB port. You can get speeds approaching 12MBit with that, which is nice and fast compared to UARTs.

I wouldn't go the JTAG way; I'm not sure if protocol overhead makes that any faster than pure serial, especially with a relatively slow adapter like an USB blaster. I'd simply increase the baudrate: I think you can go up to 1MBit with that hardware, which is 9x as fast as the default 115200 baud setting.
1MBit - so that would be 921600 baud? Seems weird - I've never used anything faster than 115200.. and I do remember days of 9600 and below! :-)

Is there any particular dev board that pops into mind when you think about USB-serial-JTAG? 9x faster would be a bit improvement for now - but if I can get up to 12Mbit/s, I'd like to get one in the mail.

How do you I change the console baudrate to 921600? I've tried setting this in both sdkconfig and sdkconfig.defaults but the printf() commands are still output at 115200.

I've also had a look at menuconfig and can't find a UART console setting there either:

Image

ESP_Sprite
Posts: 9577
Joined: Thu Nov 26, 2015 4:08 am

Re: What's the fastest form of debug output?

Postby ESP_Sprite » Wed Jan 17, 2024 12:25 am

In your case, you probably need all the CPU speed you can get, so I'd go for an ESP32-S3 devboard - e.g. the ESP32-S3-Devkit-C is the 'default' universal one you can use. There's different flavours depending on if you want external PSRAM - if speed is a concern and you need this, select one with octal PSRAM as it's the fastest.

The baud rate setting is a bit hidden: you need to select 'Custom UART' for that setting, then you can set the Tx and Rx pin as well as the baudrate. Simply keep the Tx and Rx at GPIO 1 and 3 and change the baud rate to whatever you need.

SparkyNZ
Posts: 48
Joined: Thu Jan 04, 2024 9:01 pm

Re: What's the fastest form of debug output?

Postby SparkyNZ » Wed Jan 17, 2024 4:27 am

ESP_Sprite wrote:
Wed Jan 17, 2024 12:25 am
In your case, you probably need all the CPU speed you can get, so I'd go for an ESP32-S3 devboard - e.g. the ESP32-S3-Devkit-C is the 'default' universal one you can use. There's different flavours depending on if you want external PSRAM - if speed is a concern and you need this, select one with octal PSRAM as it's the fastest.

The baud rate setting is a bit hidden: you need to select 'Custom UART' for that setting, then you can set the Tx and Rx pin as well as the baudrate. Simply keep the Tx and Rx at GPIO 1 and 3 and change the baud rate to whatever you need.
Excellent! Thanks so much for that - I wouldn't have thought about changing the UART to "custom". I got my 921600 logging now which will help somewhat.

The only thing that's putting me off those S3-DevkitC devices at the moment is the lack of (cheap) breakout boards for them. I could make my own PCB.. But.. I'm also a bit worried about the IDF support. Does 4.3.6 support the S3 boards? I'm stuck with 4.3.6 at the moment because I'm using FabGL and don't want to go through the effort of porting it to the latest IDF.

SparkyNZ
Posts: 48
Joined: Thu Jan 04, 2024 9:01 pm

Re: What's the fastest form of debug output?

Postby SparkyNZ » Wed Jan 17, 2024 4:37 am

ESP_Sprite wrote:
Wed Jan 17, 2024 12:25 am
The baud rate setting is a bit hidden: you need to select 'Custom UART' for that setting, then you can set the Tx and Rx pin as well as the baudrate. Simply keep the Tx and Rx at GPIO 1 and 3 and change the baud rate to whatever you need.
Oh no.. I've had 2 blue screen of death occurrences on my Win10 machine with the new 921600 baud rate - probably a driver bug. I might have to smarten up my logging and disable it until a certain number of instructions have been processed or time elapsed since my ESP32 boots and go back to 115200 serial.. or something in between 115200 and 921600.

576000 seems stable enough..

ESP_Sprite
Posts: 9577
Joined: Thu Nov 26, 2015 4:08 am

Re: What's the fastest form of debug output?

Postby ESP_Sprite » Wed Jan 17, 2024 6:03 am

Ah, I don't know if FabGL already supports the S3 to begin with. I also don't think an esp-idf that old supports the S3, but I'm not sure.

Who is online

Users browsing this forum: Basalt and 305 guests