Understanding Auto-Reset of Spresense

Asked 2 years ago, Updated 2 years ago, 86 views

I would like to make a measuring device with a sprense for a long time (main board + LTE expansion board).Currently, there are some problems that freeze irregularly, and I am trying to monitor watchdog, but I am struggling because it doesn't work.
Besides watdchdog, I'm looking for a way to force reset the spresense.

The expansion board has a reset pin, but I would like you to tell me how to perform a hard reset when using the LTE expansion board.Also, please let me know if there are any reference websites or methods for monitoring the life and death of microcomputers.

spresense

2022-09-30 14:40

2 Answers

You may have already tried it, but the Spresense Arduino Library allows you to use the Watchdog library.The code is the same as the sample code, but it's convenient because it's easy to use as follows:

#include<Watchdog.h>

# define BAUDRATE (115200)

void setup() {
  Serial.begin (BAUDRATE);
  Serial.println("reset!!!");
  Watchdog.begin();
}

void loop() {
  static int delay_ms = 1000;
  Watchdog.start (2000);

  Serial.println("Sleep" + String(delay_ms) + "ms");
  usleep(1000*delay_ms);

  /* Check remain time for watchdogbite*/
  Serial.println(String(Watchdog.timeleft()) + "ms left for watchdog bit";

  /* Kick a watchdog*/
  Serial.println("Kick!");
  Watchdog.kick();

  /* Increase wait time*/
  delay_ms+=100;

  /* Stop a watchdog*/
  Watchdog.stop();
}


2022-09-30 14:40

If it's an ARM CPU, there are instructions to reset the system, but what are you going to do with it?
It is impossible to detect freezing without an external circuit (for example, WDT).


2022-09-30 14:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.