Page 1 of 1

Load_ram esptool

Posted: Fri Feb 17, 2017 2:55 pm
by psinad
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

Re: Load_ram esptool

Posted: Fri Feb 17, 2017 5:38 pm
by WiFive
How does that speed up things, especially at 115200? You have a firmware linked and able to run from iram only?

Re: Load_ram esptool

Posted: Fri Feb 17, 2017 8:25 pm
by psinad
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.

Re: Load_ram esptool

Posted: Sat Feb 18, 2017 6:38 am
by kolban
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.

Re: Load_ram esptool

Posted: Sat Jan 26, 2019 10:47 pm
by RetroDISTORT
So it is possible to execute code from ram?

Re: Load_ram esptool

Posted: Mon Jan 28, 2019 2:31 am
by ESP_Sprite
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.