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.

MSP430F5514: MSP430 not getting detected as HID on invoking BSL through software

Part Number: MSP430F5514
Other Parts Discussed in Thread: UNIFLASH

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: 

bslMem.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@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
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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 Abhishek,

    Good catch. An external XTAL is required for the USB BSL. This seems to be the root of the issue:

    Any luck with the UART BSL?

    Thanks,

    Mitch

  • 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