Debugger-based On-Target Testing
|
To make the initial effort for new users as low as possible when evaluating DOTT, a cheap off the shelf reference platform was selected. All examples which are provided with the DOTT framework are pre-configured for this reference board. The reference board comes with and on-board debugger such that no additional hardware is required for the evaluation of DOTT.
The reference platform is STM32F072 Nucleo-64 board equipped with a Cortex M0 clocked at up to 48Mhz, 128KB on-chip flash and 16KB of on-chip SRAM. For evaluating DOTT, the board can be purchased for about 10 Euros at Farnell or other distributors (ST order code: NUCLEO-F072RB). Note that most of the example code is generic such that it can be built for and executed also on other Coretx-M0 devices. Only some parts of the examples make use of peripherals specific to the STM32F072 and hence would need to be ported. A picture of the board is shown below.
The reference board is divided into two halves, a bigger section carrying the STM32F072 MCU together with two buttons and I/O pins and a smaller section (with USB connector) implementing an ST-Link debugger. Via a firmware update the ST-Link debugger can be transformed into a J-Link debug probe.
Note: If you already have a Segger J-Link debug probe available you can skip this section and follow the steps outlined in the next section below.
For use with DOTT, the ST-Link debugger is now converted into a Segger J-Link debug probe. The conversion process is summarized below. Additional background on this topic and an extended description is provided on the Segger website.
ST-Link to J-Link conversion summary:
- Install the ST-Link USB drivers which can be downloaded from the [ST website][https://www.st.com/en/development-tools/stsw-link009.html]. Execute
dpinst_amd64.exe
to install the driver.- Connect the STM32F072 board to your PC via USB and execute the ST-Link reflash utility
STLinkReflash.exe
available for download at the [Segger website][https://www.segger.com/downloads/jlink#STLink_Reflash]. Follow the steps to upgrade your device to J-Link.- It is assumed that you already have the J-Link software package installed as described in the setup guide.
Once you have completed these steps, you can now verify that the J-Link probe works as expected. This is described in the following section.
If you want to convert the J-Link debugger back to the original ST-Link debugger this can also be done with the STLinkReflash.exe
utility.
To do so start the J-Link GDB Server
from the Segger folder in the start menu. In apply the settings as show in the screenshot below (USB, SWD, device type).
Click OK
and accept Segger's terms of use. If you have multiple J-Links connected to your system the tool will next ask you which one to use. Please ensure to select the correct one. If the conversion from ST-Link to J-Link was successful you should next see a window as shown below. The 'LEDs' in the J-Link
and Device
should be green. You can now close the GDB server window.
Note on terms of use: Please note that Segger's terms of use limit the application of this converted ST-Link/J-Link debug probe to ST target devices on evaluation boards. Using it with custom hardware of beyond evaluation purposes is not allowed. Please keep that in mind if your evaluation of DOTT was successful and you would like to apply it in your project.
If you already have a J-Link debug probe and want to use this instead of converting the on-board ST-Link to J-Link this is also possible. For this you have to perform the following steps.
Connect existing J-Link to target:
- Disconnect the USB cable form the STM32F072 board (the target will be powered via the J-Link)
- Remove the two jumpers on the CN2 header.
- Set the C20 jumper to E5V (external 5 volt supply instead of the default setting U5V)
- Connect the SWD data and clock lines as well as nReset, GND, 5V and VTRef as shown in the figure below.
Assuming that you have the J-Link tools already installed, you can now check the connection to the target device as described in a previous section.