2007-12-19 03:46 AM
[IAP]Problem to erase sector 2 of HDFlash with IAP Driver
2007-12-16 08:08 PM
Hi,
I'm programming an ST7 µC and i have to realize a bootloader thanks to IAP driver. But, i meet an odd problem during the call of HDFlashEraseSector(). Actually, i never leave this routine and i can observe a crash of my micro after 1s to 1.5s, following by a reboot. To define the context: - Routines of IAP driver are in the sector 0 into the flash and also the different initializations which needed, like SCI communication. - Vpp and Vdd voltage are in the the well range - Watchdog is disabled - I don't have problems to erase sector 1 before erasing sector 2 - Thanks to a scope, during the execution of HDFlashEraseSector(), i noticed that the Vpp voltage switch off when the ST7 crash appears. But, i didn't observe a reset due to LVD. Can you help me to understand reasons of such behaviour? Have you any suggestions? Below, a part of my code to erase HDflash sector:Code:
<BR>RASS_Disable(0x56,0xAE); <BR>Vpp_Enable(); <BR> <BR>//erasing sector 1 <BR>if (HDFlashEraseSector(1,8) != 3) <BR>{ <BR> aff_string(erreur); <BR>} <BR> <BR>// Check the stack: No problem->SP = 0x1F7 <BR>asm <BR>{ <BR> LD A, S; <BR> LD Nombre_octet, A; <BR>} <BR>sci_Send_Byte_Boot(Nombre_octet); <BR>//--// <BR> <BR>//erasing sector 2 <BR>if (HDFlashEraseSector(2,8) != 3) // Here, i never leave this routine and there is a reboot <BR>{ <BR> aff_string(erreur); <BR>} <BR> <BR>//--// <BR>sci_Send_Byte_Boot(0xB8); <BR>//--// <BR> <BR>//Vpp_Disable(); <BR>
If you need others informations, don't hesitate to ask me! Thanks. ;) Nicolas [ This message was edited by: nicolas_homeostasie on 19-12-2007 10:45 ]2007-12-17 04:32 AM
Nobody have an idea? :-?
Otherwise, do you know a person who is able to help me? Cheers. ;)2007-12-19 03:46 AM
Hi,
In fact, i just think of a possibility. It would seem that my PC(Program Counter) register is corrupted during the execution of HDFlashEraseSector(). Sometimes, before the end of the memory erasing, i can see my program to execute others instructions, as if it was a reboot, or sometimes it remains blocked. What do tou think of this possibiliy? And in this case, what is the reasons to obtain a corrupted PC?