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

[idf,jtag,qemu] Support running tests built as loadable ELF files (RDT-236) #105

Open
igrr opened this issue Jul 14, 2022 · 0 comments
Open
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@igrr
Copy link
Member

igrr commented Jul 14, 2022

Some test applications are small enough to be loaded into RAM of the target chip, and don't have to be flashed. Loading into RAM is typically faster than flashing.

The task is to support running tests with loadable ELF files for idf, jtag and qemu plugins.

For the ESP chips, ELF files can be loaded into the chip RAM in two ways:

  • Using esptool.py. In this case, the ELF file first needs to be converted into a .bin file (using esptool.py elf2image). Then the resulting .bin file can be loaded into chip RAM using esptool.py load_ram. The program is loaded and immediately starts to execute.
  • Over JTAG. In this case, the program can be loaded into RAM using GDB load command. (This approach works for all chips which have OpenOCD support, not necessarily ESPs.)

Note 1: we need to be careful not to reset the chip after loading the program and before running the test. Unlike the case when the program is flashed to the chip, the program loaded into RAM will be lost after reset. Then the chip will execute whichever program is stored in flash (if any).

Note 2: not every ELF file can be loaded into ESP chip RAM using the options above. When building an app using ESP-IDF, the option CONFIG_APP_BUILD_TYPE_ELF_RAM should be enabled. If it is not enabled, the resulting ELF file can't be loaded into RAM.
It is also possible to build loadable ELF files without IDF using the latest esp-2022r1-rc1 GCC based toolchain. (For the ESP32 only, so far.) For instructions, see internal merge request idf/newlib-cygwin!44.

For the old TTFW based implementation, see https://github.com/espressif/esp-idf/blob/master/tools/test_apps/system/gdb_loadable_elf/app_test.py.

@igrr igrr added the enhancement New feature or request label Jul 14, 2022
@github-actions github-actions bot changed the title [idf,jtag,qemu] Support running tests built as loadable ELF files [idf,jtag,qemu] Support running tests built as loadable ELF files (RDT-236) Jul 14, 2022
@hfudev hfudev self-assigned this Sep 19, 2022
@hfudev hfudev added this to the 1.0.0 milestone Sep 19, 2022
@hfudev hfudev mentioned this issue Sep 23, 2022
@hfudev hfudev modified the milestones: 1.0.0, 1.1.0 Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants