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.

Starterware - stuck at MMUInit() -> CP15TlbInvalidate()

Other Parts Discussed in Thread: AM3358, AM3359, SYSBIOS

Hello everyone,

First of all, thank you for taking a second to look at this problem. I have a huge feeling that I am just missing something simple. Any help in pointing me in the right direction would be greatly appreciated.


I am building some Starterware code for the starter-kit. I believe the processor on board is an AM3359 processor. I have imported the following library projects : drivers, platform, system, and utils. I have built these libraries with TI v5.1.9 compiler. I have also imported gpioLEDBlink project. I have made a few modifications in this project to initialize the MMU and CACHE among a few other things. This project, that creates an binary to be loaded, has also been compiled with TI v5.1.9 . All projects use the AM3358.cmd to build their library/binary as appropriate. I have no errors or warnings.

I want to also add that I had this code working. I recently have been making the change over to the BBB board. Somewhere along the line, i believe I changed a setting.

The problem that I am seeing is that when my code steps into MMUInit, and soon afterwards CP15TlbInvalidate(), the code jumps into an assembly file. I've followed the assembly instruction and see that it ultimately loops at pc: 0x20080 : EAFFFFFE     B       PC,0X20080. As you can see, the flow of the code get's to the point that it branches to itself and stays there for eternity. I'm thinking that the coprocessor, aka the System Control Coprocessor (what ever that is), tried to write to invalid location and put itself there.

As I have mentioned, I have had this code working and I believe it could be a simple compilation issue. I forgot to mention that I am compiling the .out binary with the  rtsv7A8_A_le_eabi.lib runtime support library.

Any guidance would be greatly appreciated. Thank you in advance.

  • Sorry, I'll correct myself, all projects use the AM3358.cmd to build thier library/binary as appropriate.
  • Moving this to the Starterware forum.

  • So, I believe I have discovered the problem. The address at 0x20080 is a dead loop signalling that the interrupt handler has not been set up. I had choosen to use the AM3358.cmd linker file over the gpioLEDBlink.cmd linker file. That is where I believe I went wrong. gpioLEDBlink.cmd held necessary declarations and parameters like -e Entry (telling the program to start there thus initializing the interrupt handler before main), and declaring parameters like bss_start and bss_end.

    In the end, stick with the cmd files they give you and, modify as needed.
  • Sorry, I will finally finalize the answer to my problem. Yes, Starterware needs to begin it's code at Entry. However, for some odd reason, my code just would not compile if included my own command file. Somewhere deep down in my settings, it is already using a command file. I suggest that you don't modify the command file. My code compiles again and I can go back to bare metal coding.
  • Hi Beau :

    I have the same issue as your problem, however, I can not find AM3358.cmd in my am335x_sysbios_ind_sdk_1.1.0.8.

    Could you share you command file?

    Or could you give me some suggestion?

    Below is my command file.

    /****************************************************************************/
    /* AM335x.cmd */
    /* Copyright (c) 2014 Texas Instruments Incorporated */
    /* Author: Rafael de Souza */
    /* */
    /* Description: This file is a sample linker command file that can be */
    /* used for linking programs built with the C compiler and */
    /* running the resulting .out file on an AM335x device. */
    /* Use it as a guideline. You will want to */
    /* change the memory layout to match your specific */
    /* target system. You may want to change the allocation */
    /* scheme according to the size of your program. */
    /* */
    /****************************************************************************/

    #ifdef A8_CORE /* A8 memory map */
    MEMORY
    {
    SRAM: o = 0x402F0400 l = 0x0000FC00 /* 64kB internal SRAM */
    L3OCMC0: o = 0x40300000 l = 0x00010000 /* 64kB L3 OCMC SRAM */
    M3SHUMEM: o = 0x44D00000 l = 0x00004000 /* 16kB M3 Shared Unified Code Space */
    M3SHDMEM: o = 0x44D80000 l = 0x00002000 /* 8kB M3 Shared Data Memory */
    DDR0: o = 0x80000000 l = 0x40000000 /* 1GB external DDR Bank 0 */
    }

    SECTIONS
    {
    .text > L3OCMC0
    .stack > L3OCMC0
    .bss > L3OCMC0
    .cio > L3OCMC0
    .const > L3OCMC0
    .data > L3OCMC0
    .switch > L3OCMC0
    .sysmem > L3OCMC0
    .far > L3OCMC0
    .args > L3OCMC0
    .ppinfo > L3OCMC0
    .ppdata > L3OCMC0

    /* TI-ABI or COFF sections */
    .pinit > L3OCMC0
    .cinit > L3OCMC0

    /* EABI sections */
    .binit > L3OCMC0
    .init_array > L3OCMC0
    .neardata > L3OCMC0
    .fardata > L3OCMC0
    .rodata > L3OCMC0
    }
    #endif /* A8 memory map */

    #ifdef M3_CORE /* M3 memory map */
    MEMORY
    {
    M3UMEM: o = 0x00000000 l = 0x00004000 /* 16kB M3 Local Unified Code Space */
    M3DMEM: o = 0x00080000 l = 0x00002000 /* 8kB M3 Local Data Memory */
    M3SHUMEM: o = 0x20000000 l = 0x00004000 /* 16kB M3 Shared Unified Code Space */
    M3SHDMEM: o = 0x20080000 l = 0x00002000 /* 8kB M3 Shared Data Memory */
    }

    SECTIONS
    {
    .text > M3UMEM
    .stack > M3DMEM
    .bss > M3DMEM
    .cio > M3DMEM
    .const > M3UMEM
    .data > M3DMEM
    .switch > M3DMEM
    .sysmem > M3DMEM
    .far > M3DMEM
    .args > M3DMEM
    .ppinfo > M3DMEM
    .ppdata > M3DMEM

    /* TI-ABI or COFF sections */
    .pinit > M3UMEM
    .cinit > M3UMEM

    /* EABI sections */
    .binit > M3UMEM
    .init_array > M3UMEM
    .neardata > M3DMEM
    .fardata > M3DMEM
    .rodata > M3UMEM
    }
    #endif /* M3 memory map */

    #ifdef PRU_CORE /* PRU memory map */
    MEMORY
    {
    PAGE 0:
    PRUIMEM: o = 0x00000000 l = 0x00001000 /* 8kB PRU0 Instruction RAM */
    PAGE 1:
    PRUDMEM: o = 0x00000000 l = 0x00001000 /* 8kB PRU Data RAM 0 */
    PAGE 2:
    SHAREDMEM: o = 0x00010000 l = 0x00003000 /* 12kB Shared RAM */
    }

    SECTIONS
    {
    .text:_c_int00 > 0x0
    .text > PRUIMEM, PAGE 0
    .bss > PRUDMEM, PAGE 1
    .data > PRUDMEM, PAGE 1
    .rodata > PRUDMEM, PAGE 1
    .farbss > SHAREDMEM, PAGE 2
    .fardata > SHAREDMEM, PAGE 2
    .rofardata > SHAREDMEM, PAGE 2
    .sysmem > PRUDMEM, PAGE 1
    .stack > PRUDMEM, PAGE 1
    .init_array > PRUDMEM, PAGE 1
    .cinit > PRUDMEM, PAGE 1
    .args > PRUDMEM, PAGE 1
    }
    #endif /* PRU memory map */

    Best regards,

    Marcus