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.

MSPBoot and User App Debugging

Other Parts Discussed in Thread: MSP430G2553

I am trying to run and debug a user app (App1_MSPBoot) from the source associated with MSPBoot – Main Memory Bootloader for MSP430™ Microcontrollers.  I have been able to run the demo using two G2553's with UART as outlined in the app note.  Now I just want to use CCS and using only the target G2553, load MSPBoot, and then load and debug App1_MSPBoot.

Is what I am trying attempt possible?

Am I tweaking the right thing in Run/Debug Settings (shown below) or am I completely off course?

Is there a way to link the object file and memory map from MSPBoot to the App1_MSPBoot project?

I have loaded MSPBoot successfully but I run into trouble when I switch projects to App1_MSPBoot, load it and attempt to run the debugger.   I had thought that changing the project settings Run/Debug Settings->Launch configuration->Target->MSP430 Properties->Erase Options would make it work.  Here is what I tried:

  • Erase main memory
    Debug Result:  no symbols defined for 0xFFFF
    Console Output: MSP430: Can't Run Target CPU: Could not run device (to breakpoint)

  • Erase and download necessary segments only (Differential Download)
    Debug Result:  TI MSP430 USB1/MSP430(Running)
    Console Output: MSP430: Loading complete. There were 242 (code) and 50 (data) bytes written to FLASH/FRAM. The expected RAM usage is 80 (uninitialized data + stack) bytes.DX FlashEnabled. Total Flash Sectors In Binary: 0 Total Sectors Written: 0

    If I pause the debug session:
    Debug Result: TI MSP430 USB1/MSP430 (Suspended)
    0xE4A4 (no symbols are defined for 0xE4A4)

  • Replace written memory locations, retain unwritten memory locations
    Debug Result:  TI MSP430 USB1/MSP430(Running)

    Console Output: MSP430: Loading complete. There were 242 (code) and 50 (data) bytes written to FLASH/FRAM. The expected RAM usage is 80 (uninitialized data + stack) bytes.

    If I pause the debug session:
    Debug Result: TI MSP430 USB1/MSP430 (Suspended)
    0xFF66 (no symbols are defined for 0xFF66)

Thanks,

Douglas

  • Hi Douglas,

    What you are trying to do is possible.

    The error you are getting regarding the symbols not being defined can be fixed if you hit Run -> Load -> Add Symbols and then choose the MSPBoot.out as your program file.

    Also, you should find that once you debug, you will have an issue with the CRC check in the TI_MSPBoot_AppMgr_AppisValid() function. If you change this to return TRUE_t then you should be able to run the application properly.

    Regards,
    Akash Patel
  • Hi Douglas,

    I'll be closing out the thread as we haven't heard from you in a couple weeks. If you're still having issues, please let me know and I can reopen the thread, otherwise please mark my previous post as verified answer if that solved your issue.

    Regards,
    Akash Patel
  • Please confirm these are the steps I need to take to debug my app:
    1. Debug MSPBoot (Properties -> Debug -> MSP430 Properties -> Erase main and information memory
    2. Exit debugger
    3. Debug App (Properties -> Debug -> MSP430 Properties -> Erase main memory only)
    4. Run -> Load -> Add Symbols, choose MSPBoot.out

    When I do this I get:
    0xFFFF (no symbols are defined for OxFFFF)

    MSP430: Can't Run Target CPU: Could not run device (to breakpoint)

    If I hover over TI MSP430 USB1/MSP430 a window pops up that shows
    MSP430
    Program 0 App.out

    Program 1 MSPBoot.out

    Before I started integrating my code with MSPBoot I had a tested and working app that I could debug and run using the default linker command. However, after adding the hooks to MSPBoot I cannot debug and run this slightly modified app. To add in MSPBoot code I:

    Add two source files to project:
    TI_MSPBoot_Mgr_Vectors_G2553.c
    TI_MSPBoot_Mgr_Vectors.h

    Modified TI_MSPBoot_Mgr_Vector_G2553.c and added external ISR prototype for UART_RX_ISR.
    Removed #pragma for USART_RX_ISR definition in my original code. Added Dummy_Isr to main.c

    Use lnk_msp430G2553_UART_1KB_App.cmd.

    Am I missing some setting in the Properties?

    Thanks,

    Douglas
  • Hi Douglas,

    Try using the "Replace written memory locations, retain unwritten memory locations" in the Erase Options for MSPBoot. After that load the symbols using the appropriate .out file. That will allow you to the see the problem flow for debugging so you can see if you are getting any errors in your program execution.

    Regards,
    Akash Patel
  • Akash,

    That worked.  For anyone following the thread I will summarize on how to debug an app that is intended to work with MSPBoot.

    • Build your app, e.g. App1_MSPBoot.
    • In the project MSPBoot, file TI_MSPBoot_AppMgr.c modify the function TI_MSPBoot_AppMgr_ValidateApp() to always return true 

    tBOOL TI_MSPBoot_AppMgr_ValidateApp(void)
    {
    //  if ((TI_MSPBoot_AppMgr_BootisForced() == FALSE_t) &&
    //     (TI_MSPBoot_AppMgr_AppisValid() == TRUE_t))
      {
        return TRUE_t; // Boot is not forced and App is valid
      }

    /*
      else
      {
      return FALSE_t; // Boot is forced or App is valid
      }

    */
    }

    • In project MSPBoot Properties -> Debug -> MSP430 Properties under Erase Options select Replace written memory locations, retain unwritten memory locations.
    • Build MSPBoot.
    • Debug MSPBoot.  Go to Run -> Load -> Add Symbols -> Browse project and select the App1_MSPBoot.out file. Press F8 (Resume).

    When you get to the production stage and want to run code with a CRC, just remove the comments that were added above from the project MSPBoot, file TI_MSPBoot_AppMgr.c, function TI_MSPBoot_AppMgr_ValidateApp().  Rebuild MSPBoot and load the code. I automated the CRC generation as part of the build step for the App1_MSPBoot by opening Properties -> Build selecting the Variables tab and adding the following variable:
      Name: CRCGEN430
      Type: File
      Value: <Path to the CRCGen430.exe file>

    I then added the following line to the post-build steps:

    "${CRCGEN430}" CRC16 "${BuildArtifactFileBaseName}.txt" "${BuildArtifactFileBaseName}_CRC.txt" C003 FBFF C000

    Douglas

  • Douglas,

    Thanks for taking out the time to rewrite all the information in this thread into a cohesive post. Glad to hear that you have it working now!

    Regards,
    Akash Patel

**Attention** This is a public forum