Using I2C bus to download code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using I2C bus to download code

1,671 Views
Fan
Contributor I
Hi,
Instead of using a debugger, can I use I2C bus to download code to the microcontroller? I know this is a very special case: basically a running code on the MCU has to be able to overwrite itself. 
I am using HCS08 microcontroller. 
Thanks for any information.
Fan
Labels (1)
0 Kudos
2 Replies

293 Views
Fan
Contributor I
Thank you for the response.
Yes, my application is already using I2C bus, that's why I want to use I2C for the reprogramming.
I got answer from Freescale technical support, they are saying this is basically a boot loader issue. They don't have a boot loader using I2C, but they have one using SCI ports. According to them, it's possible to modify upon this boot loader.
0 Kudos

293 Views
mke_et
Contributor IV
I'm wondering why you feel using the I2C interface would make it simpler to solve the problem of overwriting itself? No matter what, the issues will remain the same.

EXCEPT where the interface hardware is concerned.

By that I mean if you write a polled serial handler and a polled I2C handler, then there's not much difference in the issues involved. But if you mean an interrupt driven serial handler (with vectors in flash) as opposed to a polled I2C handler, yes, there is a difference. In either case though, the safest thing to do is to disable interrupts and use a scheme where you place everything in RAM, including code, to do the erase and reprogram.

Then again, if you mean using 'existing packaged debug tools' over the serial link vs writing your own I2C interface handler...

On the other hand... If you had an application that had to use I2C and you didn't want to interface to the serial port, but instead share usage of the I2C, then right there is a very logical reason to use the I2C. But you still have all the same issues that you would have with a serial port doing a 'live interactive update' of the code.

Message Edited by mke_et on 2006-12-1204:38 PM

0 Kudos