Can upload but sketch doesn't run

Have tried 3 different udev files, am member of dialout, did a reboot and reloaded udev many times.
crw-rw-rw- 1 root dialout 166, 0 Mar 5 15:53 /dev/ttyACM0
OS: Ubuntu 22.04 up to date
Have spent many hours and have no idea what is wrong.

Blockquote

Sketch uses 259265 bytes (19%) of program storage space. Maximum is 1310720 bytes.
Global variables use 18776 bytes (5%) of dynamic memory, leaving 308904 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: ec:da:3b:54:d8:dc
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0004ffff...
Compressed 15088 bytes to 10374...
Writing at 0x00000000... (100 %)
Wrote 15088 bytes (10374 compressed) at 0x00000000 in 0.2 seconds (effective 508.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 604.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 752.3 kbit/s)...
Hash of data verified.
Compressed 259632 bytes to 143914...
Writing at 0x00010000... (11 %)
Writing at 0x0001c993... (22 %)
Writing at 0x00024c49... (33 %)
Writing at 0x0002a138... (44 %)
Writing at 0x0002f3f6... (55 %)
Writing at 0x0003501f... (66 %)
Writing at 0x0003ee39... (77 %)
Writing at 0x00045410... (88 %)
Writing at 0x0004ab78... (100 %)
Wrote 259632 bytes (143914 compressed) at 0x00010000 in 1.7 seconds (effective 1234.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

and

024-03-05T20:54:00.578Z daemon INFO time="2024-03-05T15:54:00-05:00" level=info msg="Port /dev/ttyACM0 successfully opened"
2024-03-05T20:54:00.578Z monitor-service INFO Using port configuration for serial:/dev/ttyACM0: {"settingsList":[{"settingId":"baudrate","value":"9600"},{"settingId":"bits","value":"8"},{"settingId":"dtr","value":"on"},{"settingId":"parity","value":"none"},{"settingId":"rts","value":"on"},{"settingId":"stop_bits","value":"1"}]}
2024-03-05T20:54:00.578Z monitor-service INFO started monitor to /dev/ttyACM0 using serial
2024-03-05T20:54:00.579Z monitor-service INFO No port configuration changes have been detected. No need to send configure commands to the running monitor serial:/dev/ttyACM0.
2024-03-05T20:54:02.607Z root WARN Widget was activated, but did not accept focus after 2000ms: serial-monitor
Warning: /usr/lib/x86_64-linux-gnu/libvulkan_intel.so: cannot open shared object file: Permission denied
Warning: loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib/x86_64-linux-gnu/libvulkan_intel.so. Ignoring this JSON
Warning: loader_get_json: Failed to open JSON file virtio_icd.x86_64.json
Warning: loader_get_json: Failed to open JSON file lvp_icd.x86_64.json
Warning: /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so: cannot open shared object file: Permission denied
Warning: loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so. Ignoring this JSON
Warning: loader_scanned_icd_add: Could not get 'vkCreateInstance' via 'vk_icdGetInstanceProcAddr' for ICD libGLX_nvidia.so.0
Warning: loader_get_json: Failed to open JSON file intel_hasvk_icd.x86_64.json
Warning: vkCreateInstance: Found no drivers!
Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
    at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88)
    at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:458)
    at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344)
    at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266)
    at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521)

please give us a bit more context

the sketch gets uploaded, but not sure what you mean with "it doesn't run".
It could be a sketch issue.

What IDE are you using?
which version of the ESP32 platform?
is the board an Arduino Nano ESP32 or another ESP32?

Can you post the sketch, if not just the setup() would help.

Sketch is Blink with a print statement added:

  https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  for (int i = 0; i<300; i++) {
    Serial.print(1.23456, 4);   
  }
  
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
  Serial.print(1.23456, 4);
}

In ~/arduionIDE/arduion-cli/yaml is see:

board_manager:
    additional_urls: []
build_cache:
    compilations_before_purge: 10
    ttl: 720h0m0s
daemon:
    port: "50051"
directories:
    data: /home/martin/.arduino15
    downloads: /home/martin/.arduino15/staging
    user: /home/martin/Arduino
