Unable to get crash information from Giga

Posting here as in the hope someone will be able to help. I raised an issue on ArduinoCore-mbed#958 regarding extracting the crash information from the Giga.

The main reason is due the Giga falling over with dreaded flashing LED after many hours of running. I've rebuilt ArduinoCore-mbed to update platform.crash-capture-enabled and platform.fatal-error-auto-reboot-enabled flags, but the crash isn't captured and it doesn't restart.

Can anyone help?

Hi @dansiviter. Take a look at my recent post here GIGA R1: Auto reboot on fatal

I have created my own mbed_die() to flash a few times then reboot - works great:

MBED_NORETURN void mbed_die () {
  gpio_t led_red, led_grn, led_blu;
         
  gpio_init_out(&led_red, LED_RED);
  gpio_init_out(&led_grn, LED_GREEN);
  gpio_init_out(&led_blu, LED_BLUE);

  gpio_write(&led_red, 1);
  gpio_write(&led_grn, 1);
  gpio_write(&led_blu, 1);

  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 4; ++j) {
      gpio_write(&led_red, 0);
      wait_us(150000);
      gpio_write(&led_red, 1);
      wait_us(150000);
    }
    for (int j = 0; j < 4; ++j) {
      gpio_write(&led_red, 0);
      wait_us(400000);
      gpio_write(&led_red, 1);
      wait_us(400000);
    }
  }
  NVIC_SystemReset();
}

Fault data like that below is sent to Serial1 (which is where my blackbox connects):

++ MbedOS Fault Handler ++

FaultType: HardFault

Context:
R0   : 00000000
R1   : 2404B4EE
R2   : 0000AAAA
R3   : 00000000
R4   : 24006D90
R5   : 2403FFE4
R6   : 0059B6A7
R7   : 40000C00
R8   : 240017B0
R9   : 00000001
R10  : 00000000
R11  : 0059B6A7
R12  : 0001E848
SP   : 24055410
LR   : 08094EAF
PC   : 080A1A82
xPSR : 41000000
PSP  : 240553A8
MSP  : 2407FF78
CPUID: 411FC271
HFSR : 40000000
MMFSR: 00000082
BFSR : 00000000
UFSR : 00000000
DFSR : 00000000
AFSR : 00000000
MMFAR: 00000000
Mode : Thread
Priv : Privileged
Stack: PSP

-- MbedOS Fault Handler --

1 Like

Thanks @steve9; it's now restarting! I'm still not getting any crash data though. I'm tried monitoring (via TX0/RX0) but nothing is coming through. I've now tried all TXn/RXn pins and nothing. I know it works as if I use Serial1 I do get output.

I've not done anything specifically to direct the fault output to TX0/RX0. My blackbox is set to 115200 to match system default - that's it. I'm aware of a macro REDIRECT_STDOUT_TO to redirect console output, but I'm not using it.

Again thanks @steve9, baud rate sorted it.

Glad that's working for you. IIRC, this default behaviour doesn't need those platform... additions to the .json and hence no recomp of the lib.

Also, probably want something to delay the restart in mbed_die() to give fault data time to be sent.

1 Like