Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) ESP32S3 onboard debugging exception at setCpuFrequencyMhz (Read 274 times)
StephenB
Junior Member
**
Offline


Posts: 15
Joined: Feb 14th, 2024
ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Apr 16th, 2025 at 1:11pm
Print Post  
I am trying to set-up onboard debugging using a S3N16R8 board.

I have a board.txt file per the website.(attached).

The debugging throws an error:at setCpuFrequencyMhz

"C:\Users\steph\Pictures\Screenshots\Screenshot2025-04-16135625.png"


The same program debugs using platformio. The driver for interface 2 is libusbK (v3.1.0.0) I.e. the Expressif driver
« Last Edit: Apr 16th, 2025 at 1:16pm by StephenB »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
StephenB
Junior Member
**
Offline


Posts: 15
Joined: Feb 14th, 2024
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #1 - Apr 16th, 2025 at 1:14pm
Print Post  
here is the output from the build.

"C:\Users\steph\Pictures\Screenshots\Screenshot2025-04-16135625.png"
« Last Edit: Apr 16th, 2025 at 1:18pm by StephenB »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #2 - Apr 16th, 2025 at 2:58pm
Print Post  
Thanks for the report and the logs, I have a setup currently running with the debugger on the ESP32S3.

So we can understand the issue in more detail can you attach the below two logs:
C: / Users/ steph/ AppData/ Local/ Temp/ VMBuilds/ JTAG_Test/ esp32_esp32s3/ Debug/ JTAG_Test.ino_DebugOpenOCD.log
C: / Users/ steph/ AppData/ Local/ Temp/ VMBuilds/ JTAG_Test/ esp32_esp32s3/ Debug/ JTAG_Test.ino_DebugGDB.log

Is your sketch just a simple "Blink" type sketch currently or something more advanced, if you can share the INO file we can test on our board here as well.
« Last Edit: Apr 16th, 2025 at 3:00pm by Simon@Visual Micro »  
Back to top
IP Logged
 
StephenB
Junior Member
**
Offline


Posts: 15
Joined: Feb 14th, 2024
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #3 - Apr 16th, 2025 at 3:49pm
Print Post  
the sketch is using the onboard neopixel

Code
Select All
void setup() {
    // No need to initialize the RGB LED
    Serial.begin(115200);
}

// the loop function runs over and over again forever
void loop() {
#ifdef RGB_BUILTIN
    digitalWrite(RGB_BUILTIN, HIGH);   // Turn the RGB LED white
    delay(1000);
    digitalWrite(RGB_BUILTIN, LOW);    // Turn the RGB LED off
    delay(1000);

    neopixelWrite(RGB_BUILTIN, RGB_BRIGHTNESS, 0, 0); // Red
    delay(1000);
    neopixelWrite(RGB_BUILTIN, 0, RGB_BRIGHTNESS, 0); // Green
    delay(1000);
    neopixelWrite(RGB_BUILTIN, 0, 0, RGB_BRIGHTNESS); // Blue
    delay(1000);
    neopixelWrite(RGB_BUILTIN, 0, 0, 0); // Off / black
    delay(1000);
    Serial.println("end cycle");
#endif
}
 

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #4 - Apr 17th, 2025 at 9:35am
Print Post  
Thanks for the update and detail.

Can you try reducing the number of breakpoints in the sketch to 1, and try debugging again?

The logs posted previously show it is failing to insert some of the breakpoints.
  
Back to top
IP Logged
 
StephenB
Junior Member
**
Offline


Posts: 15
Joined: Feb 14th, 2024
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #5 - Apr 17th, 2025 at 12:16pm
Print Post  
It works if there is only 1 breakpoint, but not if there are any more. Is that a known limitation that I missed?

Is there some setting etc to remove that limitation?
The same sketch on VSC and Platformio works with multiple break points
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #6 - Apr 17th, 2025 at 12:40pm
Print Post  
Thanks for confirming we are reproducing the same issue.

We will release an updated version of OpenOCD and I'll attach the new override configurations for the local board.txt when this is fully tested.
« Last Edit: Apr 17th, 2025 at 12:59pm by Simon@Visual Micro »  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #7 - Apr 17th, 2025 at 2:43pm
Print Post  
Quote:
The same sketch on VSC and Platformio works with multiple break points


Can you confirm which package you are using in PIO so we can compare the GDB/OpenOCD versions/configurations here.

Using vMicro if you roll back to board package v3.0.5 then the breakpoints all work as expected.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #8 - Apr 22nd, 2025 at 3:31pm
Print Post  
Just to update on our findings so far:

PIO Uses the older IDF 4.4 integration, which is the same in the ESP32 cores for Arduino/vMicro before 3.x.

The 3.x cores bring in the IDF v5 packages which require further fine tuning (and potentially other changes to linker scripts etc) to allow more than 1 breakpoint to be used (2 are available, however one is reserved by the system for crash handling, hence only having one available to you in the sketch).

We will continue to investigate this and update as soon as we have a working solution.
  
Back to top
IP Logged
 
StephenB
Junior Member
**
Offline


Posts: 15
Joined: Feb 14th, 2024
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #9 - Apr 22nd, 2025 at 4:37pm
Print Post  
Thank you for the update.
It is probably no help but the Platformio framework is expressif32 Version 6.10.0

PACKAGES:
- framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b
- tool-esptoolpy @ 1.40501.0 (4.5.1)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
- toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5

Looking at the debug output I note:
Open On-Chip Debugger  v0.11.0-esp32-20220706 (2022-07-06-15:48)

Regards.
« Last Edit: Apr 22nd, 2025 at 4:40pm by StephenB »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: ESP32S3 onboard debugging exception at setCpuFrequencyMhz
Reply #10 - Apr 22nd, 2025 at 4:40pm
Print Post  
Thanks for the update.

The IDF Version integrated within that is the old 4.4 version (I used the same PIO package today), so in Visual Micro you need to roll back to a board package version before 3.x to get the same IDF integration.

The IDF changes are the root cause of the breakpoint limitations, as before the 3.x Board Package the Soft breakpoints worked correctly (in general) however since the changes to the core these no longer work due to the changes within IDF and the prebuild Arduino libraries.

We will ask Espressif more about this as it is a shared limitation with the Arduino IDE which is frustrating for many users.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint