My quick notes for setting up Netbeans, OpenOCD for ARM cortex processor development on Arch Linux. The instructions, excluding the ARCH Linux specific pacman commands, should be the same for any Linux platform.
So I’ve bought some STM32F103 ARM Cortex based boards, and for starting building software for them these are the steps:
Download the ARM toolchain from ARM GNU Toolchain. In my case I downloaded the latest available version for Linux 64 bit.
Create a working directory, in my case I just created /opt/ARM and unzip the toolchain there.
cd /opt mkdir ARM cd ARM tar xvf ~/Downloads/gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2
Add now the ARM toolchain to your path, by editing the .bashrc file at our home directory:
cd vi .bashrc
Add at the end the following line:
and then execute the following command for assuming the new setting, on the current terminal window:
To the new path to be globally available we have to logout and login again, but we won’t do that right now.
We can now test the ARM toolchain installation by calling, for example the command: arm-none-eabi-gcc -v
arm-none-eabi-gcc -v Using built-in specs. COLLECT_GCC=arm-none-eabi-gcc COLLECT_LTO_WRAPPER=/opt/ARM/gcc-arm-none-eabi-6_2-2016q4/bin/../lib/gcc/arm-none-eabi/6.2.1/lto-wrapper Target: arm-none-eabi Configured with: /tmp/jenkins-GCC-6-build... ... ...
OpenOCD is a tool that will allow to flash the ARM processors and also allow to debug code. Netbeans by itself won’t be able to flash code on the processor. So regarding OpenOCD we need to do the installation and some configurations first:
On ARCH Linux it goes more or less like this:
sudo -s pacman -S openocd cp /usr/share/openocd/contrib/99-openocd.rules /etc/udev/rules.d groupadd plugdev usermod -a -G plugdev pcortex udevadm control --reload-rules
Replace pcortex on the usermod command with your user name. Now we can logout and logon again to assume the new user group and path.
Setting up Netbeans
After starting up NetBeans, I’m using the latest version 8.2 (at the date of this post), we select Tools->Plugins and try to search and install the gdbserver plugin. If it fails searching for it, just download it from the GDBServer Plugin home page and install it manually.
Then we need to add the ARM toolchain to the available C++ Tools Collection. Just go to Tools->Options->C++ and press the Add button:
We don’t need to do nothing for anything else, since Code Completion tab will be filled automatically.
And that’s it, we can now use Netbeans to develop for ARM based boards.
In the next post we will see how to flash and debug code on these ARM based boards.