Skip to main content
Visitor 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

    This topic has been closed for replies.
    Best answer by PatrickF

    Hi @morthy 

    maybe you missed to enable the I & D caches ?

    Regards.

    1 reply

    PatrickFAnswer
    Technical Moderator
    July 3, 2025

    Hi @morthy 

    maybe you missed to enable the I & D caches ?

    Regards.

    morthyAuthor
    Visitor II
    July 9, 2025

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

    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.