Finding JTAG/SWD location on custom PCB
Hey ST Community,
A little bit of background knowledge. Aside from a few Arduino/microcontroller courses in college I am relatively new to coding and MCUs, specifically the ARM format. I currently work in the heavy machinery segment and am trouble shooting some emulators that are giving me issue with my personal machines.
The pictures below are of the custom PCB that lives inside of an epoxy block. In its finished form, there are pins out the bottom to connect the to the part of the sensor interface of heavy machinery. Based on the numbers and letters on the MCU it is a STM32F405 with 64 pins. (***Note: I am aware this board is damaged but I can remove an identical, intact board when it comes to testing time***). I have an ST-Link V3 Set coming in the mail and I am looking for advice on connecting to this board.
This is an emulator that can plug in to the harness and "emulate" certain aspects of heavy machinery tunes so we are able to adjust other sensors/values/parts to get the ideal performance/efficiency/remove bugs. It communicates with the vehicles ECM through the standard J1939 CAN bus.
The issue is that while we can read and copy the CAN bus data, the board runs an algorithm for emulating the "OEM+" CAN bus values and that occasionally throws codes or cuts power to the machine. From the research I've done there is no way to go backwards from CAN bus data to hard code. Additionally, this is an old-ish piece of "proprietary" tech from a now defunct small company with no open source code available.
As it works the majority of the time I believe it is hardware issue due to the high heat and vibration experiences by construction equipment. My goal is to copy whatever is possible from this chip and board so I can then reupload it to a more robust PCB system and potentially edit it there if need be.
Based on forum browsing, the STM reference and the AN sheet my ST-Link needs to be connected to SWDIO (PA13, pin 46) and SWCLK (PA14, pin 49) and then possibly put into bootloader mode with the BOOT0 pin (which is intact on the MCU). My first question: how do I identify those pins on the board and will I have to wire directly to the MCU?
Provided I can establish a connection with the ST-Link, what is my next step for copying the contents of the board? I know I need to use STM32cube and possibly OpenOCD but I am unsure in what configuration. I've been through GitHub looking for the puzzle pieces but frankly everything could be in ancient Greek.
Time isn't a huge issue as the machines run most of when I need them and I've been through college level mech eng so I've got a decent base knowledge of things and a penchant for hard work. Also the majority of the work will be done with a new XPS15, i9 and Windows 11 Home (23H2).
Thanks in advance,
Mason

