H8/36014: Flash programming.

Hi, I am doing some normal code execution on the H8/36014 processor, and when a series of errors happen, I want to write some bytes to a specific Flash page. After this, I need to come back to what I was doing without resetting the micro. Is this possible? I know that I'll have to copy the flashing routines to RAM and execute it from there. I then need to come back to the code I was executing earlier, and the processor should be in the same state it was in before I jumped to the flashing routines in RAM. Is this possible?

Thanks.

Reply to
Deepak Mohan
Loading thread data ...

Using User mode programming it is possible, *BUT* depends on how your application is structured.

Assumptions You have at all times at least 384 bytes of RAM available for the code to run in.

You have read the datasheet on User mode programming.

You are talking about errors other than runaway NMI interupt or related hardware faults.

To ensure it was in the same state you will need to have separate stack areas, User mode programming uses specifc areas of RAM for the code, data and stack.

How much of the same state, amount of data, and amount of spare RAM you have has not been described.

Please remember you only have 2KB total RAM available and your code cannot access any part of the Flash during this code execution. It is generally advisable to write this code in assembler to ensure NO library calls or calls to data in flash, and all programme control is done by branch instructions. Once the programming is finished you can reset the stack pointer, reenable interupts.

Special care must be taken on how NMI is used or processed and may need external disabling gate.

You will need startup code that recognises that a Watchdog interupt occured and you were doing flash operations.

--
Paul Carpenter		| paul@pcserv.demon.co.uk
        Main Site
              GNU H8 & mailing list info.
             For those web sites you hate.
Reply to
Paul Carpenter

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.