H8/36014: Flash programming.

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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.

Re: H8/36014: Flash programming.
On 27 May, in article

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

--
Paul Carpenter        | snipped-for-privacy@pcserv.demon.co.uk
<http://www.pcserv.demon.co.uk/ Main Site
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline