Open cisen opened 5 years ago
C:\ti\simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\nortos\CC26X2R1_LAUNCHXL
C:\ti\simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\hexfiles
SDK里面自带的ROM烧录到板子里面,然后等待大概1分钟,手机就又会出现project zero连接到板子Task Testing
->connect符号,再点击开始即可运行你写的硬件代码。还可以再I/O Mapping
里面选择你要导出的信号接口地址The launchpad launchxl CC26X2R1 is a platform based on the CC26x2 MCU by Texas Instrument, an SoC with an ARM Cortex-M4 and a multi-functional Radio (BLE, IEEE, FM). The kit is i2c compatible, and can be extended with several sensors using i2c.
The technical reference manual for the cc26x2 can be found here.
First, follow the Tock Getting Started guide.
There are two options for flashing and debugging the board:
OpenOCD + on-board debugger: The launchxl boards have an on-board debug-chip (the XDS110) to allow flashing and debugging the chip over USB that works with OpenOCD. However, to use the on-board debugger, you need to upgrade its firmware, and use an unreleased version of OpenOCD that can interface with it.
JLinkExe + external JTag debugger: You can connect an external debugger to the JTag port (labled "Target In") and use JLinkExe/JLinkGDBServer to flash and debug the chip. This is currently a more seemless software experience, but requires additinoal hardware (the debugger).
The jumpers on the configurable headers change which debug features are available.
In order to interact with the serial console over USB, you need to attach
jumpers to the RX
and TX
pins.
For flashing and debugging, you need different sets of jumpers for each strategy.
If you're using OpenOCD, ensure all the jumpers are attached to the configurable header pins. Specifically, for flashing and debugging you need at least:
GND
3V3
RST
TMS
TCK
TDO
TDI
If you're using JLinkExe/JLinkGDBServer, make sure to detach the
TMS
, TCK
, TDO
, and TDI
pins. If you don't, JLinkExe will fail to
connect and print an error that it cannot find ICE-PICK (because TI is really
serious about useful error messages).
InitTarget: Can not find ICE-Pick (IDCODE mismatch).
Only necessary for OpenOCD
The launchpad has TI's XDS110 JTAG device that can be used to program it.
However, OpenOCD requires a recent version of the firmware that may not be on
the board. To update, follow the steps
here.
Note: you only need to download CCS to do this, the firmware.bin
file is in
the xds110 folder.
Only necessary for OpenOCD
As of July 2018, the released version of OpenOCD (v0.10) does not include support for the XDS110 on-board debugger. However, support is available from source since May 2018 so you must install a version of OpenOCD from a recent Git snapshot.
$ git clone https://git.code.sf.net/p/openocd/code openocd
Refer to the OpenOCD README for specific installation instructions, but it is just a normal autotools project, so the following should work:
$ cd openocd
$ ./bootstrap
$ ./configure --prefix $HOME/.local
$ make install
Tockloader supports flashing the launchpad using OpenOCD.
$ tockloader <command> --board launchxl-cc26x2r1 --openocd
IMPORTANT: This step is both necessary (at least once) and a bit dangerous. Proceed carefully.
The CC26x2/CC13x2 series of chips contains a set of customer configuration registers (CCFG) that modify chip behavior in various ways, including the radio MAC address, voltage, and startup behavior. The registers live at a very high address, but can be written using the last page in flash (offset 0x56000).
By default, the chip is configured to start a hardware bootloader that loads a payload binary over the UART. We do not use this bootloader. Before Tock will properly boot, you have to change the CCFG registers.
A reasonable set of CCFG values is in src/ccfg.rs
, which compiles to a
separate target binary and can be flashed directly to offset of the first CCFG
register (0x57FA8).
If you're using OpenOCD:
$ make flash-ccfg
If you're using JLinkExe
$ make flash-ccfg-jlink
The Makefile targets flash
(for OpenOCD) and flash-jlink
) (for JLinkExe) build and load the kernel.
OpenOCD:
$ make flash # make and flash the kernel
JLinkExe:
$ make flash-jlink # make and flash the kernel
You can flash processes using Tockloader.
OpenOCD:
$ tockloader install --board launchxl-cc26x2r1 --openocd [PATH_TO_PROCESS]
JLinkExe:
$ tockloader install --board launchxl-cc26x2r1 --jlink [PATH_TO_PROCESS]
You need to use openocd together with gdb in order to debug the launchxl board using JTAG. However, you'll need to build OpenOCD with extra applied patches until the next version has been released.
Clone the repository and apply the patches:
$> git clone https://git.code.sf.net/p/openocd/code openocd
$> cd openocd
$> git pull http://openocd.zylin.com/openocd refs/changes/22/4322/2
$> git pull http://openocd.zylin.com/openocd refs/changes/58/4358/1
Once cloned and the patches has been applied, read the readme in order to build and install openocd.
Once flashed, launch openocd with the configuration specified at jtag/openocd.cfg:
$> openocd -f jtag/openocd.cfg
And then launch gdb
$> arm-none-eabi-gdb -x jtag/gdbinit
and it will automatically connect to the board.
NOTE: There is currently a problem using the cortex_m SYSRESETREQ
command
in openocd in order to reset the board. This is also the default way we want to
reset..
When the board panics or crashes, the RED led will blink rapidly.
总结
文档