python-msp430-tools icon indicating copy to clipboard operation
python-msp430-tools copied to clipboard

msp430.bsl.bsl.BSLTimeout: could not sync

Open kianmeng opened this issue 7 years ago • 2 comments

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

kianmeng avatar Jul 24 '17 13:07 kianmeng

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.

zsquareplusc avatar Jul 24 '17 23:07 zsquareplusc

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.

kianmeng avatar Jul 25 '17 14:07 kianmeng