AnsweredAssumed Answered

STM32-MAT/TARGET. Prohibiting a floating point reduces execution time, but not the footprint size

Question asked by Dima Sagalov on Mar 1, 2018
Latest reply on Mar 5, 2018 by Aimagin Co., Ltd.

If the check box 'floating point number' is unchecked in 'Model Configuration Parameters':

 

the following code to configure the system timer is still generated:

/* USER CODE BEGIN 2 */
/* Systick configuration and enable SysTickHandler interrupt */
if (SysTick_Config((uint32_t)(SystemCoreClock * 0.001))) {
autoReloadTimerLoopVal_S = 1;
do {
autoReloadTimerLoopVal_S++;
} while ((uint32_t)(SystemCoreClock * 0.001)/autoReloadTimerLoopVal_S >
SysTick_LOAD_RELOAD_Msk);
SysTick_Config((uint32_t)(SystemCoreClock * 0.001)/autoReloadTimerLoopVal_S);
}
remainAutoReloadTimerLoopVal_S = autoReloadTimerLoopVal_S;//Set nb of loop to do
/* USER CODE END 2 */

where 0.001 is the model execution time step specified in the Simulink model.

 

If replace this code to

/* USER CODE BEGIN 2 */
/* Systick configuration and enable SysTickHandler interrupt */
if (SysTick_Config((uint32_t)(SystemCoreClock / 1000))) {
autoReloadTimerLoopVal_S = 1;
do {
autoReloadTimerLoopVal_S++;
} while ((uint32_t)(SystemCoreClock / 1000)/autoReloadTimerLoopVal_S >
SysTick_LOAD_RELOAD_Msk);
SysTick_Config((uint32_t)(SystemCoreClock / 1000)/autoReloadTimerLoopVal_S);
}
remainAutoReloadTimerLoopVal_S = autoReloadTimerLoopVal_S;//Set nb of loop to do
/* USER CODE END 2 */

then footprint size is reduced by 4K.

4К, for a minute, is 1/4 of the total size of the STM32F030F4 flash memory!

My Simulink model took up less space  than this library!

Well, it is not optimal to add 4К size floating point library only for the sake of one-time calculation!

 

P.S.

I do not think that by this post I will open America for anyone who is involved in the development of this product! Most likely, this is a conscious victim! But it would like to see this issue solved in future releases!

 

Thanks!

Outcomes