EK-TM4C1294XL: I am trying to reuse the BOOTP and TFTP functionalities from the EMACbootloader code in my own project.

Part Number: EK-TM4C1294XL

Tool/software:

I am trying to reuse the BOOTP and TFTP functionalities from the EMACbootloader code in my own project. However, when I directly reuse and execute the BOOTPThread function, the program enters the FaultISR at the call to uip_udp_remove(g_pConn). This function modifies the variable g_pConn. Do you know what might be causing the problem when executing this function?

PT_THREAD(BOOTPThread(void))
#endif
{
//
// Begin the proto-thread.
//
PT_BEGIN(&g_sThread);
wait_for_link:
PT_WAIT_UNTIL(&g_sThread,
(LOCAL_EMACPHYRead(EMAC0_BASE, 0, EPHY_BMSR) &
EPHY_BMSR_LINKSTAT) != 0);
//
// Reset the host address.
//
*((uint32_t *)(void *)(&uip_hostaddr)) = 0;
//
// Re-bind the UDP socket for sending requests to the BOOTP server.
//
uip_udp_remove(g_pConn);
*((uint32_t *)(void *)(&g_sServerAddr)) = 0xffffffff;
uip_udp_new(&g_sServerAddr, HTONS(BOOTP_SERVER_PORT));
uip_udp_bind(g_pConn, HTONS(BOOTP_CLIENT_PORT));
  • Hi Muneto-san,

    In the bl_emac.c file, the g_pConn is declared as a pointer. Make sure this pointer variable is allocated correctly. Please use this app note to find the offending instruction that caused the faults. Diagnosing Software Faults in Stellaris® Microcontrollers

    //*****************************************************************************
    //
    // The UDP socket used to communicate with the BOOTP and TFTP servers (in
    // sequence).
    //
    //*****************************************************************************
    struct uip_udp_conn *g_pConn;

      In uip.h file, did you set UIP_UDP?

    #if UIP_UDP
    /**
    * Representation of a uIP UDP connection.
    */
    struct uip_udp_conn {
    uip_ipaddr_t ripaddr; /**< The IP address of the remote peer. */
    u16_t lport; /**< The local port number in network byte order. */
    u16_t rport; /**< The remote port number in network byte order. */
    u8_t ttl; /**< Default time-to-live. */

    /** The application state. */
    uip_udp_appstate_t appstate;
    };