I successfully used gcc compiler cc3200 demo run in BPI G1


[tr][td]I got a BPI G1 development board, and succeeded in ubuntu14.04 running demo, I will share my experiences and joy

  1. Download cc3200sdk
    download SimpleLink Wi-Fi CC3200 Software Development Kit (SDK), but is exe format, so I can only be installed in the windows, and then copy it to linux

  2. Configuring the LaunchXL JTAG Debug Interface
    The debug interface is provided by an FTDI FT2232 chip with custom vendor and product IDs. To make it accessible for the Linux system, there is an udev rule needed: /etc/udev.rules.d/99-tiftdi.rules

ATTRS{idProduct}=="c32a", ATTRS{idVendor}=="0451", RUN+="echo 0451 c32a > /sys/bus/usb-serial/drivers/ftdi_sio/new_id", MODE="666", GROUP="plugdev"

With the ftdi-sio module loaded (by the above udev rule or otherwise), I get two /dev/ttyUSBx devices when the Launchpad is plugged in。

  1. Build and install openOCD (Open On-Chip Debugger)
    Building and installing openOCD is the standard “./configure; make; sudo make install”,I Using OpenOCD in version 0.8.0。Libusb installed before compiling。
sudo apt-get install libusb-1.0.0-dev

Then, execute the command:

cd <openOCD source tree>
sudo make install

After a successful installation shown

Using OpenOCD in version 0.8.0, the configuration file for the debug interface needs to be changed.
In ~/CC3200_SDK/cc3200-sdk/tools/gcc_scripts/cc3200.cfg replace the following few lines

interface ft2232
ft2232_layout luminary_icdi
ft2232_device_desc "USB <-> JTAG/SWD"
ft2232_vid_pid 0x0451 0xc32a


interface ftdi
ftdi_device_desc "USB <-> JTAG/SWD"
ftdi_vid_pid 0x0451 0xc32a
ftdi_layout_init 0x00a8 0x00eb
ftdi_layout_signal nSRST -noe 0x0020

Then, you need to configure the G1, as shown in Figure

starting OpenOCD with the following command:

openocd -f ~/CC3200_SDK/cc3200-sdk/tools/gcc_scripts/cc3200.cf

shows the following message:

Open On-Chip Debugger 0.8.0 (2014-09-19-14:45)
Licensed under GNU GPL v2
For bug reports, read
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
Info : clock speed 1000 kHz
Info : JTAG tap: cc3200.jrc tap/device found: 0x0b97c02f (mfg: 0x017, part: 0xb97c, ver: 0x0)
Info : JTAG tap: cc3200.dap enabled
Info : cc3200.cpu: hardware has 6 breakpoints, 4 watchpoints
  1. Download arm-none-eabi Cross Tool Chain
    The arm-none-eabi cross tool chain will enable you to compile, link and debug source code destined to run on the CC3200 arm microcontroller.
    Download the prebuilt binaries of the arm-none-eabi cross tool chain for Linux from launchpad.net. Unpack it to an appropriate directory and add the bin/ directory to the execution path.
tar xvjf gcc-arm-none-eabi-4_8-2014q2-20140609-linux.tar.bz2
export PATH=$PATH:~/gcc-arm-none-eabi-4_8-2014q2/bin
  1. Compile and debug getting_started_with_wlan_station
    Edit the OpenOCD start command in ~/CC3200_SDK/cc3200-sdk/tools/gcc_scripts/gdbinit to make shure OpenOCD finds it’s appropriate configuration file.
    Mine looks like this:
target remote | openocd -c "gdb_port pipe; log_output openocd.log" -f ~/CC3200_SDK/cc3200-sdk/tools/gcc_scripts/cc3200.cfg

Compile getting_started_with_wlan_station

cd ~/CC3200_SDK/cc3200-sdk/example/getting_started_with_wlan_station/gcc

Then compile the information appears as follows

CC    ../main.c
  CC    ../pinmux.c
  CC    ../../common/gpio_if.c
  CC    ../../common/uart_if.c
  CC    ../../common/startup_gcc.c
  LD    exe/wlan_station.axf

Install minicom and open ttyUSB1

minicom -D /dev/ttyUSB1

Run a gdb session

cd  ~/CC3200_SDK/cc3200-sdk/example/getting_started_with_wlan_station
arm-none-eabi-gdb -x ~/CC3200_SDK/cc3200-sdk/tools/gcc_scripts/gdbinit gcc/exe/wlan_station.axf

The following message will appear

GNU gdb (GNU Tools for ARM Embedded Processors)
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gcc/exe/wlan_station.axf...done.
Open On-Chip Debugger 0.8.0 (2015-03-22-01:50)
Licensed under GNU GPL v2
For bug reports, read
0x00001f5e in ?? ()
Loading section .text, size 0xd378 lma 0x20004000
Loading section .ARM, size 0x8 lma 0x20011378
Loading section .data, size 0x898 lma 0x20011380
Start address 0x2000539c, load size 56344
Transfer rate: 62 KB/sec, 3521 bytes/write.
Breakpoint 1 at 0x20004eee: file ../main.c, line 943.

Breakpoint 1, main () at ../main.c:943
943            long lRetVal = -1;

Enter c, Enter, the following message appears, indicating that is already running

(gdb) c