New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 790006 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

ec: stm32: Log watchdog PC

Project Member Reported by sha...@chromium.org, Nov 30 2017

Issue description

On stm32*, when CONFIG_WATCHDOG_HELP is defined, we should be able to log PC at the time the pre-watchdog interrupt fired for later retrieval in panicinfo. Currently we're not logging any useful info, eg:

Saved panic data: (NEW)
=== PROCESS EXCEPTION: 00 ====== xPSR: ffffffff ===
r0 :         r1 :         r2 :         r3 :        
r4 :dead6664 r5 :00000000 r6 :00000000 r7 :00000000
r8 :00000000 r9 :00000000 r10:00000000 r11:00000000
r12:         sp :00000000 lr :         pc : 

Probably this entry is created in system_common_pre_init().
 
Is it just for stm32?
Do we actually log watchdog PC for other EC chips?
Yes, see npcx for an example.
Owner: philipchen@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 4 by bugdroid1@chromium.org, Dec 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/0037fb8dfcd7136d40e608ad9973331bd82d9a80

commit 0037fb8dfcd7136d40e608ad9973331bd82d9a80
Author: Philip Chen <philipchen@google.com>
Date: Mon Dec 11 23:16:23 2017

system: Log PC and task id on watchdog

For debug, in common code let's log the watchdog PC
and task id as our SW panic params.

BUG= chromium:790006 
BRANCH=none
TEST=manually test scarlet rev2 from a1-a3, b1-b2:

(a1) Add 'while(1);' in button ISR
(a2) Boot and press the button
(a3) When watchdog is triggeried, check with 'panicinfo'
that saved R5 is the PC for button ISR.

(b1) 'crash watchdog' in EC console
(b2) Check with 'panicinfo' that CONSOLE task id is saved in
EXCEPTION and PC is saved in R5.

Change-Id: I64d2fcf594dd24b0951e002ab8e80ebcac2d1def
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/803618
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>

[modify] https://crrev.com/0037fb8dfcd7136d40e608ad9973331bd82d9a80/core/cortex-m/watchdog.c
[modify] https://crrev.com/0037fb8dfcd7136d40e608ad9973331bd82d9a80/chip/npcx/watchdog.c
[modify] https://crrev.com/0037fb8dfcd7136d40e608ad9973331bd82d9a80/common/system.c
[modify] https://crrev.com/0037fb8dfcd7136d40e608ad9973331bd82d9a80/core/cortex-m0/watchdog.c

Status: Fixed (was: Assigned)

Sign in to add a comment