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.

Problem trying to jump and execute app from custom bootloader

Other Parts Discussed in Thread: MSP430F5419A

Hi,

I'm using a MSP430F5419A.

I have a custom bootloader which uses UART to get the app image. I place the app starting at address 0x10000 and then I call the address 0xBC7E (which is the reset vector of my app image). The device reset but does not seems to enter the app image.

The part I don't understand is how do I get the bootloader to actually "jump" into the app image to run it?

My bootloader reset vector is 0xFFFE, which I believe to be OK.

My app reset vector is 0xBC7E, which I also believe to be OK

Here are some defines I use, incase it helps to help me.

#define FIRMWARE_BASE_ADD					(0x10000)

//Flash info space
#define FIRMWARE_FLASH_CHECKSUM				(0x10000)
#define FIRMWARE_VESION_ADD					(0x10004)
#define FIRMWARE_COMPATIBILITY_ADD			(0x10008)
#define FIRMWARE_LAUNCH_COMPATIBILITY_ADD	(0x1000C)
#define FIRMWARE_COMPONENT_ID_ADD 			(0x10010)
#define FIRMWARE_INFO_SPACE_SIZE			(0x14)
//Code space
#define FIRMWARE_CODE_ADD					(0x10014)
#define FIRMWARE_CODE_SIZE             		(0xFFEC)
//vector table space
#define FIRMWARE_INTERRUPT_FCT_SEGMENT_ADD	(0x9C00)
#define FIRMWARE_INTERRUPT_FCT_ADD			(0x9C00)
#define FIRMWARE_INTERRUPT_FCT_SIZE			(0x2000)
//vector table space
#define FIRMWARE_VECTOR_TABLE_SEGMENT_ADD	(0xBC00)
#define FIRMWARE_VECTOR_TABLE_ADD			(0xBC00)
#define FIRMWARE_VECTOR_TABLE_SIZE			(0x80)
//Complete space
#define FIRMWARE_INFO_AND_CODE_SIZE         FIRMWARE_CODE_SIZE + FIRMWARE_INFO_SPACE_SIZE //excluding vector table
#define FIRMWARE_COMPLETE_SIZE         		FIRMWARE_INFO_AND_CODE_SIZE + FIRMWARE_VECTOR_TABLE_SIZE //including vector table

//Section limit
#define FIRMWARE_SECTION1_MIN				FIRMWARE_BASE_ADD
#define FIRMWARE_SECTION1_MAX				FIRMWARE_BASE_ADD + FIRMWARE_INFO_AND_CODE_SIZE
#define FIRMWARE_SECTION2_MIN				FIRMWARE_INTERRUPT_FCT_ADD
#define FIRMWARE_SECTION2_MAX				FIRMWARE_INTERRUPT_FCT_ADD + FIRMWARE_INTERRUPT_FCT_SIZE + FIRMWARE_VECTOR_TABLE_SIZE

#define FIRMWARE_RESET_VECTOR 				(0xBC7E)

///////////////////////////////////////
// BOOTLOADER INFO
///////////////////////////////////////
//Flash info space
#define BOOTLOADER_BASE_ADD         		(0xBE00)
#define BOOTLOADER_CHECKSUM_ADD 			(0xBE00)
#define BOOTLOADER_VERSION_ADD         		(0xBE04)

#define BOOTLOADER_COMPATIBILITY_VERSION_ADD (0xBE08)
#define BOOTLOADER_COMPONENT_ID_ADD 		(0xBE0C)
#define BOOTLOADER_INFO_SPACE_SIZE			(0x10)
//Code space
#define BOOTLOADER_CODE_ADD 				(0xBE10)
#define BOOTLOADER_CODE_SIZE             	(0x3FF0)
//Vector table space
#define BOOTLOADER_VECTOR_TABLE_SEGMENT_ADD	(0xFE00)
#define BOOTLOADER_VECTOR_TABLE_ADD			(0xFF80)
#define BOOTLOADER_VECTOR_TABLE_SIZE		(0x80)
//Complete space
#define BOOTLOADER_INFO_AND_CODE_SIZE        BOOTLOADER_CODE_SIZE + BOOTLOADER_INFO_SPACE_SIZE //excluding vector table
#define BOOTLOADER_COMPLETE_SIZE             BOOTLOADER_INFO_AND_CODE_SIZE + 0x200 //including vector table from 0xFE00

//Section limit
#define BOOTLOADER_SECTION1_MIN				BOOTLOADER_BASE_ADD
#define BOOTLOADER_SECTION1_MAX				BOOTLOADER_BASE_ADD + BOOTLOADER_INFO_AND_CODE_SIZE
#define BOOTLOADER_SECTION2_MIN				BOOTLOADER_VECTOR_TABLE_ADD
#define BOOTLOADER_SECTION2_MAX				BOOTLOADER_VECTOR_TABLE_ADD + BOOTLOADER_VECTOR_TABLE_SIZE

#define BOOTLOADER_RESET_VECTOR 			(0xFFFE)

  • Hello,
    I will move your post to the MSP430 device forums, where the experts there can help you best.

    Thanks
    ki
  • On a reset, the MSP430 CPU jumps to the address in the reset vector (0xFFFE). Any other vector at another address must be handled by your code.

  • David Mercier said:
    ... and then I call the address 0xBC7E ...

    Are you using Assembly or c to do that "call"? Specifically, how did you "call the address oxBC7E"?

  • 		/****************************************************
    		 * FIRMWARE LAUNCH.
    		****************************************************/
    		StartFirmware = (void(*)(void))*FirmwareResetVector;
    		StartFirmware();

    I just found out this morning that it's jumping correctly... The reset I was seeing was the app resetting a few pins (the power ones... grrrr...) but I was unable to see it in the debugger because I didn't load correctly the app symbols. So I was thinking the app was not starting the right way.

    After breaking on a breakpoint in the bootloader, before starting the app, then I load the app symbols and I can see it stepping in the app.

    Thank you all for your help.

**Attention** This is a public forum