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.
Hi
I want to update firmware through USB. I am trying to invoke the BSL through software as suggested in the report http://www.ti.com/lit/an/slaa452c/slaa452c.pdf After the call to invoke BSL, the host software - the Visual Studio based GUI and the Python based Firmware Upgrader aren't detecting MSP430 as a HID. If I try to halt the programmer during debugging, I get the error message: "MSP430: Trouble Halting Target CPU: Internal error". But I can halt it after a while. If I try to read the memory at 0x1000 from the memory browser I can see all 0x3FFF. However, if I read the BSL memory from the command line tool MSPFlasher it appears to be fine and looks like this:
@1000 05 3C 41 3C FF 3F FF 3F 00 08 88 39 B2 40 80 5A 5C 01 32 C2 31 40 00 34 B0 13 56 17 FF 3F 06 00 FF 09 01 A1 01 85 3F 95 3F 75 08 25 01 15 01 09 01 81 02 85 3F 95 3F 75 08 25 01 15 01 09 01 91 02 C0 09 02 29 00 01 01 00 80 32 09 04 00 00 02 03 00 00 00 09 21 01 01 00 01 22 24 00 07 05 81 03 40 00 01 07 05 01 03 40 00 01 FF 0F 05 0F 03 11 02 17 01 12 01 00 02 00 00 00 08 47 20 00 02 09 01 00 00 00 01 3D 90 AD DE 04 20 3E 90 EF BE 01 20 03 3C 0C 43 0D 43 10 01 3C 41 3D 41 10 01 0C 43 B2 D0 03 80 82 01 B2 40 28 96 00 09 B2 D0 00 01 04 09 A2 B2 02 09 0A 20 B2 93 FE FF 08 20 3B 40 2C 01 1B 83 FE 23 B2 B2 08 09 01 24 2C D3 B2 C0 00 01 04 09 C2 43 28 96 10 01 F2 B0 0F 00 84 23 09 20 C2 93 84 23 03 34 5E 42 20 09 0B 3C 5E 42 22 09 08 3C C2 93 84 23 03 34 5E 42 C8 23 02 3C 5E 42 88 23 7E F2 C2 4E 60 24 5E 42 60 24 42 19 4E 10 C2 4E 60 24 B0 13 E2 17 3C 40 60 24 80 00 A6 17 F2 43 02 24 C2 43 10 24 C2 43 21 09 10 01 C2 93 82 23 11 20 5E 42 84 23 7E F0 0F 00 0A 24 5E 93 0E 20 C2 93 84 23 03 34 F2 D2 C8 23 02 3C F2 D2 88 23 80 00 24 11 F2 D2 20 09 F2 D2 22 09 10 01 C2 93 80 23 04 34 1F 43 D2 D3 3C 09 03 3C 0F 43 D2 C3 3C 09 5E 42 80 23 7E B0 60 00 8F 20 5D 42 81 23 4D 83 80 24 5D 83 6B 24 6D 83 67 24 6D 83 45 24 5D 83 09 24 6D 83 52 24 5D 83 46 24 5D 83 33 24 5D 83 54 24 7A 3C 1F B3 78 28 5E 42 83 23 5E 83 08 24 5E 83 0F 24 7E 80 1F 00 1C 24 5E 83 13 24 6C 3C C2 43 23 09 F2 40 12 00 02 24 3C 40 74 10 80 00 A6 17 C2 43 23 09 F2 40 29 00 02 24 3C 40 42 10 80 00 A6 17 F2 40 24 00 02 24 3C 40 1E 10 80 00 A6 17 C2 43 23 09 F2 40 09 00 02 24 3C 40 54 10 80 00 A6 17 1F B3 48 28 B0 13 E2 17 C2 43 60 24 D2 42 01 24 61 24 3A 3C F2 D2 22 09 D2 42 82 23 3F 09 80 00 24 11 F2 D2 22 09 D2 42 82 23 00 24 B0 13 24 11 D2 43 12 24 10 01 C2 43 23 09 D2 43 02 24 3C 40 00 24 80 00 A6 17 F2 D2 22 09 D2 42 84 23 01 24 80 00 24 11 80 00 32 11 5E 42 84 23 7E F0 0F 00 0C 24 5E 93 1B 20 C2 93 84 23 04 34 F2 F0 D7 00 C8 23 03 3C F2 F0 D7 00 88 23 80 00 24 11 7E 90 80 00 03 20 B0 13 E2 17 43 3F 7E 90 82 00 02 20 80 00 DC 10 F2 D2 20 09 F2 D2 22 09 10 01 21 83 32 C2 03 43 B2 40 02 1C 5A 24 B2 40 17 24 5C 24 C2 43 0E 24 C2 43 11 24 B2 40 28 96 00 09 82 43 08 09 03 43 B2 40 40 18 08 09 B2 40 80 00 04 09 B0 13 D8 17 C2 43 12 24 F2 40 A5 00 21 01 5E 42 20 01 3E F0 03 00 0F 4E 3F D0 00 44 82 4F 24 01 B0 13 C8 17 4F 4E 8F 10 82 DF 24 01 B0 13 C8 17 C2 4E 20 01 0F DE 3F D0 00 44 82 4F 26 01 92 B3 2C 01 FD 2B 92 C3 2C 01 1E 53 2E 92 E4 2B C2 43 21 01 F2 D0 0C 00 4A 02 B2 C0 00 01 6C 01 05 3C B2 F0 F4 FF 6E 01 A2 C3 02 01 1E 42 6E 01 7E B0 09 00 F6 23 B2 40 20 00 66 01 B2 40 53 02 68 01 B2 40 00 02 6A 01 B2 40 20 02 C0 03 B1 40 2C 01 00 00 0C 3C B2 40 00 51 CE 03 92 B3 CE 03 FD 2B A2 D2 C0 03 2F 41 3F 53 81 4F 00 00 81 93 00 00 F1 23 B2 C0 00 40 CE 03 1F 42 DE 03 3F 90 96 08 03 28 3F 40 0F 05 0E 3C 3F 90 C5 04 03 28 3F 40 0F 03 08 3C 3F 90 DD 02 03 2C 3F 40 17 01 02 3C 3F 40 11 02 82 4F 14 24 82 43 60 01 B2 40 F3 10 64 01 B2 40 40 00 62 01 B2 40 44 02 68 01 B2 B2 08 09 06 28 B0 13 78 16 B0 13 8C 14 A2 D3 02 09 21 53 10 01 5E 42 3E 09 2E B2 02 28 80 00 BA 16 A2 B3 08 09 0C 28 B0 13 D8 17 B0 13 78 16 B0 13 8C 14 B2 F0 F9 FF 08 09 A2 D3 02 09 10 01 A2 B2 08 09 06 28 B0 13 D8 17 B2 40 04 A5 20 01 10 01 D2 B3 30 09 10 28 F2 D0 10 00 3C 09 C2 43 23 09 D2 93 10 24 03 20 B0 13 76 15 02 3C F2 D2 20 09 D2 C3 30 09 10 01 4E 93 02 34 80 00 8C 14 3E B0 40 00 0B 28 D2 43 11 24 F2 D0 10 00 3C 09 F2 C0 40 00 3E 09 82 43 10 09 10 01 3E B0 20 00 07 28 B0 13 78 16 F2 F0 9F 00 3E 09 C2 43 11 24 10 01 C2 43 12 24 C2 43 11 24 C2 43 00 24 C2 43 01 24 C2 43 3C 09 F2 43 02 24 F2 43 04 24 C2 43 10 24 7E 40 80 00 C2 4E 21 09 C2 4E 23 09 F2 40 8C 00 20 09 F2 40 8C 00 22 09 F2 40 03 00 2F 09 F2 40 03 00 2E 09 C2 4E C8 23 F2 40 10 00 C9 23 C2 4E CA 23 C2 4E CE 23 F2 40 40 00 CF 23 C2 4E 88 23 C2 43 89 23 C2 43 8A 23 F2 40 40 00 8F 23 F2 40 40 00 3C 09 C2 43 3E 09 C2 CE 3E 09 10 01 1B 15 1F 42 5A 24 5B 4F 03 00 0A 43 5E 4F 01 00 5C 4F 02 00 8C 10 0C DE 0D 4B 6E 4F 7E 80 11 00 0C 24 7E 80 06 00 12 24 6E 82 1A 20 2F 52 1E 42 5E 24 2E 82 B0 13 D4 15 17 3C 1F 53 0C 4F B0 13 26 16 4C 93 09 24 7C 40 05 00 0C 3C B2 90 A5 A5 56 24 04 20 B0 13 EC 17 4C 43 04 3C 6C 42 02 3C 7C 40 07 00 B0 13 82 17 1A 17 10 01 5E 42 02 24 7E 93 28 24 7E 90 09 00 03 28 7F 42 7E 82 09 3C 7E 92 02 2C 4F 4E 07 3C 7F 42 D2 93 0E 24 03 20 4E 43 5D 43 02 3C 7E 43 4D 43 C2 4D 10 24 C2 4E 02 24 4F 93 0C 24 3E 40 78 23 4D 4F 1C 42 06 24 EE 4C 00 00 92 53 06 24 1E 53 7D 53 F7 23 C2 4F 21 09 10 01 C2 43 10 24 10 01 5B 15 0A 4F 4B 43 08 4C 09 4D 08 5E 09 63 0D 99 03 28 1C 20 0C 98 1A 2C 6E 4A B2 90 A5 A5 56 24 0C 20 4B 43 1D 15 0F 16 CF 4E 00 00 1D 15 0F 16 66 4F 4E 96 03 24 5B 43 01 3C 6B 42 1A 53 1C 53 0D 63 0D 99 E9 2B 02 20 0C 98 E6 2B 4C 4B 56 17 10 01 1B 15 0D 43 3A 40 E0 FF 0B 4C 3B 50 20 00 7E 4A 7F 4C 0E EF 0D DE 0C 9B FA 23 0D 93 05 20 B2 40 A5 A5 56 24 4C 43 13 3C 92 42 58 24 44 01 1F 42 58 24 3F 50 06 00 82 4F 40 01 C2 43 E0 FF 1F 42 58 24 3F 50 10 00 82 4F 44 01 7C 40 05 00 1A 17 10 01 21 83 81 43 00 00 B2 40 28 96 00 09 92 42 14 24 12 09 B2 40 00 03 10 09 82 43 14 09 3F 40 4C 01 3F 53 FE 2F 2F 41 0E 4F 1E 53 81 4E 00 00 3F 90 E9 03 05 2C 82 93 14 09 EF 23 92 D3 02 09 21 53 10 01 F2 D0 10 00 3C 09 F2 40 80 00 23 09 03 3C F2 F0 FA 00 3E 09 C2 43 10 24 82 43 60 24 B0 13 64 11 34 40 80 00 82 C4 20 09 82 C4 22 09 E2 C2 3E 09 82 D4 20 09 82 D4 22 09 D2 B3 3E 09 E8 2F 10 01 C2 43 8A 23 B0 13 F0 13 D2 93 12 24 FB 23 C2 93 11 24 F8 23 C2 93 8A 23 F5 37 F2 B0 7F 00 8A 23 F1 27 5F 42 01 1C 82 4F 5E 24 5C 43 10 01 7E 40 3F 00 C2 93 CA 23 0F 34 C2 4E 80 1C 3F 40 81 1C 0D 4C 0D 5E FF 4C 00 00 1F 53 0C 9D FB 23 F2 40 40 00 CA 23 01 3C 4E 43 4C 4E 10 01 0F 41 3F 50 00 DC 8F 43 FE 23 2F 83 FC 23 82 43 56 24 B2 40 00 A5 58 24 B0 13 AA 12 B0 13 FA 16 5C B3 FC 2B B0 13 0A 15 F9 3F 03 43 1F 42 5C 24 FF 40 3B 00 00 00 1F 42 5C 24 CF 4C 01 00 E2 43 16 24 3C 40 16 24 B0 13 28 17 4C 93 FA 27 10 01 82 4C 06 24 1E 42 86 23 5F 42 02 24 0F 9E 04 28 C2 4E 02 24 4E 43 01 3C 5E 43 C2 4E 0E 24 80 00 76 15 B2 B0 10 00 2C 01 FC 2B B2 C0 10 00 2C 01 10 01 3F 40 DF 2E 3F 53 FE 2F 10 01 C2 43 23 09 E2 43 02 24 10 01 1D 15 10 01 FF FF A0 10 A5 3C 5A C3 FF FF 00 10 FF FF FF FF q
I am not being able to use BSLScripter as it is unable to open the HID device. I can't try UART-BSL as there is a problem with the UART on the PCB I am working on. In the document on using USB for firmware updates I did read something about the XT2 clock frequency setting but I haven't been able to look into that yet and will do so at the earliest.
Here is my code:
uint08 fInvokeBsl;
void main(void)
{
WDTCTL = WDTPW|WDTHOLD; // Stop WDT
USBKEYPID = 0x9628; // Unlock the USB registers
USBPWRCTL |= VBONIE; // Enable the VBUS-on interrupt
USBPHYCTL |= PUSEL;
USBCNF |= PUR_EN;
USBKEYPID = 0x9600; // Lock the USB registers
if(fInvokeBSL)
{
__disable_interrupt();
((void (*)())0x1000)();
fInvokeBSL = 0;
}
#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;
}
}
I have searched a lot on this issue including multiple threads on this forum but haven't been able to find a solution. Any help will be greatly appreciated. Please let me know if any other information is needed.
Thanks in advance
[Update:] Using Uniflash I programmed the BSL with values present in the attached file. Now on connecting the USB cable to my laptop and pausing the programmer, I get the message "Break at address '0x133C' with no debug information available, or outside of program code". I am able to view the disassembly code in the disassembly window.
Hi Abhishek,
I am looking into this and will provide updates as soon as I can.
Thanks,
Mitch
Hi Mitch
Thanks a lot for your reply. I was waiting for the reply eagerly.
Here's some more information. I am not using an external crystal oscillator for XT1 or XT2, and using the default clock provided with MSP430. The hardware connections I am making are the following: (from the USB cable) +5V to VBUS, Data+ to DP, Data- to DM and Ground of the USB cable to Ground of MSP430. VUSB is connected to ground through a capacitor. PUR is connected to ground through a 1Mega-Ohm resistor. For hardware invoking of BSL, PUR needs to be pulled high, for the software invocation, is it okay if it is connected to ground?
In the meantime I will try using UART to use UART-BSL and let you know the results.
Thanks
Here's some more information from my side. There is no pull-up resistor in my circuit from the PUR pin to DP. There is also no external crystal into XT2. I think these two conditions are necessary for the working of the USB BSL.
Hi Mitch,
Trying to use UART-BSL proved to be a disaster. I tried replacing the BSL with an UART BSL for another family. It ended up locking the JTAG on my MCU and corrupting the code. I now have to throw away the IC. I am yet to figure out why it happened. I have posted a question on the same here. Could you please get somebody to look at it? I am okay with it not working but I want to understand why the JTAG got locked and the firmware got corrupted.
Thanks and Regards
Abhishek
**Attention** This is a public forum