This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BSL [Errno 71] Protocol Error MSP4305528

Other Parts Discussed in Thread: MSP430F5528

I am getting this error when I execute "./python-msp430-tools python -m msp430bsl5.hid_1 -e -v -P ./5529_HID_echo.txt" in Linux. The device is MSP430F5528. BSL is all working in Windows on this device with the "user" option in the Python GUI from the MSP430USBDevelopersPackage_4_10_02\Host_USB_Software\Python_Firmware_Upgrader. 

I copied my TI-hex firmware to 5529_HID_echo.txt so directed by TI BSL documentation. I am assuming I need to change something in the python scripts but I don't see where. Please let me know what I need to do/look at?

  • Hello,

    Did you first try downloading the 5529_HId_echo example using Python on Linux prior to changing the contents of the text file?  Also I am confused about the  version of Python downloader tool you are using.  Are you using the one in MSP430USBDevelopersPackage_4_10_02 or the one in MSP430USBDevelopersPackage_5_00_01? 

    The version that is contained in 5_00_01 has been updated to work with Linux.

    Regards,

    Arthi Bhat

  • Hi,

    Didn't try 5529_HID_echo example first because I have a custom PCB with the MSP430F5528 so I don't know how the IO configuration will conflict.

    Using 4_10_2. I had to rename scripts from *script*.py to remove the .py and then the python install works on linux as describe in the TI documentation.

    It appear so be running, I see:

    action list:

    mass_erase()

    program_file()

    reset()

    Download full BSL...

    An error occurred:

    ***

    Thank you,

    Zach

     

  • Hi,

    Can you use the python upgrader tool that was packaged with 5_00_01.  That has been updated to work with Linux and you won't have to update the files etc...as you will have to with 4_10_02.

     

    Regards,

    Arthi

  • Hi, correction below --

    Didn't try 5529_HID_echo example first because I have a custom PCB with the MSP430F5528 so I don't know how the IO configuration will conflict.

    --Using 4_10_2 on Windows, for Linux I downloaded Python_Firmware_Upgrader-5_00_01.zip. I had to rename scripts from *script*.py to remove the .py and then the python install works on Linux as describe in the TI documentation.

    It appear so be running and prints->

    action list:

    mass_erase()

    program_file()

    reset()

    Download full BSL...

    An error occurred:

    ***

    Thank you,

    Zach
  • Thanks,

    I double checked and I am running with Python_Firmware_Upgrader-5_00_01.zip. What else should I do?

    Zach
  • Hi,

    What *scripts*.py are you re-naming?  Can you give me the directory or the filename you are changing?  Also which TI documentation are you looking at?

    Regards,

    Arthi Bhat

     

  • Yes,

    Documentation at:

    Python_Firmware_Upgrader/release_Notes_Example_Python_Firmware_Upgrader.html

    and

    pypi.python.org/.../python-msp430-tools



    The scrips I had to rename because they were reported as missing with the .py:

    msp430-bsl-fcdprog
    msp430-bsl-fcdprog.py
    msp430-bsl-legacy
    msp430-bsl-legacy.py
    msp430-bsl-telosb
    msp430-bsl-telosb.py
    msp430-bsl.py
    msp430-compare
    msp430-compare.py
    msp430-convert
    msp430-convert.py
    msp430-downloader
    msp430-downloader.py
    msp430-gdb
    msp430-gdb.py
    msp430-generate
    msp430-generate.py
    msp430-hexdump
    msp430-hexdump.py
    msp430-jtag
    msp430-jtag-legacy
    msp430-jtag-legacy.py
    msp430-jtag.py
    msp430-ram-usage
    msp430-ram-usage.py
    msp430-tool
    msp430-tool.py


    -Zach
  • I am not sure I understand why you had to install and re-name those files...because you should not have to.  Once you have unzipped the MSP430DevelopersPackage_5_00_01 you should be able to bring up a terminal window and run the command as listed in the release_notes_Example_Python_Firmware_Upgrader.html file.  

    What version of Python is installed on you Linux box?  Does it have tkinter installed also?  What is the version of your Linux box?

    You can try downloading the .txt file using the GUI (without all those file changes):

    From a terminal window type in the command: 

    sudo PYTHONPATH=./python-msp430-tools python TargetGUI.py

    This should bring up a GUI. Then click on File->Open User Firmware and select your updated file.

    Let me know if that works.

     

     

     

  • Linux Box Rev.

    Ubuntu 12.04.3 LTS
    Kernel = 3.0.101+

    The GUI has the same error:

    Opening HID device '/dev/hidraw3'
    Mass erase...
    Download full BSL...
    Programming...
    Programming: OK
    Exception in Tkinter callback
    Traceback (most recent call last):
    File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1413, in __call__
    return self.func(*args)
    ...
    #10 line left out here
    ...
    File "home/linaro/Documents/Python_Firmware_upgrader/python-msp430-toos/msp430/bsl5/hid_1.py", line 237, in write_report os.write(self.hid.device, data)
    OSError: [Errno 71] Protocol error
  • You might want to check the port permission on the port attached to your device.  The error could be happening because the tool cannot write to the port.  So here is something you can do:

    • Bring up terminal window and type in:  ls /dev/hid*
    • Connect the msp430 device to USB port and re-type in:  ls /dev/hid*
    • Note the difference in result between the two steps listed above. 
    • Change permission on the HID port as follows:
              sudo  chmod  0666   /dev/hidrawX      (where X is the number assigned to the HID port connected to the msp430 device).

  • Same results. ls /dev/hid* in both cases comes up with /dev/hidraw0 thru 3, the GUI only recognize /dev/hidraw3, so I put the chmod 0666 on that one, and it's called out by the GUI just before the error.
  • Well, you  might need to debug why the data is not being written.  You could put in some print statements to verify that the HID device is the correct one and then look at the data being downloaded.  The other thing you can do is dowload the example (demo) 5529_Hid_Blink or 5529_HID_CDC.txt files as is without any changes to see if these files get downloaded without error.  Yes the Blink LED example might not work since your IO ports might be different however if the information gets downloaded without error then the updates to the 5529_Hid_Echo.txt file might need to be examined.

    Regards,

    Arthi Bhat

  • The original 5529_Hid_Blink.txt unmodified has the same error, plus my custom.txt file works in the same GUI in Windows. What do I need to print out in python, in which file?

    Thanks,
    Zach
  • Hello,

    Please continue to help me run this problem to ground for the "protocol error" with the Python firmware upgrade BSL in Linux. Everything else in my prototype with the MSP430F5528 works and our client is anxious to get to production quantities and the last requirement is BSL in Linux. It was suggested I print out some specifics in the Python scripts. Please let me know what I should prints and where it is located in the files. Any other suggestions are appreciated.

    -Zach
  • You can put in debug statement in hid_1.py file just before function call:

    self.write_report(txdata)

    and another one in function:

    def write_report(self, data):

    in the class:

    class HIDBSL5(HIDBSL5Base):
            """\
            HID support for running on Linux (systems with /dev/hidraw*).
            """

    The debug statements can be:

    self.logger.debug(self.hid_device);

    self.logger.debug(data);

    The logger statements should log the info to the GUI.

    If you can send the python-firmware-downloader folder (the one you are using...the one that is giving you the error) along with your text file that you are downloading I would like to verify if I can reproduce the error on my linux box.

    Regards,

    Arthi Bhat 

  • Arthi Bhat,

    Thank you.

    I don't see in this forum how to attach my files? Do I need your email address? 

    Zach

  • When you do a reply, in the tool bar you should see an icon of a paper clip.  That should allow you to attach documents to this message.

    You might want to zip the Python-Firmware-Upgrader folder first.

    Regards,

    Arthi Bhat

  • Please see here how to attach files to posts: e2e.ti.com/.../148.4-5-attaching-a-file
    Please see also how to post if the Reply button is not appearing for you: e2e.ti.com/.../3175.4-7-help-not-seeing-any-reply-buttons-on-a-forum-thread
  • Thank you. It seems like want I needed was to reboot the linux box after the python msp430_tools install.Python_Firmware_Upgrader.zip

**Attention** This is a public forum