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.

Problem reading Tiva C series registers in debug after updating CCS

Other Parts Discussed in Thread: TM4C123GH6PM, UNIFLASH, LMFLASHPROGRAMMER

I'm using a TM4C123GH6PM with CCS version 5.4.

I was previously using CCS version 5.3 and did a clean reinstall to upgrade to 5.4.

My problem is that I cannot read most registers in debug mode in CCS. There is a Registers window you can use to view the contents of each register. If I expand a register, I get a "Error: unable to read" message for each entry. Not all registers do this. For example, I can always read the core registers without a problem. Maybe one or two other ones are able to be read as well.

This worked fine when I was using CCS 5.3. Here is an image of what I am seeing: 

I have pretty much ruled out hardware issues at this point.

Any input is much appreciated

  • BrandonM said:
    I have pretty much ruled out hardware issues at this point.

    Upon device reset the Tiva peripherals are disabled (no clock). Attempts to access a disabled peripheral from the CPU cases a bus fault (leading to the FaultISR being entered).

    With CCS 5.4 I found that the CCS debugger only displayed the register values of peripherals which had been enabled. E.g. after downloading a program to a LM4F120H5QR:

    a) In CCS select a System Reset (Ctrl-Shift-S), which resets the device and halts execution at the reset vector.

    b) In the CCS register view open a view of the GPIO_PORTB registers. CCS reports that it is unable to read the GPIO_PORTB peripheral registers. The Console has errors of the following form:

    CORTEX_M4_0: Trouble Reading Memory Block at 0x400053fc on Page 0 of Length 0x4: Debug Port error occurred.

    c) Single step the program up until it has enabled the GPIO_PORTB peripheral, and CCS continues to report that it is unable to read the GPIO_PORTB peripheral registers.

    d) After single stepping over the following line which enables the GPIO_PORTB peripheral, the CCS debugger is then able to display the contents of the GPIO_PORTB peripheral registers:

      MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

    Therefore, I assumed that it was the expected behavior of CCS 5.4 to report an error if you attempt to view registers for a peripheral which hadn't been enabled by the software being debugged.

    [I haven't yet attempt to repeat with CCS 5.3]

  • Thanks, Chester.

    That was my problem.

  • Hi Chester,
    I am having this problem with CCS 6.1 and tried doing what you suggested above but that didn't work. Any other idea on how I can fix this problem? I tried flash programming, JTAG reset, all possibilities I found but nothing works!!
    Thanks.
  • Tiago Amaral said:
    I tried flash programming, JTAG reset, all possibilities I found but nothing works!!

    Which registers are you having trouble viewing?

    Also, can you post details of any errors reported by CCS?

  • Chester, 
    First, thank you so much for replying!!


    I am using the I2C3 to read some sensor value. First it was getting stuck at the while loop waiting for the DATA REGISTER 

    readTemp3 = I2CMasterDataGet(I2C3_BASE);

    And now I cant even connect. 
    Honestly, I am so confused that I don't know what else to do. 

  • Did the CCS errors about being unable to read the I2C3 registers occur before or after the I2C3 peripheral was enabled?

    Tiago Amaral said:
    And now I cant even connect.

    Do you mean you can no longer download a program using the CCS debugger?

    If so, try the Device Unlock Sequence using LMFlashProgrammer or UNIFLASH. The following post will give more details on LMFlashProgrammer Unlock Device View for TM4C123 and TM4C129 Products

  • Ther I2C3 is setup before any read of the register.
    I can download the program but I cannot debug it. I am using the KENTEC Display and all hangs up. I try to start debugging but the::
    CORTEX_M4_0: Trouble Reading Memory Block at 0x40023000 on Page 0 of Length 0x4: Debug Port error occurred.
    CORTEX_M4_0: Trouble Reading Memory Block at 0x40023008 on Page 0 of Length 0x4: Debug Port error occurred.
    CORTEX_M4_0: Trouble Reading Memory Block at 0x4002302c on Page 0 of Length 0x4: Debug Port error occurred.
    CORTEX_M4_0: Trouble Reading Memory Block at 0x40023004 on Page 0 of Length 0x4: Debug Port error occurred.

    occurs.

    I tried the LMFlashProgrammer but still have the same issue.
    One thing works which is the TIMER0 that I set for 1 Min and that works since I see the LED on and OFF.
    I am trying to give you as much info as I can but I believe I am running out of options or got too tired.
  • Hi, I am having the same problem after a hard fault but I manage to recovered using LM flash, the problem now is I am unable to use PORTB as it is unable to read memory block at 0x40005510, can this be recovered? by the way I can still program the leds on board on PORTF.