Hey,
I try to implement the communication with a GANG430 programmer in python.
To get an idea how it work i sniffed on the serial port.
There are same things I don't understand.
First: the PSA algorithm
this is the sample code in c: (from the Manual rev Q)
for (PSA = StartAddr - 2, i = 0; i < Length; i++) { if (PSA & 0x8000) PSA = ((PSA ^
0x0805) << 1) | 1; else PSA <<= 1; PSA ^= Data[i]; }
This is what i have done in python:
psa=DEF_MAIN_START-2
for i in range(0,DEF_MAIN_LENGTH,1):
if psa & 0x8000:
psa = (((psa ^ 0x0805)<<1) | 1)
else:
psa <<=1
psa ^= data[i]
I feeded my python script with the same firmeware but cann't get the same PSA checksum from sniffing the port.
Second: in the manual for the GANG430 under 3.5.10 Load Image Checksum
the bytes D9 : should be MSByte of the start address
and D11: should be LSByte of the start address
same for the length byte D12 : MSB and D14 : LSB
but I can't see this in my sniffed sample....there is D9: LSB und D11:MSB....and the same for D12: LSB -D14 : MSB
Is this a fault in the manual???
Thanks in advance.
Regards,
Kay