I'm trying to use the GPT in a project, but the register base address is inaccessible. Running the GPT example project crashes my board, and I have to use serial downloader mode to recover, which is painful.
This is the base address according to the manual and MIMXRT1052.h
/** Peripheral GPT2 base address */
#define GPT2_BASE (0x401F0000u)
/** Peripheral GPT2 base pointer */
#define GPT2 ((GPT_Type *)GPT2_BASE)
But when I step through the project, attempting to read memory at that location breaks the debugger and corrupts flash on the board
That just happened to me. If you don't have the GPT clocks enabled in CCGR0 or CCGR1, that's what happens.
Sorry if this answer is a bit late.
Tom
Hello Benjamin,
How are you trying to read the memory that corresponds to the GPT2? I didn't face any issue while accessing this memory region through the peripherals view on MCUXpresso IDE, see below image. I highly recommend you to check section12.8 of the MCUXpresso User guide to learn more about the peripherals view.
About what you mentioned that you have to use serial downloader mode to recover your board after you flash the GPT example. This is due to the instruction __WFI. With this instruction, you are sending the RT to a low power state where only an interrupt can wake-up the core. This causes that the debugger cannot halt the core when trying to debug. To avoid this to happen, comment the else statement on the infinite loop, as shown on the image.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------