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.

Using printf with RM42 Launchpad on MacOSX (El Capitan)

Other Parts Discussed in Thread: LAUNCHXL-RM42, HALCOGEN

Hi,

I've tried multiple ways to print from the RM42 launchpad to my Macbook Air without success.

1) Using the standard printf, I followed these steps for using printf and CIO in CCS. The code builds and flashes with no problem, but I do not see the CIO option in the available consoles so I am unable to view "hello world" when I call printf("hello world").

  

I previously posted in the Hercules Launchpad forum and it seems that this is a problem specific to CIO with the Mac version CCS. I pasted the feedback below for reference.

"The Wiki Page MacOS X CCSv6 Beta says: C I/O does not work on ARM based devices due to a known issue with conditional breakpoints." - Chester Gillon

"the Mac OSX port of CCS is still being developed, and our team hasn't used it yet. So we are very limited in what we can do to help. 
Chester's recommendation to ask on the CCS forum is the best idea I think because there should be one or two people on that forum w. Mac." - Anthony F. Seely

So I am posting here in case anyone has run into this problem and has a solution.

2) I also tried using UART and SCI from the ADC Example. I get the code flashed to the board, but run into the same problem of being able to view the output. On slide 23 when it says to open a terminal to view the output, I followed the steps for the terminal built into CCS. When I edit the settings and change the connection type to serial I get a cannot initialize serial error: "the RXTX library has not been installed".

When I try to install it I get the error: 

"Cannot complete the install because one or more required items could not be found.
Software being installed: RXTX End-User Runtime 2.1.7.4_v20071016-7B57e7UAXMAAqGAGf (gnu.io.rxtx.feature.group 2.1.7.4_v20071016-7B57e7UAXMAAqGAGf)
Missing requirement for filter properties ~= $0: RXTX End-User Runtime 2.1.7.4_v20071016-7B57e7UAXMAAqGAGf (gnu.io.rxtx.feature.group 2.1.7.4_v20071016-7B57e7UAXMAAqGAGf) requires 'gnu.io.rxtx.macosx [2.1.7.3_v20071015]' but it could not be found"

I have not been able to figure out how to install the dependency.

2.5) So then I tried to get an external terminal program running to view the SCI output from the board. The problem I ran into here was I could not find the device being recognized by my computer. Both ls tty.usb* and ls cu.usb* in the terminal returned no resulted. I tried installing the FTDI drivers for OS X http://www.ftdichip.com/Drivers/VCP.htm. The installation completed but I saw no change in the recognized devices. Following the step in the installation guide (which refers to an older version of macOSX) I got up to page 4 where the drive installs successfully, but the I still have no USB devices in /dev/cu* and /dev/tty*. I also looked in system information and these were the only usb devices that showed up: 

so I am stuck getting my computer to recognize the board and getting the CCS terminal working for serial for the SCI option and I cannot open a CIO console for the standard printf option. From what I understand the CIO console only opens if CCS is receiving CIO data from the board.

Any ideas of how I should proceed? I've also tried both SCI and standard printf with demo code that flashed to my board out of the box. Every time I ran into the same problem viewing the "hello world" message in a terminal. I wonder if this is a MacOSX specific problem? 

Thanks so much! Please find my specific version numbers below if it will be helpful.

Alex

System Version: OS X 10.11.1 (15B42)

Code Composer Studio Version: 6.1.1.00027

Board: LAUNCHXL-RM42 REVB

  • Alex,

    As Chester mentioned CIO is not working in the MacOS beta right now. There is an update putting together that may resolve this. I have my environment setup with an RM46 (couldn't find an RM42) setup to test it out. Once I have tested it and figured out if it corrects the issue I will let you know. If it works fine it would be live today.

    Regards,
    John
  • For #2 this will take longer to solve as we need to find an alternative solution that works on MacOS. Currently that is planned for CCSv6.2 e/o March. Hopefully when we have #1 fixed that will help with what you need.

    John
  • I tried out the fix for the CIO problem and it works for me. It will be broadly deployed later but for now you can installed by doing the following.

    Go to Help -> Install New software
    In the box for the update site enter software-dl.ti.com/.../
    Select the update in the list that appears and click next, accept the license...
    It will download the update and prompt you to restart CCS.
    When it restarts it will install the update and then exit
    Start CCS
    For me it prompted me to update the firmware on my XDS110 when I launched my debug session. I let it do the update.
    Now CIO works for me

    Regards,
    John
  • Thanks John! I appreciate the help. I installed the update and restarted CCS. It did not ask to update the firmware on my RM42Launchpad but flashed with no problems. However, I still ran into the same problem being unable to see C/IO in the console. I attached my project so you can take a look, but I don't think I've missed any steps. I have the code for printf and sciSend in my main method. I tested printf by adding a call at the very beginning of the main method. I used an absolute path to the include folder so you might have to add your include path to get it to compile.

    Update
    I also got my hands on a windows computer yesterday and was able to get sciSend() to work receiving on the CCS terminal. Are there no drivers for Mac for the RM42 launchpad that I can install? I saw a TI post on MSP430 drivers: e2e.ti.com/.../198722
    Since I can receive SCI with any terminal application I just need to work out the driver problem to read the output from the board with my Mac.

    CAN_Example.zip

  • Alex,

    You could try in the Hercules forum to see if they have drivers but I am doubtful.  We are just starting to roll out software on MacOS so I don't think they are available yet.

    I don't see CIO with our example.  I have my own that I also generated from Halcogen and it works.  It is attached if you want to give it a try.

    rm42cio.zip

    I thought maybe the issue with yours was with the size of the stack or heap but increasing them didn't help.

    I commented out the sci init calls and the while(1) loop in your example but still no luck.

    I changed #include "stdio.h" to #include <stdio.h> no luck.  Just trying different things at this point.

    I commented out the _enable_interrupts line.  Then it worked!

    So CIO will work but something with that code is conflicting with it.  I will ask one of our compiler members if they can think of why.

    Regards,

    John

  • Thanks again John! I was able to get it working using your tips.

    I ended up only needing to comment out the line "while(tx_done == 0){};" to get it to work. No idea why this was causing problems. It is placed after the printf() line. The code hangs at this point because I do not have the board connected to a CAN bus. Tx_done is set to 1 when the rx line reads the transmitted value, which cannot happen without the bus connected. My only guess is that the code waiting in the while loop somehow prevents the printf interrupt from occurring, but that doesn't make sense to me since this loop happens after printf() is called. Does printf() work asynchronously? Oddly enough commenting out the enable_interrupts line did not solve the problem for me. CAN requires that command to work as far as I know. I wonder if not calling it broke the tx_done functionality on your setup.

    I really appreciate the help. Would not have been able to get it working without you. Let me know if you figure out more info on the conflicting code.