EmbeddedRelated.com
Forums
Memfault Beyond the Launch

MSP430FG4618 BSL help

Started by "Jul...@gmail.com [msp430]" May 27, 2014
I am trying to implement updating MSP430FG4618 through serial port.
I had downloaded Slau319h.zip file which as BSLdemo2.exe and the files.
BSLDEMO is sending the command.

Problem is on MSP430 side.

I want know which port MSP430 is using for BSL.
I had tried to use P2.5/UCA0RXD,P2.4/UCA0TXD

and P4.0/UTXD1 ,P4.1/URXD1

but both give same result.

Then i tried to check if MSP430 can jump to boot loader mode and place this
code in MSP430 .
before i send any data from BSL demo.
__disable_interrupt();

((void (*)())0x1000)();

But it reset immediately after the execution of ((void (*)())0x1000)();

Please let me know how to configure MSP430 to upgrade firmware through
serial port.
and which serial it is using by default.
I need to use P2.5/UCA0RXD,P2.4/UCA0TXD.

with regards

Beginning Microcontrollers with the MSP430

On 05/27/2014 10:16 AM, July Brownie j...@gmail.com [msp430] wrote:
> I want know which port MSP430 is using for BSL.
> I had tried to use P2.5/UCA0RXD,P2.4/UCA0TXD
>
> and P4.0/UTXD1 ,P4.1/URXD1
>
> but both give same result.
>

You obviously haven't read the device data sheet which tells you which
pins it uses for BSL.
--
David W. Schultz
http://home.earthlink.net/~david.schultz
Returned for Regrooving


Posted by: "David W. Schultz"


I tried it but not able to locate.
There are certain pin which the documents is mentioning.
Please help me by just sharing it i am implementing BSL for first time got
very confused.
i was following this document.
http://www.ti.com/lit/ug/slau319h/slau319h.pdf
On Tue, May 27, 2014 at 10:25 AM, 'David W. Schultz'
d...@earthlink.net [msp430] wrote:

> On 05/27/2014 10:16 AM, July Brownie j...@gmail.com [msp430] wrote:
> > I want know which port MSP430 is using for BSL.
> > I had tried to use P2.5/UCA0RXD,P2.4/UCA0TXD
> >
> > and P4.0/UTXD1 ,P4.1/URXD1
> >
> > but both give same result.
> > You obviously haven't read the device data sheet which tells you which
> pins it uses for BSL.
>
> --
> David W. Schultz
> http://home.earthlink.net/~david.schultz
> Returned for Regrooving
>
>
>
Are you taking about this .if that is the case i want to use
P2.5/UCA0RXD,P2.4/UCA0TXD.
not 1.0 and 1.1.

[image: Inline image 3]
On Tue, May 27, 2014 at 10:39 AM, July Brownie wrote:

> I tried it but not able to locate.
> There are certain pin which the documents is mentioning.
> Please help me by just sharing it i am implementing BSL for first time got
> very confused.
> i was following this document.
> http://www.ti.com/lit/ug/slau319h/slau319h.pdf
> On Tue, May 27, 2014 at 10:25 AM, 'David W. Schultz'
> d...@earthlink.net [msp430] wrote:
>
>> On 05/27/2014 10:16 AM, July Brownie j...@gmail.com [msp430]
>> wrote:
>> > I want know which port MSP430 is using for BSL.
>> > I had tried to use P2.5/UCA0RXD,P2.4/UCA0TXD
>> >
>> > and P4.0/UTXD1 ,P4.1/URXD1
>> >
>> > but both give same result.
>> >
>>
>> You obviously haven't read the device data sheet which tells you which
>> pins it uses for BSL.
>>
>> --
>> David W. Schultz
>> http://home.earthlink.net/~david.schultz
>> Returned for Regrooving
>>
>>
>>
[Non-text portions of this message have been removed]


Posted by: July Brownie


On 05/27/2014 11:17 AM, July Brownie j...@gmail.com [msp430] wrote:
> Are you taking about this .if that is the case i want to use
> P2.5/UCA0RXD,P2.4/UCA0TXD.
> not 1.0 and 1.1.
BSL uses dedicated pins for its serial I/O and can use no others. If you
cannot use those pins, then you can't use BSL.
--
David W. Schultz
http://home.earthlink.net/~david.schultz
Returned for Regrooving


Posted by: "David W. Schultz"


what if i want to write my own BSL.

Is there a way i can get 2.12 code and modify it use 2.5 and 2.4

On Tue, May 27, 2014 at 11:22 AM, 'David W. Schultz'
d...@earthlink.net [msp430] wrote:

