Skip to content

Commit

Permalink
armv8-m:fix log warnning
Browse files Browse the repository at this point in the history
armv8-m/arm_securefault.c:72:11: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
   72 |   sfalert("\tCFSR: %08x HFSR: %08x DFSR: %08x\n", getreg32(NVIC_CFAULTS),
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: anjiahao <[email protected]>
  • Loading branch information
anjiahao1 authored and xiaoxiang781216 committed Aug 11, 2024
1 parent fecc509 commit ce6d308
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/arm/src/armv8-m/arm_hardfault.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int arm_hardfault(int irq, void *context, void *arg)

hfalert("PANIC!!! Hard Fault!:");
hfalert("\tIRQ: %d regs: %p\n", irq, context);
hfalert("\tBASEPRI: %08x PRIMASK: %08x IPSR: %08"
hfalert("\tBASEPRI: %08" PRIx8 " PRIMASK: %08" PRIx8 " IPSR: %08"
PRIx32 " CONTROL: %08" PRIx32 "\n",
getbasepri(), getprimask(), getipsr(), getcontrol());
hfalert("\tCFSR: %08" PRIx32 " HFSR: %08" PRIx32 " DFSR: %08"
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/src/armv8-m/arm_memfault.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ int arm_memfault(int irq, void *context, void *arg)

mfalert("PANIC!!! Memory Management Fault:\n");
mfalert("\tIRQ: %d context: %p\n", irq, context);
mfalert("\tCFSR: %08x MMFAR: %08x\n",
mfalert("\tCFSR: %08" PRIx32 " MMFAR: %08" PRIx32 "\n",
getreg32(NVIC_CFAULTS), getreg32(NVIC_MEMMANAGE_ADDR));
mfalert("\tBASEPRI: %08x PRIMASK: %08x IPSR: %08"
mfalert("\tBASEPRI: %08" PRIx32 " PRIMASK: %08" PRIx32 " IPSR: %08"
PRIx32 " CONTROL: %08" PRIx32 "\n",
getbasepri(), getprimask(), getipsr(), getcontrol());

Expand Down
9 changes: 5 additions & 4 deletions arch/arm/src/armv8-m/arm_securefault.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ int arm_securefault(int irq, void *context, void *arg)

sfalert("PANIC!!! Secure Fault:\n");
sfalert("\tIRQ: %d regs: %p\n", irq, context);
sfalert("\tBASEPRI: %08x PRIMASK: %08x IPSR: %08"
sfalert("\tBASEPRI: %08" PRIx8 " PRIMASK: %08" PRIx8 " IPSR: %08"
PRIx32 " CONTROL: %08" PRIx32 "\n",
getbasepri(), getprimask(), getipsr(), getcontrol());
sfalert("\tCFSR: %08x HFSR: %08x DFSR: %08x\n", getreg32(NVIC_CFAULTS),
getreg32(NVIC_HFAULTS), getreg32(NVIC_DFAULTS));
sfalert("\tBFAR: %08x AFSR: %08x SFAR: %08x\n",
sfalert("\tCFSR: %08" PRIx32 " HFSR: %08" PRIx32 " DFSR: %08" PRIx32 "\n",
getreg32(NVIC_CFAULTS), getreg32(NVIC_HFAULTS),
getreg32(NVIC_DFAULTS));
sfalert("\tBFAR: %08" PRIx32 " AFSR: %08" PRIx32 " SFAR: %08" PRIx32 "\n",
getreg32(NVIC_BFAULT_ADDR), getreg32(NVIC_AFAULTS),
getreg32(SAU_SFAR));

Expand Down

0 comments on commit ce6d308

Please sign in to comment.