EmbeddedRelated.com
Forums

Bootloader Via Bit-Banged UART Code?

Started by aekalman June 22, 2003
Hi All.

On a new design of mine I plan to implement a software UART with two
GPIO pins of a '149 so as to leave the hardware UARTs free for other
purposes. 

I'd like to add the ability to upgrade firmware via the software UART.
I'm not really up on the whole MSP430 bootloader scene as I have
always used the JTAG interface in the past.

Can anyone point me to the truly relevant documents / code that'll
speed me along? I'd prefer pointers to code that people have actually
used to implement this sort of thing, rather than just googlebot
results.

Any pitfalls I should be aware of?

Thanks,

--Andrew


Beginning Microcontrollers with the MSP430

Hi Andrew,
Some of my customers do hope to implement their own upgrade procedure 
in MSP430. And one of them implemented a similiar way with yours in 
his product. There are two procedure you can use. Run the code in RAM 
or run the code in FLASH.

If you want to run the upgrade code in RAM, you can write a sub-
routine to do this communication-and-upgrade job. Next time when 
MSP430 get proper request, it will excute the upgrade job. All you 
need to care about is, don't power off in the middle of upgrade. The 
benifit of this way is that you can change all the FLASH memory of 
your MSP430.

And if you want to run the upgrade code in Flash, just put it in a 
specify Flash sector. My suggestion is put it at where your power-on-
reset begins. The benifits of this way are: You don't need to care 
about the power down problem, and you can repeat the upgrade 
procedure even if there are some failures happdened. The payoff is, 
you need to keep a small space of FLASH for this upgrade code.

And about how to manipulate the FLASH memory of MSP430, you can refer 
to TI's application note SLAA103, MSP430 flash self-programming 
technique. And also you can read the user's guide, chapter 5.

Regards,
Austin
--- In msp430@msp4..., "aekalman" <aek@n...> wrote:
> Hi All.
> 
> On a new design of mine I plan to implement a software UART with two
> GPIO pins of a '149 so as to leave the hardware UARTs free for other
> purposes. 
> 
> I'd like to add the ability to upgrade firmware via the software 
UART.
> I'm not really up on the whole MSP430
bootloader scene as I have
> always used the JTAG interface in the past.
> 
> Can anyone point me to the truly relevant documents / code that'll
> speed me along? I'd prefer pointers to code that people have 
actually
> used to implement this sort of thing, rather than
just googlebot
> results.
> 
> Any pitfalls I should be aware of?
> 
> Thanks,
> 
> --Andrew




----- Original Message ----- 
From: "aekalman" <aek@aek@...>
To: <msp430@msp4...>
Sent: Monday, June 23, 2003 4:20 AM
Subject: [msp430] Bootloader Via Bit-Banged UART Code?


> Hi All.
>
> On a new design of mine I plan to implement a software UART with two
> GPIO pins of a '149 so as to leave the hardware UARTs free for other
> purposes.
>
> I'd like to add the ability to upgrade firmware via the software UART.
> I'm not really up on the whole MSP430 bootloader scene as I have
> always used the JTAG interface in the past.

There is already a bootloader in the F149 that uses a software UART on P1.1
and P2.2.  The programmer also needs access to Reset line to use it.  THe
information about that is in the datasheet.

You can also write your own software uart and bootloader.  You could even
use the same pins.  There is a software uart application note and example
cdoe on TI.com, but its in the section for simpler processors than the F149.
Once you have a software uart, you can write your own bootloader using that
software uart.

>
> Can anyone point me to the truly relevant documents / code that'll
> speed me along? I'd prefer pointers to code that people have actually
> used to implement this sort of thing, rather than just googlebot
> results.
>
> Any pitfalls I should be aware of?
>
> Thanks,
>
> --Andrew
>
>
>
> .
>
>
>
> ">http://docs.yahoo.com/info/terms/
>
>
>


Hi,

> There is already a bootloader in the F149 that
uses a software UART on P1.1
> and P2.2.  The programmer also needs access to Reset line to use it.  THe
> information about that is in the datasheet.

I could only find the software UART but not with a bootloader.
Can you give an URL to that datasheet?

Regards

Rolf F.





THe bootloader I am talking about there is programmed into the F149 at the
factory, and the datasheet is the F149 datasheet.  Actually the F149
datasheet only gives a summary of it, but it says its a standard TI protocol
and if you search ti.com for "boot ROM serial protocol" it seems to be
used
on their DSP's.


----- Original Message ----- 
From: <nobodyo@nobo...>
To: <msp430@msp4...>
Sent: Tuesday, June 24, 2003 5:36 AM
Subject: Re: [msp430] Bootloader Via Bit-Banged UART Code?


> Hi,
>
> > There is already a bootloader in the F149 that uses a software UART on
P1.1
> > and P2.2.  The programmer also needs access
to Reset line to use it.
THe
> > information about that is in the datasheet.
>
> I could only find the software UART but not with a bootloader.
> Can you give an URL to that datasheet?
>
> Regards
>
> Rolf F.
>
>
>
>
>
>
> .
>
>
>
> ">http://docs.yahoo.com/info/terms/
>
>
>


--- In msp430@msp4..., "David Lions" <davidl@c...> wrote:
 > There is already a bootloader in the F149 that uses a software UART
on P1.1
> and P2.2.  The programmer also needs access to
Reset line to use it.
 THe
> information about that is in the datasheet.
> 
> You can also write your own software uart and bootloader.  You could
even
> use the same pins.  There is a software uart
application note and
example
> cdoe on TI.com, but its in the section for simpler
processors than
the F149.
> Once you have a software uart, you can write your
own bootloader
using that
> software uart.

Thanks, David.

It looks like I will have to combine the two, in that I need to
implement it using just Tx and Rx lines (no Reset) as that's what's
available. I suspect I will write it to listen to the Rx line for the
first few seconds, and if there is no activity, then start up
normally. If there is activity, commence a download. And it would be
nice to be able to command it to go from normal operation to the
bootloader "mode" without physical access to Reset.

Well, I have my work cut out for me!

--Andrew


--- In msp430@msp4..., "Austin" <austinwu@m...> wrote:
 > And if you want to run the upgrade code in Flash, just put it in a 
> specify Flash sector. My suggestion is put it at
where your power-on-
> reset begins. The benifits of this way are: You don't need to care 
> about the power down problem, and you can repeat the upgrade 
> procedure even if there are some failures happdened. The payoff is, 
> you need to keep a small space of FLASH for this upgrade code.
> 
> And about how to manipulate the FLASH memory of MSP430, you can refer 
> to TI's application note SLAA103, MSP430 flash self-programming 
> technique. And also you can read the user's guide, chapter 5.

Hi Austin.

In my case (see my other post, too) it probably makes more sense to
put it in Flash, and having it off the reset vector is in line with my
thinking (on power-up, looks for flash download for N seconds, then
begins operating normally, etc.).

Thanks for your advice.

--Andrew