File tree Expand file tree Collapse file tree 3 files changed +198
-114
lines changed
tools/esptool_libs/nodejs Expand file tree Collapse file tree 3 files changed +198
-114
lines changed Original file line number Diff line number Diff line change
1
+ # NodeJS ESP Tools
2
+
3
+ The ` build.js ` tool is used to take the ` stub_flasher_32.elf ` and break it apart into the separate files that need to be individually pushed to ESP32 RAM for execution.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Extract the text and data sections to their own files.
3
+ xtensa-esp32-elf-objcopy \
4
+ --dump-section .text=text.dat \
5
+ --dump-section .data=data.dat \
6
+ stub_flasher_32.elf
7
+
8
+ # Parse out the text load address, the data load address and the entry point from the ELF.
9
+ text_address=` xtensa-esp32-elf-objdump --section-headers --wide --section=.text stub_flasher_32.elf | sed -n ' $s/^\s*[[:alnum:]]*\s*\S*\s*[[:alnum:]]*\s*[[:alnum:]]*\s*\([[:alnum:]]*\).*/\1/p' `
10
+ # echo "Text address: 0x${text_address}"
11
+ data_address=` xtensa-esp32-elf-objdump --section-headers --wide --section=.data stub_flasher_32.elf | sed -n ' $s/^\s*[[:alnum:]]*\s*\S*\s*[[:alnum:]]*\s*[[:alnum:]]*\s*\([[:alnum:]]*\).*/\1/p' `
12
+ # echo "Data address: 0x${data_address}"
13
+ entry_point=` xtensa-esp32-elf-objdump --wide --file-headers stub_flasher_32.elf | sed -n ' /start address/s/start address 0x\([[:alnum:]]\)/\1/p' `
14
+ # echo "Entry point: 0x${entry_point}"
15
+
16
+ echo " {"
17
+ echo " \" textAddress\" : \" ${text_address} \" ,"
18
+ echo " \" dataAddress\" : \" ${data_address} \" ,"
19
+ echo " \" entryPoint\" : \" ${entry_point} \" ,"
20
+ echo " \" textData\" : \" $( base64 --wrap=0 text.dat) \" ,"
21
+ echo " \" dataData\" : \" $( base64 --wrap=0 data.dat) \" "
22
+ echo " }"
23
+
24
+ # Remove the temporary text and data files.
25
+ # rm text.dat data.dat
You can’t perform that action at this time.
0 commit comments