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.

MSP430FR6972: USE SOME OF FRAM AS RAM ,BUT MCU RUN IN LOCKED UP STATUS

Part Number: MSP430FR6972

Hi,

  My customer use FR6972 in an project. They want use 0x4400-0x5eff as RAM but failed. Can you help me to check the XCL which they revised. Is there any documents to say how to operate FRAM TO RAM?

Here is what they revised of XCL.

// ************************************************
//
// XLINK configuration file for MSP430FR6972
//
// Copyright 1996-2015 IAR Systems AB.
//
// See the file 430/doc/licenses/IARSourceLicense.txt for detailed
// license information.
//
// $Revision: 13028 $
//
// ************************************************

// ---------------------------------------------------------
// Description
//

//
// Usage:
//
// xlink [file file ...] -f lnk430fr6972.xcl
//
// -----------------------------------------------
// Device summary
//

//
// Core: MSP430Xv2
//
// Interrupt vectors: 56
//
// Signature memory: 16 Bytes
//
// JTAG Signature memory: 4 Bytes
//
// BSL Signature memory: 4 Bytes
//
// IPE Signature memory: 8 Bytes
//
// Peripheral units: 00100-00FFF
//
// Information memory (FRAM): 01800-019FF //0.5K
//
// Read/write memory (RAM): 01C00-023FF //2K
//
// Read/write memory (TINYRAM): 00006-0001F
//
// Persistent memory (FRAM): 04400-0FFFF //47k
// 10000-13FFF //16k
//


// -----------------------------------------------
// Segments
//

// -------------------------------------
// Data read/write segments
//

//
// The following segments are available for both
// the DATA16 and DATA20 segment groups.
//
// segment Usage
// ------- --------------------------
// DATA<nn>_Z Data initialized to zero
// DATA<nn>_I Data initialized by copying from DATA<nn>_ID
// DATA<nn>_N Data defined using __no_init
// DATA<nn>_P Data defined using __persistent
// DATA<nn>_HEAP The heap used by 'malloc' and 'free'
//
// segment Usage
// ------- --------------------------
// CSTACK Runtime stack
// TLS16_I Thread-local storage for main thread
//


// -------------------------------------
// Program and data read-only segments
//

//
// The following segments are available for both
// the DATA16 and DATA20 segment groups.
//
// segment Usage
// ------- --------------------------
// DATA<nn>_C Constant data, including string literals
// DATA<nn>_ID Initializers for DATA<nn>_I
//
// segment Usage
// ------- --------------------------
// INFO Information memory
// INFOA Information memory, bank A
// INFOB Information memory, bank B
// INFOC Information memory, bank C
// INFOD Information memory, bank D
// CSTART Program startup code
// CODE Program code
// ISR_CODE Program code for interrupt service routines
// DIFUNCT Dynamic initialization vector used by C++
// CHECKSUM Checksum byte(s) generated by the -J option
// SIGNATURE Signature memory
// JTAGSIGNATURE JTAG Signature memory
// BSLSIGNATURE BSL Signature memory
// IPESIGNATURE IPE Signature memory
// INTVEC Interrupt vectors
// RESET The reset vector
// TLS16_ID Thread-local initializers for main thread
// MPU_B<N> Memory Protection Unit border
// IPE_B<N> Intellectual Property Encapsulation border
// IPECODE16 IPE code
// IPEDATA16_C IPE constant data
//
// Notes:
//
// * The segments CSTART, ISR_CODE, and DIFUNCT, as well as the segments in
// the DATA16 and TLS16 segment groups must be placed in in the range
// 0000-FFFD.
//
// * The INFOx and INFO segments overlap, this allows data either to be
// placed in a specific bank or anywhere in the info memory.
//
// * The INTVEC and RESET segments overlap. This allows an application to
// either use the reset vector provided by the runtime library, or
// provide a reset function by defining an interrupt function associated
// with the reset vector.
//
// * To use the Memory Protection Unit, the symbol ?mpu2_init should be
// included in the application. The symbol '__iar_430_MPU_base' should be
// defined to the location of the MPU peripheral registers, and the
// registers '__iar_430_MPUSAM_value' and '__iar_430_MPUCTL0_value' to
// the value the registers MPUSAM and MPUCTL0 should be initialized to,
// respectively.
//
// * To include Intellectual Property Encapsulation (IPE), the library
// label '__iar_430_ipe_signature' must be included in the application.
// (One way to do this is to use the -g XLINK command-line option.) The
// symbol '__iar_430_MPUIPC0_value' must be defined to the value the
// MPUIPC0 register should be initialized to.
//
// * To include custom segments in the Intellectual Property Encapsulation
// (IPE) area, place them between the segments IPE_B1 and IPE_B2.
//