library:
    enable_unsafe_install: false
logging:
    file: ""
    format: text
    level: info
metrics:
    addr: :9090
    enabled: true
output:
    no_color: false
sketch:
    always_export_binaries: false
updater:
    enable_notification: true

In pluggable-monitor-settings.json is:

{"esp32:esp32:esp32s3-/dev/ttyACM0-serial":{"baudrate":{"id":"baudrate","label":"Baudrate","type":"enum","values":["300","600","750","1200","2400","4800","9600","19200","31250","38400","57600","74880","115200","230400","250000","460800","500000","921600","1000000","2000000"],"selectedValue":"9600"},"bits":{"id":"bits","label":"Data bits","type":"enum","values":["5","6","7","8","9"],"selectedValue":"8"},"dtr":{"id":"dtr","label":"DTR","type":"enum","values":["on","off"],"selectedValue":"on"},"parity":{"id":"parity","label":"Parity","type":"enum","values":["none","even","odd","mark","space"],"selectedValue":"none"},"rts":{"id":"rts","label":"RTS","type":"enum","values":["on","off"],"selectedValue":"on"},"stop_bits":{"id":"stop_bits","label":"Stop bits","type":"enum","values":["1","1.5","2"],"selectedValue":"1"}}}

The log file is empty
recent-sketches.json has:

{
  "file:///home/martin/Arduino/scratch/Blink": 1709672027934
}

recentworkspace.json has:

{"recentRoots":["file:///home/martin/Arduino/scratch/Blink"]}

Looking at the schematic, I see pin 13 is labelled RESETN and connected to GPIO0, whereas the push-button (active low) is connected to pin 3
image
Again, the IDE shows the sketch being properly uploaded, but it doesn't start? Thanks for the help, I'm at a loss; I can't find any documentation on how to start the sketch. I also can only find real minimal documentation on how to the "Tools" menu options for using the Nano ESP32, so maybe I have something incorrect there. I so far can't find where the json file for these options is stored.

P.S. Arduino Nano ESP32 with a single push-button.

"doesn't run" means that

  1. it does not print
  2. it does not blink
  3. both of the above

Both of the above. Documentation is not up to date with the IDE. Under "Tools" menu I have:
Upload Mode: UART0/Hardware CDC
USB Mode: Hardware CDC and JTAG
JTAG Adapter: ESP USB Bridge
USB CDC on Boot: Enabled
and many other settings (again, can't find documentation on how to choose them).

you need to call Serial.begin() before the first Serial.print()

Just tried, no changes:
...

Writing at 0x000454f3... (88 %)
Writing at 0x0004abe3... (100 %)
Wrote 261488 bytes (145177 compressed) at 0x00010000 in 1.7 seconds (effective 1247.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

I now have a tab in the IDE with debug_custom.json:

{
	"name":"Arduino on ESP32-S3",
	"toolchainPrefix":"xtensa-esp32s3-elf",
	"svdFile":"debug.svd",
	"request":"attach",
	"overrideAttachCommands":[
		"set remote hardware-watchpoint-limit 2",
		"monitor reset halt",
		"monitor gdb_sync",
		"thb setup",
		"c"
	],
	"overrideRestartCommands":[
		"monitor reset halt",
		"monitor gdb_sync"
	]
}

Update: added
#define LED_BUILTIN 48

to sketch and now can see yellow LED blinking, so the sketch is running. Still can not see print statement outputs? Question: Is there any way of running gdb on a NANO ESP32S3 using the IDE? Or should something like open OCD and an ST-Link/V2

Hello @kw_martin, thanks for your informative posts. I think there's a basic misunderstanding here: what you are reporting as entries in the Tools menu do not match with the Arduino Nano ESP32 board you are using.

Please make sure you are using the Arduino ESP32 Boards by Arduino package - in it you should find only the "Arduino Nano ESP32" board. If you have a long list of ESP32 boards among which to choose, you are using the "esp32" package by "Espressif Systems".

Once you have correctly selected this board, please follow this guide to restore full functionality on your Nano ESP32 (loading code for other boards will interfere with recovery and other stuff on the Flash).

Let us know if this helps!