The solution's built-in debugger natively supports J-Link, perfect for automated testing, and, with its integration of the GDB remote protocol, also provides third-party debug probes. We continue to keep our products cutting-edge and multi-platform for everything from small microcontrollers up to devices with multiple Arm Cortex-A 64-bit cores. "This makes support for Arm64 important for our customer base. "We see a migration to 64-bit cores, even for a typical embedded application, simply because many modern SoCs and FPGAs use them," says Ivo Geilenbruegge, managing director of SEGGER. Combined with the highly optimising C/C SEGGER Compiler, remarkably small yet efficient programs can be generated, setting every byte to work. It arrives with the company's highly optimised emRun runtime and emFloat floating-point libraries, as well as its smart Linker, all of which have been designed from the ground up, particularly for embedded systems. The solution includes all the tools and attributes required for professional embedded C and C programming and development. With a similar look and feel on all platforms and completely portable projects, developers can appreciate efficient development on Windows, Linux, and macOS, on Arm, Intel, and Apple Silicon. It probably didn’t matter, but there is an instance where an array is allocated for a file name and then deleted improperly.The latest release of Embedded Studio, SEGGER's all-in-one IDE solution for building embedded applications, now supports ARMv8-A CPUs, including Cortex-A53, Cortex-A57 and Cortex-A72. Once I added it to the project, I had to fix one small thing. If you prefer STM32Duino, check this out for something similar. The library is a thin wrapper around the ITM functions in CMSIS, so if you aren’t using Mbed, just have a look at those functions and you’ll be able to figure it out. Since I’m using Mbed, the first thing I did was go looking for a library. Building it from scratch did work, though. There are also some open source tools, but the Ubuntu packages are too old and the release packages didn’t work. Many IDEs and debuggers can read SWO output. There are, of course, other options, too. A normal terminal won’t do it, but ST’s STM32CubeProgrammer can easily read the data. Of course, you also need some sort of tool to read the output. However, if you shop the usual Chinese shops, you can usually find one for a reasonable price. The “full” ST-Link V2 has the pin brought out, but is usually a lot more expensive. Unfortunately, the cheap ones that look like a USB memory device you typically get don’t have the SWO pin. You also need an ST-Link dongle that has an SWO pin. Since I’m using the Blackpill with an STM32F411CE, we know it should work and the output pin will be PB3. There will be one pin on the device marked SWO (and probably other things, too). Not all ARM chips support ITM - the Integrated Trace Macrocell - but that’s what you need. What You Need ST’s STM32CubeProgrammer can display SWO data.įirst, you need a compatible ARM chip. In this case, I picked All because its the only thing coming out of the device, anyway. There are actually 32 channels of output, but channel 0 is reserved for the debugging output. As you can see in the figure, you get a nice window that shows all the output. You can use putc or printf to write to the debugging output. If (count % 10) debugport.putc('*') else debugport.printf("%d\r\n",count) ThisThread::sleep_for(rate) // sleepy time SWO_Channel debugport // requires #include "SWO.h"ĭebugport.printf("\r\nHello World from SWO\r\n") ĭebugport.printf("CPU SystemCoreClock is %d Hz\r\n", SystemCoreClock) Spoiler alert: your existing hardware might need a quick hack to make it work, although you can buy something off the shelf if you prefer. I’ll start backward with the end result, then talk about the software, so you’ll be good and motivated by the time you get to the hardware requirements. If you use other JTAG devices like the BlackMagic probe, you probably already have this set up for you. I’m writing this using the STM32-specific ST-LINK hardware. But it is possible, and when you are done reading, you’ll be able to do it, too. I decided I wanted to try that on the Blackpill running mbed, and found out it isn’t as easy as you might think. However, what if you don’t have an output device or you are using it for something else? If you are using most modern ARM chips, you have another option - a dedicated output channel that is used for several things, including debugging output. Sure, printf is expensive and brings in a lot of code, but if you have the space and time to use it while debugging you can always remove it before you are finished. Although printf-style debugging has a bad rep, I find myself turning to it on occasion.
0 Comments
Leave a Reply. |