Re: Booting MPC565 by CAN/RS-232?

David Wybo <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Organization RealTime Consultants, Inc.
Message-ID <[email protected]>
It is fairly straightforward, but there are a couple caveats. First you 
need a device driver for the port you want to flash from. However, if 
you are reflashing the internal flash, and your vector table is in this 
internal flash, then you need to be very careful about an interrupt 
river device driver, since at some point in time, you will be erasing 
the vector table. So, you can either programmatically move the vector 
table to some other memory, or run a polled device driver.

Secondly, the code you are executing in order to do the download must 
execute from somewhere, and it also cannot be executing out of the 
internal flash while you are trying to reprogram it. So, either this 
code, I'll call it the bootloader, needs to be moved from internal flash 
to RAM, or it needs to execute from external flash, or it needs to be 
downloaded into RAM at the point in time when you want to reflash.

The bootloader I wrote a while back, accepts a new application over CAN. 
WHile the old application is running, a message is sent to the target 
stating that a reflash is requested. The message is acknowledged, and 
the bootloader is downloaded into RAM. WHen the bootloader is completely 
downloaded, the application terminates and jumps to the bootloader, 
which then communicates to the host to download the new application for 
flashing. I happen to use CCP for the protocol, but you can use anything 
you want.

Keep in mind that with only 8 byte data packets, CAN bootloading may 
take longer than a serial download. However, the time needed to reflash 
a 2 Mb application over CAN is not that bad. I also use an RTOS but that 
also is not necessary.

Hope this helps.

vijayanandl wrote:

>Hi All,
>      I have a question regarding programming the internal flash. In my 
>current implementation I have programmed the MPC565 internal flash 
>using the JTAG interface. We have a working system now and to expand 
>its functions, now I am interested to program the internal flash using 
>the RS-232/CAN interface if possible. The question is I am currently 
>using the standard initialization, with program executing from internal 
>flash and I do not use an RTOS(its a bareboard) my environment is 
>Codewarrior and BDI. So what are the steps I need to take to achieve 
>this capability using RS-232/CAN interface? 
>Do I need to modify my initialization files, flash driver etc. Advice 
>in this regard will be really helpful. Thanks in advance.
>
>Regards
>Vijay
>
>
>
>
>
>-----------------------------------------------------------
>To learn more about Freescale Microcontrollers, please visit
>http://www.freescale.com/mcu
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>  
>

-- 
David Wybo                    mailto:[email protected]
RealTime Consultants, Inc.    Phone: 248.345.6160
www.realtimeconsultantsinc.com





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/dN_tlB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.