2003-02-26 12:01 AM
Emulation of In Application Programming and E3 subroutines
2011-05-17 02:32 AM
When entering in debug mode, the ST9 emulator is designed so any user
code is dumped into an emulator's RAM (system memory) rather than the emuchip's internal Flash memory (internal memory). Does anyone know how to dump and execute code in Flash memory and be able to read code and data in Flash and E3 memories using the emulator ???2011-05-17 02:32 AM
This has to be performed in 2 steps :
1. While in debug mode, define the memory areas type : system or internal memory. For instance, you can associate your Flash sector 1 to the emulator's internal memory (Flash sector 1 of your emuchip : that's a real Flash memory) rather than the system memory (emulator's RAM). This operation only needs to be perform once. 2. Then EACH TIME you modify the content of an internal memory, you will need to request a memory update (or memory load into the emuchip) So after this code modification : a. Compile your code b. Go into debug mode c. Click on the ''console'' tab menu inside the ''output'' window d. Type ''load'' then enter Any memory area defined as internal will then be updated with the new content. This load from the emulator's RAM to the emuchip Flash/E3 memory is not done automatically by the emulator when switching from editor mode to debug mode. That way you don't reprogram the emuchip memory unless it is really necessary (number of write/erase cycles is limited on the emuchip memory). Thanks to this 2 steps you will be able to debug any IAP and E3 programs Take care, Jojo2011-05-17 02:32 AM
For IAP in general, I will advise you to take a look at the AN1275 ''ST9 In-Application Programming for the ST92F120''. This application note can also be used for the ST92F124, F150 and F250.
Breizh2011-05-17 02:32 AM
Concerning the E3, the emulator uses by default the emuchip internal E3 so you do not have to think about it.
I suggest also to have a look at the readme_flash.txt file in the downloader directory of the STVD9 V6 toolchain, for instance : ''C:\ST9PlusV6.1.6\downloader\st92f150-emu2\v1.03''2011-05-17 02:32 AM
When you go from editor to debugger your program is automatically reload in emulation memory (if memory is mapped as system) or in ST9+ internal memory (if memory is mapped as internal).
note 1: V6.1.7 handles far better the flash internal memory (no more hang-up) note 2: problem to trace internal memory data. ST9+ internal data bus is not output during read operation. It is impossible to trace it. Indeed, when memory is mapped as internal it is data from emulation memory that is traced. So to trace your program you need to load it two times, first in emulation memory (memory mapped as system) and second in ST9+ internal memory (memory mapped as internal). This problem will be removed on downloader release V1.05 for ST92F150 that will be available soon. [ This message was edited by: Romain on 22-01-2003 09:02 ]2011-05-17 02:32 AM
The readme_flash.txt states that: ''flash sector is erased when first address of the sector is writen, so in each sector your program must start at the first sector address''.
That means that, if the program starts at the first sector address of the writen sector, at each entry in the debug mode, the internal flash sector will be erased and reprogrammed.2011-05-17 02:32 AM
In another words, be aware that the emuchip Flash and E3 indurance is limited so select the internal memory option only when necessary.
Otherwise, you gonna toast your emuchip pretty quickly if you use your emulator intensively. Skywalker2011-05-17 02:32 AM
In addition, do not execute memory protection code with the internal flash memory mapped as internal, otherwize you will have troubles in further applications as the emuchip will be protected.