// ---------------------------------------------------------
// Configuation
//

// -----------------------------------------------
// Stack and heap sizes
//

// Uncomment for command line use
//-D_STACK_SIZE=160
//-D_DATA16_HEAP_SIZE=160
//-D_DATA20_HEAP_SIZE=160
//-g?mpu2_init
//-g__iar_430_ipe_signature


// -----------------------------------------------
// Define cpu
//

-cmsp430


// -----------------------------------------------
// Support for placing functions in read/write memory
//

-QCODE_I=CODE_ID


// -----------------------------------------------
// Support for thread local storage
//

-QTLS16_I=TLS16_ID


// -----------------------------------------------
// Hardware multiplier location
//

-D__iar_HWMUL=4C0


// ---------------------------------------------------------
// Placement directives
//

// -----------------------------------------------
// Information memory
//


-Z(CONST)INFO=1800-19FF
-Z(CONST)INFOA=1980-19FF
-Z(CONST)INFOB=1900-197F
-Z(CONST)INFOC=1880-18FF
-Z(CONST)INFOD=1800-187F

// -----------------------------------------------
// RAM memory
//

-Z(DATA)TINYRAM=0006-001F
-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,TLS16_I=1C00-23FF,4400-5EFF //加2816字节的RAM
-Z(DATA)CODE_I
-Z(DATA)DATA20_I,DATA20_Z,DATA20_N
-Z(DATA)CSTACK+_STACK_SIZE#


// -----------------------------------------------
// FRAM memory
//

// -------------------------------------
// Low memory 0-0FFFF
//

// ---------------------------
// Read/write data in FRAM
//

-Z(CONST)DATA16_P,DATA20_P=8000-FF7F // 改wfjP=7000-FF7F
-Z(DATA)DATA16_HEAP+_DATA16_HEAP_SIZE
-Z(DATA)DATA20_HEAP+_DATA20_HEAP_SIZE

// ---------------------------
// Memory Protection Unit (MPU) border
//

-Z(CONST)MPU_B1

// ---------------------------
// Intellectual Property Encapsulation (IPE)
//

-Z(CONST)IPE_B1=8000-FF7F // 改// 改wfjP=7000-FF7F
-Z(DATA)IPEDATA16_N
-Z(CODE)IPECODE16
-Z(CONST)IPEDATA16_C,IPE_B2

// ---------------------------
// Memory Protection Unit (MPU) border
//

-Z(CONST)MPU_B2

// ---------------------------
// Constant data
//

-Z(CONST)DATA16_C,DATA16_ID,TLS16_ID,DIFUNCT,CHECKSUM=8000-FF7F //改// 改wfjP=7000-FF7F

// ---------------------------
// Code
//

-Z(CODE)CSTART,ISR_CODE,CODE16=8000-FF7F //改// 改wfjP=7000-FF7F


// -------------------------------------
// All memory 0-FFFFF
//

// ---------------------------
// Code
//

-P(CODE)CODE=8000-FF7F,10000-13FFF //改// 改wfjP=7000-FF7F
-Z(CODE)CODE_PAD

// ---------------------------
// Constant data
//

-Z(CONST)DATA20_C,DATA20_ID,CODE_ID=8000-FF7F,10040-13FFF //改// 改wfjP=7000-FF7F


