请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:MSP430F5529 int main(void)
{
uint8_t res;
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
uart_init();
UCA0IE |= UCRXIE; //INTR ENABLE FOR RX A0
__enable_interrupt(); //global en for maskables...(GIE bit in SR)
P1DIR |= 0x01; //LED SET
__delay_cycles(100000);
// MAIN LOOP
char msg[] = "HELLO WORLD";
//char bsl_msg = "into the BSL";
int position;
for(position=0; position< sizeof(msg); position++)
{
UCA0TXBUF = msg[position];
P1OUT |= 0x01; // turn on P1.0
__delay_cycles(100000);
P1OUT &= ~0x01; // turn off P1.0
__delay_cycles(100000);
}
while(1)
{
//UCA0TXBUF = 0x4D;
if(counter == 4)
{
bsl_flag = 0;
//__bis_SR_register(LPM0_bits + GIE);
__disable_interrupt();
//SFRIE1 &= ~OFIE;
((void ( * )()) 0x01000) (); //jump to bsl
// uart_init();
// __delay_cycles(100000);
//
// if (!BSL_slavePresent())
// break;
// BSL_sendSingleByte(VBOOT_ENTRY_CMD);
// __delay_cycles(500000);
//
// BSL_flush();
//
// /* Sending the version command */
// res = BSL_sendCommand(BSL_VERSION_CMD);
// UCA0TXBUF = res;
}
//__delay_cycles(1000000);
}
我正在连接 Launchpad、串行监视器连接到 P3.3和 P4.4 A0 UART 引脚。 我无法理解、在 BSL 软命令之后、即 ((void (*)()) 0x01000)();//跳转到 BSL、
(我甚至尝试了 ((void (*)()) 0x1000)();//Jump to BSL)应该会发生的情况。
1.在调试会话中(即 SBWTDIO 和 SBWTCK 跳线被连接)跳转到 BSL 命令之后、发生编程复位。 循环的串行打印正常、并等待中断发生。 (计数器<4)。
此周期运行2次、然后一切都停止。 调试会话进入挂起状态。
2.如果软 BSL 在您的解决方案后工作,我不知道从我的电脑串行显示器期待或发送什么。 给我一些命令来测试像版本 ID 这样的版本、这样我就知道 BSL 正在与我进行串行通信。 如果我发送- 80 IE 04 04、这是正确的吗?