2003-01-21 09:18 AM
2011-05-17 02:32 AM
I had some trouble figuring the ''Flash Protect'' registers - I worked
from an AppNote (AN1275) that gave example in-application-programming, and it had some code to prepare the Flash for reprogramming. In this code, I found that the ''calls 230038h'' crashed on the emulator - no testflash? I cannot find any documentation on the testflash routines and what they do - is there any? [ This message was edited by: Romain on 22-01-2003 08:55 ]2011-05-17 02:32 AM
You are correct : no TestFlash on the emuchip, see previous discussion : ''ST92F120 code running with emulator not with device ?''
This is why this call to the TestFlash (calls 230038h) crashes your debugger. For your information, this calls to the TestFlash allows to execute a subroutine that will temporarily disable the access protection to this Test Flash. This way, the user can temporarily set high some bits from the protection registers and therefore temporarily unprotect any memory... Regarding your second question, it seems that you are lucky : there is a new application note since last month that talks about the TestFlash. See AN1528, ''ST92F120/F124/F150/F250 TESTFLASH'' Jojo [ This message was edited by: Romain on 22-01-2003 08:58 ]2011-05-17 02:32 AM
Jojo
You are wrong. Testflash is in emulation chip. On emulation chip only one control bit allows to enable/disable all internal Flash memory (i.e sectors F0, F1, F2, F3 and testflash and FlashOTP). So, to be able to run/display testflash routines in seg 23 you need to map sectors F0,F1,F2,F3 (000000-01FFFF) and testflash (230000-231F7F) and FlashOTP(231F80-231FFF) as internal. Once it is done you program should runs. You can set breakpoint on 230038 and use step. Pierre Tarayre2011-05-17 02:32 AM
You are right, Pierre. It works
Thanks for the tip Jojo