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.

MSP430F5527: Python USB Firmware Update software not working

Part Number: MSP430F5527

Hello,

I am a graduate student working on a laser system control board built around the MSP430 that is used in a project across multiple universities. I am in charge of managing the firmware and hardware, and am looking into ways to get firmware updates to boards at other universities in an easy manner. I have found that the MSP430 we are using supports a firmware update through the BSL over USB, which is ideal for our project because we already send data to a host computer through USB, and if that same cord can be used for firmware updates, that eliminates the need to distribute debuggers to each team or collect the boards to update them.

In looking into this, I first discovered slaa452c which goes over how to do this. Unfortunately, some people on other teams use Mac computers, so the Microsoft Visual Studio approach with the .NET framework will not work for us. I then found this post though that seems to convey that this approach is no longer supported, and a python tool is now supported instead which is cross platform (yay).

e2e.ti.com/.../msp430f5529-usb-firmware-update-using-ti-visual-studio-project

I then found the "Python Firmware Upgrader Tool for MSP430 MUCs" document which is located in the USB developers pack in the folder for host to MCU software. On paper, this seems like exactly what we need, so I started looking into using it. I work on a Mac so started on that, even though I have access to Windows computers if needed. The first thing that I realized when following the instructions in the release notes is that the TargetGUI.py code does not run with python3, as the syntax of prints is slightly different and it throws a bunch of errors (and I am sure there are many other things that make this incompatible with python3). I then used pyenv to set up my environment to python2, and still run into issues. What is seems to come down to is the hid.py file that imports hid (from cython-hidapi I think?). The error I am getting is shown below.

Traceback (most recent call last):
  File "TargetGUI.py", line 67, in <module>
    import hid
  File "build/bdist.macosx-13.2-x86_64/egg/hid.py", line 7, in <module>
  File "build/bdist.macosx-13.2-x86_64/egg/hid.py", line 6, in __bootstrap__
  File "hid.pyx", line 418, in init hid
AttributeError: 'module' object has no attribute 'finalize'

I have tried this with different python versions at this point, I have installed Cython and Cython-hidapi with pip, as well as installing them from their git-hub repo's (with a clean uninstall and reinstall of python in between). I have also tried changing hid to hid_1 or vice versa in the lines where the program is crashing, as the terminal output seemed to point to that as the issue, as well as a note in the release notes that states:
"Hid.py filename in the msp430-python-tools directory conflicted with the hid.py filename in cython-hidapi module during a calls to import hid. In order to resolve this conflict, hid.py has been re-named to hid_1.py and the original hid.py included as hid_original.py in the msp430-python-tools directory."

I also found the following post and followed what they did, and managed to get the python-msp430-tools running, but when I follow these steps I still get errors. I have also tried replacing the folder containing the tools that is distributed by TI with one pulled from the most recent github commit, and still could not get it to work. With that being said, right now the documentation says in section 5.2.3 of the python tool guide that "Python is available for the MacOS, but the Upgrader has not been tested on the Mac.", but to my testing, it doesn't actually work on Mac. I think leaving this section in is misleading unless TI successfully can make this work, which I have not been able to find in my research.

e2e.ti.com/.../msp430f5659-msp430f5659-python-firmware-upgrader-setup-fails-again

I then moved to a Windows computer to continue my work, and was able to upload over USB with the provided precompiled .exe program that is contained in that folder, which shows that our hardware works and the board is able to be programed over USB with the BSL. I then went to try to customize the GUI on windows, and started by trying to run the GUI with python instead of the .exe, and when running "python setup.py install" in one of the required packages (distribute), I ran into a number of errors.

Overall, the application report on this python firmware update tool is from 2013, and I think the software ecosystem has changed enough since then that someone from TI should look into it and update that document, as well as the release notes, to reflect the current state of things and what steps are needed to make this work. In the meantime, if anyone could give advice of where to proceed from here that would be great. Our board has 5 MSP430's running different firmware, and customizing the GUI to be able to correctly flash the correct program to each is the ultimate goal, to remove any confusion on the other teams.

Thanks,

-Max Thoburn

  • Hi Max,

    Could you share the link where do you get the document "Python Firmware Upgrader Tool for MSP430 MUCs"? I can try to connect with the author and check what we can help on your question. 

    Best regards,

    Cash Hao

  • Hey there,

    https://www.ti.com/tool/download/MSP430USBDEVPACK/5.20.07.01
    On this page, if you download the USB Stack and Examples folder, and from there go into the "Host_USB_Software" folder, there is a folder called Python_Firmware_Upgrader which has the files I am referencing. You can also download just that folder from the downloads page linked above. Inside this folder, there are the release notes as well as the "Python Firmware Upgrader Tool for MSP430 MUCs" document in a folder called "doc". Is that what you are looking for?

    Many thanks,

    -Max Thoburn

  • Hi Max,

    I found this document. And some more things I found in the “release_Notes_Example_Python_Firmware_Upgrader” about the requirements. You mentioned the python version in the thread. You can refer to the below information about it. 

    Well, I did not find who wrote this document. However, I also noticed that in the support section in the release not. You can email to the msp430 SW and ask for help through msp430ware@list.ti.com 

    Best regards,

    Cash Hao

**Attention** This is a public forum