EmbDev.net

Forum: ARM programming with GCC/GNU tools lpc21isp bug


Author: Viliam K. (viliam_k)
Posted on:
Attached files:

Rate this post
0 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/applic...

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.

:
Author: Jörg Wunsch (dl8dtl) (Moderator)
Posted on:

Rate this post
0 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.

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 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.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.