arm: fix incorrect printk() usage

Change-Id: I56f980659513e66a414cc7ca9b64ecde61e903f9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2016-08-18 13:03:42 -07:00 committed by Anas Nashif
commit b63d4928d8
2 changed files with 15 additions and 10 deletions

View file

@ -23,6 +23,7 @@
#include <toolchain.h> #include <toolchain.h>
#include <sections.h> #include <sections.h>
#include <inttypes.h>
#include <nanokernel.h> #include <nanokernel.h>
#include <nano_private.h> #include <nano_private.h>
@ -97,8 +98,8 @@ FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason,
PR_EXC("**** Unknown Fatal Error %d! ****\n", reason); PR_EXC("**** Unknown Fatal Error %d! ****\n", reason);
break; break;
} }
PR_EXC("Current thread ID = 0x%x\n" PR_EXC("Current thread ID = %p\n"
"Faulting instruction address = 0x%x\n", "Faulting instruction address = 0x%" PRIx32 "\n",
sys_thread_self_get(), sys_thread_self_get(),
pEsf->pc); pEsf->pc);

View file

@ -26,6 +26,7 @@
#include <nanokernel.h> #include <nanokernel.h>
#include <nano_private.h> #include <nano_private.h>
#include <inttypes.h>
#ifdef CONFIG_PRINTK #ifdef CONFIG_PRINTK
#include <misc/printk.h> #include <misc/printk.h>
@ -65,7 +66,7 @@ void _FaultDump(const NANO_ESF *esf, int fault)
{ {
int escalation = 0; int escalation = 0;
PR_EXC("Fault! EXC #%d, Thread: %x, instr @ %x\n", PR_EXC("Fault! EXC #%d, Thread: %p, instr @ 0x%" PRIx32 "\n",
fault, fault,
sys_thread_self_get(), sys_thread_self_get(),
esf->pc); esf->pc);
@ -77,19 +78,20 @@ void _FaultDump(const NANO_ESF *esf, int fault)
: "Bus fault on vector table read\n"); : "Bus fault on vector table read\n");
} }
PR_EXC("MMFSR: %x, BFSR: %x, UFSR: %x\n", PR_EXC("MMFSR: 0x%" PRIx32 ", BFSR: 0x%" PRIx32 ", UFSR: 0x%"
PRIx32 "\n",
__scs.scb.cfsr.byte.mmfsr.val, __scs.scb.cfsr.byte.mmfsr.val,
__scs.scb.cfsr.byte.bfsr.val, __scs.scb.cfsr.byte.bfsr.val,
__scs.scb.cfsr.byte.ufsr.val); __scs.scb.cfsr.byte.ufsr.val);
if (_ScbMemFaultIsMmfarValid()) { if (_ScbMemFaultIsMmfarValid()) {
PR_EXC("MMFAR: %x\n", _ScbMemFaultAddrGet()); PR_EXC("MMFAR: 0x%" PRIx32 "\n", _ScbMemFaultAddrGet());
if (escalation) { if (escalation) {
_ScbMemFaultMmfarReset(); _ScbMemFaultMmfarReset();
} }
} }
if (_ScbBusFaultIsBfarValid()) { if (_ScbBusFaultIsBfarValid()) {
PR_EXC("BFAR: %x\n", _ScbBusFaultAddrGet()); PR_EXC("BFAR: 0x%" PRIx32 "\n", _ScbBusFaultAddrGet());
if (escalation) { if (escalation) {
_ScbBusFaultBfarReset(); _ScbBusFaultBfarReset();
} }
@ -111,8 +113,8 @@ void _FaultDump(const NANO_ESF *esf, int fault)
*/ */
static void _FaultThreadShow(const NANO_ESF *esf) static void _FaultThreadShow(const NANO_ESF *esf)
{ {
PR_EXC(" Executing thread ID (thread): 0x%x\n" PR_EXC(" Executing thread ID (thread): %p\n"
" Faulting instruction address: 0x%x\n", " Faulting instruction address: 0x%" PRIx32 "\n",
sys_thread_self_get(), sys_thread_self_get(),
esf->pc); esf->pc);
} }
@ -138,7 +140,8 @@ static void _MpuFault(const NANO_ESF *esf, int fromHardFault)
} else if (_ScbMemFaultIsDataAccessViolation()) { } else if (_ScbMemFaultIsDataAccessViolation()) {
PR_EXC(" Data Access Violation\n"); PR_EXC(" Data Access Violation\n");
if (_ScbMemFaultIsMmfarValid()) { if (_ScbMemFaultIsMmfarValid()) {
PR_EXC(" Address: 0x%x\n", _ScbMemFaultAddrGet()); PR_EXC(" Address: 0x%" PRIx32 "\n",
_ScbMemFaultAddrGet());
if (fromHardFault) { if (fromHardFault) {
_ScbMemFaultMmfarReset(); _ScbMemFaultMmfarReset();
} }
@ -169,7 +172,8 @@ static void _BusFault(const NANO_ESF *esf, int fromHardFault)
} else if (_ScbBusFaultIsPrecise()) { } else if (_ScbBusFaultIsPrecise()) {
PR_EXC(" Precise data bus error\n"); PR_EXC(" Precise data bus error\n");
if (_ScbBusFaultIsBfarValid()) { if (_ScbBusFaultIsBfarValid()) {
PR_EXC(" Address: 0x%x\n", _ScbBusFaultAddrGet()); PR_EXC(" Address: 0x%" PRIx32 "\n",
_ScbBusFaultAddrGet());
if (fromHardFault) { if (fromHardFault) {
_ScbBusFaultBfarReset(); _ScbBusFaultBfarReset();
} }