On 5/31/2018 12:01 AM, Danilo Beuche wrote:
Hi,


On 31.05.2018 08:41, Steve wrote:
It just dawned on me, that the stm32 normally executes its programs
out of flash.

Yes, this is often the case. See below.
I was thinking the flash stored the software, and the first thing it
did, was move the code to ram for execution. I was thinking the flash
access time was too slow.

It is slower, indeed but due to the fairly low amount of internal RAM,
for the STM32F4 the code is in general executed straight out of flash.
Of course it is possible to move some or all code to RAM if you have
enough spare.

I don't believe this is necessary; the 'F4-series have the ART
accelerator and 128-bit wide flash. Between the two, there's
very little penalty running out of flash.

https://eda360insider.wordpress.com/2011/09/22/ingenious-architectural-features-allow-st-micro-to-extract-maximum-performance-from-new-microcontroller-family-based-on-arm-cortex-m4-cost-less-than-6-bucks-in-1000s/

Before going to the trouble to move flash code to RAM, it's worth
making sure there's an issue by benchmarking - I suspect this will
never come up in reality.

Also note that moving code into RAM introduces the possibility
of contention between code and data fetches, which will substantially
reduce performance. ST provides CCM RAM in some parts with the
intention that it is used to hold code moved from flash; CCM RAM
isn't usable with DMA and, if no data is stored in it, avoids code/data
contention. If you store data and code in CCM, you once again get
access contention and the association performance hit.

This means even if you move code to RAM, you might not see the
performance improvement you expect.

Cheers,
Dana  K6JQ


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Freetel-codec2 mailing list
Freetel-codec2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freetel-codec2

Reply via email to