工具/软件:
我们遇到了中所述的相同问题
https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1048612/msp430fr5969-sp-issue-invoking-bsl-through-software-using-serial-port-terminal
MSP430FR5043微控制器除外。
- 我们通过软件启动 BSL。
- 据我们所知、此操作正在按预期运行
- 发送错误的标头会正确返回0x51、使用正确的标头字节时、也会正确报告其他错误、
但是、发送批量擦除或密码数据包(具有正确的 CRC)似乎会将代码重新启动到主应用程序中。
这篇文章引用了一个最终解决方案、其中涉及禁用 MPU 和重新配置 UART。
我们使用以下代码启动引导加载程序:
__disable_interrupt(); // disable interrupts // Disable UART and its interrupts before jumping to BSL UCA3IE &= ~UCRXIE; // Disable USCI_A3 RX interrupt UCA3IFG = 0; // Clear interrupt flags // Disable MPU (Memory Protection Unit) MPUCTL0 = MPUPW | MPUENA; // Disable MPU WDTCTL = WDTPW | WDTHOLD; // disables the watch dog CSCTL0_H = CSKEY >> 8; // unlock clock registers CSCTL1 = DCORSEL | DCOFSEL_3; // DCO to 8MHz CSCTL2 = SELS__DCOCLK | SELM__DCOCLK; // set SMCLK & MCLK to the DCO (digital controlled oscillator) CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // divide clocks by 1 CSCTL0_H = 0; // lock registers ((void (*)()) 0x1000)(); // jump to BSL
我们注意到了这个项目、它是从衍生出来的、具有一个预定义符号"_mpu_enable"。 但是、无论是否使用此符号、在运行 BSL 时、代码仍然存在相同的问题。
无论是允许应用程序运行还是作为 main()中的第一项运行、我们都会遇到同样的问题
这其中是否明显缺少任何内容?