EmbDev.net

Forum: ARM programming with GCC/GNU tools lpc21isp bug


von Viliam K. (viliam_k)


Attached files:

Rate this post
useful
not useful
Hi, I tired using the lpc21isp utility to flash my ADuC7026 through the 
serial bootloader and I cam across a frustrating bug.

ADI's appnote AN-724 describes the communication protocol for the serial 
bootloader. Basically each command sent to the ADuC ends with a two's 
complement checksum of every byte after the start ID. otherwise put, the 
euqation is 0x00 - (8 bit sum of: number of bytes + sum of all of the 
bytes).
Check the bottom of page three: 
http://www.analog.com/static/imported-files/application_notes/AN-724.pdf

Here is the debug output from lpc21isp:

C:\Users\Viliam\Desktop>lpc21isp_beta -ADARM -debug ADuC2.hex com7 9600 
45000

Target: Analog Devices.
Turn on debug.
lpc21isp version 1.37
File ADuC2.hex:
        loaded...
Converting file ADuC2.hex to binary format...

<many lines containing debug info on the hex file, they are not 
relevant>

        converted to binary format...
        image size : 525024
COM-Port com7 opened...
Synchronizing
Sending '(08)'
Answer(Length=1244680): 'ADuC7026   -62 I31    (0A)(0D)'
Erasing .. Sending '(07)(0E)(06)E(00)(00)(00)(00)(00)(FFFFFFB5)'
Answer(Length=1244424): ''
Sending '(07)(0E)(06)E(00)(00)(00)(00)(00)(FFFFFFB5)'
Answer(Length=1244424): ''
Sending '(07)(0E)(06)E(00)(00)(00)(00)(00)(FFFFFFB5)'
Answer(Length=1244424): ''
Send packet failed



lpc21isp does receive the correct response from the ADuC ('ADuC7026 
-62 I31    (0A)(0D)'). However it does not send the correct packets 
afterwards.

'(07)(0E)(06)E(00)(00)(00)(00)(00)(FFFFFFB5)' is the correct packet to 
erase the first address page, but clearly FFFFFFB5 is wrong. First, it 
is not one byte, second the checksum should be B4.

I tried brute forcing the protocol with RealTerm. If I send 
'(07)(0E)(06)E(00)(00)(00)(00)(00)(B4)' I receive the correct ack byte 
'0x06'. but if I send the same bytes, but with the checksum B5, I 
receive the NACK byte '0x07' over the serial connection.

EDIT: B5 is the correct checksum, however, the FFFFFFB5 not being one 
byte is still a problem....

I hope this summarizes the problem well enough. Any ideas on how to get 
a hold of the developers to change this?

Thanks for the help,
-Viliam

PS I attached the complete lpc21isp output.

:
von Jörg W. (dl8dtl) (Moderator)


Rate this post
useful
not useful
Viliam K. wrote:

> EDIT: B5 is the correct checksum, however, the FFFFFFB5 not being one
> byte is still a problem....

I don't know that software, but it seems like a sign extension bug
to me, most likely one only affecting the printout of the debugging
information.

von Martin Thomas (Guest)


Rate this post
useful
not useful
>...
>lpc21isp version 1.37
>...
First of all try with a newer version of lpc21isp. The current version 
in the sf.net SVN is 1.79.

>...
> Any ideas on how to get a hold of the developers to change this?
>...
If it still fails it might be better to ask in the lpc21isp Yahoo group. 
As far as I remember the contributor of the AD-ARM bootloader-driver 
reads this group too.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.