cancel
Showing results for 
Search instead for 
Did you mean: 

Why is my MP135 program running so slowly?

morthy
Associate II

my code only made changes the io, no rtos, no interrupt, but it cost over 1 us.  the picture is that io sta. and clockp1.jpgp2.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

Hi @morthy 

maybe you missed to enable the I & D caches ?

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
PatrickF
ST Employee

Hi @morthy 

maybe you missed to enable the I & D caches ?

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

oh,you are right, after i enable the cache,the runtime speed doubled.

thank you

Hi,

only doubled ?

I guess only Instruction cache were enabled (as it is simple as set a bit).

Data cache might bring more perf (e.g. write to GPIO section will be posted, so 0 waits), but this need to setup MMU with correct regions (usually sections attributes are : memories as "NORMAL", peripherals as "DEVICE" ).
I'm not fully knowledgeable on how to do it with HAL, but I assume functions to do such exists (maybe examples).

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

When running the DDR example in STM32Cube_FW_MP13_V1.1.0, it takes 1.25us. after manually enabling the cache, the runtime is about 660ns. however, after downloading x-cube-freertos-mpu from GitHub and running the same code, the runtime is approximately 220ns.the rtos project exactly enable MMU and Cache