making an application updateable using IAP in P89LPC936?

Started by Sarsam NL, April 29, 2005, 05:43:38 AM

Previous topic - Next topic

Sarsam NL

I want to write it but need alots of help. I am not so experienced into ASM and also about bootloaders. If anyone can help me writing such a ISP-loader. I think it is very important. Nowdays the programs has to be updateable and you dont want to lose your hard effort on writing an update and somebody can tap it and place it into a copy of the device, and your hard work is lost. To prevent, there must be a program written such as that one of ATMEL's.
Best regareds
Sarsam

Sarsam NL

Dear Andy,.
Thanks again,
Could you provide me more details about the FLASHMAGIC just in time module. I could not find it here at the site.
another question, I use LPC935 and i tried to update the ISP-loader and a bit modified. I changed the asm file of the LPC_ISP_8KV03.a51, where the bytes are been stored, there i just manupulated the data by Xoring the data with #34 to make the Hex file uploaded not easy readable to others. and then it writes it to the flash. when programming i disable the "protect ISP" and then choose "erase blocks used by the HEX file". FM even asks if i am sure while overwriting ISP and I type yes. After update, the ISP should respond as downloading the file but each single byte should be XORed by #34 but the program that i run just works perfect, even without modifing it in the HEX file. So a bit strange. Hope you have more suggestions, i modified the a51 file here,
LCMD:
   MOV   R5,#0   ;begin record... zero checksum
   ACALL   ECHO      ;get first char and echo
   CJNE   A,#':',LCMD   ;record starts with ':' char
   ACALL   GET2      ;get the number of bytes in record
   MOV   NBYTES,TMP3   ;and save
   ACALL   GET2      ;get MSB of load address
   MOV   ADR1,TMP3   ;and save
   ACALL   GET2      ;get LSB of load address
   MOV   ADR0,TMP3   ;and save it
   ACALL   GET2      ;get record type
   MOV   RTYPE,TMP3   ;and save it
   MOV   A,NBYTES   ;else, more than
   MOV   R2,A   
   JZ   EOR      ;zero data bytes ?
   MOV   R1,#DBYTES   ;pointer for data bytes
LDATA:   ACALL   GET2      ;get data byte
   MOV A,TMP3;After GET2 is called it stores the byte to TMP3   XRL  A,#34;XOR the data 34(decrypt the data)
   MOV TMP3,A;move it back to TMP3
   MOV   @R1,TMP3   ;store it
   INC   R1      ;and bump up the pointer   
   DJNZ   R2,LDATA   ;repeat if more bytes in record


Jan Waclawek

Sarsam,

You are on the right track.

The problem might be in this line:

MOV A,TMP3;After GET2 is called it stores the byte to TMP3   XRL A,#34;XOR the data 34(decrypt the data)

If you place the XRL after any ";"  (i.e. after the comment),  it becomes a part of the comment.


Try

        MOV A,TMP3;After GET2 is called it stores the byte to TMP3
   XRL A,#34;XOR the data 34(decrypt the data)
        MOV TMP3,A;move it back to TMP3


Jan Waclawek


Sarsam NL

Thank you Jan,
I am sorry was my mistake, actually while copy pasting this was taken wrongly over as the line was as you suggested. I XOR it as it is mentioned, if you or anybody else can take a look at the ISP code written by philips for the LPC family. There i modified it but the loader places the right bytes at the right places so the data does not become currupted as i hoped. I am not familiar with these ISP codes. I am really stuck.
Anyhow i am researching all methods possible as LPC is my best choice.
Best regards,
Sarsam