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.

CCS/TM4C123GH6PM: Code always run into infinite loop

Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

Hi Team,

I tried to do the "direct register access model" programming on the "TM4C123G LaunchPad" through ccs, but met a problem at the beginning.

As showed in the image blow left, there are simple codes to configure the PF1/PF2/PF3 as output and set their value as 0. While debugging when i am trying to "step over" the highlight step, the program will run into the "fault while loop". I do not know why this would happen. Could you help to provide some instruction/comments on it. Thanks.

Thanks and best regards,

Felix

  • Felix Wang said:
    While debugging when i am trying to "step over" the highlight step, the program will run into the "fault while loop". I do not know why this would happen.

    Diagnosing Software Faults in Stellaris® Microcontrollers has guidance on debugging the cause of faults. While the document was written for Stellaris devices, it also applies to Tiva devices.

    Felix Wang said:
    Could you help to provide some instruction/comments on it.

    Section 5.2.6 System Control of the TM4C123GH6PM datasheet contains:

    There must be a delay of 3 system clocks after a peripheral module clock is enabled in the RCGC register before any module registers are accessed.

    There is no such delay in the example code, and so the fault could be due to an attempt to access the peripheral before it is ready. Rather than inserting a fixed delay, you can instead poll the General-Purpose Input/Output Peripheral Ready (PRGPIO) to determine when the GPIO Port F is ready.

    Also, what is the reason for needing to use the "direct register access model" rather than TivaWare?

  • Hi Chester,

    Thanks a lot for your reply. Now the problem is solved through adding the status checking code.

    Yes, i know there is TivaWare driverlib. And we just need to call the related function to do the job. But in my case, the customer has not adopted the TI MCU to control the LED driver (our team is responsible for the LED driver product). in order to provide better support i have to learn how to configure the registers. And this is my first time to use Arm based MCU. i find there is much difference between the tm4c123 and msp430.

    For example, after solving the above issue. i tried to use the PF4 terminal to generate an interrupt. I have already successfully realized setting the PF4 - MIS bit after clicking the SW1 button on the launch board. But i do not know how to setup the ISR to make the code jump into the related interrupt handler function.

    Is there any instructions on how to configure the startup file to set the interrupt vector table and related ISR? i tried to look for the related information on the website but only find the guide that are all based on the TivaWare driverlib.

    thanks and best regards,

    Felix   

  • Hello Felix,

    I will reach out to you offline about this request as we do not support DRM with TM4C MCU's on the E2E forums (stated in our Forum Guidelines).