BSL timeout when writing >64k ROM

Asked by Flemming Nyboe

Hello,
When programming an F2617, I get a BSL timeout when reaching >64k ROM:
----
>python msp430-bsl.py -v --progress -p COM3 --invert-reset --invert-test -i ihex -eP build\WEBSTechSR300\main.ihex.out-00003
Debug is False
Verbosity level set to 2
Python version: 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]
pySerial version: 2.5
action list:
   mass_erase()
   program_file()
   reset()
Programming...
Write segment at 0x3b00 10182 bytes
Write segment at 0x62c8 4119 bytes
Write segment at 0x72e0 104 bytes
Write segment at 0xffc0 38034 bytes

An error occurred:
timeout while reading answer (ack)
Cleaning up after error...
----
object dump:
$ msp430-objdump -h main.exe

main.exe: file format elf32-msp430

Sections:
Idx Name Size VMA LMA File off Algn
  0 .far.text 00009452 00010000 00010000 0000397c 2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .text 000027c6 00003b00 00003b00 000000f4 2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .rodata 00001017 000062c8 000062c8 000028bc 2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .data 00000068 00001100 000072e0 000038d4 2**1
                  CONTENTS, ALLOC, LOAD, DATA
  4 .bss 00000e24 00001168 00007348 0000393c 2**1
                  ALLOC
  5 .noinit 00000002 00001f8c 00007348 0000393c 2**1
                  ALLOC
  6 .vectors 00000040 0000ffc0 0000ffc0 0000393c 2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  7 .comment 00000030 00000000 00000000 0000cdce 2**0
                  CONTENTS, READONLY
  8 .debug_aranges 00000460 00000000 00000000 0000ce00 2**3
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_info 000037f6 00000000 00000000 0000d260 2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_abbrev 0000171d 00000000 00000000 00010a56 2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_line 000017fd 00000000 00000000 00012173 2**0
                  CONTENTS, READONLY, DEBUGGING
 12 .debug_frame 000003b0 00000000 00000000 00013970 2**2
                  CONTENTS, READONLY, DEBUGGING
 13 .debug_str 00000757 00000000 00000000 00013d20 2**0
                  CONTENTS, READONLY, DEBUGGING
 14 .debug_loc 000022da 00000000 00000000 00014477 2**0
                  CONTENTS, READONLY, DEBUGGING
 15 .debug_ranges 00000198 00000000 00000000 00016751 2**0
                  CONTENTS, READONLY, DEBUGGING
 16 .gnu.attributes 00000011 00000000 00000000 000168e9 2**0
                  CONTENTS, READONLY
----

Any advice would be appreciated.

Regards
Flemming Nyboe

Question information

Language:
English Edit question
Status:
Solved
For:
python-msp430-tools Edit question
Assignee:
No assignee Edit question
Solved by:
Flemming Nyboe
Solved:
Last query:
Last reply:
Revision history for this message
Flemming Nyboe (flemming-z) said :
#1

Hi again: traceback:
----------
Traceback (most recent call last):
  File "msp430-bsl.py", line 7, in <module>
    msp430.bsl.target.main()
  File "c:\python27\lib\site-packages\msp430\bsl\target\__init__.py", line 508, in main
    bsl_target.main()
  File "c:\python27\lib\site-packages\msp430\target.py", line 707, in main
    self.do_the_work()
  File "c:\python27\lib\site-packages\msp430\target.py", line 680, in do_the_work
    f(*args, **kwargs)
  File "c:\python27\lib\site-packages\msp430\target.py", line 259, in program_file
    self.memory_write(segment.startaddress, data)
  File "c:\python27\lib\site-packages\msp430\bsl\bsl.py", line 144, in memory_write
    self.BSL_TXBLK(address & 0xffff, block)
  File "c:\python27\lib\site-packages\msp430\bsl\target\__init__.py", line 478, in BSL_TXBLK
    return SerialBSL.BSL_TXBLK(self, address, data)
  File "c:\python27\lib\site-packages\msp430\bsl\bsl.py", line 65, in BSL_TXBLK
    answer = self.bsl(BSL_TXBLK, packet, expect = 0)
  File "c:\python27\lib\site-packages\msp430\bsl\target\__init__.py", line 171, in bsl
    raise bsl.BSLTimeout('timeout while reading answer (ack)')
msp430.bsl.bsl.BSLTimeout: timeout while reading answer (ack)
----------

Revision history for this message
Flemming Nyboe (flemming-z) said :
#2

Solved.

bsl.py line
packet = struct.pack('<HH', address_hi_bits, 0)
should be
packet = struct.pack('<HH', 0, address_hi_bits)
(see slau319b section 2.4.1)

As a curiosity, I also found that the AL/AH bytes of the 'Set mem offset' command are in fact not don't care, though indicated as such in slau319b. I get verification errors if they are not zero.

Regards
Flemming Nyboe