zsquareplusc / python-msp430-tools

The project provides a number of scripts to work with the MSP430 embedded processor. Such as up/download firmware with JTAG, BSL or GDB (proxy) as well as working with different formats of binaries (ihex, titext, hexdump, ELF). The full functionality is also available as Python library.
Other
23 stars 11 forks source link

msp430.bsl.bsl.BSLTimeout: could not sync #1

Open kianmeng opened 6 years ago

kianmeng commented 6 years ago

I've this development kit, MSP430 LCD Developmen​t Board MSP430 LCD KIT-C + MSP430F413 Microcontroller. Full kit documentation can be downloaded here (note some documents are in Chinese).

When running the msp430-bsl command, it can't seems to sync. Is there any way to proceed ahead to get it to work or maybe I miss something? Please advise.

$ sudo msp430-bsl -v --debug
Debug is True
Verbosity level set to 2
Python version: 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118]
pySerial version: 3.2.1
action list:
   reset()
ERROR:BSL:Sync failed, aborting...
Cleaning up after error...
Traceback (most recent call last):
  File "/usr/local/bin/msp430-bsl", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/msp430/bsl/target/__init__.py", line 516, in main
    bsl_target.main()
  File "/usr/local/lib/python2.7/dist-packages/msp430/target.py", line 724, in main
    self.do_the_work()
  File "/usr/local/lib/python2.7/dist-packages/msp430/target.py", line 695, in do_the_work
    self.open_connection()
  File "/usr/local/lib/python2.7/dist-packages/msp430/bsl/target/__init__.py", line 442, in open_connection
    self.check_extended()
  File "/usr/local/lib/python2.7/dist-packages/msp430/bsl/bsl.py", line 110, in check_extended
    self.device_id, self.bsl_version = struct.unpack(">H8xH4x", self.version())
  File "/usr/local/lib/python2.7/dist-packages/msp430/bsl/bsl.py", line 179, in version
    return self.BSL_TXVERSION()
  File "/usr/local/lib/python2.7/dist-packages/msp430/bsl/bsl.py", line 99, in BSL_TXVERSION
    answer = self.bsl(BSL_TXVERSION, "\0" * 4)
  File "/usr/local/lib/python2.7/dist-packages/msp430/bsl/target/__init__.py", line 142, in bsl
    self.sync()
  File "/usr/local/lib/python2.7/dist-packages/msp430/bsl/target/__init__.py", line 119, in sync
    raise bsl.BSLTimeout('could not sync')
msp430.bsl.bsl.BSLTimeout: could not sync
zsquareplusc commented 6 years ago

You did not specify a port. Try adding -p hwgewp://prolific or the corresponding /dev/ttyUSBx device name.

The boards seems to support BSL but has some jumpers that must be set correctly.

kianmeng commented 6 years ago

Thanks. I'm not sure what is -p hwgewp://prolific but /dev/ttyUSB0 did do the trick.

$ sudo msp430-bsl -v --debug /dev/ttyUSB0
Debug is True
Verbosity level set to 2
Python version: 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118]

Connection have been made and the timer in the LCD stop counting. Do you know what I can do next to download or upload program to the MCU? I'm new to this micro-controller stuff.