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.

TMS320F28388D: Unable to debug TCPEcho (tcpEchoF2838X) project

Part Number: TMS320F28388D

Hello Community,

I'm able to import tcpEchoF2838X project and after making necessary changes able to build it in without errors.

I'm able to add driverlib_cm and add IPCISR as well.

But When I tried to run in debug mode I'm getting "Cortex_M4_0: AutoRun: Target not run as breakpoint could not be set: _JobHardwareBreakpoint::ARM_DEBUG_V7M_fpb_add_breakpoint: FPB : All resources are in use.[25062]" Error and execution halts.

This is my project folder :

This is my linker filer :

MEMORY
{
   /* Flash sectors */
   CMBANK0_RESETISR : origin = 0x00200000, length = 0x00000008 /* Boot to Flash Entry Point */
   CMBANK0_SECTOR0  : origin = 0x00200008, length = 0x00003FF7
   CMBANK0_SECTOR1  : origin = 0x00204000, length = 0x00004000
   CMBANK0_SECTOR2  : origin = 0x00208000, length = 0x00004000
   CMBANK0_SECTOR3  : origin = 0x0020C000, length = 0x00004000
   CMBANK0_SECTOR4  : origin = 0x00210000, length = 0x00010000
   CMBANK0_SECTOR5  : origin = 0x00220000, length = 0x00010000
   CMBANK0_SECTOR6  : origin = 0x00230000, length = 0x00010000
   CMBANK0_SECTOR7  : origin = 0x00240000, length = 0x00010000
   CMBANK0_SECTOR8  : origin = 0x00250000, length = 0x00010000
   CMBANK0_SECTOR9  : origin = 0x00260000, length = 0x00010000
   CMBANK0_SECTOR10 : origin = 0x00270000, length = 0x00004000
   CMBANK0_SECTOR11 : origin = 0x00274000, length = 0x00004000
   CMBANK0_SECTOR12 : origin = 0x00278000, length = 0x00004000
   CMBANK0_SECTOR13 : origin = 0x0027C000, length = 0x00004000

   C1RAM            : origin = 0x1FFFC000, length = 0x00001FFF
   C0RAM            : origin = 0x1FFFE000, length = 0x00001FFF

   BOOT_RSVD        : origin = 0x20000000, length = 0x00000800 /* Part of S0, BOOT rom will use this for stack */
   S0RAM             : origin = 0x20000800, length = 0x0000F7FF
   E0RAM            : origin = 0x20010000, length = 0x00003FFF

   CPU1TOCMMSGRAM0  : origin = 0x20080000, length = 0x00000800
   CPU1TOCMMSGRAM1  : origin = 0x20080800, length = 0x00000800
   CMTOCPU1MSGRAM0  : origin = 0x20082000, length = 0x00000800
   CMTOCPU1MSGRAM1  : origin = 0x20082800, length = 0x00000800
   CPU2TOCMMSGRAM0  : origin = 0x20084000, length = 0x00000800
   CPU2TOCMMSGRAM1  : origin = 0x20084800, length = 0x00000800
   CMTOCPU2MSGRAM0  : origin = 0x20086000, length = 0x00000800
   CMTOCPU2MSGRAM1  : origin = 0x20086800, length = 0x00000800
}

SECTIONS
{
   .resetisr        : > CMBANK0_RESETISR | CMBANK0_SECTOR0
   .vftable         : > CMBANK0_SECTOR0   /* Application placed vector table in Flash*/
   .vtable          : > S0RAM             /* Application placed vector table in RAM*/
   .text            : >> CMBANK0_SECTOR4 | CMBANK0_SECTOR5
   .cinit           : > CMBANK0_SECTOR0
   .pinit           : >> CMBANK0_SECTOR0 | CMBANK0_SECTOR1
   .switch          : >> CMBANK0_SECTOR0 | CMBANK0_SECTOR1
   .sysmem          : > S0RAM

   .stack           : > C1RAM
   .ebss            : > C1RAM
   .econst          : >> CMBANK0_SECTOR0 | CMBANK0_SECTOR1
   .esysmem         : > C1RAM
   .data            : > S0RAM
   .bss             : > CMBANK0_SECTOR6
   .const           : {} LOAD = CMBANK0_SECTOR9 | CMBANK0_SECTOR10 ,
   							RUN = S0RAM,
   							LOAD_START(constLoadStart),
   							LOAD_SIZE(constLoadSize),
   							LOAD_END(constLoadEnd),
   							RUN_START(constRunStart),
   							RUN_SIZE(constRunSize),
   							RUN_END(constRunEnd),
							ALIGN(8)

    MSGRAM_CM_TO_CPU1 : > CMTOCPU1MSGRAM0, type=NOINIT
    MSGRAM_CM_TO_CPU2 : > CMTOCPU2MSGRAM0, type=NOINIT
    MSGRAM_CPU1_TO_CM : > CPU1TOCMMSGRAM0, type=NOINIT
    MSGRAM_CPU2_TO_CM : > CPU2TOCMMSGRAM0, type=NOINIT

    .TI.ramfunc : {} LOAD = CMBANK0_SECTOR0 | CMBANK0_SECTOR1 | CMBANK0_SECTOR4,
                           RUN = S0RAM,
                           LOAD_START(RamfuncsLoadStart),
                           LOAD_SIZE(RamfuncsLoadSize),
                           LOAD_END(RamfuncsLoadEnd),
                           RUN_START(RamfuncsRunStart),
                           RUN_SIZE(RamfuncsRunSize),
                           RUN_END(RamfuncsRunEnd),
                           ALIGN(8)
}

