Texas Instruments MSP432 support

Hello,
Mbed OS 5.15 supports the MSP432 controller from TI (see …/targets/TARGETS_TI/…).
I have written this port using the MSP432 Launchpad as a test platform.
Since this information is nowhere mentioned in the release notes, I would like to
distribute this information via this post. It would be great if other developers could
try out this port and report their experiences/enhancements.

BR, Andreas

Hi Andreas,
Thank you for your efforts, I certainly know the effort it takes to do this.
I can’t find your platform/ target page other than Targets in Mbed github.
Do you have a platform page, for instance:

https://os.mbed.com/platforms/Teensy-3-1/

What board would I get and does it have the usual Mbed DAP functionality or some other way to download/debug program code?
Also how can I do the ‘Add to your Mbed Compiler’.

For example the Teensy3.1/3.2 platform has since disappeared from the Mbed platform page along with some other platforms. So you may have a battle to get this added here.
This is understandable for the the Teensy platform due to the lack of Mbed standard DAP functionality which it simply does not and can not have. So the TI platform must have this to qualify for platform page listing.

To be perfectly honest with you TI themselves should make some effort to do this, its in their interest and would be beneficial from a commercial point for them to do so.

BR
Paul

Hello Paul,

well, there is no platform page because the typical board you use for the MSP432 (e.g. the MSP432 Launchpad https://www.ti.com/tool/MSP-EXP432P401R ) does not have the Mbed DAP functionality. TI uses their own debug interface, which supports DAP, but not the mass-storage functionality to flash the board and also not the functionality to auto-detect the device. Both would be crutial for a full Mbed integration.

I am teaching microcontroller classes on a regular basis using the above mentioned MSP432 Launchpad. TI is quite helpful in supporting academic institutions with hardware. Also they have a nice so called “eduational boosterpack” https://www.ti.com/tool/BOOSTXL-EDUMKII , which I definitely need to do s.th. reasonable with my students, because we have no sufficient lab-space at our university. I have written my own C++ -based RTOS for this platform, which works quite well. Last summer a student mentionen MBed OS, because he was doing a project with a STM32 board. So I spend some time to mostly copy-paste my own drivers for GPIO/I2C/SPI etc. and did a MBed port as a little exercise. These drivers all use the hardware directly without TIs so called DriverLib, which I personally do not like very much, because it sometimes obfuscates the functionality of the hardware and is more complicated to use than simply programming the registers. Besides that it has horrible long method names like GPIO_getEnabledInterruptStatus(GPIO_PORT_P6).
Programming a MSP432 launchpad is quite easy using TI’s DSLite tool. I simply build a MBed binary and download it with this tool, which is fast and reliable. If anybody needs help in this area I can provide support.

Yes, if TI would put some effort in MBed OS, there could even be a full support for most of their existing Cortex-M based boards. Most debug interfaces are also based on Cortex-M processors (for the MSP432 launchpad it is a Tiva-C controller). Actually I was thinking about writing another MBed port for Tiva-C,
and then try to build the DAPLink software, which might already support gcc/g++ (formerly only the ARM-compiler was supported). Doing this one could flash the debug interface itself to get a fully MBed-compliant TI microcontroller board. But since TI is obviously not taking any effort in this area, this might be a fantasy forever.

BR, Andreas

1 Like

Any good news about mso432 on mbed os?

Well, as I said in my original mail, MSP432 (launchpad) support is already contained in latest versions of mbed OS. The only thing which is needed is to manually upload the binary to the board with TI’s DSLite tool. Let me know if you need some help in this area.
Currently I don’t have the time to work on the debugging/downloading topic using mbed DAP.

BR, Andreas

1 Like

Support for MSP432 has been moved to GitHub - Terstegge/mbed-os-MSP432

Hello Andreas,

Thank you for creating this port of Mbed for MSP432, it’s very cool! I have been able to compile it, with the intention of loading it to the MSP-EXP432P401R LaunchPad board. My problem actually comes down to the xdsdfu tool required to enumerate and flash the board. Neither my Windows or Linux PCs can see the board (xdsdfu -e returns “found 0 devices.” I updated the firmware of the XDS110 using TI Code Composer Studio, and I can load programs from CCS, so there should be no problem in seeing the board. Any tips you can provide in getting the board to show up, so that I can put it in a “drag & drop” mode (using a command like: xdsdfu -c 2 -r) would be appreciated!

Thanks,
Dave

…And don’t worry about my question, I had a bad USB cable! I was successful in getting the MSP432 configured into drag & drop mode, then was able to drop the compiled mbed binary onto the mounted USB “drive” to reflash the MSP432. Some notes from my experience:

  1. Windows 10 PC w/ WSL Ubuntu 18.04. I run mbed-cli from WSL, which I used to compile using GCC_ARM.

  2. Had to install TI Code Composer Studio in order for the computer to identify the MSP432, so that I could update the firmware on the on-board XDS110 debugger.

  3. With firmware 3.0.0.13 on the debugger, open Windows Prompt.

  4. cd C:\ti\ccs1010\ccs\ccs_base\common\uscif\xds110

  5. enumerate:

    C:\ti\ccs1010\ccs\ccs_base\common\uscif\xds110>xdsdfu -e

  6. Now I switched the debugger into programming mode:

    C:\ti\ccs1010\ccs\ccs_base\common\uscif\xds110>xdsdfu -m

  7. Set it to mode 2 or 4 for drag & drop. I chose #2 b/c I want to use CCS:

    C:\ti\ccs1010\ccs\ccs_base\common\uscif\xds110>xdsdfu -c 2

  8. you gotta change the serial number to be hex only (M4321005 → 04321005) + reboot:

    xdsdfu -s 04321005 -r

  9. Finally, it pops up on the Windows desktop. I drag mbed-os-MSP432.bin to the drive, and then you can see the LEDs change… It is running the new program!

Thank you, I am very excited to have the ability to design using mbed OS on this platform.

Dave

Hello David,

great that you managed to use my Mbed port! You are the first (known) user of
Mbed on the MSP432 (except myself, of course) :slight_smile:

I did some testing on the I2C/SPI/UART parts, and from my point of view the provided
interfaces should all work as expected. Please let me know if you find any problems/bugs.

BR, Andreas

1 Like

Andreas,

Yes it’s an exciting project, and again, thanks for sharing!

So I haven’t been able to dig into this yet, but what IDE are you using with mbed? Can you debug using the XDS110 and TI Code Composer Studio (CCS) for instance? In order to get the mbed project into CCS to debug, I looked to export from mbed CLI using following command:

mbed export -i make_gcc_arm -m MSP432P401R

This (or a similar command) was successful, and it created a Makefile. But then after importing to CCS, I must admit that I was a bit lost. It did not appear that I was able to compile the project, nor run in a debug mode.

Thoughts? Or do you think I should be using a different toolchain / environment for debugging the MSP432 w/ mbed OS?

Thanks,
Dave

Hello Dave,

sorry, this reply is really late…
I am also using CCS, because the debug support in this IDE is quite good (and I was too lazy to set up a debug environment with open tools myself).
Yes, you will not be able to debug a simple Makefile-based project. As far as I can see you always have to create a CCS-project with the correct MCU selected. I solved the issue by creating a Makefile-based library (mbed) in CCS. So mbed is compiled in this project with the --library-option. After that, I created a standard CCS project for msp432, and included the mbed library as a reference in this project. I can’t remember all the details, but it worked. It has the additional advantage that my MSP432-project did not have a local copy of the whole mbed-tree, but got all necessary includes (and the library) by respective ‘exported’ settings in the above mentioned library project.
Not very specific what I am writing here, but you might get a clou.
BR, Andreas
P.S.: Did you manage to try out some peripherals of the MSP432 launchpad? Any problems?

Hi Andreas, thanks for the reply. I think that is quite clever to create a library in CCS. I would ask if you could share the library files, but I don’t want to waste your time, since I have not gone much further with the Launchpad + Mbed OS recently. A consequence of too many hobbies, I am afraid.

I have built another, custom board using STM32F405 that I was also intending to create an Mbed OS port for. I will probably take your model of using a library in the IDE to allow use of a debugger (outside of GDB). And if the project is too daunting I may go back to the MSP432 for awhile.

Until then, stay well!

Hi David, I will do my best to publish the mbed-CCS project, maybe within my existing mbed repository for
the MSP432. And yes - also too many hobbies on my side, and the winter semester ist starting soon
(creating videos etc. etc.).

Another option if you don’t want to use MSD and DAPlink, is it’s pretty easy to get mbed CLI to work with JLink to program over JTAG/SWD

Hello,

I don’t have a MSP432P401R chip to verify it but if mbed export works I think you should be able to debug with the OpenOCD (it has a ti_msp432_p4xx.cfg configuration file) using for example the QtCreator IDE.

Best regards, Zoltan