Windows platform compiler and IDE

Hi Megan,

Thanks, its working now. To summarize: Cygwin can be used as a framework for freedom-e-sdk on a Windows platform. All that is necessary is to assure that before cloning, the global Git parameters are set to support symlinks and to conserve the POSIX line ending LF (i.e. not converting to CRLF).

Best regards,
Donnie

1 Like

Great!

Were you able to successfully upload a program with OpenOCD on Windows? Wondering if there are any gotchas there.

Not yet, but it is not a Cygwin issue. I get the exact same responses in Cygwin as in Ubuntu when trying to connect:

Now watch me blush as I confess that I have not yet figured out how to resolve the problem I am having with the openocd.cfg file. I am guessing that I need to replace the target setting from “extended-remote localhost:3333” to something relating to my Olimex debugger, but I don’t yet know how. Here is what lsusb is telling me:

Any hints?

That should work fine, the correct openocd.cfg file should be picked for your board. However, you need the correct setup to have the device recognized and for you to have permissions to write to it with OpenOCD.

I’m working on writing better instructions for this in the Getting Started Guide. Here is the “draft” version, if you care to give it a try:

  • With your board’s debug interface connected, make sure your device shows up with the
    lsusb command (The example is for HiFive1, for the debugger on Arty you will see Olimex Ltd. ARM-USB-TINY-H)

    lsusb
    …
    Bus XXX Device XXX: ID 0403:6010 Future Technology Devices
    International, Ltd FT2232C Dual USB-UART/FIFO IC

  • Set the udev rules to allow the device to be accessed by the plugdev group:

> sudo vi /etc/udev/rules.d/99.openocd-rules

Add the following lines and save the file (if they are not already there):

SUSBSYSTEM==``usb'', ATTR{idVendor} == ``1b5a',
ATTR{idProduct}==``002a'', MODE=``664'', GROUP=``plugdev''

SUBSYSTEM==``tty'', ATTRS{idVentor} == ``1b5a'', ATTRS{idProduct}==
``002a'', MODE=``664'', GROUP=``plugdev''
  • See if your board shows up as a serial device belonging to the plugdev group:

    ls -l /dev/ttyUSB*
    /dev/ttyUSB0 /dev/ttyUSB1

(If you have other serial devices or multiple boards attached, you may have more devices
listed). For serial communication with the UART, you will always want to select the higher
number of the pair, in this example /dev/ttyUSB1.

> ls -al /dev/ttyUSB1
crw-rw-r-- 1 root plugdev 188, 1 Nov 28 12:53 /dev/ttyUSB1
  • Add yourself to the plugdev group.

> sudo useradd <name> -G plugdev

  • Log out and log back in, then check that you’re now a member of the plugdev group:

    groups
    … plugdev …

Now you should be able to access the device without sudo permissions

Actually looking at your error above, I think the problem is just that your BOARD variable should be “freedom-e300-arty”, not “freedom-e300-arty-dev-kit”. We shortened the name some time back. Please let me know if there is any existing documentation that has the long name.

Megan

Hi Megan,

I still seem to b e off track:

Still needing some help.

Update: until now, I had been powering the Arty via USB connector. I thought that the UART might be interfering with the debugger, so I switched to powering via wall wart and get a different response:

Uploading…

Still not looking very good, I think.

Ah! I now see LED1 light up green when starting the debug make, so obviously I must have connected. I will try it now using Cygwin.

Does not look so good using Cygwin. Subdirectories /udev/rules.d under /etc did not exist, so I naively created them before adding file 99.openocd-rules. The Olimex debugger is listed under lsusb, but there are no ttyUSB devices under /dev. I searched the web but could not find anything helpful.

I’m guessing that there is no easy solution for this.

Hi Megan,

The “1b5a” VendorID looks like a typo - on my Ubuntu it appears under lsusb as “15ba”

Best Regards

My web searches seemed to hint at a bad HW connection, so I rechecked the connections between the debugger and the Arty, but found no errors. I then hooked up a logic analyzer to port JD and could see bits toggling on TDI, TCK and TDO and alas! the debugger connected successfully:

I then tried again to connect using the Cygwin platform, but with no success. As expected, no activity on TDI, TCK or TDO. Cygwin is not finding the USB connection.

Thanks Donnie.

So, to summarize:

  • following the instructions above (after fixing my typo) worked for you on Ubuntu
  • Trying to make the same changes on Cygwin didn’t work, and you can’t communicate with the Olimex debugger on Windows through Cygwin

Well, I’m not too sure. I only got it to work once. After failing under Cygwin, I tried again under Ubuntu, with no success. My ttyUSB has dissappeared:

Rebooting both Windows and VirtualBox Ubuntu did not help. I think I will move to a dual boot Ubuntu installation.

Hi Megan,

This problem might only relate to Ubuntu running on VirtualBox. I found out that I must have another USB device connected in order to have the ttyUSB devices activated. The Olimex alone does not trigger the relavent modules. But, the additional USB device must NOT be the shared USB/JTAG port on the Arty. Having worked that out, I can now use the debugger on the Ubuntu VirtualBox platform.

You may want to test this on a native Linux installation. I don’t yet have one laying around.

Hi Megan,

Good news - after installing openOCD within Cygwin I was able to make connection to the Arty using the Olimex debugger make:

To install openOCD in Cygwin I followed (to some degree - seems fairly outdated) the relevant installation steps shown here , adjusting for newer package versions where applicable.

Any other points fall into mind regarding Windows platform usability I ought to check?

I spent a few days trying to get the Arduino IDE to run under Cygwin, and at last succeeded by using ant. However, when I try to install the SiFive boards via the Board Manager, I get an error (“the tool openocd is not available for your operating system”) which I have not been able to solve:

Can someone provide some help here?

Many thanks

Arduino IDE checks your platform to know which versions of the precompiled binaries to download. The message means your platform (windows) isn’t supported. Right now we’re only officially supporting Linux, with macOS coming soon.

Since I am starting the Arduino IDE under Cygwin and openocd is working correctly under Cygwin, I was expecting it to look for and run openocd under Cygwin (the Linux flavor of openocd). Is there a way to have Arduino IDE tweaked to recognize Cygwin as the active OS? (I´m very weak in Java.)

Openocd just happens to be the first tool in the list. You’d get the same error for all the tools.

The easiest thing to do with your setup since you already have freedom e SDK compiled is to do a manual install of the Arduino package (without the package manager). The instructions for that are in the README of what I just realized is still a private repo for the actual Arduino package source. Will update here next week with the instructions.

Great! Thanks.

The repo is now public. You could follow the “Manual Install” instructions of the README to likely get it working in your Cygwin setup. Let us know how it works for you!

Hi Megan,

I followed the instructions in the readme, but I don’t seem to be getting it right. I installe Arduino-1.6.12 on Windows, cloned the cinco git, exported the PATH with my freedom-e-sdk binary and setup the symlink. to cinco/hardware sifive.
After starting the Arduino IDE and trying to install the SiFive boards, I get an error saying openOCD is not available:

openOCD is installed and working under Cygwin, but I haven`t figured out how to point the Arduino IDE to it. Can you give me another pointer?

Many thanks for you help :confused: