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

[VSC-1568] get supported qemu targets from tools json #1405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brianignacio5
Copy link
Collaborator

Description

Use $IDF_PATH/tools/tools.json to obtain QEMU forks supported targets. From now any IDF_TARGET is mapped to them and fallback to esp32 and esp32c3 forks.

Fixes #1404

Type of change

  • New feature (non-breaking change which adds functionality)

Steps to test this pull request

Provide a list of steps to test changes in this PR and required output

  1. Click on "[QEMU Server]" on the status bar and run either QEMU Debug or Monitor. It should select the new esp32s3 (when available in ESP-IDF tools.json) target.
  2. Execute action.
  3. Observe results.
  • Expected behaviour:

  • Expected output:

How has this been tested?

Manual testing running any QEMU command (Debug, Monitor) to make sure IDF_TARGET is used to get the QEMU fork to use (xtensa or risc-v)

Test Configuration:

  • ESP-IDF Version: 5.4
  • OS (Windows,Linux and macOS): macOS

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

@brianignacio5 brianignacio5 added this to the v1.9.1 milestone Jan 20, 2025
@brianignacio5 brianignacio5 self-assigned this Jan 20, 2025
Copy link

Download the artifacts for this pull request:
You can test these changes by installing this VSIX by click menu View -> Command Palette..., type Install from VSIX and then select downloaded esp-idf-extension.vsix file to install the extension.

Copy link
Collaborator

@radurentea radurentea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Fabricio-ESP Fabricio-ESP changed the title get supported qemu targets from tools json [VSC-1568]get supported qemu targets from tools json Jan 23, 2025
@Fabricio-ESP Fabricio-ESP changed the title [VSC-1568]get supported qemu targets from tools json [VSC-1568] get supported qemu targets from tools json Jan 23, 2025
@Fabricio-ESP
Copy link
Collaborator

Fabricio-ESP commented Jan 24, 2025

I confirmed that with this update the QEMU monitor allows using ESP32, ESP32C3 and ESP32S3. For some reason monitor only worked for ESP32, it does not seem to be a block on the extension but rather something on IDF or docker.
image

Copy link
Collaborator

@Fabricio-ESP Fabricio-ESP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked using Windows and Mac connected to docker container.
The QEMU emulation is failing for esp32c3, and esp32s3 is missing form the json file, but manually adding the target allows the extension to send the command to QEMU.
The issue is related to ESP-EDF, no side effected detected on the VSCOde extension.

@radurentea
Copy link
Collaborator

I've tested with ESP32C3 and QEMU monitor worked.

export IDF_PATH='/opt/esp/idf'
'/opt/esp/python_env/idf5.5_py3.12_env/bin/python' '/opt/esp/idf/tools/idf_monitor.py' -p socket://localhost:5555 -b 115200 --toolchain-prefix riscv32-esp-elf- --target esp32c3 '/workspaces/hello_world/build/hello_world.elf'
root@325c130a2771:/workspaces/hello_world# export IDF_PATH='/opt/esp/idf'
root@325c130a2771:/workspaces/hello_world# '/opt/esp/python_env/idf5.5_py3.12_env/bin/python' '/opt/esp/idf/tools/idf_monitor.py' -p socket://localhost:5555 -b 115200 --toolchain-prefix riscv32-esp-elf- --target esp32c3 '/workspaces/hello_world/build/hello_world.elf'
--- esp-idf-monitor 1.5.0 on socket://localhost:5555 115200
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
Restarting in 9 seconds...
Restarting in 8 seconds...
Restarting in 7 seconds...
Restarting in 6 seconds...
Restarting in 5 seconds...
Restarting in 4 seconds...
Restarting in 3 seconds...
Restarting in 2 seconds...
Restarting in 1 seconds...
Restarting in 0 seconds...
Restarting now.
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x15b8
load:0x403cc710,len:0xc30
load:0x403ce710,len:0x2fe8
entry 0x403cc71a
I (23139) boot: ESP-IDF v5.5-dev-1655-gc5865270b5 2nd stage bootloader
I (23140) boot: compile time Jan 27 2025 14:20:09
I (23144) boot: chip revision: v0.3
I (23145) boot: efuse block revision: v0.0
I (23146) boot.esp32c3: SPI Speed      : 80MHz
I (23146) boot.esp32c3: SPI Mode       : SLOW READ
I (23147) boot.esp32c3: SPI Flash Size : 2MB
I (23150) boot: Enabling RNG early entropy source...
I (23154) boot: Partition Table:
I (23155) boot: ## Label            Usage          Type ST Offset   Length
I (23155) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (23155) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (23156) boot:  2 factory          factory app      00 00 00010000 00100000
I (23156) boot: End of partition table
I (23158) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=08c20h ( 35872) map
I (23165) esp_image: segment 1: paddr=00018c48 vaddr=3fc8ba00 size=012e4h (  4836) load
I (23168) esp_image: segment 2: paddr=00019f34 vaddr=40380000 size=060e4h ( 24804) load
I (23190) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=16714h ( 91924) map
I (23204) esp_image: segment 4: paddr=0003673c vaddr=403860e4 size=05858h ( 22616) load
I (23221) esp_image: segment 5: paddr=0003bf9c vaddr=50000000 size=0001ch (    28) load
I (23224) boot: Loaded app from partition at offset 0x10000
I (23224) boot: Disabling RNG early entropy source...
I (23233) cpu_start: Unicore app
I (23245) cpu_start: Pro cpu start user code
I (23245) cpu_start: cpu freq: 160000000 Hz
I (23245) app_init: Application information:
I (23245) app_init: Project name:     hello_world
I (23245) app_init: App version:      1
I (23245) app_init: Compile time:     Jan 27 2025 14:20:00
I (23245) app_init: ELF file SHA256:  b7b81a158...
I (23245) app_init: ESP-IDF:          v5.5-dev-1655-gc5865270b5
I (23246) efuse_init: Min chip rev:     v0.3
I (23246) efuse_init: Max chip rev:     v1.99 
I (23246) efuse_init: Chip rev:         v0.3
I (23246) heap_init: Initializing. RAM available for dynamic allocation:
I (23246) heap_init: At 3FC8DBB0 len 00032450 (201 KiB): RAM
I (23246) heap_init: At 3FCC0000 len 0001C710 (113 KiB): Retention RAM
I (23246) heap_init: At 3FCDC710 len 00002950 (10 KiB): Retention RAM
I (23247) heap_init: At 5000001C len 00001FCC (7 KiB): RTCRAM
I (23251) spi_flash: detected chip: gd
I (23251) spi_flash: flash io: dio
W (23252) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (23252) sleep_gpio: Configure to isolate all GPIO pins in sleep state
I (23253) sleep_gpio: Enable automatic switching of GPIO sleep configuration
I (23256) main_task: Started on CPU0
I (23256) main_task: Calling app_main()
Hello world!

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

Successfully merging this pull request may close these issues.

Outdated information about supported QEMU targets (VSC-1568)
3 participants