/*
//===========================================================================
// End of file.
//===========================================================================
*/

My debug properties:

Error:

Include options :

I have also gone through certain forum threads but they didn't help.

My ultimate goal is to - Bring Up TCP/IP and communicate between a Host and Client and further send and receive certain set of commands

Note: I'm able to communicate using with a Host PC using UDP but I dont want to use UDP.

Please let me know how would I achieve this ?

Regards,

Pranay

  • Hi Pranay, Thanks for reaching out.  Please expect a delay in reply due the long weekend in observance of Dr. Martin Luther King day.  Regards, Krishna

  • "Breakpoint could not be set. All resources are in use" -> This probably means you are running out of the breakpoints. Please try after removing one of the breakpoints.

    Regards,

    Veena

  • Also, have you loaded any application on the C28x which configures the required clocks?

    Regards,

    Veena

  • Hi Veena,

    Please Re-read the description of query I asked, these are the basic things that I would check for -  removing the break points and running cpu1 core first and - then loading cm core. Please check the screenshot attached in description above.

    Thanks and regards,

    pranay.

  • I'm able to debug now, I disabled Enable Semi hosting and it worked.

    --Pranay.

  • Veena,

    As now I'm able to get tcpEchoF2838X project working and I'm able to ping successfully by setting static IP.

    I want to send and receive data to and from TCP server.

    Can you please guide me through any links/Docs that would help me achieve Data sending and receiving.
    I think control should be passed to a call back function if Connection has been established and if data received.

    Also If we assign IP Dynamically (using DHCP) how would I track my current IP address in code? Any variable ?

    Update 1:

    I see there is a "tcpWorker" thread running, But when I tried sending data, breakpoint is supposed to hit in this function right ? But I see that it is not getting hit here.

    Update 2:

    I was sending data to the wrong port address, I configured port address to 1000 and initiated a packet and I'm able to receive that.

    My next query would be - How would I configure multiple sockets/ports and send and receive data from/to both ?

    Thanks,
    --Pranay.

  • Hi Pranay,

    Your query has been forwarded to Ethernet expert. You will hear a response soon.

    Regards,

    Veena

  • Hi Pranay,

    To enable multiple connections, you must create one listening connection, which stays active all the time and waits for incoming connections.  This listening connection will have a callback function with tcp_accept().

    When a new client wants to connect, the accept callback configures a new tcp_pcb (struct tcp_pcb) with a pointer to this new data connections 

    For LWIP, the file lwipopts.h has some configuration parameters that you will have to update the parameters MEMP_NUM_TCP_PCB, MEMP_NUM_TCP_PCB_LISTEN, MEMP_NUM_NETCONN to enable more incoming connections.

    Best Regards

    Siddharth

  • Hello siddharth,

    Thanks for the reply. I will implement that and get back to you.

    I'm facing another issue when I tried to add below functions in tcpEchoF2838X project


        CM_init();
        //
        // Clear any IPC flags if set already
        //
        IPC_clearFlagLtoR(IPC_CM_L_CPU1_R, IPC_FLAG_ALL);

        //
        // Enable IPC interrupts
        //
        IPC_registerInterrupt(IPC_CM_L_CPU1_R, IPC_INT0, IPC_ISR0);

    So in the CM_init part it gave me vector table flash not found error so I added startup_css.c file and edited it,
    Also made a few changes in linker script.

    With above changes I'm unable to debug tcpEcho, It is not able run or ping.

    I have gone through "https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1052998/tms320f28388d-tcp-not-working-with-ipc-interrupt?tisearch=e2e-sitesearch&keymatch=tcp%25252525252520examples# " this link and also added these changes but of no use for me.

    My requirement is to communicate with CPU1 core from CM and vice-versa.

    Can someone please help me here to get this project up and running.

    Update 1:

    I removed CM_init(); from main() and deleted startup_css.c and everything seems working now.
    I'm able to receive data over TCP and push it o CPU1 and also push data from CPU1 to CM.

    Now I'm left with Extra Socket creation and communicating with it for which I'd follow above suggested solution.

    Also Few other queries :

    1. How to send data back to Particular Client outside "tcpWorker"  ?

    2. Is CM_Init() function that initializes CM core not required in this case of tcpEcho example ?

    3. If I use DHCP server for IP address assignment, How would I Internally track currently assigned IP ? Any variable present ?

    Thanks and regards,

    Pranay.

  • Pranay, 

    Will get back to you in a day or two to clarify your queries.

    Best Regards

    Siddharth

  • Hi Siddharth,

    Any inputs here ? I'm waiting fro your reply.

    --Pranay