Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


FPU issue in function call (STM32F407 and STM32F429)

Hello,

i recognized a strange behavior between STM32F407 and STM32F429 librarys. I tried to convert a double to string with a simple function i wrote by myself.


void double2str( double value, char *str, uint8_t precision );



If i use a simple code just convert a single double and transmit this with USART the STM32F407 get stuck (Hardware fault). If i use the identical code at STM32F429 everything is fine.
I tried to use a pointer for the double value and it works at the STM32F407:


void double2str( double *value, char *str, uint8_t precision )
(
double val2 = *value;
...



So something ist worng with the function call and the double value.
Is there a way to fix this?

I can not change hard ABI to soft, or softfp. This causes many errors in the StandardPeripheralLibraries while building the project.

Thanks, Erik

Erik, We need more info to go on. If you could post the entire double2str routine.
And, what kind of hard-fault? Usually a hard-fault means something wrong with the stack, if there were an FP error you would just get the wrong number.
Have you tried stepping through the routine in the debugger?

-Matt


Hello,

the function “double2layer” has no important content. It is just the double value given to the function which causes the error. (i earased the whole content - the fault still happens)


void double2str( double value, char *str, uint8_t precision )
{
if( value >= 0 )
*(str++) = ‘+’;
else{
*(str++) = ‘-‘;
value = -value;
}
}


If i copy this function into the calling routine everything works fine.
Or this way works too:


void double2str( double *val, char *str, uint8_t precision )
{
double value = *val;

if( value >= 0 )
*(str++) = ‘+’;
else{
*(str++) = ‘-‘;
value = -value;
}
}



When i try to debug i get into this at the function call:


/**
* @brief This is the code that gets called when the processor receives an
* unexpected interrupt. This simply enters an infinite loop, preserving
* the system state for examination by a debugger.
* @param None
* @retval None

  • /

.section .text.Default_Handler,”ax”,%progbits
Default_Handler:
Infinite_Loop:
b Infinite_Loop
.size Default_Handler, .-Default_Handler