2009-08-04 01:15 AM
Execute code from External memory
2011-05-17 03:50 AM
2011-05-17 03:50 AM
There is a 3-word instruction fetch buffer inside the Cortex-M3 processor. This buffer applies to program execution from flash as well as from SRAM or external memory.
Beside from that, there is also a flash memory prefetch unit directly couple to the flash. This only applies to executing program from flash memory. Instruction fetch on the Cortex-M3 processor is always 32-bit. For each instruction fetch, it will have to be divided into two 16-bit accesses. And there might be wait states for each 16-bit read, as well as data registering stage for feeding back the external data to the processor, so it will be less than half of the speed. However, for each access you could be fetching 2 16-bit instructions, so the ratio of execution speed cannot be calculated in a straight forward manner. The best thing to do is to try and see. [ This message was edited by: joseph.yiu on 02-11-2008 12:16 ]2011-05-17 03:50 AM
Thanks Joseph & Moderator.
The old thread mentions a 11 times difference in execution speed. Assuming this 11 times was for a NOR flash, a PSRAM would reduce that to 8.2 times (assuming 70 ns PSRAM & 93 ns NOR flash). Even with a PSRAM, the effective MIPS would be then ~10 @ 72MHz (assuming ~86MIPS @ 72Mhz when executing from internal Flash). Such a big difference recommends one to _not_ to use the STM32 if the code size is more than 512KB. Can someone from ST confirm if these results are as expected?2011-05-17 03:50 AM
Thanks Joseph for the detailed comments. However, I believe that rs1 is talking about the Prefetch buffer coupled to the flash, which , as you have said, accelerates the execution only out of Flash, For more details refer to PM0042 ''STM32F10xxx Flash programming'' , section ''Read Operation''.
For the Comparison between External NOR and Internal(Flash) code execution, You can refer to these results posted in this thread : Cheers, STOne-32.[ This message was edited by: STOne-32 on 02-11-2008 15:30 ]