Load_ram esptool

psinad
Posts: 2
Joined: Fri Nov 04, 2016 1:09 pm

Load_ram esptool

Postby psinad » Fri Feb 17, 2017 2:55 pm

Hi,
I want to speed up development and use "load_ram" in esptool.py .
First I've done
"make app"
$ python /C/esp32/esp32_sdk/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port COM15 --baud 115200 load_ram /C/esp32/tests/ESP32_CAN_demo/build/CAN_demo.bin
esptool.py v2.0-beta1
Connecting.....
Uploading stub...
Running stub...
Stub running...
WARNING: Suspicious segment 0x0, length 0
WARNING: Suspicious segment 0x0, length 0
WARNING: Suspicious segment 0x0, length 65512
WARNING: Suspicious segment 0x3f400010, length 25016
WARNING: Suspicious segment 0x3ffb0000, length 9276
WARNING: Suspicious segment 0x40080400, length 81036
RAM boot...
Traceback (most recent call last):
File "C:/esp32/esp32_sdk/esp-idf/components/esptool_py/esptool/esptool.py", line 2261, in <module>
main()
File "C:/esp32/esp32_sdk/esp-idf/components/esptool_py/esptool/esptool.py", line 2060, in main
operation_func(esp, args)
File "C:/esp32/esp32_sdk/esp-idf/components/esptool_py/esptool/esptool.py", line 1503, in load_ram
for (offset, size, data) in image.segments:
TypeError: 'ImageSegment' object is not iterable

Any hint why I got those errors or what should I do to got it right?

Salve,
Dan

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Load_ram esptool

Postby WiFive » Fri Feb 17, 2017 5:38 pm

How does that speed up things, especially at 115200? You have a firmware linked and able to run from iram only?

psinad
Posts: 2
Joined: Fri Nov 04, 2016 1:09 pm

Re: Load_ram esptool

Postby psinad » Fri Feb 17, 2017 8:25 pm

Maybe I had to ask the question in a different way: is "load_ram" documented somewhere? How is supposed to work?
Actually what I try to achieve is the possibility to write small snippets of code, to download code only in RAM, avoid to write to flash.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Load_ram esptool

Postby kolban » Sat Feb 18, 2017 6:38 am

From what I understand, this esptool subcommand takes a file and copies the content of that file into RAM and then executes ... quite where execution is passed ... I don't know. I am however interested in your end goal. What do you see as the value of loading snippets into RAM for execution? Do you have a special project in mind or is the goal to reduce the edit/compile/flash/run cycle? ... or something else.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

RetroDISTORT
Posts: 4
Joined: Fri Oct 13, 2017 5:44 am

Re: Load_ram esptool

Postby RetroDISTORT » Sat Jan 26, 2019 10:47 pm

So it is possible to execute code from ram?

ESP_Sprite
Posts: 9761
Joined: Thu Nov 26, 2015 4:08 am

Re: Load_ram esptool

Postby ESP_Sprite » Mon Jan 28, 2019 2:31 am

Yes, it is; as long as you put your code in IRAM instead of DRAM, there's no problem executing it. See for instance the IRAM_ATTR function attribute in esp-idf.

Who is online

Users browsing this forum: Google [Bot], pacucha42 and 96 guests