Reprogramming FLASH on the RCM4200

Hi,

I am looking for some guidance on accessing the FLASH on-board the RCM4200, outside of the General User Block Access.

I have implemented a download feature via the Ethernet interface to allow my application to upgrade code through our messaging protocol where we take the image generated by Dynamic C and pass in down in 4K chunks until the new load is complete

I had previously implemented this on a RCM3300 and hacked some code that I had located on the site for a download manager. Being under the gun to get things working I got my code functional although I did not have the time to truly understand what was really happening.

When I try to run the same code on the RCM4200 nothing seems to be changing in the FLASH.

Basically my code is modifying the MB3CR register to flip A18 and assumes the FLASH is in Quadrant 3, and then calls the WriteFlash routine in the BIOS.

I am looking for information to understand how the FLASH on the RCM4200 is mapped (i.e quadrant) and which MBxCR register I should be accessing.

I have had little need to get this low into the bowels of the Rabbit code and I don’t know if I am chasing a memory management difference between the R3000 and R4000 or a difference between the RCM3300 and the RCM4200.

So, I am looking for any examples or pointers that anyone may be able to provide.

Thanks in advance,

Mark Horton

I had exactly the same problem, but with an R2000.
Problem: The Flash mounted in the R2000 modules can be read and written at the same time, so running code can write in the same Flash. The Flash mounted in the R4000 modules can’t do this. I don’t see any code in the DC to solve this problem directly.
My solution:
A “Loader” program, compiled with “Compile to Flash, run in Ram” option. It is saved in the low half of the Flash, but runs in RAM. Then, it is able to write the Flash if necessary. Furthermore, I wrote my own write Flash routines. The “Loader”, receives the new program and saves it in the high half of the Flash (as usual, this program must have the “Invert A19” option).
“Running in RAM” lets MB3CR for accessing to FLASH. It’s OK.