Running Nuttx RTOS on EK-TM4C123GXL
This is the short tutorial on how to build and flash Nuttx, the real-time operating system on TM4C123G LaunchPad on fresh installed Ubuntu 16.04 LTS.
More about Nuttx for TM4C123G LaunchPad:
More about Nuttx for TM4C123G LaunchPad:
https://bitbucket.org/nuttx/nuttx/src/42a0796615909b301273ee30fd5af907f4253347/configs/tm4c123g-launchpad/?at=master
Building Nuttx
In terminal run this commands:
mkdir nuttxdir
cd nuttxdir
git clone https://bitbucket.org/nuttx/nuttx
git clone https://bitbucket.org/nuttx/apps
git clone https://bitbucket.org/nuttx/tools
sudo apt-get install gperf flex bison libncurses5-dev
cd tools/kconfig-frontends/
./configure --enable-mconf
make
sudo make install
sudo ldconfig
cd ../..
cd nuttxdir
git clone https://bitbucket.org/nuttx/nuttx
git clone https://bitbucket.org/nuttx/apps
git clone https://bitbucket.org/nuttx/tools
sudo apt-get install gperf flex bison libncurses5-dev
cd tools/kconfig-frontends/
./configure --enable-mconf
make
sudo make install
sudo ldconfig
cd ../..
Without libncurses5-dev you will have the problem with kconfig-mconf, so don't miss to install it.
cd nuttx/tools ./configure.sh tm4c123g-launchpad/nsh cd .. make menuconfig
Inside menu config, you need select System Type -> Toolchain Selection -> Generic GNU EABI toolchain under Linux
For debugging you will need to add debugging symbols.
Build Setup -> Debug Options -> Generate Debug Symbols
Press exit couple of time until ask you to save it. Now run make and you will have nuttx firmware inside this folder ready to be uploaded to your board.
make
Setup VisualStudio Code for debugging Nuttix
For debugging Nuttx inside Visual Studio Code here is launch.json configuration.
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch", "type": "cppdbg",
"request": "launch",
"miDebuggerPath": "arm-none-eabi-gdb",
"targetArchitecture": "arm",
"debugServerPath":"openocd",
"debugServerArgs":"-f /usr/share/openocd/scripts/board/ek-tm4c123gxl.cfg",
"filterStderr": true,
"serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
"program": "/home/osboxes/nuttx/nuttx/nuttx",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{ "text" : "target extended-remote :3333"},
{ "text" : "monitor halt"},
{ "text" : "load /home/osboxes/nuttx/nuttx/nuttx"}
]
}
]
}
If you got problems with a running debugger then try to reconnect the cable of the board.
Inside tiva_start.c source set some breakpoints and you are ready to go.
If you wish to connect to NuttShell (Nuttx shell) you can do it with the screen.
sudo apt-get install screen screen /dev/ttyACM0 115200
To get out from screen press disconnect the cable or software way out is Ctrl + A + D. After that you will need kill screen process. Here is the example:
osboxes@osboxes:~/nuttx/nuttx$ pgrep screen
21386
osboxes@osboxes:~/nuttx/nuttx$ kill -9 21386
That is all. Thanks for reading this blog. Igor
Comments
Post a Comment