Urgent help with H8/3672 Flash programming routines

Hello everybody!

Has anyone worked with the microprocessor H8/3672 of Hitachi? If so, could you help me to code the routines for an in-application Flash programming process?. What I'm trying to do is a backup of several calibration values in a free segment of Flash memory while the program is running. The first step I take consist on copying to RAM the Flash-related functions. Then, when I call them, the program gets hunged at the point when I set the bit SWE of FLMCR1. Any idea?

I thank your help in advance!

DAVE

Reply to
David Fernandez
Loading thread data ...

Be sure that all interrupts are off and that the timing routines are producing the right times.

Gerard

formatting link

Reply to
Gerard

Thanks Gerard

All checked!. Interrupts are disabled and no timing is requiered before the setting of SWE in register FLMCR1, so the origin of the problem is not located in delay routines. In addition to this, I have made sure that the Flash functions' pointers point correctlly to RAM positions and that no accés to Flash is being performed while programming process is activated.

What seems so extrange to me is that, if I comment the line FLMCR1 |= 0x40 //(SWE=1) of my programming routine (running from RAM), execution flows normally till the end of the function and returns to code in Flash. Obviously, it has no efect on Flash due to the fact that others bits of FLMCR1 are not accesible while SWE=0.

From this observation, I suspect that real problem is related to accés to the internal I/O register FLMCR1

Any more suggestions?

DAVE

Reply to
David Fernandez

He David,

Well I'm doing the same with no problems. First I had problems with the internal flash driver ( I use it for an embedded file system, st_efs, for an operating system StackTos) because of interrupts ( I thought that everything was blocked but that was not the case) but after solving this it is working very fine.

How do you debug this? with the target monitor from Hitachi?

formatting link

Reply to
Gerard

Hi Gerard!,

Interrupts seem to be all disabled (including RTE & address break interrupt). The whole number of tools I'm using reduces to HDI of Hitachi and icch83 compiler from IAR. In order to get rid of problems due to address break interrupt, what I do is to write Flash with HDI and then execute with no debuger on th H8/3672.

Just one more question: how do you realised that some interrupts were not masked, and what was the exact sign of malfunction you got?

Could you explain me the exact process you follow to transfer Flash functions' code to RAM?. I'd very gratefull if you could describe the code for internal flash driver (If you consider it's possible, of course).

Best regards,

DAVE

Reply to
David Fernandez

David,

I send some stuff to snipped-for-privacy@yahoo.es

Good luck!

for an

everything

working

so,

program

Reply to
Gerard

Hi!

Thank you very much for your interest. I'm processing the file you sent me. We'll be in touch.

DAVE

Reply to
David Fernandez

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.