FlexSEA Wiki

A WEARABLE ROBOTICS TOOLKIT

User Tools

Site Tools


manage:debugger_tips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
manage:debugger_tips [2019/12/17 17:06]
rharris
manage:debugger_tips [2019/12/17 21:47] (current)
rqurashi
Line 47: Line 47:
 Not shown on this screenshot is another problematic situation: having certain sectors protected. Not shown on this screenshot is another problematic situation: having certain sectors protected.
  
 +===== Printing Floats =====
 +
 +Printing floats is not enabled on most embedded systems by default, including STM32. ​
 +
 +To enable printing floats, you must add "-u _printf_float"​ to the linker flags in cmake/​chip/<​chip_name>​_definitions.cmake
 +
 +For example:
 +<code c>
 +set(MANAGE_LINK_FLAGS "-u _printf_float -specs=rdimon.specs"​)
 +</​code>​
 +
 +In general we want to have this feature turned off for code size reasons, but it is essential for debugging complex code involving floats.
 +
 +There also seems to be a bug in the provided cmake/​obko/​stm32_linker.cmake
 +By default the _estack variable is set as follows:
 +<code c>
 +_estack = ${STM32_RAM_ORIGIN} + ${STM32_RAM_SIZE} - 1
 +</​code>​
 +It should be set as follows, or else float prints will not work:
 +<code c>
 +_estack = ${STM32_RAM_ORIGIN} + ${STM32_RAM_SIZE}
 +</​code>​
manage/debugger_tips.txt ยท Last modified: 2019/12/17 21:47 by rqurashi