We have given enough information to the SES to build
a skeleton of our project. SES has also assembled the
necessary include and startup files according to the entries
we made during the new project setup process. The
leftmost area of Screenshot 4 displays our DesignCycle1
project layout, while the right hand area of Screenshot 4
welcomes us to the SES. This is a good place to stop and
explore the features of the SES.
Attaching the J-Link PRO
Now that we have the SES pointed in the
STM32F030R8T6 direction, we will need to perform some
hardware work that will allow us to utilize the combined
power of the J-Link PRO and the SES.
The STM32F0308-DISCO is packaged with a bare
through-hole printed circuit board (PCB) whose hole pitch
The J-Link PRO you see in Photo 2
sports a standard five-pin JTAG interface
positioned on a 20-pin male header. The
STM32F030R8T6 uses a two-pin SWD
(Serial Wire Debug) programming
interface. SWD replaces the five-pin JTAG
interface with a clock pin (SWCLK) and
bidirectional data pin (SWDIO). The
SWCLK signal is attached to the JTAG TCK
pin, while the SWDIO signal overlays the
JTAG TMS signal. The SWD conversion is
very easy to perform. The construction
plan is laid out in Schematic 1 and the
physical result is shown in Photo 3.
We must remove the pair of CN2
jumpers. Removing the jumpers severs the
logical link between the STM32F0308-
DISCO’s built-in ST-LINK/V2 programmer/
debugger and the STM32F030R8T6. We can
still get power for the STM32F030R8T6 via
the STM32F0308-DISCO’s USB portal.
The original idea behind the CN2
jumpers is to allow the STM32F0308-
DISCO’s built-in ST-LINK/V2 to be used as a
standalone programmer/debugger via the
CN3 header pins.
If we’ve assembled our SWD interface
correctly, the SES should see the J-Link PRO
and allow a connection. Screenshot 5
confirms our success. The STM32F0308-
DISCO is powered up and attached to the J-Link PRO, which is recognized by the SES.
It’s time to write some code.
If we are to be successful ARM programmers, we
must understand the ARM architecture. Although reading
the datasheets and reference manuals is a great way to get
familiar with ARM, there is another way you can increase
your ARM knowledge. Once you’ve done your reading,
you can apply what you’re learned to help with your
understanding of the contents of the stm32f0xx.h file. In
this case, the stm32f0xx.h file is formally known as the
CMSIS (Cortex Microcontroller Software Interface
Standard) Cortex-M0 device peripheral access layer
header file. The stm32f0xx.h header file consists of a
configuration section that allows us to specify the target
device and crystal frequency. The stm32f0xx.h header file
also contains data structures and address mapping for all
of the device’s peripherals.
Peripheral register declarations, bit definitions, and
macros to access the peripheral hardware registers are
48 February 2016
Post comments on this article and find any associated files and/or downloads at www.nutsvolts.com/
■ Photo 2. In addition to its standard programming/debugging duties, the
J-Link PRO’s Ethernet interface allows multiple unit debugging over an
Ethernet network. Our immediate need is the J-Link PRO’s ability to
interface to our STM32F030R8T6 using an SWD programming interface.
The target socket is loaded with a 1.27 mm SWD adapter.
■ Screenshot 4. Our new project is ready to be fleshed out. This is also a
good time to explore the features offered by the Segger Embedded Studio.