mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-13 02:54:09 +08:00
How to profile ardupilot binary on ESP32 and use result to place critical functions to the IRAM
Prepare source
- Configure project with
--enable-profileoption:./waf configure --board=esp32diy --enable-profile - Rebuild binaries
Run program with profiling enabled
- Flash and run binary
- Try to use mode silimiar to real flight. I.E. compass/gps connected, armed state, and so no
- It will write profile stat to the
/APM/APM/PROF000.TXTfiles on the sdcard every one minute
Use profile info to optimize program
- Copy
PROF*.TXTfile from sd card - Copy file
arducopter.mapfrom build directory - Use them to produce
functions.listby the scriptLinkerScriptGenerator.kt(modify paths and limits inside) - Place file
functions.listto thetarget/copter/mainfolder
how to build LinkerScriptGenerator.kt
$ sudo snap install --classic kotlin
build
kotlinc LinkerScriptGenerator.kt -d generator.jar
collect up profiling file into this folder... as per above.
files that the kotlin tool expects to find in this folder:
"ardusub.map",
"PROF000.TXT",
file/s it will create in this folder:
"functions.list"
cp ../../../build/esp32buzz/idf-plane/arduplane.map ardusub.map touch PROF000.TXT
#run: java -jar generator.jar