> On 05/27/2014 11:17 AM, July Brownie j...@gmail.com [msp430] wrote:
> > Are you taking about this .if that is the case i want to use
> > P2.5/UCA0RXD,P2.4/UCA0TXD.
> > not 1.0 and 1.1.
>
> BSL uses dedicated pins for its serial I/O and can use no others. If you
> cannot use those pins, then you can't use BSL.
> --
> David W. Schultz
> http://home.earthlink.net/~david.schultz
> Returned for Regrooving
>
>
>
You can write your own serial downloader to work on any pins. With some
gotchas. You need to think about the order of flash deletion, should
probably try to reserve the interrupt vectors, because that is the
greatest risk, deleting the reset vector and losing comm before that has
been reprogrammed. You need to decide how you're going to handle other
interrupts, do you make the ISR's relocatable or fix them in memory, do
you use the UART ISR and UART hardware for the downloader, or do you bit
bang it, etc etc. You can write a robust downloader in under 512 bytes.
That is one which can recover if power is lost or comm is lost during
the update process.

This isn't a BSL, because it requires your code to manage it. You could
make it like a BSL, operating from specific pin inputs, but that would
potentially require reserved pins, reserving the UART, or providing 2
different UART handlers, say one bit banged and one using the ISR. There
are too many ways to do this for a single solution to be viable.

When I do this the entry point to my code contains a check to see if the
system was mid update when last run. if so it will send a code over the
UART to say it wants an update. Else it runs your code as normal until
and unless it receives an instruction to update the saoftware. that can
be serial comm, a dedicated pin, whatever, then you need to decide how
to verify that and handle the update process from that point. It can be
different for every system. For example an RF downloader is slightly
moree complex than a plain UART, using interrupts forces some
constraints on your overall code design.

Al

On 28/05/2014 2:08 AM, July Brownie j...@gmail.com [msp430] wrote:
> what if i want to write my own BSL.
>
> Is there a way i can get 2.12 code and modify it use 2.5 and 2.4
> On Tue, May 27, 2014 at 11:22 AM, 'David W. Schultz'
> d...@earthlink.net
> [msp430] > wrote:
>
> On 05/27/2014 11:17 AM, July Brownie j...@gmail.com
> [msp430] wrote:
> > Are you taking about this .if that is the case i want to use
> > P2.5/UCA0RXD,P2.4/UCA0TXD.
> > not 1.0 and 1.1.
>
> BSL uses dedicated pins for its serial I/O and can use no others.
> If you
> cannot use those pins, then you can't use BSL.
> --
> David W. Schultz
> http://home.earthlink.net/~david.schultz
>
> Returned for Regrooving
>
Thanks for This idea.

Since 2.12 is already return and tested is it possible to get the source
code and just change RX and TX pin.

I feel this will be easier instead of writing a new code to get BSL working.

On Tue, May 27, 2014 at 12:33 PM, Onestone o...@bigpond.net.au [msp430]
wrote:

> You can write your own serial downloader to work on any pins. With some
> gotchas. You need to think about the order of flash deletion, should
> probably try to reserve the interrupt vectors, because that is the greatest
> risk, deleting the reset vector and losing comm before that has been
> reprogrammed. You need to decide how you're going to handle other
> interrupts, do you make the ISR's relocatable or fix them in memory, do you
> use the UART ISR and UART hardware for the downloader, or do you bit bang
> it, etc etc. You can write a robust downloader in under 512 bytes. That is
> one which can recover if power is lost or comm is lost during the update
> process.
>
> This isn't a BSL, because it requires your code to manage it. You could
> make it like a BSL, operating from specific pin inputs, but that would
> potentially require reserved pins, reserving the UART, or providing 2
> different UART handlers, say one bit banged and one using the ISR. There
> are too many ways to do this for a single solution to be viable.
>
> When I do this the entry point to my code contains a check to see if the
> system was mid update when last run. if so it will send a code over the
> UART to say it wants an update. Else it runs your code as normal until and
> unless it receives an instruction to update the saoftware. that can be
> serial comm, a dedicated pin, whatever, then you need to decide how to
> verify that and handle the update process from that point. It can be
> different for every system. For example an RF downloader is slightly moree
> complex than a plain UART, using interrupts forces some constraints on your
> overall code design.
>
> Al
> On 28/05/2014 2:08 AM, July Brownie j...@gmail.com [msp430] wrote:
>
> what if i want to write my own BSL.
>
> Is there a way i can get 2.12 code and modify it use 2.5 and 2.4
> On Tue, May 27, 2014 at 11:22 AM, 'David W. Schultz'
> d...@earthlink.net [msp430] wrote:
>
>>
>> On 05/27/2014 11:17 AM, July Brownie j...@gmail.com [msp430]
>> wrote:
>> > Are you taking about this .if that is the case i want to use
>> > P2.5/UCA0RXD,P2.4/UCA0TXD.
>> > not 1.0 and 1.1.
>>
>> BSL uses dedicated pins for its serial I/O and can use no others. If you
>> cannot use those pins, then you can't use BSL.
>> --
>> David W. Schultz
>> http://home.earthlink.net/~david.schultz
>> Returned for Regrooving
>>
>>
>
I don't know if Ti release the code for their bootloader. I suspect not.
You could go to the boot loader at 0C00H of course and disassemble it. I
don't know of an MSP430 disassembler, but you can dump these contents,
diplay the disassembly in the IAR disassembly window and see quite
clearly where the pins are set, and handled through the code. Just look
for references to P1 and P2 then substitute the relevant addresses and
bit/pin numbers you want to use.

