This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Trouble Reading Memory Block at 0x900267fc on Page 0 of Length 0xd: Debug Port error occurred.

Hi,

I've run into a strange problem while debugging on my EK-TM4C123GXL kit. I've tried to run a code that ran just fine before and now I'm getting this error while stepping through the code:

Trouble Reading Memory Block at 0x900267fc on Page 0 of Length 0xd: Debug Port error occurred.

There were no modifications done to the code. It just used to run fine the way it is. The code line where the error appears is this one:

HWREG(ui32Base + GPIO_O_PCTL) = ((HWREG(ui32Base + GPIO_O_PCTL) & ~(0xf << ui32Shift)) | ((ui32PinConfig & 0xf) << ui32Shift));

I'm using the CCS for debugging. The behaviour seems almost random. Sometimes the code works yet other times the aforementioned error occurs. Thanks for any insight.

  • So it turns out I forgot to SysCtlPeripheralEnable before calling GPIOPinConfigure. It's working fine now.

  • Martin Zeman said:
    forgot to SysCtlPeripheralEnable before calling GPIOPinConfigure

    Not to cast doubt on these findings - but most always (under IAR) a hard fault results when we've not properly clocked (via SysCtlPeripheralEnable()) any peripheral - prior to calling any of that peripheral's functions...

    As your original post noted this issue appeared w/some randomness/variation - might you detail the exact SysCtlPeripheralEnable() you employed?   We'll load, test and report - see if your findings extend to other devices...

    My earlier suspicion was that your: "HWREG(ui32Base + GPIO_O_PCTL)

    should have earlier - or instead - defined:  ui32Base as PWMxBase.   (where x = 0,1 etc.)  This function performs w/out flaw under IAR - provided that we've earlier enabled that specific PWM module...

  • Sorry for the late reply. The exact call is SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    The issue never happened again since. So it seems to have done the trick.