各位大神
本人最近在用5529 通过 bsl升级程序,在msp430f5529的launch pad上 通过 bsl的方式已经实现了程序升级,现在的问题是在自己做的pcb上无法升级,下面的程序在5529launch pad的可以实现bsl程序升级,在自己做的板子上不行
#include "msp430f5529.h"
volatile unsigned char fInvokeBSL ;
void main(void) {
fInvokeBSL = 0;
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer -- not used in this example
// Activate the sensing of 5V VBUS on the USB cable
USBKEYPID = 0x9628; // Unlock the USB registers
USBPWRCTL |= VBONIE; // Enable the VBUS-on interrupt
USBKEYPID = 0x9600; // Lock the USB registers
// SYSCTL = SYSBSLIND;
while (1) {
__bis_SR_register(GIE);
USBCNF=PUR_EN+USB_EN;
__bis_SR_register(LPM3_bits + GIE);
// Go into LPM3; keep ints enabled.
__disable_interrupt(); // Ensure no application interrupts fire during BSL
if (fInvokeBSL)
((void (*)()) 0x1000)(); // This sends execution to the BSL. When execution
// returns to the user app, it will be via the reset
} // vector, meaning execution will re-start.
}
#pragma vector=USB_UBM_VECTOR // USB Interrupt Service Routine
__interrupt void iUsbInterruptHandler(void) {
switch (__even_in_range(USBVECINT & 0x3f, USBVECINT_OUTPUT_ENDPOINT7)) {
case USBVECINT_PWR_VBUSOn:
fInvokeBSL = 1; // Set flag
__bic_SR_register_on_exit(LPM3_bits);
// Exit LPM3 when exiting the ISR.
break;
default:
break;
}
}
在launchpad 上可以被pc识别,现在主要的问题是在自己做的板子上pc无法识别,是我写的程序太简单了吗 ,哪个大神有5529用户程序中包含用于bsl升级的程序吗,能不能给我发一份,先谢过了
-
-