Skip to main content
Pramod singh
Associate II
October 31, 2017
Question

Can you please find out and tell me, what is the no of clock cycles required to execute a single instruction in stm32f072. In our case at a frequency of 48 MHz the fastest speed i could achieve is 200n sec which is quite slow if we compare with the s

  • October 31, 2017
  • 2 replies
  • 875 views
Posted on October 31, 2017 at 06:45

STM32F0 command execution speed

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    October 31, 2017
    Posted on October 31, 2017 at 14:54

    Can we please try to leave the entire question out of the title. Edit to put the question into the question field, and a summary in the title....

    200ns is rather slow, how are you measuring this?

    What are you measuring? One C line may translate into many assembler instructions, it is those that nominally take 1 cycle.

    The problem at 48MHz is that it isn't 24MHz x2 in terms of performance, the wait state from the flash predominates.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Jack Peacock
    Visitor II
    November 1, 2017
    Posted on November 01, 2017 at 02:41

    SRAM is no wait state, so if you're trying for fastest instruction rate run the code from there.  From flash make sure the prefetch is turned on, Vcore at right voltage range, and latency set properly.  Are you using an HSE with a crystal?  Don't use an internal RC oscillator for SYSCLK, you build in a 1% error that way.

    If you're toggling GPIO pins to generate a signal that's an unreliable measurement.  Run a loop with 100,000 iterations or some count under the ppm rating on your HSE crystal, do a before and after timer capture with timer clocked from system bus.  That'll give you a better metric.

      Jack Peacock

    Pramod singh
    Associate II
    November 7, 2017
    Posted on November 07, 2017 at 10:27

     ,

     ,

    Hii Jack,

    Thank You For your reply, Can you please guide me with the procedures of how to switch ,–mlong-calls , ,in specific compiler on ,System Workbench for STM so that i can use, ' , , ♯ define RAMFUNC __attribute__ ((long_call, section ('.ramfunctions'))) ,  ,'.