EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Flash/EEPROM Programming via CAN

Started by Trevor Wigle September 10, 2003
Hi folks,

First let me say that I have read/am aware of Motorola's App Note 1828 on
the subject.

I was wondering if anyone had written their own software for programming the
Flash of an HC12 over CAN. How well did it work? Did you employ the
bootloader-to-load-a-bigger-bootloader-in-RAM method (i.e., a low-level
permanent bootloader that loads a larger LRAE program that does all the real
programming, verifying, etc.) described in the App Note? Were the
bootloader(s) written in assembly or C? Was a separate coding effort needed
for programming the EEPROM?

Are there any third-party products/companies that would do sell such a
package as well and would save the time of development? Does anyone have
experience with these?

(I am using a MC912DG128A and have experience with Vector's CANalyzer.)

Thanks in advance,

- Andrew




I am also working on a CAN bootloader and I have noticed
other posts (K-Line etc) and now the post from Trevor. My
question is, is there a number of people/companies that are
interested in combining efforts to create some code, either
as open source or code used amongst the contributors,
that could be used with whatever communication flavor
they choose?

Steve
Automated lighting systems at www.brightan.com
Embedded micro-controllers and CAN interfaces at www.zanthic.com

> ----- Original Message -----
> From: "Trevor Wigle" <>
> To: "68HC12" <>
> Sent: Wednesday, September 10, 2003 4:25 PM
> Subject: [68HC12] Flash/EEPROM Programming via CAN > > Hi folks,
> >
> > First let me say that I have read/am aware of Motorola's App Note 1828
on
> > the subject.
> >
> > I was wondering if anyone had written their own software for programming
> the
> > Flash of an HC12 over CAN. How well did it work? Did you employ the
> > bootloader-to-load-a-bigger-bootloader-in-RAM method (i.e., a low-level
> > permanent bootloader that loads a larger LRAE program that does all the
> real
> > programming, verifying, etc.) described in the App Note? Were the
> > bootloader(s) written in assembly or C? Was a separate coding effort
> needed
> > for programming the EEPROM?
> >
> > Are there any third-party products/companies that would do sell such a
> > package as well and would save the time of development? Does anyone
have
> > experience with these?
> >
> > (I am using a MC912DG128A and have experience with Vector's CANalyzer.)
> >
> > Thanks in advance,
> >
> > - Andrew
> >
> >
> >
> > --------------------
> >
> >
> >
> > ">http://docs.yahoo.com/info/terms/
> >
> >
> >
>


Hi!

I've been working on M68HC912DG128As and CAN for the last three years and
I'm now designing/ writing my own software for Flash programming over CAN
for HC12 and HCS12 in C. Vector has some software available also:

http://www.vector-informatik.de/english/products/ecu.html

JK
-----Original Message-----
From: Trevor Wigle [mailto:]
Sent: 11. syyskuuta 2003 1:25
To: 68HC12
Subject: [68HC12] Flash/EEPROM Programming via CAN Hi folks,

First let me say that I have read/am aware of Motorola's App Note 1828 on
the subject.

I was wondering if anyone had written their own software for programming the
Flash of an HC12 over CAN. How well did it work? Did you employ the
bootloader-to-load-a-bigger-bootloader-in-RAM method (i.e., a low-level
permanent bootloader that loads a larger LRAE program that does all the real
programming, verifying, etc.) described in the App Note? Were the
bootloader(s) written in assembly or C? Was a separate coding effort needed
for programming the EEPROM?

Are there any third-party products/companies that would do sell such a
package as well and would save the time of development? Does anyone have
experience with these?

(I am using a MC912DG128A and have experience with Vector's CANalyzer.)

Thanks in advance,

- Andrew
--------------------
">http://docs.yahoo.com/info/terms/


Hi Trevor, Yes, we made our own bootrom, which let us download program to FLASH
by CAN. Our bootrom have size 2K and placed at 0xF000 address of
HCS12 DG128 microcontroller. Boot procces consist of this parts: 1. Host (PC or CAN-master) send 4 messages with specific ID. This
messages contains unique (4 double words) address of module. (Address
writed in protected area of bootrom and can not be rewrited) 2. If module received its address it start receive other messages that
hold RAM-data. This way let us load any program to RAM. At then end
we send message this 'jump to RAM' command. 3. RAM program had all needed Flash/EEPROM routines
(PROGRAM/ERASE/READ). For example host can send 'flash erase' command or 'load flash' command. 4. Then host done flash programming it's send 'reset command'. After
this module reboots (by watchdog) and starts again from bootrom. After
0.3 sec passed, if no messages with address of modules comes, module
jumped from bootrom to main program in Flash.

All code (for bootrom and RAM program) writed in C. (assemler used
only for 'jump to address' routine). All works fine. It is simple to
write this programs (I have spend two weeks). If you want, I can send
sources.

WBR, lenux



> All code (for bootrom and RAM program) writed in C. (assemler used
> only for 'jump to address' routine). All works fine. It is simple
to
> write this programs (I have spend two weeks). If you want, I can
send
> sources.

hi lenux,

If You can?
I'll be happy...

Mariusz





I put it to Files. Archive call bootrom.zip and contain two IAR
projects with bootrom and RAM program.

WBR, lenux
--- In , "manekb2000" <manekb@p...> wrote: > > All code (for bootrom and RAM program) writed in C. (assemler used


> > only for 'jump to address' routine). All works fine. It is simple


> to


> > write this programs (I have spend two weeks). If you want, I can


> send


> > sources.


>


> hi lenux,


>


> If You can?


> I'll be happy...


>


> Mariusz


That sounds easier than my experience told me till now.

My main problem is not to change the Protocol to some other (I will
implement a Bootloader via K-Line Protocol). I still can not port the
Bootloader-samplecode (written in Assembler) from Motorola to C.

So it would be realy great if i could get source from you to
understand how the bootloader works and how it could be implemented
in C.

If someone will be interested in Bootloading via K-Line i will also
give Sourcecode ( After i got it working *g*)

Alex

--- In , "lenux22" <lenux22@y...> wrote:
> Hi Trevor, > Yes, we made our own bootrom, which let us download program to
FLASH
> by CAN. Our bootrom have size 2K and placed at 0xF000 address of
> HCS12 DG128 microcontroller. Boot procces consist of this parts: > 1. Host (PC or CAN-master) send 4 messages with specific ID. This
> messages contains unique (4 double words) address of module.
(Address
> writed in protected area of bootrom and can not be rewrited) > 2. If module received its address it start receive other messages
that
> hold RAM-data. This way let us load any program to RAM. At then
end
> we send message this 'jump to RAM' command. > 3. RAM program had all needed Flash/EEPROM routines
> (PROGRAM/ERASE/READ). For example host can send 'flash erase' > command or 'load flash' command. > 4. Then host done flash programming it's send 'reset command'.
After
> this module reboots (by watchdog) and starts again from bootrom.
After
> 0.3 sec passed, if no messages with address of modules comes,
module
> jumped from bootrom to main program in Flash. >
>
> All code (for bootrom and RAM program) writed in C. (assemler used
> only for 'jump to address' routine). All works fine. It is simple
to
> write this programs (I have spend two weeks). If you want, I can
send
> sources. >
>
> WBR, lenux





UPS!

To fast!*g*

Thanks for sharing!!

Alex
--- In , "Alexander Veit" <alex.veit@t...>
wrote:
> That sounds easier than my experience told me till now.
>
> My main problem is not to change the Protocol to some other (I will
> implement a Bootloader via K-Line Protocol). I still can not port
the
> Bootloader-samplecode (written in Assembler) from Motorola to C.
>
> So it would be realy great if i could get source from you to
> understand how the bootloader works and how it could be implemented
> in C.
>
> If someone will be interested in Bootloading via K-Line i will also
> give Sourcecode ( After i got it working *g*)
>
> Alex
>
> --- In , "lenux22" <lenux22@y...> wrote:
> > Hi Trevor,
> >
> >
> > Yes, we made our own bootrom, which let us download program to
> FLASH
> > by CAN. Our bootrom have size 2K and placed at 0xF000 address of
> > HCS12 DG128 microcontroller. Boot procces consist of this parts:
> >
> >
> > 1. Host (PC or CAN-master) send 4 messages with specific ID. This
> > messages contains unique (4 double words) address of module.
> (Address
> > writed in protected area of bootrom and can not be rewrited)
> >
> >
> > 2. If module received its address it start receive other messages
> that
> > hold RAM-data. This way let us load any program to RAM. At then
> end
> > we send message this 'jump to RAM' command.
> >
> >
> > 3. RAM program had all needed Flash/EEPROM routines
> > (PROGRAM/ERASE/READ). For example host can send 'flash erase'
> >
> >
> > command or 'load flash' command.
> >
> >
> > 4. Then host done flash programming it's send 'reset command'.
> After
> > this module reboots (by watchdog) and starts again from bootrom.
> After
> > 0.3 sec passed, if no messages with address of modules comes,
> module
> > jumped from bootrom to main program in Flash.
> >
> >
> >
> >
> > All code (for bootrom and RAM program) writed in C. (assemler
used
> > only for 'jump to address' routine). All works fine. It is simple
> to
> > write this programs (I have spend two weeks). If you want, I can
> send
> > sources.
> >
> >
> >
> >
> > WBR, lenux




I hate to post a "me too" but I would also like a
copy of this code, if possible. Thanks!

Steve
Automated lighting systems at www.brightan.com
Embedded micro-controllers and CAN interfaces at www.zanthic.com ----- Original Message -----
From: "Alexander Veit" <>
To: <>
Sent: Friday, September 12, 2003 5:18 AM
Subject: [68HC12] Re: Flash/EEPROM Programming via CAN > UPS!
>
> To fast!*g*
>
> Thanks for sharing!!
>
> Alex
> --- In , "Alexander Veit" <alex.veit@t...>
> wrote:
> > That sounds easier than my experience told me till now.
> >
> > My main problem is not to change the Protocol to some other (I will
> > implement a Bootloader via K-Line Protocol). I still can not port
> the
> > Bootloader-samplecode (written in Assembler) from Motorola to C.
> >
> > So it would be realy great if i could get source from you to
> > understand how the bootloader works and how it could be implemented
> > in C.
> >
> > If someone will be interested in Bootloading via K-Line i will also
> > give Sourcecode ( After i got it working *g*)
> >
> > Alex
> >
> > --- In , "lenux22" <lenux22@y...> wrote:
> > > Hi Trevor,
> > >
> > >
> > > Yes, we made our own bootrom, which let us download program to
> > FLASH
> > > by CAN. Our bootrom have size 2K and placed at 0xF000 address of
> > > HCS12 DG128 microcontroller. Boot procces consist of this parts:
> > >
> > >
> > > 1. Host (PC or CAN-master) send 4 messages with specific ID. This
> > > messages contains unique (4 double words) address of module.
> > (Address
> > > writed in protected area of bootrom and can not be rewrited)
> > >
> > >
> > > 2. If module received its address it start receive other messages
> > that
> > > hold RAM-data. This way let us load any program to RAM. At then
> > end
> > > we send message this 'jump to RAM' command.
> > >
> > >
> > > 3. RAM program had all needed Flash/EEPROM routines
> > > (PROGRAM/ERASE/READ). For example host can send 'flash erase'
> > >
> > >
> > > command or 'load flash' command.
> > >
> > >
> > > 4. Then host done flash programming it's send 'reset command'.
> > After
> > > this module reboots (by watchdog) and starts again from bootrom.
> > After
> > > 0.3 sec passed, if no messages with address of modules comes,
> > module
> > > jumped from bootrom to main program in Flash.
> > >
> > >
> > >
> > >
> > > All code (for bootrom and RAM program) writed in C. (assemler
> used
> > > only for 'jump to address' routine). All works fine. It is simple
> > to
> > > write this programs (I have spend two weeks). If you want, I can
> > send
> > > sources.
> > >
> > >
> > >
> > >
> > > WBR, lenux >
> -------------------- >
> ">http://docs.yahoo.com/info/terms/ >



I would also like to have a copy of the code.
Thanks.

Kevin > ----- Original Message -----
> From: "Alexander Veit" <alex.veit@t...>
> To: <>
> Sent: Friday, September 12, 2003 5:18 AM
> Subject: [68HC12] Re: Flash/EEPROM Programming via CAN > > UPS!
> >
> > To fast!*g*
> >
> > Thanks for sharing!!
> >
> > Alex



The 2024 Embedded Online Conference