FlashX driver disables interrupts

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FlashX driver disables interrupts

804件の閲覧回数
janahan
Contributor I
Why does the flashx driver need to disable interrupts during some of its operations like erasing sectors, etc.?
0 件の賞賛
1 返信

353件の閲覧回数
trailman
Contributor V

When a flash is beeing written/erased, it can not be read at the same time.

But to execute some code from a flash, a CPU need to fetch (read) the code from this flash.

So as a result, to erase or write a flash when the code is running from the same flash :

- the small code launching the real erase/write and waiting for completion must be copied to RAM run from RAM. The code jumps from flash to this code in RAM, then returns to flash when done.

- the interrupts must be disabled to prevent an interrupt from branching the CPU to an interrupt handler in flash, and to prevent the task from beeing preempted by another running from flash.