DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • A Reference Architecture for Constrained AI-Assisted Design
  • Audit-Ready by Design: Building Lineage, Point-in-Time Reconstruction, and Immutability Into Data Architecture
  • How to Design a Distributed Job Scheduler
  • A Practical Guide to Temporal Workflow Design Patterns

Trending

  • Designing Memory Architecture for Stateful AI Agents: Short-Term Context and Long-Term Persistence
  • Part 4: Multi-Agent Orchestration — Pairing Goose With Quarkus Flow State Machines
  • MQTT, Kafka, NATS, or Zenoh? Choosing Edge-to-Cloud Messaging by Traffic Pattern
  • New York City Taxi Trips: Putting Neo4j and DuckDB to Work

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

Hardware Reset for ARM Cortex-M With Segger J-Link and Kinetis Design Studio

The reset and signal line of a microcontroller is probably the most important signal to a microcontroller. And, if things go wrong, then the first thing to check is the reset line. So, having control over reset is an important aspect for embedded development. Read on to learn more.

By 
Erich Styger
·
Jan. 20, 16 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
9.3K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

The reset and signal line of a microcontroller is probably the most important signal to a microcontroller. And, if things go wrong, then the first thing to check is the reset line. So, having control over reset is an important aspect for embedded development. You would think that if you download a program to a microcontroller, the debug probe would put the device into reset at the start with a short pulse like this:

Reset Signal in Logic Analyzer

Reset Signal in Logic Analyzer

But actually, this might not be the case because the debug probe can put the device into reset using the ARM SYSRESETREQ bit of the core. This does a reset, but without the external Reset pin. So, if my hardware depends on that reset signal, I have a problem. The SYSRESETREQ way used by default with using GDB e.g. with the NXP/Freescale Kinetis Design Studio and the Segger J-Link.

A check of the Segger J-Link user manual shows that it supports multiple reset strategies, where type 0 is used normally. But, what I would need is type 2:

Cortex-M Reset Strategies

Cortex-M Reset Strategies (Source: Segger)

For a project with the tinyK20 (ARM Cortex M4 from NXP/Freescale), I have to make sure that the reset line is used to reset the hardware. For this, I hooked up a logic analyzer to check what happens if I download/debug the firmware:

Reset Line Monitoring

Reset Line Monitoring

And indeed: the reset line is kept high and not touched when I download/debug the firmware with Kinetis Design Studio, GDB, and Segger J-Link:

Reset Line HIGH

Reset Line HIGH

So, how to have the reset line toggled? The above chapter "Reset Strategies" in the Segger J-Link manual says that I could use strategy type 2. But how to use it with the GNU Debugger (gdb) in Eclipse?

The Segger GDB manual has the important hint how to select a reset strategy:

GDB Reset Types

GDB Reset Types (Source: Segger)

So, I need to use:

monitor reset 2

This allows me to use strategy 2 which should toggle the RESET line. So, I have added this to the debugger startup settings:

monitor reset command in launch configuration

Monitor Reset Command in Launch Configuration

And indeed, now RESET is used when I download the application to the board:

Reset Signal in Logic Analyzer

Reset Signal in Logic Analyzer

And, to my surprise, it works as well for the restart button:

Restart Command

Restart Command

And, actually with the latest GNU ARM Eclipse plugins for Segger there is even a setting to specify the reset type. So, I only have to specify the reset type number:

Type of reset specified

Type of Reset Specified

Even easier!

P&E Universal Multilink

And, what if I'm using the P&E Multilink Universal? I have not found a GDB setting to choose from different reset strategies. So, I made a quick test with the same setup:

Reset Probing with P&E Multilink

Reset Probing with P&E Multilink

P&E Reset Signal

P&E Reset Signal

So, obviously the P&E Multilink Universal probe does always reset pin toggling.

Summary

By default, the reset line is not needed for SWD/JTAG debugging. But, if I need to have the reset line toggled for debugging, I can specify the reset type 2 for ARM Cortex-M in the GNU ARM Eclipse Segger J-Link debug plugins. The approach discussed here works with command line GDB debugging and with any Eclipse GDB debug solution using the GNU ARM Eclipse plugins, for example the NXP Kinetis Design Studio.

I have not looked yet into ways how to do the same with other debug connections like P&E or OpenOCD. That might or might not be possible, maybe someone can comment?

Happy resetting!

Reset (computing) Arm (geography) Design

Published at DZone with permission of Erich Styger. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • A Reference Architecture for Constrained AI-Assisted Design
  • Audit-Ready by Design: Building Lineage, Point-in-Time Reconstruction, and Immutability Into Data Architecture
  • How to Design a Distributed Job Scheduler
  • A Practical Guide to Temporal Workflow Design Patterns

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook