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.

Cannot write or erase bank C in main flash

Other Parts Discussed in Thread: MSP430F5528

We are creating an application that requires storing data in main flash using the MSP430F5528. I am trying to use all of bank C and D, but I cannot erase or write bank C. Unlike bank D which is initially erased, bank C clearly has data written to it. When I try to erase bank C, the program goes haywire and nothing works even when reset. I have to reprogram it to fix it.

Here is what the memory map looks like in the linker file:

SFR : origin = 0x0000, length = 0x0010
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100
RAM : origin = 0x2400, length = 0x2000
USBRAM : origin = 0x1C00, length = 0x0800
INFOA : origin = 0x1980, length = 0x0080
INFOB : origin = 0x1900, length = 0x0080
INFOC : origin = 0x1880, length = 0x0080
INFOD : origin = 0x1800, length = 0x0080

FLASH : origin = 0x4400, length = 0x7DDE

MYDATA : origin = 0x14400,length = 0x0FFF

INT00 : origin = 0xFF80, length = 0x0002
INT01 : origin = 0xFF82, length = 0x0002
INT02 : origin = 0xFF84, length = 0x0002
INT03 : origin = 0xFF86, length = 0x0002
INT04 : origin = 0xFF88, length = 0x0002
INT05 : origin = 0xFF8A, length = 0x0002
INT06 : origin = 0xFF8C, length = 0x0002
INT07 : origin = 0xFF8E, length = 0x0002
INT08 : origin = 0xFF90, length = 0x0002
INT09 : origin = 0xFF92, length = 0x0002
INT10 : origin = 0xFF94, length = 0x0002
INT11 : origin = 0xFF96, length = 0x0002
INT12 : origin = 0xFF98, length = 0x0002
INT13 : origin = 0xFF9A, length = 0x0002
INT14 : origin = 0xFF9C, length = 0x0002
INT15 : origin = 0xFF9E, length = 0x0002
INT16 : origin = 0xFFA0, length = 0x0002
INT17 : origin = 0xFFA2, length = 0x0002
INT18 : origin = 0xFFA4, length = 0x0002
INT19 : origin = 0xFFA6, length = 0x0002
INT20 : origin = 0xFFA8, length = 0x0002
INT21 : origin = 0xFFAA, length = 0x0002
INT22 : origin = 0xFFAC, length = 0x0002
INT23 : origin = 0xFFAE, length = 0x0002
INT24 : origin = 0xFFB0, length = 0x0002
INT25 : origin = 0xFFB2, length = 0x0002
INT26 : origin = 0xFFB4, length = 0x0002
INT27 : origin = 0xFFB6, length = 0x0002
INT28 : origin = 0xFFB8, length = 0x0002
INT29 : origin = 0xFFBA, length = 0x0002
INT30 : origin = 0xFFBC, length = 0x0002
INT31 : origin = 0xFFBE, length = 0x0002
INT32 : origin = 0xFFC0, length = 0x0002
INT33 : origin = 0xFFC2, length = 0x0002
INT34 : origin = 0xFFC4, length = 0x0002
INT35 : origin = 0xFFC6, length = 0x0002
INT36 : origin = 0xFFC8, length = 0x0002
INT37 : origin = 0xFFCA, length = 0x0002
INT38 : origin = 0xFFCC, length = 0x0002
INT39 : origin = 0xFFCE, length = 0x0002
INT40 : origin = 0xFFD0, length = 0x0002
INT41 : origin = 0xFFD2, length = 0x0002
INT42 : origin = 0xFFD4, length = 0x0002
INT43 : origin = 0xFFD6, length = 0x0002
INT44 : origin = 0xFFD8, length = 0x0002
INT45 : origin = 0xFFDA, length = 0x0002
INT46 : origin = 0xFFDC, length = 0x0002
INT47 : origin = 0xFFDE, length = 0x0002
INT48 : origin = 0xFFE0, length = 0x0002
INT49 : origin = 0xFFE2, length = 0x0002
INT50 : origin = 0xFFE4, length = 0x0002
INT51 : origin = 0xFFE6, length = 0x0002
INT52 : origin = 0xFFE8, length = 0x0002
INT53 : origin = 0xFFEA, length = 0x0002
INT54 : origin = 0xFFEC, length = 0x0002
INT55 : origin = 0xFFEE, length = 0x0002
INT56 : origin = 0xFFF0, length = 0x0002
INT57 : origin = 0xFFF2, length = 0x0002
INT58 : origin = 0xFFF4, length = 0x0002
INT59 : origin = 0xFFF6, length = 0x0002
INT60 : origin = 0xFFF8, length = 0x0002
INT61 : origin = 0xFFFA, length = 0x0002
INT62 : origin = 0xFFFC, length = 0x0002
RESET : origin = 0xFFFE, length = 0x0002