I have never tried reprogramming the BSL memory but, assuming it is
FLASH it wouldn't be a massive task to dump the memory from 0C00h to
0fffH and then hand patch the specific port addresses and then
re-programming it. You may mess up one micro if this doesn't work. If it
does work you have a true BSL, rather than a serial updater, but I
actually think a serial updater is better in the field than a BSL of
this type.

Al

On 28/05/2014 3:41 AM, July Brownie j...@gmail.com [msp430] wrote:
> Thanks for This idea.
>
> Since 2.12 is already return and tested is it possible to get the
> source code and just change RX and TX pin.
>
> I feel this will be easier instead of writing a new code to get BSL
> working.
>
> On Tue, May 27, 2014 at 12:33 PM, Onestone o...@bigpond.net.au
> [msp430] > > wrote:
>
> You can write your own serial downloader to work on any pins. With
> some gotchas. You need to think about the order of flash deletion,
> should probably try to reserve the interrupt vectors, because that
> is the greatest risk, deleting the reset vector and losing comm
> before that has been reprogrammed. You need to decide how you're
> going to handle other interrupts, do you make the ISR's
> relocatable or fix them in memory, do you use the UART ISR and
> UART hardware for the downloader, or do you bit bang it, etc etc.
> You can write a robust downloader in under 512 bytes. That is one
> which can recover if power is lost or comm is lost during the
> update process.
>
> This isn't a BSL, because it requires your code to manage it. You
> could make it like a BSL, operating from specific pin inputs, but
> that would potentially require reserved pins, reserving the UART,
> or providing 2 different UART handlers, say one bit banged and one
> using the ISR. There are too many ways to do this for a single
> solution to be viable.
>
> When I do this the entry point to my code contains a check to see
> if the system was mid update when last run. if so it will send a
> code over the UART to say it wants an update. Else it runs your
> code as normal until and unless it receives an instruction to
> update the saoftware. that can be serial comm, a dedicated pin,
> whatever, then you need to decide how to verify that and handle
> the update process from that point. It can be different for every
> system. For example an RF downloader is slightly moree complex
> than a plain UART, using interrupts forces some constraints on
> your overall code design.
>
> Al
>
> On 28/05/2014 2:08 AM, July Brownie j...@gmail.com
> [msp430] wrote:
>> what if i want to write my own BSL.
>>
>> Is there a way i can get 2.12 code and modify it use 2.5 and 2.4
>> On Tue, May 27, 2014 at 11:22 AM, 'David W. Schultz'
>> d...@earthlink.net
>> [msp430] >
>> wrote:
>>
>> On 05/27/2014 11:17 AM, July Brownie j...@gmail.com
>> [msp430] wrote:
>> > Are you taking about this .if that is the case i want to use
>> > P2.5/UCA0RXD,P2.4/UCA0TXD.
>> > not 1.0 and 1.1.
>>
>> BSL uses dedicated pins for its serial I/O and can use no
>> others. If you
>> cannot use those pins, then you can't use BSL.
>> --
>> David W. Schultz
>> http://home.earthlink.net/~david.schultz
>>
>> Returned for Regrooving
>>
>
"July Brownie j...@gmail.com [msp430]" :

> Since 2.12 is already return and tested is it possible to get the source
> code and just change RX and TX pin.

I think BSL (with modified pins) is not possible for the pins you mentioned
2.5, P2.4 and P4.0, P4.1, because BSL is done using a Timer (and not a UART)
and the timer functions (TAx) are not available on that pins.

M.


Posted by: Matthias Weingart



Memfault Beyond the Launch