MSP430 in-circuit firmware upgrade question

I am trying to implement the in-circuit firmware upgrade feature on a MSP430148 based system. The firmware consists of a boot loader and application. boot loader will be able to receive new application firmware over UART and program it into the flash to replace the older application.

I have a few questions related to this:

  1. Can the boot loader program flash while executing in flash? Or does it have to be copied to RAM first?
  2. Both of my boot loader and application need to communicate over UART, how do I change the interrupt handler at run time? I am using IAR's tool. Its "interrupt" keyword sets up interrupt vector at compile time.
  3. In IAR's Embedded Workbench, I will have two projects for boot loader and application. If I use the linker script to place boot loader and application into different location, can I use C-Spy to download them into flash?
  4. When build the application firmware for field upgrade, what link output format should I choose that's good for download and flash programming?
  5. When the system goes to production, how do I get a complete flash image so we can program it on MSP430 chips before populate it on the board?

Thanks Weiyang Zhou

Reply to
Weiyang Zhou
Loading thread data ...

Weiyang Zhou schrieb in Nachricht ...

how

and

application

I think you should work on it and not ask school questions. The people are very busy here!

Sorry - Henry

Reply to
Henry Kiefer

While you are programming the flash, it can't execute from it, so it automatically executes marching on the spot until the write is finished. So you have two choices: copy your loader to RAM, or turn off all interrupts while actually writing.

Just a flag to steer to mthe appropriate routine from the interrupt. Or make the interrupt vector table point to a table of pointers (in RAM) to the approriate routine.

Something with checking would probably be better than the Texas .txt format. OPerhaps add a CRC to each block.

Don't. All the flash MSP430s have a built in serial bootloader, for the cost of 4 extra pins on the board (tx, rx, reset, gnd). Or use the JTAG if serial is too slow.

Paul Burke

Reply to
Paul Burke

I still don't quite understand what you mean by make the interrupt vector table point to a table of pointers (in RAM) to the appropriate routine, may I have a little more details?

In our hardware design, not all pins required foe bootstrap loader are available. There is not JTAG connector either. We need to program the chip before put it on the board. How can I do this?

Thanks Weiyang

Reply to
Weiyang Zhou

Declare a pointer to your interrupt function, it's just an ordinary function::

void (*CCR12ISR_hook)();

Write a routine that does your bootloader interrupt stuff:

void BootloaderCCR12ISR() { WhateverPleasesYou(); }

In your initialisation for the bootloader, make the hook point to the ISR (before you enable the interrupts):

CCR12ISR_hook = BootloaderCCR12ISR;

Then the interrupt routine calls the hook (this is in MSPGCC format):

interrupt(TIMERA1_VECTOR) INTERRUPT_MODE CCR12ISR (void) { (*CCR12ISR_hook)(); }

and similarly when you call the app, change the hook to point to the app's ISR.

You'll have to get a socket for a TQFP. They aren't at all cheap. You should have put the pins on the PCB.

Paul Burke

>
Reply to
Paul Burke

I plan to create to separate projects for bootloader and application. But CCR12ISR_hook needs to be variable visible to both projects, how do I do that? Should I put it into a fixed RAM location?

Thanks Weiyang

vector

have

put

Reply to
Weiyang Zhou

You could usefully do that, say in the flash page below the vectors. You'll probably also need to create a custom startup module for the app.

Paul Burke

Reply to
Paul Burke

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.