2019-08-12 01:48 AM
Used cube to generate a project with default settings for STM32F429I disco board plus CMSIS V2 RTOS and USART 2 half duplex transmit only . Generated the code for System Workbench.
I retargeted _write() and provided __io_putchar(). I added -u _printf_float to the linker flags.
In the StartDefaultTask I added
float fVal = 345.678;
printf("Hello World\r\n");
printf("fVal %f\r\n",fVal);
Output
Hello World
fVal . !
Issues
With -specs = nosys.specs -specs= nano.specs -u _printf_float - printf causes a hard fault.
With specs = nosys.specs -specs -u _printf_float - 1st printf OK 2nd printf produces incorrect output
2019-08-20 05:27 AM
@Dave Nadler
Hello Dave. I implemented your solution with heap_useNewlib.c and it worked.
If I'm understanding it correctly ANY kind of dynamic memory assignment is now coming out of the RAM between end and _estack.
That's all printf family type stuff and all RTOS tasks/objects.
Have you had any experience of running out of heap in a reasonable sized project. On our last project we had an external sdram and directed all RTOS activity to that.
2019-08-20 06:04 AM
@davidregan9 - Yes you understand correctly; all malloc'd memory is consolidated. In next few days I'll post an update (on web page linked above) with better control of and diagnostics for the separate stack used for ISRs. I haven't had too much trouble with running out of space and I always put detailed diagnostics into the application (checking task stacks, heap, and shortly the ISR MSP stack).
Glad my solution helped you,
Best Regards, Dave
PS: @Markus GIRDLAND - Any progress getting these fixes integrated into CubeMX??
2019-08-20 06:20 AM
@Dave Nadler
Excellent piece of work. Never had occasion to use --wrap switch so that took a couple of go's
2019-08-20 07:35 AM
@Dave Nadler Thank you for replying. I was starting to think nobody was out there.
2019-08-27 01:42 AM
Sorry for the late reply, I've been out-of-office.
I haven't heard any status update regarding this from the CubeMX team as of yet.
As soon as it is implemented they'll share it with the IDE team.