There is an driver example project in the SDK flexspi_hyper_flash_polling_transfer that shows how to access the FlexSPI flash but only when running from RAM. Is it possible to erase/write to a sector of the FlexSPI flash when executing in place (XIP)?
解決済! 解決策の投稿を見る。
Hi Bruce
this may depend on used flash part and one can consult with its vendor, as
if the processor is running in XIP mode using the SPI interface, one can’t simply modify
(i.e., erase/write) that SPI flash device. That’s because it may require taking the SPI peripheral
out of XIP mode and putting it into SPI mode, which could crash the system.
More considerations can be found for example on
http://www.electronicdesign.com/embedded-revolution/xip-linux-new-spin-embedded-architecture
SPI Flash - SEGGER - Support Wiki
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi brucebarnes,
It is not possible to erase/write flash when in xip from the same flash.
You can use a small hack though.
If you have enough amount of RAM available, you can execute all the code dealing with flexspi and qspi from the RAM. Thus, it would not interfere with any xip sequences.
Hi 2winkle
Regarding your statement "It is not possible to erase/write flash when in xip from the same flash."
Is this because of the (I am assuming Linux is used in this case):
4. any combination of the above or some other reason?
In case it's the SOC, do you know if i.MX 8qx/dx can do such a thing?
Hi sbuligan@visteon.com,
As per my understanding, a NOR flash accessed via SPI interface can be read from and written at the same time, as SPI interface is bi-directional (full-duplex). But, if in XIP mode, and the code implementing the read/write transactions are present in the NOR flash, read and write will not be possible simultaneously. Please do correct me if I am wrong.
I have not worked with XIP in linux, but I think that the kernel will already be executing from some form of RAM. So, using the SPI drivers in the kernel shouldn't affect the read/write cycle. I am not entirely sure though.
This query along with the one for i.MX 8qx/dx can be asked as a separate question tagged with linux, xip and imx8. You will surely get a better answer there.
Also, do read this article :smileyhappy:
Hi, thanks for the reply, I actually read the article before posting the question. Even if the commands are present inside the NOR, couldn't they be cached? If you can't or let's say you don't want to ever delete the command LUT, if the NOR chip supports read while write I imagine you could do the following scenario: erase parts of the flash you are currently not XIPing from... but I'll guess I'll find out with experience :smileysilly:
Is it possible to read and write on another norflash? Here's the situation: portA put the program, xip mode; Another norflash(portB) puts the data, but it doesn't work.
Is it because flexspi shares a bus??
Hi jixiaohu,
Make sure the SPI NOR flashes are connected in 'parallel mode'.
yes, read and write on another norflash is possible.
Best regards
igor
Hi Bruce
this may depend on used flash part and one can consult with its vendor, as
if the processor is running in XIP mode using the SPI interface, one can’t simply modify
(i.e., erase/write) that SPI flash device. That’s because it may require taking the SPI peripheral
out of XIP mode and putting it into SPI mode, which could crash the system.
More considerations can be found for example on
http://www.electronicdesign.com/embedded-revolution/xip-linux-new-spin-embedded-architecture
SPI Flash - SEGGER - Support Wiki
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------