Main Site Documentation

SWD debugging on Cerberus using the STM32F4 Discovery


#1

One thing I wish Cerberus had was a DNI header for native debugging. Luckily, (most of) the pins required for a debugging connection are on socket 6, so it’s easy to fashion a debugging connector.

The only issue is the pesky reset line, which isn’t available on any of the sockets. Fortunately, it’s easily accessible on the bottom-right pin of the reset tactile button.

I wired this up to be pin-compatible with the SWD port on the infamous STM32F4Discovery board, which is (incidentally) probably the cheapest debugger available that’s supported by standard ARM toolchains. The pinout is:
1 -> 1 (3V3)
2 -> 3 (SWCLK)
3 ->10 (GND)
4 -> 6 (SWDIO)
5 -> reset pin (RST)

(ST-LINK -> Cerberus socket 6)

I’m sure this has been mentioned before, as it’s such an easy hack, but I just wanted to remind fellow native coders about it!

Thought this may help someone!


#2

Nice! I have boards that look similar :wink:


#3

Nice info. Thanks! This would be better added to the Wiki and linked to the Cerberus Developer page so it isn’t lost in the forum.


#4

I think Wiki is being replaced.


#5

That is very very useful Jay, thanks.

The other end of the connector looks like this. For anyone who hasn’t done this before, remember to power the module whatever it is. I used a CerbII and applied 5V to what was labed VBUS. That put a regulated 3.3V out. Without it, the STLINK just sat there.


#6

This new product we made to help with JTAG needs https://www.ghielectronics.com/catalog/product/466


#7

Nice. I might pick one up next order.

When starting off with the CoOs on the ST-Discovery, I ran into the issue that it has an 8MHz xtal, while the Cerberus has a 12MHz xtal.

That value needs to get tweaked correctly in code or else things like the USART won’t calculate baud rate out correctly.

Where is that system crystal value found/changed in the CoOs?

I’m staring at system_stm32f4xx.c, but… well… it’s not that obvious. I suppose it could be buried in the PLL spec, but I’d hate to dig all the way through it if someone has done this before.

Thanks


#8

@ Familyghost - Check Oberon’s port:

They have Discovery solution there.


#9

@ Familyghost, do you use J-Link do debug you Cerb II?
If so, can you please help me setup my Keil uVision to debug run the debugger?


#10

Jer,

I am using the STLINK2, and the SWD interface using CoIDE. That works. I can’t afford a seat of Keil.(I wish!)

Looking at the J-Link, it seems to have the same SWD/JTAG connector as the STLINK2.

What seems to be the issue?

Make sure your host pc can detect it. Segger has a bunch of utilities for it. Your CerbII needs to be powered for it to work. You have to pull the signals it needs off the header.

Jay’s picture is a big help. The same signals are on the CerbII (same chip). Let me know if you are having trouble finding them.