This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hard fault with register access during FVP debugging

Hi,

I'm developing firmware with LPCXpresso55S28 (Cortex-M33) and Keil µVision v5.34 and would like to debug my code using FVP. The example mentioned in this application note works perfectly.

However, when I use my code or even hello_world example for LPCXpresso55S28, I'm able to launch the debug session but once I access any register, I always get a hard fault.

static inline void POWER_SetBodVbatLevel(power_bod_vbat_level_t level, power_bod_hyst_t hyst, bool enBodVbatReset)
{
    // For example writing to BODVBAT register causes hard fault with FVP
    PMC->BODVBAT = (PMC->BODVBAT & (~(PMC_BODVBAT_TRIGLVL_MASK | PMC_BODVBAT_HYST_MASK))) | PMC_BODVBAT_TRIGLVL(level) |
                   PMC_BODVBAT_HYST(hyst);
    PMC->RESETCTRL =
        (PMC->RESETCTRL & (~PMC_RESETCTRL_BODVBATRESETENABLE_MASK)) | PMC_RESETCTRL_BODVBATRESETENABLE(enBodVbatReset);
}

I'm using FVP executable FVP_MPS2_Cortex-M33_MDK.exe which I assume should be compatible. I have tried with every ARMCM33*.txt configuration file with same outcome.

Any idea what might be the problem?

Thanks.

Parents Reply Children