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.

MSP430FR2476: Unable to add timers and interrupts in BSL Code

Part Number: MSP430FR2476
Other Parts Discussed in Thread: MSP430FR2311,

Hi Team,

I have successfully flashed the LED code to MSP430FR2476(target) with MSP430FR2311(Host) with reference MSP430FRBoot – Main Memory Bootloader and Over-the-Air Updates for MSP430Tm FRAM Large Memory Model Devices and User’s Guide MSP430Tm FRAM Devices Bootloader (BSL). But additional watchdog interrupt or Timer interrupt isn't getting initialized i tried debugging and adding breakpoint after WDT initialization
Any suggestions.
Below is the main file where i tried adding the WDT interrupt

#include "msp430.h"
#include "TI_MSPBoot_Common.h"
#include "TI_MSPBoot_CI.h"
#include "TI_MSPBoot_MI.h"
#include "TI_MSPBoot_AppMgr.h"

unsigned int *program_counter=NULL ;


//
// Local function prototypes
//

void Software_Trim(); // Software Trim to get the best DCOFTRIM value
#define MCLK_FREQ_MHZ 8 // MCLK = 8MHz

static void clock_init(void);


char JmpToApp;


void main_boot(void)
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDT_ADLY_1000;
SFRIE1 |= WDTIE;


// WDTCTL = WDTPW + WDTHOLD;

P4DIR |= BIT7;


PM5CTL0 &= ~LOCKLPM5;
clock_init();


if (JmpToApp == 1)
{
__disable_interrupt();
((void (*)()) 0xC402)();
}
// Validate the application and jump if needed
if (TI_MSPBoot_AppMgr_ValidateApp() == TRUE_t)
TI_MSPBoot_APPMGR_JUMPTOAPP();

TI_MSPBoot_CI_Init(); // Initialize the Communication Interface

__bis_SR_register(GIE);

while (1)
{

// Poll PHY and Data Link interface for new packets
TI_MSPBoot_CI_PHYDL_Poll();

// If a new packet is detected, process it
if (TI_MSPBoot_CI_Process() == RET_JUMP_TO_APP)
{

// If Packet indicates a jump to App
JmpToApp = 1;

TI_MSPBoot_AppMgr_JumpToApp();

}

}

}

#pragma vector = WDT_VECTOR
__interrupt void WDT_ISR(void)
{
P4OUT ^= BIT7;
}

/******************************************************************************
*
* @brief Initializes the MSP430 Clock
*
* @return none
*****************************************************************************/
//inline static void clock_init(void)
static void clock_init(void)
{
CSCTL1 = DCOFTRIMEN | DCOFTRIM0 | DCOFTRIM1 | DCORSEL_3; // Set DCO = 8Mhz
CSCTL2 = FLLD_0 + 243; // DCODIV = 8MHz
__delay_cycles(3);
__bic_SR_register(SCG0); // enable FLL
//Software_Trim(); // Software Trim to get the best DCOFTRIM value
CSCTL4 = SELA__REFOCLK + SELMS__DCOCLKDIV; // set ACLK = VLO
// MCLK=SMCLK=DC

#if (MCLK==1000000)
CSCTL5 = DIVS__8 + DIVM__8; // Divide DCO/8
#elif (MCLK==4000000)
CSCTL5 = DIVS__2 + DIVM__2; // Divide DCO/2
#elif (MCLK==8000000)
CSCTL5 = DIVS__1 + DIVM__1; // Divide DCO/1
#else
#error "Please define a valid MCLK or add configuration"
#endif

}

Regards,

Pallavi

  • In the demo of Main Memory Bootloader and Over-the-Air Updates for MSP430, it will keep the reset vector at 0xFFFE~0xFFFF to boot code. For the other interrupt vectors will be re-write by application's vector table when doing the firmware update as below

    So I think the interrupt should be work if you just download the boot code(do not download the application code) .

    One comment for you if you want to enable some interrupt in boot code:

    You can copy application's interrupt table into end of SRAM and enabled SRAM interrupt vector table. This will avoid over write the boot code's interrupt vectors when doing firmware update. For the operation code you can refer to this document https://www.ti.com/lit/an/slaa968/slaa968.pdf 

**Attention** This is a public forum