EmbeddedRelated.com
Forums

CPU re-write mode MC16

Started by Siva Palaninathan November 14, 2004
Hi
I am using IAR embedded work bench and trying to program(remotly)
MC16, Mitsubishi) in CPU re-write mode. In CPU re-write mode, MC16
has only 20K available RAM but the OS is about 100K so I can not re-program
the MC16 by copying the entire image to RAM. I wanted to know if I can
program MC16 by block by block. IN other words, can I put my code in
specific memory block in this way, I can re-program the specific block I want
instead of re-writing the entire OS, image
Any help would be appreciated,
thanks,

check out the Renesas website / M16C Application Notes.
There is an appnote about the M16C CPU rewrite mode.

grtnx
/jan

Siva Palaninathan <sara@engsoc.org> schrieb in im Newsbeitrag:
cn8tes$rub$1@driftwood.ccs.carleton.ca...
> Hi > I am using IAR embedded work bench and trying to program(remotly) > MC16, Mitsubishi) in CPU re-write mode. In CPU re-write mode, MC16 > has only 20K available RAM but the OS is about 100K so I can not
re-program
> the MC16 by copying the entire image to RAM. I wanted to know if I can > program MC16 by block by block. IN other words, can I put my code in > specific memory block in this way, I can re-program the specific block I
want
> instead of re-writing the entire OS, image > Any help would be appreciated, > thanks, >
In message <cn8tes$rub$1@driftwood.ccs.carleton.ca>, Siva Palaninathan 
<sara@engsoc.org> writes
>Hi >I am using IAR embedded work bench and trying to program(remotly) >MC16, Mitsubishi) in CPU re-write mode. In CPU re-write mode, MC16 >has only 20K available RAM but the OS is about 100K so I can not re-program >the MC16 by copying the entire image to RAM. I wanted to know if I can >program MC16 by block by block. IN other words, can I put my code in >specific memory block in this way, I can re-program the specific block I want >instead of re-writing the entire OS, image >Any help would be appreciated, >thanks, >
The application note reu05b0007_m16cap.pdf is probably the best guide. You need to run your programming code (Loader) from an area of Flash which you're not re-programming. The loader should first copy the Flash writing routines in the data sheet into RAM - only about 160 bytes IIRC. The Loader then fetches the 100K binary image 256 bytes at a time and writes this to a RAM buffer. The loader then calls the previously copied RAM routine to write this 256 bytes into program Flash, and so on. You can't run from Flash while writing Flash, but you can of course run from Flash while getting things ready and call RAM code for the actual writing. The RAM code is quite simple as it uses inbuilt routines. Cheers -- Keith Wootten