// -------------------------------------
// Signature memory and interrupt vectors
//

-Z(CONST)SIGNATURE=FF80-FF8F
-Z(CONST)JTAGSIGNATURE=FF80-FF83
-Z(CONST)BSLSIGNATURE=FF84-FF87
-Z(CONST)IPESIGNATURE=FF88-FF8F
-Z(CODE)INTVEC=FF90-FFFF
-Z(CODE)RESET=FFFE-FFFF

  • Hello Joyce,

    Thanks for your post.
    We will look into it and get back to you asap.

    Thanks,
    Yiding
  • Thanks for your reply.I also need a document to show me how to operate FRAM TO RAM and what should be notice. Thank you.
  • Joyce, please search in ti.com:

    SLAA628–June 2014

    "MSP430™ FRAM Technology – How To and Best Practices"

    You must see"

    3.4.1 TI Code Composer Studio

    ...

    Every CCS project has a linker command file (.cmd) that gets populated into the project folder upon project creation. This file describes the allocation of program code, variables, constants, and stacks for the

    device. It also describes the priority of how each memory segments are ordered in the device. The following segment names listed below are the most commonly used items for most applications.

    .const /* Constant data */

    .text /* Application code */

    .bss /* Uninitialized Global and static variables – default in RAM */

    .data /* Initialized Global and static variables – default in RAM */

    .stack /* Software system stack – default in RAM */

    In addition, the compiler has the capability to automatically place selected variables, arrays, or structures into FRAM when linker segments named .TI.noinit (for use in conjunction with #pragma NOINIT)

    and .TI.persistent (for use with #pragma PERSISTENT) are assigned to the FRAM. In case of .TI.persistent, this definition is already present in the linker command file, locating variables declared

    as #pragma PERSISTENT into FRAM. For important information regarding CSSv6.0.0, see Appendix A.

    In case of .TI.noinit, such an assignment can be made by the customer in analogy to the existing .TI.persistent if the #pragma NOINIT feature should be used to locate variables and structures not

    requiring C startup initialization into FRAM.

    .TI.noinit : {} > FRAM /* For #pragma NOINIT */

    .TI.persistent : {} > FRAM /* For #pragma PERSISTENT */

    ...

    From me:

    In simple terms, there are no differences between simply variables (arrays) and variables (arrays) in the FRAM - you simply need to give the linker command (describe the linker, see SLAA628) what variables it needs to place in simple memory and which ones to place in the FRAM.
    Further in your program you simply use variables (arrays) since and usually you use them in ordinary programs.

  • Thanks for your reply. I need a guide to show how to step by step in IAR project. Thank you.
  • Hello Joyce,

    I think Alexander Soroka gave you a really good explanation on using FRAM as RAM.

    And please read this document : "MSP430™ FRAM Technology – How To and Best Practices"
    www.ti.com/.../slaa628.pdf

    In Section 3.4.2, it talks about how to use IAR to do memory partitioning.

    Please let us know if you have any questions.

    Thanks,
    Yiding
  • for example:
    in main.c - before main {} proc, I'm write this:
    ...
    #include <msp430.h>

    #pragma PERSISTENT(eU_corr)
    volatile static signed char eU_corr=1;
    #pragma PERSISTENT(eU1_corr)
    volatile static signed char eU1_corr=1;
    #pragma PERSISTENT(eIbutton)
    volatile static unsigned char eIbutton=2;
    #pragma PERSISTENT(eIRcorr)
    volatile static float eIRcorr=13.13F;
    #pragma PERSISTENT(ez)
    volatile static unsigned char ez=0;...
    ...

    It's my variables.

    In pogramm: (for example)
    ...
    eU_corr = eU_corr + 123;
    ...

    In result - "eU_corr" stored in FRAM.

  • Can you share a example in IAR which  use 0x4400-0x5eff as RAM in FR6972?

  • I do not have IAR.

    I'm use CCS 8.1

**Attention** This is a public forum