I think using an external ST-LINK/V2 debugger would also work (see section 6.3.5 of the user manual).Īlso as Blargian mentioned, the clock speed must match the actual speed the microcontroller is running at. If you apply this fix, note that PB3 will be connected to SWO, so you can't use PB3 anymore. It is located on the bottom side of the board (the side without the LCD), near the SWD connector. To apply this fix, apply judicious solder to SB9, as indicated in Figure 4. By default, SWO is disconnected! This means you can't get any output back from the device for any of the SWV features. In section 6.13 of the user manual, it indicates that solder bridge "SB9" controls the SWO (Serial Wire Out). I will refer to the document "STM32F429ZI Discovery Kit User Manual" (search for "en.DM00093903" or "UM1670") as "the user manual" in the below paragraphs. Is it possible I've missed something in the setup when using CubeMX? I followed Atollics recommended setup for printf redirect exactly but nothing shows up in the SWV console.Īlthough Blargian already gave his answer as a comment, I thought I should formally answer in case anyone has the same problem.
int _write(int32_t file, uint8_t *ptr, int32_t len) I'm using windows 7 Pro 64bits SP1 + Atollic TrueStudio for STM32 v9.3.0 (Last version available) Step to reproduce the issue: I have cloned this repository https. Atollic's TrueSTUDIO IDE / SDK displays unbelievable variable values.
When I step through my code and get to that printf("hello") line it just skips over it like it doesn't exist and there is nothing printed to the SWV console.īelow is a picture of my debug settings and the modified version of int _write which resides in my syscalls.c file. STM32F429I Discovery board - unable to do printf() redirection using SWV/ITM.
The dialogue box shown below will appear. Select 'Import' from the TrueStudio IDE's 'File' menu. I am however struggling to get this to work. Atollic tools cover a much wider set of developer problems than just edit/compile/debug. Ensure the STM3240G-EVAL hardware is connected to the host computer (the computer running Atollic TrueStudio) using a suitable debug connection (such as ST Link, or J-Link) and connected to a network using an Ethernet cable.
I followed the steps in this article which explains how to setup printf redirect to the console by generating a syscalls.c file and making some changes to the int _write function in that file. When I run debug it programs the board perfectly. I used STM32CubeMX standalone to generate a project for Atollic TrueStudio and then modified the main.c files infinite loop as follows to blink an LED on and off every 2 seconds and to printf a message to the console. Currently I'm trying to figure out how to use the debugging functions of this M4 Cortex, specifically the SWV ones. I recently got an STM32F429 Discovery dev board which I have been playing around with. I started this project to learn more about how microcontrollers work and how to set up the toolchain needed to program them.I am an STM32 newcomer.
I want to migrate to printf using STM32 ITM. Printf problem - Atollic community forum apex Posts: 0 Joined: Sat 10:41 am Printf problem Quote Post by apex Sat 11:48 am Hello, i am using Atollic Lite the update version. This project was tested on NUCLEO-F030R8, was developed using the Cube-MX and the project is for ATOLLIC.
In this example we use the Call Back modality. Until now I was using printf through UART, thanks to the Virtual COM port. There are different possibility to use the UART under Interrupt, for instance use PRINTF but this mode use a loot of code or, more efficiency is to use the Call Back. If you want to know more about the way the underlying toolchain works, I suggest you take a look at my STM32-base project. I am developping a Firmware on various STM32L4 Nucleo boards with Atollic Truestudio IDE (basically Eclipse).
I don't know how to set these packages up with Atollic, but I guess that there are tutorials available on that topic. Including just these files, you can start using the CMSIS directly without using any of the HAL or generated files. The CMSIS itself just contains some large files with the register definitions found on a device.
The STM32Cube packages contain both the CMSIS and the HAL drivers for a given sub-familiy of devices ( F0, F1, etc.). Based on this, I have written a small program for the STM32F4 Discovery that uses the USB-CDC class to show up as an virtual serial port.I’m using the USB stack provided by ST, however, there is also another project that uses libopencm3 that can be found here. The second one is downloading one of the STM32Cube packages and using the files directly. The first one is using STM32CubeMX and generate low level code, like u/GDK_ATL pointed out.