cancel
Showing results for 
Search instead for 
Did you mean: 

memset() execution slower at some addresses

DApo.1
Associate II

Hello,

After some investigation was found that memset has different behavior executed from different places in flash. Data and instruction cache are off! Micro used is stm32h743xi.

Function is called with following arguments --> memset(dummy, 0, 64)

Its execution time is ~5us when function is placed at:

..., 0x8040c34, 0x8040c54, 0x8040c74, ...

Its execution time is ~1us when function is placed at:

..., 0x8040c3c, 0x8040c44, 0x8040c4c , 0x8040c5c, 0x8040c64, 0x8040c6c ...

Any ideas?

Thanks

10 REPLIES 10
DApo.1
Associate II

You caught me again :). I had to go down to 1 MHz timer frequency to avoid the overflow in the slow measurement when there is 64000.

Here are the corrected measurements:

bytes   slow  fast

B   us   us

64   5.11   0.99

640   45.4   5.22

6400   449   49

64000  4481  480

The good news is that instruction cache is solving the issue.