Modifying memory map for MSP430

Sysprogs forums Forums VisualGDB Modifying memory map for MSP430

Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6116
    Jordan
    Participant

    I am evaluating VisualGDB for use with MSP430 and STM32F4xx processors and have a question regarding the linker and memory map of the MSP430.  Currently, I am porting an MSP430 application developed using TI CCSv5 to work with VisualGDB.  We have a custom Bootloader (BSL) running that launches the application and the BSL executes from address 0x4400 (default).  When the MSP430F5528 starts up, the BSL determines if a valid application is present and remaps the Interrupt Vector table from the application flash (0x6800) into RAM and calls the application Reset Vector (0x687E) that points to the main() function of the application sitting at address 0x6880.  Is it possible to modify the linker memory map in VisualGDB or can I pass the compiler/linker the existing memory map from CCSv5?  In CCSv5 it is a lnk_msp430f5528.cmd file.

    Below is an excerpt from the linker file with the remapped addresses:

    /****************************************************************************/
     /* SPECIFY THE SYSTEM MEMORY MAP                                            */
     /****************************************************************************/
    MEMORY
     {
     SFR                     : origin = 0x0000, length = 0x0010
     PERIPHERALS_8BIT        : origin = 0x0010, length = 0x00F0
     PERIPHERALS_16BIT       : origin = 0x0100, length = 0x0100
     BSLRAM                  : origin = 0x2400, length = 0x0002
     FRAM                    : origin = 0x2402, length = 0x0002
     RAM                     : origin = 0x2404, length = 0x1F7C
     RAMINTVEC       : origin = 0x4380, length = 0x0080
     INFOA                   : origin = 0x1980, length = 0x0080
     INFOB                   : origin = 0x1900, length = 0x0080
     INFOD                   : origin = 0x1800, length = 0x0100
     BSL                     : origin = 0x4400, length = 0x2380
     UNIT_DATA    : origin = 0x6780, length = 0x0080
     INT00                   : origin = 0x6800, length = 0x0002
     INT01                   : origin = 0x6802, length = 0x0002
     INT02                   : origin = 0x6804, length = 0x0002
     INT03                   : origin = 0x6806, length = 0x0002
     INT04                   : origin = 0x6808, length = 0x0002
     INT05                   : origin = 0x680A, length = 0x0002
     INT06                   : origin = 0x680C, length = 0x0002
     INT07                   : origin = 0x680E, length = 0x0002
     INT08                   : origin = 0x6810, length = 0x0002
     INT09                   : origin = 0x6812, length = 0x0002
     INT10                   : origin = 0x6814, length = 0x0002
     INT11                   : origin = 0x6816, length = 0x0002
     INT12                   : origin = 0x6818, length = 0x0002
     INT13                   : origin = 0x681A, length = 0x0002
     INT14                   : origin = 0x681C, length = 0x0002
     INT15                   : origin = 0x681E, length = 0x0002
     INT16                   : origin = 0x6820, length = 0x0002
     INT17                   : origin = 0x6822, length = 0x0002
     INT18                   : origin = 0x6824, length = 0x0002
     INT19                   : origin = 0x6826, length = 0x0002
     INT20                   : origin = 0x6828, length = 0x0002
     INT21                   : origin = 0x682A, length = 0x0002
     INT22                   : origin = 0x682C, length = 0x0002
     INT23                   : origin = 0x682E, length = 0x0002
     INT24                   : origin = 0x6830, length = 0x0002
     INT25                   : origin = 0x6832, length = 0x0002
     INT26                   : origin = 0x6834, length = 0x0002
     INT27                   : origin = 0x6836, length = 0x0002
     INT28                   : origin = 0x6838, length = 0x0002
     INT29                   : origin = 0x683A, length = 0x0002
     INT30                   : origin = 0x683C, length = 0x0002
     INT31                   : origin = 0x683E, length = 0x0002
     INT32                   : origin = 0x6840, length = 0x0002
     INT33                   : origin = 0x6842, length = 0x0002
     INT34                   : origin = 0x6844, length = 0x0002
     INT35                   : origin = 0x6846, length = 0x0002
     INT36                   : origin = 0x6848, length = 0x0002
     INT37                   : origin = 0x684A, length = 0x0002
     INT38                   : origin = 0x684C, length = 0x0002
     INT39                   : origin = 0x684E, length = 0x0002
     INT40                   : origin = 0x6850, length = 0x0002
     INT41                   : origin = 0x6852, length = 0x0002
     INT42                   : origin = 0x6854, length = 0x0002
     INT43                   : origin = 0x6856, length = 0x0002
     INT44                   : origin = 0x6858, length = 0x0002
     INT45                   : origin = 0x685A, length = 0x0002
     INT46                   : origin = 0x685C, length = 0x0002
     INT47                   : origin = 0x685E, length = 0x0002
     INT48                   : origin = 0x6860, length = 0x0002
     INT49                   : origin = 0x6862, length = 0x0002
     INT50                   : origin = 0x6864, length = 0x0002
     INT51                   : origin = 0x6866, length = 0x0002
     INT52                   : origin = 0x6868, length = 0x0002
     INT53                   : origin = 0x686A, length = 0x0002
     INT54                   : origin = 0x686C, length = 0x0002
     INT55                   : origin = 0x686E, length = 0x0002
     INT56                   : origin = 0x6870, length = 0x0002
     INT57                   : origin = 0x6872, length = 0x0002
     INT58                   : origin = 0x6874, length = 0x0002
     INT59                   : origin = 0x6876, length = 0x0002
     INT60                   : origin = 0x6878, length = 0x0002
     INT61                   : origin = 0x687A, length = 0x0002
     INT62                   : origin = 0x687C, length = 0x0002
     RESET                   : origin = 0x687E, length = 0x0002
     FLASH                   : origin = 0x6880, length = 0x9580
     RSVDBOOTVEC             : origin = 0xFE00, length = 0x0200
     FLASH2                  : origin = 0x10000,length = 0x14400
    }
    /****************************************************************************/
     /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY                              */
     /****************************************************************************/
    SECTIONS
     {
     .bss       : {} > RAM                /* GLOBAL & STATIC VARS              */
     .sysmem    : {} > RAM                /* DYNAMIC MEMORY ALLOCATION AREA    */
     .stack     : {} > RAM (HIGH)         /* SOFTWARE SYSTEM STACK             */
    .keys      : {} > BSLRAM             /* BSL Update Keys                   */
     .fram      : {} > FRAM               /* Flash password                    */
     .unitdata  : {} > UNIT_DATA    /* THE UNIT INFO                     */
     .text      : {} > FLASH | FLASH2     /* CODE                              */
     .text:_isr : {} > FLASH              /* ISR CODE SPACE                    */
     .cinit     : {} > FLASH              /* INITIALIZATION TABLES             */
     .const     : {} > FLASH | FLASH2     /* CONSTANT DATA                     */
     .cio       : {} > RAM                /* C I/O BUFFER                      */
    .pinit     : {} > FLASH              /* C++ CONSTRUCTOR TABLES            */
    .infoA     : {} > INFOA              /* MSP430 INFO FLASH MEMORY SEGMENTS */
     .infoB     : {} > INFOB
     .infoC     : {} > INFOD
     .infoD     : {} > INFOD
    .motordata : {} > INFOD
    .int00   : {} > INT00                /* MSP430 INTERRUPT VECTORS          */
     .int01   : {} > INT01
     .int02   : {} > INT02
     .int03   : {} > INT03
     .int04   : {} > INT04
     .int05   : {} > INT05
     .int06   : {} > INT06
     .int07   : {} > INT07
     .int08   : {} > INT08
     .int09   : {} > INT09
     .int10   : {} > INT10
     .int11   : {} > INT11
     .int12   : {} > INT12
     .int13   : {} > INT13
     .int14   : {} > INT14
     .int15   : {} > INT15
     .int16   : {} > INT16
     .int17   : {} > INT17
     .int18   : {} > INT18
     .int19   : {} > INT19
     .int20   : {} > INT20
     .int21   : {} > INT21
     .int22   : {} > INT22
     .int23   : {} > INT23
     .int24   : {} > INT24
     .int25   : {} > INT25
     .int26   : {} > INT26
     .int27   : {} > INT27
     .int28   : {} > INT28
     .int29   : {} > INT29
     .int30   : {} > INT30
     .int31   : {} > INT31
     .int32   : {} > INT32
     .int33   : {} > INT33
     .int34   : {} > INT34
     .int35   : {} > INT35
     .int36   : {} > INT36
     .int37   : {} > INT37
     .int38   : {} > INT38
     .int39   : {} > INT39
     .int40   : {} > INT40
     .int41   : {} > INT41
     .int42   : {} > INT42
     .int43   : {} > INT43
     .int44   : {} > INT44
     .int45   : {} > INT45
     .int46   : {} > INT46
     .int47   : {} > INT47
     .int48   : {} > INT48
     .int49   : {} > INT49
     .int50   : {} > INT50
     .int51   : {} > INT51
     .int52   : {} > INT52
     .int53   : {} > INT53
     .int54   : {} > INT54
     .int55   : {} > INT55
     .int56   : {} > INT56
     .int57   : {} > INT57
     .int58   : {} > INT58
     .int59   : {} > INT59
     .int60   : {} > INT60
     .int61   : {} > INT61
     .int62   : {} > INT62
     .reset   : {} > RESET              /* MSP430 RESET VECTOR               */
     }
    /****************************************************************************/
     /* INCLUDE PERIPHERALS MEMORY MAP                                           */
     /****************************************************************************/
    -l msp430f5528.cmd
    #6125
    support
    Keymaster

    Hi,

    You should be able to modify the original mspgcc linker script. Normally mspgcc uses the msp430.x script located in <SysGCC>\msp430\msp430\lib\ldscripts that in turn includes msp430f5528\memory.x and msp430f5528\periph.x for device-specific data. You can make your own script based on msp430.x and specify it via the -T linker flag (i.e. add -Tc:/path/to/my-script.x to LDFLAGS).

    You can also try reusing the script from Code Composer, however you may need to adjust it to compensate for the differences in interrupt handling (.vectors section vs .intXX sections) and to include peripheral address definitions from periph.x.

    #8162
    alfredalfred
    Participant

    You can also try reusing the script from Code Composer, however you may need to adjust it to compensate for the differences in interrupt handling (.vectors section vs .intXXsections) and to include peripheral address definitions from periph.x.

     

     

    waleeed

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.