Part Number: TM4C123GH6PM
Hello,
I'm trying to debug a malfunctioning UART but running into issues when debugging the UART's peripheral memory.
After my device has run for a few days it no longer responds to requests over the UART, so I've been trying to debug this. I've verified that electrically the UART data is making it to the UART2 pins properly, so I figure it is a problem with the firmware. I connected a debugger and found that the UART ISR is no longer being triggered. The firmware enables and disables the UART RX and TX interrupts at various points, so I think there is a race condition somewhere and the RX interrupt doesn't get re-enabled, so I'm trying to confirm or disprove this.
I checked the NVIC registers to make sure that the UART2 interrupt is still enabled, which it is. Then I went to check the UART2 peripheral memory to see what interrupt sources it had enabled, but I'm unable to read the memory I need to. I'm using Eclipse, GDB, and OpenOCD to connect to the board. What I'm seeing is that I can read the UART2's peripheral memory from it's base and offset 0x00 to offset 0x2C, but all further memory is just showing as ????????. I think this typically means the memory doesn't exist, or is outside the readable range etc, or possibly that the peripheral is disabled. I am assuming the peripheral is enabled since it works for a while then stops, and the peripheral doesn't get disabled anywhere in the code.
The memory I can read, from 0x00 to 0x2C, is what I would be expecting. I can see the data in the UART data register changing, so the UART seems to be enabled and receiving data. I can see the overrun bits in the data register and receive status register are set (which is what I would expect to see if the ISR is not taking the data out). But I cannot read offset 0x38 to see what interrupts are masked, nor 0x3C to see the raw interrupt status etc. I can also successfully read all of the relevant memory for the other UARTs I'm using, it's just the one I'm most interested in that I can't.
After rebooting the board I can read those memory locations properly, but after the reboot the UART is back working so it's less interesting to me.
I'm not sure what I could be missing or what else I can check. Besides a peripheral being disabled are there conditions where some memory may be unreadable? Next time it happens I can doublecheck that the peripheral is enabled, but if it is, I'm not sure where else to look.
Thanks,
Charles