HARSFEN0602
In order to download a program image to the Dama, follow the steps below.
- Read the location (loc) and the length (len) of the user code partition from the
main TOC. For this, use the LP[3] and the LP[4] commands.
- Verify that your image block will fit inside the allocated space.
- Clear the program flash, using CP
- Download your image file by the sequence
LP[1]=loc;
DL##…100 bytes of payload
LP[1]=(loc+100)
DL##…next 100 bytes of payload
.. Until the end of the image
- Use the CC=checksum command to declare end of loading and to verify entire
download process.
In order to upload a program image from the Dama, follow the steps below.
- Read the location (loc) and the length (len) of the user code partition from the
main TOC. For this, use the LP[3] and the LP[4] commands.
- Upload your image file by the sequence
LP[1]=loc;
LP[2]=100
Use LS to get next 100 bytes of payload
LP[1]=(loc+100);
Use LS to get next 100 bytes of payload
.. Until the end of the image
6.3.4 Uploading a Program 6.3.4.1 The LS command
A program that resides in the Amplifier Flash can be uploaded for backup or for further editing. This option
is disable when program is running. After program uploading, user can correct it and returns to the
compilation step.
The LS command executes uploading a program.
Uploading from a non-protected area in the Flash goes as follows:
LP[1]=start;
LP[2]=payload net length
xxxxxxxxx<ESC>CS;
where above xxxxxxxxx denotes the escape-sequenced data payload.
Start denotes the byte address in the user program flash.
CS denotes the 16 bits checksum for the message.
Possible Execution Failures:
1) LS sequence (including <ESC>’s) exceeds 200 characters. The LS output will be terminated
with proper checksum and terminator. The data transmitted in the payload is good and meaningful,
only not to the expected length.
The 200 bytes limit is due to internal Dama buffer management.
6.4 The program execution
Note: In this step of Harmonica’s development we disable possibility to run more than one task, the virtual
machine, simultaneously. But in the future, this feature will be possible.
The following paragraphs describe how to run a program.