Skip to main content
Associate II
June 26, 2025
Solved

Why is my MP135 program running so slowly?

  • June 26, 2025
  • 1 reply
  • 503 views

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

Best answer by PatrickF

Hi @morthy 

maybe you missed to enable the I & D caches ?

Regards.

1 reply

PatrickF
PatrickFBest answer
Technical Moderator
July 3, 2025

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.NEW ! Sidekick STM32 AI agent, see here
morthyAuthor
Associate II
July 9, 2025

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

PatrickF
Technical Moderator
July 9, 2025

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.NEW ! Sidekick STM32 AI agent, see here