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.

TM4C1294NCPDT: TM4C1294

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Dear TI Support,

I have a EK-TM4C1294XL evaluation kit. I downloaded SPMA072 (Serial to Ethernet Converter for TM4C129x).

I am able to compile using CCS 11.2.0. The application is running fine and I am able to open webserver and change Serial Port 0 settings.

Serial Port 0 uses UART4. My application requires that I use UART0 instead. Following Application report, I modified config.h and switched to UART0.

I also modified interrupt vector in start-up file so it points to UART0.

The code compiles with no errors, however when started, immediately generates fault interrupt and stops.

Will you please advise?

Thanks

Felix Valladares

    

  • Hi,

      Most likely you are accessing some peripherals before they are enabled. 

      I have a couple of comments.

      - Did you only search and replace UART4 by UART0? If this is the case then it is not enough. Please see below code in config.h. It is not just changing UART4 to UART0. If you look at S2E_PORT0_RX_PERIPH  you will need to change from SYSCTL_PERIPH_GPIOK to SYSCTL_PERIPH_GPIOA and likewise for the rest of #define. 

    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 UART resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_UART_PERIPH SYSCTL_PERIPH_UART4
    
    //*****************************************************************************
    //
    //! The port on which the Port 0 UART resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_UART_PORT UART4_BASE
    
    //*****************************************************************************
    //
    //! The interrupt on which the Port 0 UART resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_UART_INT INT_UART4
    
    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 RX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RX_PERIPH SYSCTL_PERIPH_GPIOK
    
    //*****************************************************************************
    //
    //! The GPIO port on which the Port 0 RX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RX_PORT GPIO_PORTK_BASE
    
    //*****************************************************************************
    //
    //! The GPIO pin on which the Port 0 RX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RX_PIN GPIO_PIN_0
    
    //*****************************************************************************
    //
    //! The GPIO pin configuration for Port 0 RX pin.
    //
    //*****************************************************************************
    #define S2E_PORT0_RX_CONFIG GPIO_PK0_U4RX
    
    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 TX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_TX_PERIPH SYSCTL_PERIPH_GPIOK
    
    //*****************************************************************************
    //
    //! The GPIO port on which the Port 0 TX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_TX_PORT GPIO_PORTK_BASE
    
    //*****************************************************************************
    //
    //! The GPIO pin on which the Port 0 TX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_TX_PIN GPIO_PIN_1
    
    //*****************************************************************************
    //
    //! The GPIO pin configuration for Port 0 TX pin.
    //
    //*****************************************************************************
    #define S2E_PORT0_TX_CONFIG GPIO_PK1_U4TX
    
    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 RTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RTS_PERIPH SYSCTL_PERIPH_GPIOK
    
    //*****************************************************************************
    //
    //! The GPIO port on which the Port 0 RTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RTS_PORT GPIO_PORTK_BASE
    
    //*****************************************************************************
    //
    //! The GPIO pin on which the Port 0 RTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RTS_PIN GPIO_PIN_2
    
    //*****************************************************************************
    //
    //! The GPIO pin configuration for Port 0 RTS pin.
    //
    //*****************************************************************************
    #define S2E_PORT0_RTS_CONFIG GPIO_PK2_U4RTS
    
    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 CTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_CTS_PERIPH SYSCTL_PERIPH_GPIOK
    
    //*****************************************************************************
    //
    //! The GPIO port on which the Port 0 CTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_CTS_PORT GPIO_PORTK_BASE
    
    //*****************************************************************************
    //
    //! The GPIO pin on which the Port 0 CTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_CTS_PIN GPIO_PIN_3
    
    //*****************************************************************************
    //
    //! The GPIO pin configuration for Port 0 CTS pin.
    //
    //*****************************************************************************
    #define S2E_PORT0_CTS_CONFIG GPIO_PK3_U4CTS

      - If you have done all of the above correctly then I think there is one more thing to also change. If you look at enet_s2e.c file you will see below snippet of code. All the UARTprinitf are currently directed to UART0. It will interfere with your new setting for S2E port0. You need to redirect them to UART2 if you want to see UARTprintf piped to the terminal window. 

    #ifndef DK_TM4C129X
        PinoutSet(true, false);
    #else
        PinoutSet();
    #endif
    
        //
        // Configure Debug UART.
        //
        UARTStdioConfig(0, 115200, g_ui32SysClock);
    
        //
        // Clear the terminal and print banner.
        //
        UARTprintf("\033[2J\033[H");
        UARTprintf("Serial to Ethernet Example\n\n");
    
        //
        // Tell the user what we are doing now.
        //
        UARTprintf("Waiting for IP.\n");
    

      - To redirect UARTprintf to UART2 instead of UART0 you need to change:

    from:

    UARTStdioConfig(0, 115200, g_ui32SysClock);

    to:

    UARTStdioConfig(2, 115200, g_ui32SysClock);

      - The reason that I say you can redirect UARTprintf from UART0 to UART2 is because on EK-TM4C1294XL LaunchPad, both UART0 and UART2 can be routed to the COM port through the jumpers. To use UART2, you must change the JP4 and JP5 jumpers from their horizontal position to vertical position. Please refer to the LaunchPad user's guide. If you have your custom board then you can redirect to other UART for COM port provided you have a FDTI USB to serial adapter. 

      - If you want to use UART2 for COM port, you must also make sure all the pins that are to be used for UART functionalities are configured properly. If you see the above code, the PinoutSet() function will configure UART0 pins but not UART2. I will suggest you try out hello example and try to redirect all UARTprintf to UART0 and see how it works and then adapt the same for s2e project. 

      - Perhaps for the time being, you can remove or comment out all of the UARTprintf and UARTStdioConfig just to see if you are stilling getting or not getting the fault.

      - Lastly, this app note should be very help to diagnose the cause of fault. https://www.ti.com/lit/pdf/spma043

     

  • Thanks a lot Charles. I redirected debug UART from UART0 to uART2 to avoid interference with serial port 0. This fixed the issue. I don't get fault interrupts anymore. Thanks for the great support.

    Felix