The custom data is called MYDATA, and starts right at the edge of bank C. So why is there already data written in C when nothing else is mapped there? The .map file also confirms there should be no data stored here. Since erasing C causes the program to be permanently messed up (except when reprogrammed), it seems that the data stored there is important program data even though I specified it not to be stored there in the linker. Any thoughts?

One more piece of info, it works if I only use bank D.

  • In your linker script lnk_msp430f5528.cmd file there are 2 parts:

    MEMORY {} directive and SECTIONS {} directive. The last specifies where output sections are placed in memory (in relation to each other and to the entire memory space).

    Can you post your SECTIONS {} directive as well?

  • Yes, here is the other half of the file. 

    SECTIONS
    {
    .bss : {} > RAM /* GLOBAL & STATIC VARS */
    .data : {} > RAM /* GLOBAL & STATIC VARS */
    .sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */
    .stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */

    .text : {} > FLASH /* CODE */
    .text:_isr : {} > FLASH /* ISR CODE SPACE */
    .cinit : {} > FLASH /* INITIALIZATION TABLES */
    //#ifdef (__LARGE_DATA_MODEL__)
    .const : {} > FLASH /* CONSTANT DATA */
    //#else
    // .const : {} > FLASH /* CONSTANT DATA */
    //#endif
    .cio : {} > RAM /* C I/O BUFFER */

    .pinit : {} > FLASH /* C++ CONSTRUCTOR TABLES */
    .init_array : {} > FLASH /* C++ CONSTRUCTOR TABLES */
    .mspabi.exidx : {} > FLASH /* C++ CONSTRUCTOR TABLES */
    .mspabi.extab : {} > FLASH /* C++ CONSTRUCTOR TABLES */

    .infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */
    .infoB : {} > INFOB
    .infoC : {} > INFOC
    .infoD : {} > INFOD

    .mydata : {} > MYDATA

    /* MSP430 INTERRUPT VECTORS */
    .int00 : {} > INT00
    .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


    RTC : { * ( .int41 ) } > INT41 type = VECT_INIT
    PORT2 : { * ( .int42 ) } > INT42 type = VECT_INIT
    TIMER2_A1 : { * ( .int43 ) } > INT43 type = VECT_INIT
    TIMER2_A0 : { * ( .int44 ) } > INT44 type = VECT_INIT
    USCI_B1 : { * ( .int45 ) } > INT45 type = VECT_INIT
    USCI_A1 : { * ( .int46 ) } > INT46 type = VECT_INIT
    PORT1 : { * ( .int47 ) } > INT47 type = VECT_INIT
    TIMER1_A1 : { * ( .int48 ) } > INT48 type = VECT_INIT
    TIMER1_A0 : { * ( .int49 ) } > INT49 type = VECT_INIT
    DMA : { * ( .int50 ) } > INT50 type = VECT_INIT
    USB_UBM : { * ( .int51 ) } > INT51 type = VECT_INIT
    TIMER0_A1 : { * ( .int52 ) } > INT52 type = VECT_INIT
    TIMER0_A0 : { * ( .int53 ) } > INT53 type = VECT_INIT
    ADC12 : { * ( .int54 ) } > INT54 type = VECT_INIT
    USCI_B0 : { * ( .int55 ) } > INT55 type = VECT_INIT
    USCI_A0 : { * ( .int56 ) } > INT56 type = VECT_INIT
    WDT : { * ( .int57 ) } > INT57 type = VECT_INIT
    TIMER0_B1 : { * ( .int58 ) } > INT58 type = VECT_INIT
    TIMER0_B0 : { * ( .int59 ) } > INT59 type = VECT_INIT
    COMP_B : { * ( .int60 ) } > INT60 type = VECT_INIT
    UNMI : { * ( .int61 ) } > INT61 type = VECT_INIT
    SYSNMI : { * ( .int62 ) } > INT62 type = VECT_INIT
    .reset : {} > RESET /* MSP430 RESET VECTOR */
    }

  • Can you also post the top part of your .map file, from the very beginning to the start of GLOBAL SYMBOLS section?

  • Here is the .map:

    ******************************************************************************
    MSP430 Linker PC v4.1.2
    ******************************************************************************
    >> Linked Wed Jun 11 17:46:52 2014

    OUTPUT FILE NAME: <TemperatureHumidityDatalogger.out>
    ENTRY POINT SYMBOL: "_c_int00" address: 00007598


    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    SFR 00000000 00000010 00000000 00000010 RWIX
    PERIPHERALS_8BIT 00000010 000000f0 00000000 000000f0 RWIX
    PERIPHERALS_16BIT 00000100 00000100 00000000 00000100 RWIX
    INFOD 00001800 00000080 00000000 00000080 RWIX
    INFOC 00001880 00000080 00000000 00000080 RWIX
    INFOB 00001900 00000080 00000000 00000080 RWIX
    INFOA 00001980 00000080 00000000 00000080 RWIX
    USBRAM 00001c00 00000800 00000000 00000800 RWIX
    RAM 00002400 00002000 0000026f 00001d91 RWIX
    FLASH 00004400 00007dde 000034c4 0000491a RWIX
    INT00 0000ff80 00000002 00000000 00000002 RWIX
    INT01 0000ff82 00000002 00000000 00000002 RWIX
    INT02 0000ff84 00000002 00000000 00000002 RWIX
    INT03 0000ff86 00000002 00000000 00000002 RWIX
    INT04 0000ff88 00000002 00000000 00000002 RWIX
    INT05 0000ff8a 00000002 00000000 00000002 RWIX
    INT06 0000ff8c 00000002 00000000 00000002 RWIX
    INT07 0000ff8e 00000002 00000000 00000002 RWIX
    INT08 0000ff90 00000002 00000000 00000002 RWIX
    INT09 0000ff92 00000002 00000000 00000002 RWIX
    INT10 0000ff94 00000002 00000000 00000002 RWIX
    INT11 0000ff96 00000002 00000000 00000002 RWIX
    INT12 0000ff98 00000002 00000000 00000002 RWIX
    INT13 0000ff9a 00000002 00000000 00000002 RWIX
    INT14 0000ff9c 00000002 00000000 00000002 RWIX
    INT15 0000ff9e 00000002 00000000 00000002 RWIX
    INT16 0000ffa0 00000002 00000000 00000002 RWIX
    INT17 0000ffa2 00000002 00000000 00000002 RWIX
    INT18 0000ffa4 00000002 00000000 00000002 RWIX
    INT19 0000ffa6 00000002 00000000 00000002 RWIX
    INT20 0000ffa8 00000002 00000000 00000002 RWIX
    INT21 0000ffaa 00000002 00000000 00000002 RWIX
    INT22 0000ffac 00000002 00000000 00000002 RWIX
    INT23 0000ffae 00000002 00000000 00000002 RWIX
    INT24 0000ffb0 00000002 00000000 00000002 RWIX
    INT25 0000ffb2 00000002 00000000 00000002 RWIX
    INT26 0000ffb4 00000002 00000000 00000002 RWIX
    INT27 0000ffb6 00000002 00000000 00000002 RWIX
    INT28 0000ffb8 00000002 00000000 00000002 RWIX
    INT29 0000ffba 00000002 00000000 00000002 RWIX
    INT30 0000ffbc 00000002 00000000 00000002 RWIX
    INT31 0000ffbe 00000002 00000000 00000002 RWIX
    INT32 0000ffc0 00000002 00000000 00000002 RWIX
    INT33 0000ffc2 00000002 00000000 00000002 RWIX
    INT34 0000ffc4 00000002 00000000 00000002 RWIX
    INT35 0000ffc6 00000002 00000000 00000002 RWIX
    INT36 0000ffc8 00000002 00000000 00000002 RWIX
    INT37 0000ffca 00000002 00000000 00000002 RWIX
    INT38 0000ffcc 00000002 00000000 00000002 RWIX
    INT39 0000ffce 00000002 00000000 00000002 RWIX
    INT40 0000ffd0 00000002 00000000 00000002 RWIX
    INT41 0000ffd2 00000002 00000000 00000002 RWIX
    INT42 0000ffd4 00000002 00000000 00000002 RWIX
    INT43 0000ffd6 00000002 00000000 00000002 RWIX
    INT44 0000ffd8 00000002 00000000 00000002 RWIX
    INT45 0000ffda 00000002 00000002 00000000 RWIX
    INT46 0000ffdc 00000002 00000000 00000002 RWIX
    INT47 0000ffde 00000002 00000000 00000002 RWIX
    INT48 0000ffe0 00000002 00000000 00000002 RWIX
    INT49 0000ffe2 00000002 00000000 00000002 RWIX
    INT50 0000ffe4 00000002 00000000 00000002 RWIX
    INT51 0000ffe6 00000002 00000002 00000000 RWIX
    INT52 0000ffe8 00000002 00000000 00000002 RWIX
    INT53 0000ffea 00000002 00000002 00000000 RWIX
    INT54 0000ffec 00000002 00000000 00000002 RWIX
    INT55 0000ffee 00000002 00000002 00000000 RWIX
    INT56 0000fff0 00000002 00000000 00000002 RWIX
    INT57 0000fff2 00000002 00000000 00000002 RWIX
    INT58 0000fff4 00000002 00000000 00000002 RWIX
    INT59 0000fff6 00000002 00000000 00000002 RWIX
    INT60 0000fff8 00000002 00000000 00000002 RWIX
    INT61 0000fffa 00000002 00000002 00000000 RWIX
    INT62 0000fffc 00000002 00000000 00000002 RWIX
    RESET 0000fffe 00000002 00000002 00000000 RWIX
    MYDATA 00014400 00000fff 00000000 00000fff RWIX


    SECTION ALLOCATION MAP

    output attributes/
    section page origin length input sections
    -------- ---- ---------- ---------- ----------------
    .init_array
    * 0 00004400 00000000 UNINITIALIZED

    .data 0 00002400 0000010a
    00002400 00000040 main.obj (.data:outString)
    00002440 00000040 main.obj (.data:pieceOfString)
    00002480 00000040 main.obj (.data:wholeString)
    000024c0 00000034 sensor.obj (.data)
    000024f4 0000000c main.obj (.data)
    00002500 00000006 usb.obj (.data)
    00002506 00000004 main.obj (.data:tempVal)

    .TI.persistent
    * 0 00002400 00000000 UNINITIALIZED

    .bss 0 0000250a 000000c5 UNINITIALIZED
    0000250a 0000004f i2c.obj (.bss)
    00002559 00000001 --HOLE--
    0000255a 00000040 usb.obj (.bss)
    0000259a 00000022 UsbCdc.obj (.bss)
    000025bc 00000008 main.obj (.bss)
    000025c4 00000008 usbdma.obj (.bss)
    000025cc 00000003 flash.obj (.bss)

    .TI.noinit
    * 0 0000250a 00000000 UNINITIALIZED

    .stack 0 00004360 000000a0 UNINITIALIZED
    00004360 00000002 rts430x_lc_sd_eabi.lib : boot.obj (.stack)
    00004362 0000009e --HOLE--

    .text 0 00004400 00002dfc
    00004400 000004e8 main.obj (.text:main)
    000048e8 000001ae UsbCdc.obj (.text:USBCDC_receiveData)
    00004a96 0000014a UsbCdc.obj (.text:CdcToHostFromBuffer)
    00004be0 00000120 usb.obj (.text:USB_reset)
    00004d00 00000118 sensor.obj (.text:sensorLightRead)
    00004e18 000000fe UsbCdc.obj (.text:CdcToBufferFromHost)
    00004f16 000000f0 pmm.obj (.text:PMM_setVCoreUp)
    00005006 000000ea ucs.obj (.text:UCS_initFLL)
    000050f0 000000d6 usb.obj (.text:USB_enable)
    000051c6 000000d6 rts430x_lc_sd_eabi.lib : copy_decompress_rle.obj (.text:__TI_decompress_rle_core)
    0000529c 000000d2 timer_a.obj (.text:privateTimerAProcessClockSourceDivider)
    0000536e 000000c4 usb.obj (.text:USB_InitSerialStringDescriptor)
    00005432 000000c4 main.obj (.text:itoa)
    000054f6 000000c4 main.obj (.text:retInString)
    000055ba 000000b2 ucs.obj (.text:UCS_clockSignalInit)
    0000566c 000000a8 pmm.obj (.text:PMM_setVCoreDown)
    00005714 000000a8 UsbCdc.obj (.text:USBCDC_intfStatus)
    000057bc 0000009e sensor.obj (.text:sensorPressureRead)
    0000585a 0000009c sensor.obj (.text:sensorPressureEnable)
    000058f6 00000098 sensor.obj (.text:sensorTemperatureRead)
    0000598e 00000096 usb.obj (.text:USB_connectionState)
    00005a24 00000096 sensor.obj (.text:sensorHumidityRead)
    00005aba 0000008a usbdma.obj (.text:memcpyDMA)
    00005b44 00000084 usb.obj (.text:USB_init)
    00005bc8 00000080 sensor.obj (.text:sensorUVReset)
    00005c48 0000007e UsbCdc.obj (.text:USBCDC_bytesInUSBBuffer)
    00005cc6 0000007c UsbCdc.obj (.text:USBCDC_sendData)
    00005d42 0000007a usb.obj (.text:USB_determineFreq)
    00005dbc 0000007a usb.obj (.text:usbDecodeAndProcessUsbRequest)
    00005e36 00000072 gpio.obj (.text:GPIO_setAsPeripheralModuleFunctionOutputPin)
    00005ea8 00000070 usb.obj (.text:usbGetEndpointStatus)
    00005f18 00000070 usb.obj (.text:usbSendNextPacketOnIEP0)
    00005f88 0000006e rts430x_lc_sd_eabi.lib : autoinit.obj (.text:_auto_init)
    00005ff6 0000006c i2c.obj (.text:i2cRead2)
    00006062 0000006c i2c.obj (.text:i2cRead)
    000060ce 0000006a UsbIsr.obj (.text:PWRVBUSoffHandler)
    00006138 0000006a usbConstructs.obj (.text:cdcSendDataInBackground)
    000061a2 0000006a flash.obj (.text:flashLogWrite)
    0000620c 00000068 dma.obj (.text:DMA_init)
    00006274 00000066 gpio.obj (.text:GPIO_setOutputLowOnPin)
    000062da 00000064 UsbCdc.obj (.text:Handler_SetLineCoding)
    0000633e 00000060 UsbCdc.obj (.text:CopyUsbToBuff)
    0000639e 00000060 UsbCdc.obj (.text:usbGetLineCoding)
    000063fe 0000005a mcu.obj (.text:initMCUPorts)
    00006458 00000058 UsbIsr.obj (.text:PWRVBUSonHandler)
    000064b0 00000058 rts430x_lc_sd_eabi.lib : div32u.obj (.text)
    00006508 00000056 hal.obj (.text:initClocks)
    0000655e 00000056 usb.obj (.text:usbGetStringDescriptor)
    000065b4 00000052 usb.obj (.text:usbSetEndpointFeature)
    00006606 00000050 ucs.obj (.text:UCS_XT2StartWithTimeout)
    00006656 0000004e usbdma.obj (.text:USB_initMemcpy)
    000066a4 0000004e usbConstructs.obj (.text:cdcReceiveDataInBuffer)
    000066f2 0000004c gpio.obj (.text:privateGPIOGetBaseAddress)
    0000673e 0000004a usb.obj (.text:USB_setup)
    00006788 00000048 tlv.obj (.text:TLV_getInfo)
    000067d0 00000046 UsbIsr.obj (.text:SetupPacketInterruptHandler)
    00006816 00000046 usb.obj (.text:usbClearEndpointFeature)
    0000685c 00000046 usb.obj (.text:usbReceiveNextPacketOnOEP0)
    000068a2 00000044 timer_a.obj (.text:TIMER_A_configureUpMode)
    000068e6 00000040 rts430x_lc_sd_eabi.lib : cpy_util.obj (.text:__memcpy_far)
    00006926 00000040 : div32s.obj (.text)
    00006966 0000003e pmm.obj (.text:PMM_setVCore)
    000069a4 0000003e rts430x_lc_sd_eabi.lib : asr32.obj (.text:l_asr_const)
    000069e2 0000003e : lsl32.obj (.text:l_lsl_const)
    00006a20 0000003e : lsr32.obj (.text:l_lsr_const)
    00006a5e 0000003c : copy_decompress_none.obj (.text:decompress:none:__TI_decompress_none)
    00006a9a 00000038 dma.obj (.text:DMA_setDstAddress)
    00006ad2 00000038 dma.obj (.text:DMA_setSrcAddress)
    00006b0a 00000038 UsbIsr.obj (.text:OEP0InterruptHandler)
    00006b42 00000038 rts430x_lc_sd_eabi.lib : copy_zero_init.obj (.text:decompress:ZI:__TI_zero_init)
    00006b7a 00000038 : strncpy.obj (.text:strncpy)
    00006bb2 00000036 usb.obj (.text:USB_suspend)
    00006be8 00000034 usb.obj (.text:usbSetAddress)
    00006c1c 00000032 ucs.obj (.text:UCS_initFLLSettle)
    00006c4e 00000032 usb.obj (.text:USB_connectionInfo)
    00006c80 00000030 i2c.obj (.text:i2cInit2)
    00006cb0 00000030 i2c.obj (.text:i2cInit)
    00006ce0 00000030 i2c.obj (.text:i2cWrite2)
    00006d10 00000030 i2c.obj (.text:i2cWrite)
    00006d40 0000002e UsbCdc.obj (.text:CdcResetData)
    00006d6e 0000002e usb.obj (.text:usbSetConfiguration)
    00006d9c 0000002c flash.obj (.text:flashErase)
    00006dc8 0000002a usb.obj (.text:usbGetDeviceStatus)
    00006df2 00000026 main.obj (.text:reverse)
    00006e18 00000024 usb.obj (.text:usbClearDeviceFeature)
    00006e3c 00000024 usb.obj (.text:usbSetDeviceFeature)
    00006e60 00000022 usb.obj (.text:USB_disable)
    00006e82 00000022 rts430x_lc_sd_eabi.lib : mult32_f5hw.obj (.text)
    00006ea4 00000020 : strcat.obj (.text:strcat)
    00006ec4 00000020 usb.obj (.text:usbSendDataPacketOnEP0)
    00006ee4 0000001e usb.obj (.text:usbGetInterface)
    00006f02 0000001e usb.obj (.text:usbGetInterfaceStatus)
    00006f20 0000001c UsbIsr.obj (.text:IEP0InterruptHandler)
    00006f3c 0000001a usb.obj (.text:USB_connect)
    00006f56 0000001a usbdma.obj (.text:memcpyV)
    00006f70 0000001a usb.obj (.text:usbDisableInEndpointInterrupt)
    00006f8a 0000001a usb.obj (.text:usbDisableOutEndpointInterrupt)
    00006fa4 0000001a usb.obj (.text:usbSetInterface)
    00006fbe 00000018 usb.obj (.text:USB_resume)
    00006fd6 00000018 rts430x_lc_sd_eabi.lib : strcmp.obj (.text:strcmp)
    00006fee 00000016 : mult16_f5hw.obj (.text)
    00007004 00000016 usb.obj (.text:usbGetConfigurationDescriptor)
    0000701a 00000016 usb.obj (.text:usbGetDeviceDescriptor)
    00007030 00000014 usbEventHandling.obj (.text:USB_handleVbusOnEvent)
    00007044 00000014 wdt_a.obj (.text:WDT_A_hold)
    00007058 00000014 rts430x_lc_sd_eabi.lib : memset.obj (.text:memset)
    0000706c 00000014 usb.obj (.text:usbGetConfiguration)
    00007080 00000014 usb.obj (.text:usbReceiveDataPacketOnEP0)
    00007094 00000014 UsbCdc.obj (.text:usbSetControlLineState)
    000070a8 00000012 UsbCdc.obj (.text:CdcIsReceiveInProgress)
    000070ba 00000012 rts430x_lc_sd_eabi.lib : memcpy.obj (.text:memcpy)
    000070cc 00000012 : strlen.obj (.text:strlen)
    000070de 00000012 usb.obj (.text:usbInvalidRequest)
    000070f0 00000010 dma.obj (.text:DMA_getInterruptStatus)
    00007100 0000000e usbEventHandling.obj (.text:USB_handleVbusOffEvent)
    0000710e 0000000e rts430x_lc_sd_eabi.lib : copy_decompress_rle.obj (.text:decompress:rle24:__TI_decompress_rle24)
    0000711c 0000000e usb.obj (.text:usbSendZeroLengthPacketOnIEP0)
    0000712a 0000000c dma.obj (.text:DMA_disableTransfers)
    00007136 0000000c dma.obj (.text:DMA_enableTransfers)
    00007142 0000000c dma.obj (.text:DMA_setTransferSize)
    0000714e 0000000c timer_a.obj (.text:TIMER_A_stop)
    0000715a 0000000c UsbCdc.obj (.text:usbSetLineCoding)
    00007166 0000000a dma.obj (.text:DMA_startTransfer)
    00007170 0000000a system_pre_init.obj (.text:_system_pre_init)
    0000717a 0000000a rts430x_lc_sd_eabi.lib : lsl16.obj (.text)
    00007184 0000000a : lsr16.obj (.text)
    0000718e 00000008 ucs.obj (.text:UCS_XT2Off)
    00007196 00000008 usbEventHandling.obj (.text:USBCDC_handleDataReceived)
    0000719e 00000006 dma.obj (.text:DMA_disableTransferDuringReadModifyWrite)
    000071a4 00000006 dma.obj (.text:DMA_enableTransferDuringReadModifyWrite)
    000071aa 00000006 sfr.obj (.text:SFR_clearInterrupt)
    000071b0 00000006 timer_a.obj (.text:TIMER_A_clearTimerInterruptFlag)
    000071b6 00000006 timer_a.obj (.text:TIMER_A_startCounter)
    000071bc 00000006 ucs.obj (.text:UCS_clearFaultFlag)
    000071c2 00000006 usb.obj (.text:USB_getVersion)
    000071c8 00000006 usb.obj (.text:usbRestoreInEndpointInterrupt)
    000071ce 00000006 usb.obj (.text:usbRestoreOutEndpointInterrupt)
    000071d4 00000004 usbEventHandling.obj (.text:USBCDC_handleReceiveCompleted)
    000071d8 00000004 usbEventHandling.obj (.text:USBCDC_handleSendCompleted)
    000071dc 00000004 usbEventHandling.obj (.text:USBCDC_handleSetControlLineState)
    000071e0 00000004 usbEventHandling.obj (.text:USBCDC_handleSetLineCoding)
    000071e4 00000004 usbEventHandling.obj (.text:USB_handleClockEvent)
    000071e8 00000004 usbEventHandling.obj (.text:USB_handleEnumCompleteEvent)
    000071ec 00000004 usbEventHandling.obj (.text:USB_handleResetEvent)
    000071f0 00000004 usbEventHandling.obj (.text:USB_handleResumeEvent)
    000071f4 00000004 usbEventHandling.obj (.text:USB_handleSuspendEvent)
    000071f8 00000004 rts430x_lc_sd_eabi.lib : exit.obj (.text:abort)

    .text:_isr
    * 0 000071fc 000003b6
    000071fc 00000138 UsbIsr.obj (.text:_isr:iUsbInterruptHandler)
    00007334 00000110 main.obj (.text:_isr:TIMER0_A0_ISR)
    00007444 00000082 i2c.obj (.text:_isr:USCI_B0_ISR)
    000074c6 00000082 i2c.obj (.text:_isr:USCI_B1_ISR)
    00007548 00000050 main.obj (.text:_isr:UNMI_ISR)
    00007598 0000001a rts430x_lc_sd_eabi.lib : boot.obj (.text:_isr:_c_int00_noexit)

    .const 0 000075b2 000002de
    000075b2 0000010a descriptors.obj (.const:tUsbRequestList)
    000076bc 000000b8 main.obj (.const:.string)
    00007774 0000008e descriptors.obj (.const:.string:abromStringDescriptor)
    00007802 00000043 descriptors.obj (.const)
    00007845 00000001 --HOLE-- [fill = 0]
    00007846 00000020 usb.obj (.const:.string)
    00007866 00000012 descriptors.obj (.const:.string:abromDeviceDescriptor)
    00007878 00000010 descriptors.obj (.const:stUsbHandle)
    00007888 00000003 sensor.obj (.const:.string:$P$T2$3)
    0000788b 00000001 --HOLE-- [fill = 0]
    0000788c 00000002 sensor.obj (.const:.string:$P$T0$1)
    0000788e 00000002 sensor.obj (.const:.string:$P$T1$2)

    .cinit 0 00007890 00000034
    00007890 00000011 (.cinit..data.load) [load image, compression = rle]
    000078a1 00000001 --HOLE-- [fill = 0]
    000078a2 0000000c (__TI_handler_table)
    000078ae 00000006 (.cinit..bss.load) [load image, compression = zero_init]
    000078b4 00000010 (__TI_cinit_table)

    USCI_B1 0 0000ffda 00000002
    0000ffda 00000002 i2c.obj (.int45)

    USB_UBM 0 0000ffe6 00000002
    0000ffe6 00000002 UsbIsr.obj (.int51)

    TIMER0_A0
    * 0 0000ffea 00000002
    0000ffea 00000002 main.obj (.int53)

    USCI_B0 0 0000ffee 00000002
    0000ffee 00000002 i2c.obj (.int55)

    UNMI 0 0000fffa 00000002
    0000fffa 00000002 main.obj (.int61)

    .reset 0 0000fffe 00000002
    0000fffe 00000002 rts430x_lc_sd_eabi.lib : boot.obj (.reset)


    LINKER GENERATED COPY TABLES

    __TI_cinit_table @ 000078b4 records: 2, size/record: 8, table size: 16
    .data: load addr=00007890, load size=00000011 bytes, run addr=00002400, run size=0000010a bytes, compression=rle
    .bss: load addr=000078ae, load size=00000006 bytes, run addr=0000250a, run size=000000c5 bytes, compression=zero_init


    LINKER GENERATED HANDLER TABLE

    __TI_handler_table @ 000078a2 records: 3, size/record: 4, table size: 12
    index: 0, handler: __TI_zero_init
    index: 1, handler: __TI_decompress_rle24
    index: 2, handler: __TI_decompress_none

  • You are right, it all looks pretty healthy...

    The last thing you can check is your output .txt file. As you know It has several parts, each starts with @XXXX  start address label followed by actual data bytes. This is what is written to the flash of the micro. Open this file in editor which allows counting lines (like Notepad++, for example). Then search through the file for '@' character, count the bytes which follow and see if the range occupied actually within your FLASH segment address range. 

    If you find that all data in .txt lies within your FLASH segment, then there could be a problem with your flash writing functions that, for example, could mess up writing addresses.

    Also, how do you use your MYDATA segment: as a raw one or by placing some variables in it?

    - If you place some variables in it, do you declare them with #pragma NOINIT?

    - Do you use large data model to access MYDATA?

  • By the way,

    > When I try to erase bank C, the program goes haywire and nothing works even when reset.

    You can not do that in a straight way. See errata FLASH34 for your device.

    That may be the cause for your problem if the device you are using had been programmed before and contains something in bank C. Try to erase all flash in your device using FET before downloading new firmware to it.

  • Serge A said:
    Do you use large data model to access them?

    Good point, if not this will result in writing/reading to/from Flash at 0x4400 instead of 0x14400.

  • Serge, I am using the segment as a raw one, no variables. But I think you have discovered the problem. I am not using the large data model. Also, the FLASH34 errata could be wreaking havoc.

    I have been searching for how to set up the project to use the large data model, but can't seem to find an answer. Is there an easy way in CCS to make it use the large data model?

  • Hi Christopher,

    On CCS in project properties under Processor Options specify --data_model as 'large' and --near_data as 'none'.

    Regards,

    Serge

  • Thank you Serge, that did the trick! Right now it seems to be working fine without the FLASH34 errata work around, but I will probably add that in to be safe.

    -Chris

  • Glad to hear it :-)

    Also  if you want your parameters in flash to be preserved between firmware upgrades, you'll have to supply correct BSL password, otherwise it provides bulk erase of the whole flash area including your parameters block.

    We use main flash for our big factory calibration parameters as data flash is not big enough for them. And we faced the problem when the parameters area got lost just because the right BSL password was not supplied resulting to the product being returned to the factory for expensive re-calibration.

    The problem with BSL password is that it uses vector area of the firmware as its value, so when you produce new revision of firmware, there is a big chance that the password is changed as well. So the maintainer has to keep track of every revision with corresponding password, which can be quite annoying, as the impact in case of error is quite expensive.

  • Thanks for the heads up, this will definitely be something to look into soon. We are using the main memory to store sensor data, so I am sure people would be upset if all of their sensor logs were unexpectedly erased on a firmware update!

**Attention** This is a public forum