4.2.1. Segger Ozone debugger
Segger Ozone is the debugging software that is supplied by Segger with the higher tier debug probes such as the Segger J-Link PLUS. Please refer to the Ozone-manual and read it carefully before using the software.
After setting up the hardware connection you should be able to load the Ozone configuration. For details on where to find a ready configuration for foxBMS 2, please refer to Section 3.1.11.
188.8.131.52. Common pitfalls
When creating too many cyclically updated entries in the watch window, the debugger seems to stop and read the target so often that it impacts the system performance. Being aware of this issue and keeping an eye on the number of automatically updated variable watches should mitigate this issue.
184.108.40.206. Lookup program location of assertion
In the case that the program has asserted, the location of the assertion will
be written to
fas_assertLocation.pc as mentioned in
Debugging the Application.
With Ozone, the location of this assertion in the program code can be looked up as follows:
fas_assertLocationhas to be viewable in
Global Dataor in
It has to be updated (ideally by pausing program execution).
fas_assertLocationso that the members are shown. Do not unfold
Right-click on the
pcand select “Show Value in Source”.
Ozone will show the code location from where the failing assertion originated.
220.127.116.11. Break on an assertion
It can be helpful to configure Ozone to break when a new assertion location
is written to
fas_assertLocation.pc. This can be achieved by setting a data
breakpoint on this variable.
The configuration that is supplied with this project automatically adds
fas_assertLocation to the watch window and sets a data breakpoint on
fas_assertLocation.line. (It uses
.line and not
.pc, because this
member is written secondly and therefore
.pc is already written when the
debugger halts.) In order to prevent that this breakpoint is
triggered during the decompression of the RAM, the debugger is configured to
automatically clear the breakpoint before a reset and to set it when the
probe has detected a completed initialization phase.
18.104.22.168. Tracing with Segger J-Trace PRO Cortex
Apart from debug probes, Segger also supplies trace probes. With these devices it is possible to stream internal information from the MCU such as the program counter directly to the debugger. For the TMS570LC4357 target it is necessary to use the Segger J-Trace PRO Cortex model. According to its documentation it is able to trace with a data width of 4 bit.
Segger supplies with their debug probes also a software called J-Flash. This software allows to download software into a target without a debug session.
The foxBMS 2 toolchain has a wrapper for J-Flash that allows to use the utility
directly from waf. This allows the user to call waf with the
command in order to build and directly download in the connected target. This
feature can be used for integrated tests that have to download the compiled
software into a target. For the user’s convenience, the
Flash:Binary build target that allows to call this action
directly from the IDE.