RFQ/BOM 0 Sign In / Register

Select Your Location

user image

The stm32F449 test code compilation cycle is too long.

MCU
December 21, 2020 by Jina 1826

sprintf(rgbhChar,"%4.4f",1234.5678);


After testing it, this sentence took 18740 machine cycles.

In my impression, I have tested Keil's C51 before, and it seems that the more complicated conversion is only 2K~4K machine cycles (a long time, is the memory accurate?)


The current CPU is STM32F449, the compiler is IAR, and the hardware multiplier has been selected in the engineering tab.

Why is it so slow?

All Comments

user image

Jihan Posted on December 21, 2020

Is the test code on C51 consistent? Could it be caused by different test conditions?

0
user image

Mulan Posted on December 21, 2020

It is useful to compare under the same conditions; it is recommended to figure out what the c51 is.

0
user image

Bailyn Posted on December 21, 2020

1. Why is the instruction (cycle) difference after compilation for the same C statement so much? Is this the case for the reduced instruction set?

2. For library functions, they should all be provided with obj, that is, they are all pre-compiled.

0
user image

Wing Posted on December 21, 2020

This is the characteristic of the reduced instruction set. For the same operation, the number of compiled instructions will be much larger (depending on what you are doing, some require more instructions, some require less).

0

Write an answer

You need to log in to reply. Sign In | Register