HomeIoTNo SWD? No Drawback: Erich Styger Exhibits Methods to Debug Arm Cortex-M...

No SWD? No Drawback: Erich Styger Exhibits Methods to Debug Arm Cortex-M Chips Over CAN Bus



A pupil of embedded engineer and professor Erich Styger have developed a neat trick to point out anybody seeking to debug an Arm Cortex-M goal with out utilizing the normal Serial Wire Debug (SWD) or JTAG interfaces — by profiting from the CAN bus as a substitute.

“Conventional {hardware} debugging requires a {hardware} debug probe, related with a devoted SWD/JTAG debug cable to the goal system,” Styger explains. “This wants devoted pins on the goal system plus bodily entry to the system itself. In lots of instances, this isn’t doable within the ultimate product. The {hardware} debug probes, cables, pins and excessive velocity indicators are pricey. And worse they will introduce new issues and are susceptible to interference. If there’s a subject bus like CAN connecting all of the MCUs, why not use it for {hardware} debugging?”

When you’ve an Arm Cortex-M to debug however do not fancy SWD or JTAG, why not strive the CAN bus? (📹: Erich Styger)

The Controller Space Community (CAN) bus was initially developed to be used in industrial automation, and is now a key function of recent automotive programs — however somewhat than utilizing it for communication and management throughout regular operation, Styger has demonstrated how it may be used to deal with conventional debugging duties that might usually happen over SWD or JTAG: flash programming, controller halting, reminiscence inspection, and instruction stepping — because of “a somewhat unknown {hardware} function” out there on many fashions in Arm’s Cortex-M microcontroller household.

“The proposed resolution makes use of a particular ARM Cortex-M function: the ARM DebugMonitor {hardware},” Styger explains. “Utilizing a particular gateway, the CMSIS-DAP debug protocol will get translated between USB and the CAN community. Regular instruments like gdb or VS Code are used on the host. On the goal programs, a framework with the required hooks and code will get added, permitting {hardware} debugging. Throughout debugging, the framework retains the CAN communication going. In my view, the DebugMonitor function of ARM Cortex-M is among the most underrated options ARM has carried out. The DebugMonitor is accessible on all ARM Cortex-M, apart from M0/M0+.”

The framework — which makes it doable to hyperlink the DebugMonitor to conventional debugging instruments through the CAN bus — was written by Styger’s pupil Simon Kathriner, who has made it out there below an unspecified open supply license on GitLab. An in depth write-up of the way it works is accessible on Styger’s weblog.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments