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.

EK-TM4C129EXL: Debugging Firmware running on EPI flash

Part Number: EK-TM4C129EXL
Other Parts Discussed in Thread: TIDM-TM4CFLASHSRAM

Hi Everyone,

I'm trying to debug firmware running on an external flash interfaced via EPI. The firmware is fully functional where the LED blinks every 1 seconds. But i want to debug and do a step by step run. If i try to debug like how we normally do , i get the error "Address exceeds the allowed range", which i can understand since the Application base address is pointing to 0x60020000. But if the normal debug method wont work, how can this be achieved ?

This is currently being implemented on TM4C129EXL eval board without RTOS and I'm using TI compiler. Over time I'm finally going to switch to TI-RTOS with GCC compiler. 

Thanks in Advance.

- Prajnith

  • 
    

    Hi Prajnith,

     Can you try to add the below line to the GEL file within the memorymap_init() and let's see if it works.

    GEL_MapAddStr(0x60000000, 0, 0x01000000, "R", 0);

    You can go to CCS->Tools->GEL Files and then double-click on your respective GEL (i.e. tms4c1294ncpdt.gel). The GEL will look something like below.

    memorymap_init()
    {
        /*
         * Syntax for GEL_MapAddStr.
         * GEL_MapAddStr(address, page, length, "attribute", waitstate);
    
        Basic Attribute Types           Derived Attribute Types
        String      Description         String      Description
        R           Read                NONE        No memory/protected
        W           Write               RAM         Read and write
        P           Port                ROM         Read only
        EX          External            WOM         Write only
        EM          Emulator            INPORT      Port read only
        PR          Programmable        OUTPORT     Port write only
        ER          Erasable            IOPORT      Port read and write
        DA          Dual access         SARAM       Single access RAM
        ASn         Access size         DARAM       Dual access RAM
        SHnC        Shared              FLASH       Flash ROM
        CACHE       Cache               EXRAM       External RAM
        TX          Text                EXROM       External ROM
        MN          Monitor             EPROM       Erasable write-able EPROM
        SA          Single access       MONITOR     Monitor ROM
        FL          Flash               PRAM        Program RAM
        MR          Memory mapped       PROM        Program ROM
        NULL        NULL                NULL        NULL
    
        */
    
        GEL_MapAddStr(0x00000000, 0, 0x00100000, "R", 0);  /* Flash */
        GEL_MapAddStr(0x01000000, 0, 0x00008c00, "R", 0);  /* ROM */
        GEL_MapAddStr(0x20000000, 0, 0x00040000, "R|W", 0);  /* SRAM */

  • Hi Charles,

    Thanks for quick reply. I tried you suggested method but still i have issue in debugging code on external flash.

    I'm getting errors message as

    CORTEX_M4_0: GEL Output:
    Memory Map Initialization Complete
    CORTEX_M4_0: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.
    CORTEX_M4_0: File Loader: Verification failed: Values at address 0x60000000 do not match Please verify target memory and memory map.
    CORTEX_M4_0: GEL: File: C:\Users\Prajnith\workspace_v7\EPI\TIDM-TM4CFLASHSRAM\ektm4c129_epiflash_boot_demo\Debug\ektm4c129_epiflash_boot_demo.out: a data verification error occurred, file load failed.


    I was wondering does CCS need some kind of EPI driver to write to external flash in debug mode? since I'm flashing code to external flash via LM Flash programmer and TI bootloader. Also I'm using ICDI built in chip of EVK for debugging.

    Thanks,
    - Prajnith
  • Hi Charles,

    After modifying the gel file and fixing the linker issue I'm able to debug /halt the target but unable to set any brekpoints, it pops message saying the address exceeds the allowed range, what are your thoughts on this ?

    Thanks
    -Prajnith
  • Hi Prajnith,
    Sorry for the delay response. I'm out of office for two weeks. Which version of CCS do you have? Do you have the latest? Can you set breakpoints in non-EPI areas?
  • Hi Charles,

    Yes I'm using the latest ccs ide. I'm able to set breakpoints in non epi address and also set breakpoints at external sram location that is in 0xA0000000 range.

    Thanks

    - Prajnith

  • Hi Prajnith,
    I did some search in the forums and it looks like the CCS does not support HW breakpoints outside of the Flash memory range of the Cortex M architecture.
    I will suggest you open a new thread under CCS forum to confirm if this is still the case for the latest version.