cancel
Showing results for 
Search instead for 
Did you mean: 

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

Dima Sagalov
Associate II
Posted on March 01, 2018 at 14:34

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

0690X00000609krQAA.png

the following codeto 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 footprintsize is reduced by 4K.

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

My Simulink model took up less space than this library!

Well, it is not optimal toadd 4К size floating pointlibrary 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!

#stm32-mat/target-matlab #simulink
1 REPLY 1
Posted on March 05, 2018 at 11:06

Hi, Dima

I have implemented a fix I will send you as soon as possible.

Best regards,