Hello. I have seen that esp32 support XIP (https://open4tech.com/execute-place-xip-memory-model/). And I also found that some changes to the linker script can enable it (https://github.com/zephyrproject-rtos/zephyr/pull/30424 as it was done here).
I am interested how to do this with esp-idf. Maybe there is flag in menuconfig to enable it. I would be grateful if you could provide me any additional info. Thank you.
XIP: Need help with enabling execute in place in esp-idf
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: XIP: Need help with enabling execute in place in esp-idf
ESP-IDF already uses XIP for the large majority of the code generated. Is there anything specific that you want to achieve with this?
Re: XIP: Need help with enabling execute in place in esp-idf
Thank you for replying. How to detect that XIP is enabled?ESP_Sprite wrote: ↑Sun Jul 04, 2021 2:04 pmESP-IDF already uses XIP for the large majority of the code generated. Is there anything specific that you want to achieve with this?
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: XIP: Need help with enabling execute in place in esp-idf
Well, if you build your program using esp-idf, it always uses XIP for most of the code because otherwise most programs wouldn't fit in memory. But if you want specifics, run 'idf.py size', the part where it says 'flash code' will be executed as XIP. (Something similar goes for 'flash data' but it's not executed... it's directly loaded from flash, though.)
Re: XIP: Need help with enabling execute in place in esp-idf
So most of the time we cannot use external SPI-connected RAM, as it it is using same SPI. Thank you!ESP_Sprite wrote: ↑Mon Jul 05, 2021 1:38 pmWell, if you build your program using esp-idf, it always uses XIP for most of the code because otherwise most programs wouldn't fit in memory. But if you want specifics, run 'idf.py size', the part where it says 'flash code' will be executed as XIP. (Something similar goes for 'flash data' but it's not executed... it's directly loaded from flash, though.)
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: XIP: Need help with enabling execute in place in esp-idf
Define "cannot use"? If you mean the PSRAM that sits on the same bus in e.g. the Wrover modules; it's accessed via the same mechanism XIP uses so outside of the times you need to do something bypassing that mechanism (specifically flash erases and writes, in which case most code is suspended anyway), RAM is perfectly usable. Same goes for user-defined stuff you talk to via the SPI driver: while you're accessing any other SPI device on that bus, code execution is mostly suspended, but it will happily resume after you're done.
Re: XIP: Need help with enabling execute in place in esp-idf
bembite wrote:"cannot use"
Thank you!ESP_Sprite wrote: ↑Wed Jul 07, 2021 12:59 amDefine "cannot use"? If you mean the PSRAM that sits on the same bus in e.g. the Wrover modules; it's accessed via the same mechanism XIP uses so outside of the times you need to do something bypassing that mechanism (specifically flash erases and writes, in which case most code is suspended anyway), RAM is perfectly usable. Same goes for user-defined stuff you talk to via the SPI driver: while you're accessing any other SPI device on that bus, code execution is mostly suspended, but it will happily resume after you're done.
"cannot use" - I thought that in XIP mode this SPI buss is used for reading instructions from extflash and cannot suspend.
My fault, need more doc reading...
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 113 guests