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 am currently having problems invoking the USB BSL from software with the EXP430F5529 board.
I have downloaded the USB library and am using the pre-built BSL_USB_GUI.exe.
This operates quite correctly If I set the EXP4305529 power switch to the LDO position and hold down S$ whilst plugging in the USB cable. Windows correctly finds the "USB Human Interface Device" for the BSL, and BSL_USB_GUI.exe also finds the device, and I am able to update the firware as expected.
I do not want my final project to have a switch to invoke the BSL so I am trying to do this by software. I have updated the eXample software that uses the USB HID interface to control the LED, so that it will accept a command to update the firmware.
When this commnd is recieved I use the following code to statr the BSL:
strcpy(outString,"\r\nRestarting for firmware upgrade\r\n\r\n"); //Prepare the outgoing string
hidSendDataWaitTilDone((BYTE*)outString,
strlen(outString),HID0_INTFNUM,0); //Send the response over USB
P1OUT |= BIT0; //Turn on LED P1.0
USB_disconnect();
USB_disable();
USB_reset();
__disable_interrupt();
((void (*)())0x1000)(); // This sends execution to the BSL. When execution
I would expect that the USB_Disconnect() call would cause windows to drop the HID device on VID 0x2047 PID 0x0301. This operates correctly, and my control program reports that the MSP430 is disconnected.
The call to 0x1000 that enters the BSL should then allow windows to re-enumerate and find the BSL at VID 0x2047 PID 0x0200, however this does not occur.
I have also tried just using the example provided in "USB Fiel Firmware Updates on MSP430.pdf" section 4.1 page 8. This expects a system that only uses the USB for firmware up=date and uses the USB Power ON to detect the USB connection and then invokes the BSL in the same way. I have debugged this code and it would appear that the interrupt is detected when the USB is plugged in, and the call to 0x1000 is made, but windows does not manage to see the device.
I have looked at the other threads on this subject and have not really found a definitive answer, It may be possible that the BSL is corrupt, but it works fine when invoked with S4. Does any one have any advice on the best way to progres this, or any way to check for a corrupt BSL.
Regards
Roy
Hi,
Yes I did manage to get it working in the end.The main problem is that I was using Rowley Crossworks as my compiler. This has a slightly peculiar way of calling functions via pointers due to the possible 20 bit addresses.
In the end I changed my code as follows and it is now working perfectly.
static void InvokeBSL(void)
{
// disconnect our USB interface
USB_disconnect();
USB_disable();
__disable_interrupt();
// enter BSL
BranchToBSL();
}
static void BranchToBSL(void)
{
// insert assembler code to branch to BSL entry point
// BRA #0x01000
__insert_opcode(0x0080);
__insert_opcode(0x1000);
}
Dependent on the compiler you are using you may need to change this to get your compiler to insert the opcodes for the assembler routine.
Hope this helps
Roy
**Attention** This is a public forum