Using the Cube: with Visual Studio and Nano lib supporting printing of floats. sprintf crashes if the CDC USB output is not plugged into the PC
unplug my CDC USB output cable and
sprintf( string, "%.2f ",myFloat); will crash
plug it back in to the PC and without any comms, it works.
could it be a memory leak if the CDC driver is not handshook ?
anyhow the CUBE didn't allocate enough Stack space.
fixed here: in the stm32L4xx_flash.lds file
.reserved_for_stack (NOLOAD) :
{
. = ALIGN(4);
PROVIDE(__reserved_for_stack_start__ = .);
KEEP(*(.reserved_for_stack))
. = . + 0x100; /* <--- fixed here */
. = ALIGN(4);
PROVIDE(__reserved_for_stack_end__ = .);
} > SRAM