Hello,
I am using MIMXRT1061XVN5B, in my project I have to enable multiple sources of interrupts (all PITs and 7 out of 8 UARTs), in the same project I use also an external nor flash memory, at the beginning, I got a strange behavior and I got to know that the flash transfer shouldn't be interrupted in the middle of the transfer, I made sure that this was the problem by disabling all interrupts before any flash transfer and enabling them again after it is done. It's kind of crucial to miss any event that can happen on any of the UARTs or to miss timer-based calls, so I tried to use the flash transfers with DMA, the transfer itself works fine but I had the same problem if I don't disable the interrupts and this was kind of odd as the DMA should take care of the transfer leaving the processor out of it. Are there any pointers to how can I solve this? or any other way that I can manage to do the flash transfers without disabling the interrupts?
Thanks.
解決済! 解決策の投稿を見る。
Hi Lukaz,
are you using a read-while-write flash?
If your answer is no:
You can't write to the flash and exectue from it at the same time (the flash write function needs to be located in RAM too).
If you can't disable interrupts you will have to find another solution. Examples would be:
- copying everything that gets executed while the flash is written to to internal RAM after booting and execute from there (or all code if your application is small enough), use flash only as data storage and for booting
- use a second flash as data storage
- execute from external SDRAM and use flash only as data storage and for booting
Kind regards,
Stefan
Hi Lukaz,
are you using a read-while-write flash?
If your answer is no:
You can't write to the flash and exectue from it at the same time (the flash write function needs to be located in RAM too).
If you can't disable interrupts you will have to find another solution. Examples would be:
- copying everything that gets executed while the flash is written to to internal RAM after booting and execute from there (or all code if your application is small enough), use flash only as data storage and for booting
- use a second flash as data storage
- execute from external SDRAM and use flash only as data storage and for booting
Kind regards,
Stefan
Hello Lukaz,
maybe one of these hints may help you to solve your problem:
- are you executing from the same flash you are writing to?
- is your interrupt vector table located in the flash you are writing to?
- is any of the interrupt service routines located in the flash you are writing to or do they use data/call functions located in flash?
- does another flash transfer get started before the last one is finished (e.g. in one of your interrupts)?
- does any other function (e.g. uart transfers) use DMA and is the DMA priority setting for that transfer higher than the flash transfer (and is interrupting of dma transfers activated)?
Kind regards,
Stefan
Hello Stefan,
thanks for your reply, to answer your questions:
- yes
- yes
- yes
- no
- no
Do you have a better view now about why this is happening?
Thanks in advance.