EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Flash/EEPROM Programming via CAN

Started by Trevor Wigle September 10, 2003
I would also like to have a copy of the code.

Cheers,
Yogeesh > ----- 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






For all who want download C sources of CAN bootrom: Just type http://groups.yahoo.com/group/68HC12/files in the browser and download file called bootrom.zip.

WBR, lenux
--- In , "Yogeesh" <yogeesh@c...> wrote: > I would also like to have a copy of the code.


>


> Cheers,


> Yogeesh


>


>


> > ----- 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


Hi Lenux,

Thank you for you informative response and generously posting your code.

I was curious what you did for the host (i.e., non-HC12) side of things.
Did you write a PC program to communicate with your bootrom? If so, for
what language (Visual Basic, some scripting language, etc.)? How did you
interface your target HC12 to your PC (or whatever contains the "new" code)?
Did you use any specific cables, like Vector's CANcardX (or make a "smart"
cable mentioned in the app note)? Can you make any recommendations?

Thanks,
- Andrew

-----Original Message-----
From: lenux22 [mailto:]
Sent: Thursday, September 11, 2003 3:22 AM
To:
Subject: [68HC12] Re: Flash/EEPROM Programming via CAN 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/



Hello, Trevor. To interface with HCS12 (i.e. load program to it) we use CAN-USB or
CAN-COM module. Yes, we write PC program (in C) to communicate via USB
or COM port with target (HCS12 device). All cables we made by
ourselfs. Our standart cable is 4-pin (CAN HIGH, CAN LOW, VCC and GND)
and connected to HCS12 to supply it with Vcc.

WBR, lenux
--- In , "Trevor Wigle" <trevorwigle@e...>
wrote: > Hi Lenux,


>


> Thank you for you informative response and generously posting your
code. >


> I was curious what you did for the host (i.e., non-HC12) side of
things. > Did you write a PC program to communicate with your bootrom? If so,
for > what language (Visual Basic, some scripting language, etc.)? How
did you > interface your target HC12 to your PC (or whatever contains the
"new" code)? > Did you use any specific cables, like Vector's CANcardX (or make a
"smart" > cable mentioned in the app note)? Can you make any recommendations?


>


> Thanks,


> - Andrew


>


> -----Original Message-----


> From: lenux22 [mailto:lenux22@y...]


> Sent: Thursday, September 11, 2003 3:22 AM


> To:


> Subject: [68HC12] Re: Flash/EEPROM Programming via CAN


>


>


> 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/


Hello Lenux,

I have written a simple download procedure for downloading via RS232 (for DP256 CPU). It works fine, but I also wanted to download code via CAN. Is it possible that you send me a example how to do this?
What Hardware, software do you use on PC- side ?
Best regards

Andy

----- Original Message -----
From: lenux22
To:
Sent: Wednesday, September 17, 2003 11:18 AM
Subject: [68HC12] Re: Flash/EEPROM Programming via CAN Hello, Trevor. To interface with HCS12 (i.e. load program to it) we use CAN-USB or
CAN-COM module. Yes, we write PC program (in C) to communicate via USB
or COM port with target (HCS12 device). All cables we made by
ourselfs. Our standart cable is 4-pin (CAN HIGH, CAN LOW, VCC and GND)
and connected to HCS12 to supply it with Vcc.

WBR, lenux
--- In , "Trevor Wigle" <trevorwigle@e...>
wrote: > Hi Lenux,


>


> Thank you for you informative response and generously posting your
code. >


> I was curious what you did for the host (i.e., non-HC12) side of
things. > Did you write a PC program to communicate with your bootrom? If so,
for > what language (Visual Basic, some scripting language, etc.)? How
did you > interface your target HC12 to your PC (or whatever contains the
"new" code)? > Did you use any specific cables, like Vector's CANcardX (or make a
"smart" > cable mentioned in the app note)? Can you make any recommendations?


>


> Thanks,


> - Andrew


>


> -----Original Message-----


> From: lenux22 [mailto:lenux22@y...]


> Sent: Thursday, September 11, 2003 3:22 AM


> To:


> Subject: [68HC12] Re: Flash/EEPROM Programming via CAN


>


>


> 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/ --------------------



Hi,
We use CAN for programming and internal data
aquisition of target processor. We have our own
hardware for PC interface(parallel port to CAN
interface using HCS12). Our software developed in VC++
(MFC application).

Refer Motorola application Note AN1828 "Flash
programming via CAN" it is good document to begin.
Regards,
Venu

--- Andreas Mueller <> wrote:
> Hello Lenux,
>
> I have written a simple download procedure for
> downloading via RS232 (for DP256 CPU). It works
> fine, but I also wanted to download code via CAN. Is
> it possible that you send me a example how to do
> this?
> What Hardware, software do you use on PC- side ?
> Best regards
>
> Andy
>
> ----- Original Message -----
> From: lenux22
> To:
> Sent: Wednesday, September 17, 2003 11:18 AM
> Subject: [68HC12] Re: Flash/EEPROM Programming via
> CAN > Hello, Trevor. > To interface with HCS12 (i.e. load program to it)
> we use CAN-USB or
> CAN-COM module. Yes, we write PC program (in C) to
> communicate via USB
> or COM port with target (HCS12 device). All cables
> we made by
> ourselfs. Our standart cable is 4-pin (CAN HIGH,
> CAN LOW, VCC and GND)
> and connected to HCS12 to supply it with Vcc. >
>
> WBR, lenux >
> --- In , "Trevor Wigle"
> <trevorwigle@e...>
> wrote: > > Hi Lenux, > > > Thank you for you informative response and
> generously posting your
> code. > > > I was curious what you did for the host (i.e.,
> non-HC12) side of
> things. > > Did you write a PC program to communicate with
> your bootrom? If so,
> for > > what language (Visual Basic, some scripting
> language, etc.)? How
> did you > > interface your target HC12 to your PC (or
> whatever contains the
> "new" code)? > > Did you use any specific cables, like Vector's
> CANcardX (or make a
> "smart" > > cable mentioned in the app note)? Can you make
> any recommendations? > > > Thanks, > > - Andrew > > > -----Original Message----- > > From: lenux22 [mailto:lenux22@y...] > > Sent: Thursday, September 11, 2003 3:22 AM > > To: > > Subject: [68HC12] Re: Flash/EEPROM Programming
> via CAN > > > > 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' > >
>
=== message truncated === __________________________________




Memfault Beyond the Launch