Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xtensa formatting #1694

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/target/cortexar.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,16 +964,15 @@ static void cortexr_mem_handle_fault(
const cortexar_priv_s *const priv = (cortexar_priv_s *)target->priv;
/* If we suffered a fault of some kind, grab the reason and restore DFSR/DFAR */
if (priv->core_status & CORTEXAR_STATUS_DATA_FAULT) {
#if ENABLE_DEBUG == 1
#ifndef DEBUG_WARN_IS_NOOP
const uint32_t fault_status = cortexar_coproc_read(target, CORTEXAR_DFSR);
const uint32_t fault_addr = cortexar_coproc_read(target, CORTEXAR_DFAR);
DEBUG_WARN("%s: Failed at 0x%08" PRIx32 " (%08" PRIx32 ")\n", func, fault_addr, fault_status);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than moving this, it should be gated by #ifndef DEBUG_WARN_IS_NOOP in place of #if ENABLE_DEBUG == 1 - this will stop the variable definitions doing the wrong thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I've updated this gate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We guess it's fine to have the DEBUG_WARN() inside the guard block, just.. not ideal as we should really complete the IO operations before reporting the failure. That said, this nominally works so we'll go with it and merge.

#else
(void)func;
#endif
cortexar_coproc_write(target, CORTEXAR_DFAR, orig_fault_addr);
cortexar_coproc_write(target, CORTEXAR_DFSR, orig_fault_status);

DEBUG_WARN("%s: Failed at 0x%08" PRIx32 " (%08" PRIx32 ")\n", func, fault_addr, fault_status);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/target/imxrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static bool imxrt_ident_device(target_s *const target)
priv->flexspi_base = IMXRT117x_FLEXSPI1_BASE;
break;
default:
DEBUG_TARGET("Unknown ROM fingerprint at %08x = %08x\n", rom_location, fingerprint);
DEBUG_TARGET("Unknown ROM fingerprint at %08" PRIx32 " = %08" PRIx32 "\n", rom_location, fingerprint);
break;
}

Expand Down
3 changes: 2 additions & 1 deletion src/target/msp432e4.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ bool msp432e4_probe(target_s *const target)
(devid1 & MSP432E4_SYS_CTRL_DID1_FAMILY_MASK) != MSP432E4_SYS_CTRL_DID1_MSP432E4)
return false;

DEBUG_TARGET("%s: Device version %x:%x, part ID %x, pin count %u, temperature grade %x, package type %x\n",
DEBUG_TARGET("%s: Device version %" PRIx32 ":%" PRIx32 ", part ID %" PRIx32 ", pin count %" PRIu32
", temperature grade %" PRIx32 ", package type %" PRIx32 "\n",
__func__, (devid0 >> MSP432E4_SYS_CTRL_DID0_VERSION_MAJ_SHIFT) & MSP432E4_SYS_CTRL_DID0_VERSION_MAJ_MASK,
devid0 & MSP432E4_SYS_CTRL_DID0_VERSION_MIN_MASK,
(devid1 >> MSP432E4_SYS_CTRL_DID1_PART_NUM_SHIFT) & MSP432E4_SYS_CTRL_DID1_PART_NUM_MASK,
Expand Down