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.

Linux/MSP432P401R: Bare minimum assembly project

Part Number: MSP432P401R

Tool/software: Linux

I am using "openocd" as my GDB server.

Using telnet, I have successfully flashed a *.out file to the Launchpad that was previously built with Code Composer.

I can also step through (but not flash) the same file/program if I use the GDB client.

So I have some confidence I have a basic procedure that will work for me.

I am trying to get down to the least possible code & files as a starter.

My question is what I am missing from (below) that prevents me from flashing the resulting *.elf file generated.

this is my linker.script.ld file:

_estack = 0x20010000;

MEMORY
{
    FLASH ( rx )      : ORIGIN = 0x08000000, LENGTH = 256K
    RAM ( rxw )       : ORIGIN = 0x20000000, LENGTH = 64K
}

and this is my core.S source:

.syntax unified
.cpu cortex-m4 
.fpu vfpv4
.thumb
.global vtable
.global reset_handler

.type vtable, %object vtable: .word _estack .word reset_handler .size vtable, .-vtable .equ somevar, 5 .type reset_handler, %function reset_handler: LDR R0, =_estack MOV SP, R0 LDR R0,=somevar main_loop: B main_loop .size reset_handler, .-reset_handler

These are the build steps:

arm-none-eabi-gcc -x assembler -c -O0 -mcpu=cortex-m4 -mthumb -Wall -g core.S -o core.o

arm-none-eabi-gcc core.o -g -mcpu=cortex-m4 -mthumb -Wall --specs=nosys.specs -nostdlib -lgcc -T./linker.script.ld -o main.elf

The above works (with minor size changes of course) for an STM32 device.

Looking through existing projects is a lot of information... not exactly helpful.

  • Hello,

       I cannot comment on the GDB.  Looking at your memory configuration, it does not match what I would find in the linker command file in CCS.  Specifically, the origin of 0x00000000 vs 0x08000000.  Also, there is a specific mirrored section of RAM that allows for execution.

    MEMORY
    {
        MAIN       (RX) : origin = 0x00000000, length = 0x00040000
        INFO       (RX) : origin = 0x00200000, length = 0x00004000
    #ifdef  __TI_COMPILER_VERSION__
    #if     __TI_COMPILER_VERSION__ >= 15009000
        ALIAS
        {
        SRAM_CODE  (RWX): origin = 0x01000000
        SRAM_DATA  (RW) : origin = 0x20000000
        } length = 0x00010000
    #else
        /* Hint: If the user wants to use ram functions, please observe that SRAM_CODE             */
        /* and SRAM_DATA memory areas are overlapping. You need to take measures to separate       */
        /* data from code in RAM. This is only valid for Compiler version earlier than 15.09.0.STS.*/ 
        SRAM_CODE  (RWX): origin = 0x01000000, length = 0x00010000
        SRAM_DATA  (RW) : origin = 0x20000000, length = 0x00010000
    #endif
    #endif
    }

    Hope that helps.

    Chris

**Attention** This is a public forum