-
Notifications
You must be signed in to change notification settings - Fork 3
Preparing the environment
Hi,
I'm working currently with Ubuntu 16.04 (Linux), due to that's free for all. Below are some tools and the way to creating a compiling environment on Linux.
-
Tools: lm4flash
This is a command-line flash tool and able to work on all Linux, Windows and Mac OS X.
-
How-to build:
- Pre-condition: The libusb-1.0 must be install in advance.
- Clone the repo:
git clone https://github.com/utzig/lm4tools.git
- Change directory:
cd lm4tools/lm4flash
- Build:
make release PREFIX=/path/to/install
- Finish, add the lm4flash tool to $PATH if necessary:
export PATH=$PATH:/path/to/install
-
GNU ARM Embedded Toolchain
-
Download: link
-
Extract to somewhere, and add the compiler to the $PATH as follows:
export PATH=$PATH:$HOME/tools/gcc-arm-none-eabi-7-2017-q4-major/bin
- OpenOCD (Open On-Chip-Debugger) with ICDI support.
- Clone OpenOCD prj from GIT:
git clone git://git.code.sf.net/p/openocd/code openocd
- Or download: link
- Need to enable ICDI support (--enable-ti-icdi) when configuring OpenOCD. To build OpenOCD, use the following sequence of commands:
cd openocd
./bootstrap
./configure --prefix=/usr --enable-maintainer-mode --enable-stlink --enable-ti-icdi
make
sudo make install
-
Download the vscode at the link.
-
Install an extension: Cortex Debug.
Debugging support for ARM Cortex-M Microcontrollers with the OpenOCD GDB Server.
-
Configuring the Launch for debugging
- Refer to here for more info.
- Below are my configuration as an example for Tiva-C Debugging
"configurations": [
{
"cwd": "${workspaceRoot}",
"executable": "./demo/bare_metal_gcc/blinky_prj/blinky.axf",
"name": "Debug Microcontroller",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"configFiles": [
"/usr/share/openocd/scripts/board/ek-tm4c123gxl.cfg"
]
}
]
The source code is implemented in the repo ./wiki/preparing_environment
- Compiling the hello program:
cd wiki/preparing_environment
make build
- Flashing the program (binary files) to the Tiva-C board.
sudo lm4flash hello.axf
-
Debugging
TBD: Add an image for debugging on vscode
Nhi Van Pham @ 2018 vannhibka@gmail.com