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.

MSP430F2419 extended memory usage (@ 0x10000)

Other Parts Discussed in Thread: MSP430F2419

I would like to relocate my code currently running in Flash and fLASH2 (MSP430F2419) to extended memory (starting at 0x10000) exclusively. I modified the link cmd file as follows:

     .text      : {}> FLASH2      /* CODE                              */
    .text:_isr : {} > FLASH             /* ISR CODE SPACE                    */
    .cinit     : {} > FLASH2             /* INITIALIZATION TABLES             */
    .const     : {} > FLASH2       /* CONSTANT DATA                     */
    .cio       : {} > RAM               /* C I/O BUFFER                      */

    .pinit     : {} > FLASH2              /* C++ CONSTRUCTOR TABLES            */

     FLASH                   : origin = 0x2100, length = 0xdebe
     FLASH2                  : origin = 0x10000,length = 0x10000

I left isr in Flash section. The code seems to run ok. However, if I pause it using code composer debug environmnet (while in sleep mode), and restart it again, I get a software reset and reenter main as if I just rebooted. I am running 4.2.1.04 of CCS. I am I missing something? This doesnt happen if I load the code in both FLASH and FLASH2. Please help. Thanks.

  • The IFG1 register hlds some flags which indicate the cause of the last reset. If you inspect this register on program start, it might shed some light on the cause of reset.

    Are you sure you just continue after pausing the processor? Your wording "...and restart it..." might indicate that your instead (unwillingly) restart the device, whcih means resetting it and start from scratch.

    Also, I think I remember that there are problems when you stop a device in sleep mode. It's better to set a breakpoint to any ISR and wait for any action (if there i snone, you know that you're still in LPM at the point where you entered it)

  • Thanks for you response. I looked @ IFG1 register and nothing seems to standout. My use of "...restart...." is probably not appropriate. I exit hault by clicking on the "Run" control in CCS debug window. I am wondering if it has to do with the fact that my code is loaded below the reset vector (after 0x10000) and may be CCS doesnt support this. One thing worth mentioning, I have 1 sec ticker controlled by WDT_VECTOR interrupt. and my code flow is as follows:

    // enter lpm mode
     LPM3;   
     
      do
      {
        // stay here unless woken up by interrupt (wakeup_flag is toggled at least every 1s by WDT_VECTOR)

    } while (!wakeup_flag);

    I halt while in the do while. When I try to run the code again, the micro resets instead of staying in the loop. 

      

  • There are several entries in the errata sheets regarding the debugger and 20bit (MSP430C) instructions and/or LPM. You shoiuld check them.

    Also, you shouldn't put a breakpoint on the instruction right after entering LPM. This breakpoitn is triggered before the LPM is entered. (the LPMs basically stop the cpu clock after the command that enter them, so the breakpoint is triggered with the last clock cycle)

**Attention** This is a public forum