sumeet
Posts: 21
Joined: Mon Jan 15, 2018 3:34 pm

Development environment for bare metal

Sat Jan 27, 2018 12:27 pm

I have good experience of high-level programming and have always used IDEs like Visual Studio and Eclipse. I am trying to learn bare metal on RPi3. My current toolset is:

Editor: vim/gedit/Visual Studio Code/Notepad++
Toolchain: ARM arm-none-eabi for 32 bit and Linaro aarch64-elf for 64 bit
Debugger: gdb from the above toolchain
Emulator: qemu for raspi3 (from bzt in this forum)
Accessories: Have ordered Adafruit USB to TTL cable so that I can easily transfer files from my laptop after code changes

So my questions:
- I am comfortable with the editors I use and am fine without intellisense. But still, does anyone use an IDE here?
- I use Ubuntu for development and have installed arm-none-eabi using "apt install gcc-arm-none-eabi" which was easy. I installed linaro toolchain from https://releases.linaro.org/components/ ... rch64-elf/ by extracting the tar.gz into /etc and then created symbolic links to the binaries in /etc/gcc..../bin into /usr/bin. Is this how you install linaro toolchain?
- I am using gdb to debug code in qemu. But after having used IDEs for over a decade I find it tedious to type commands like info, display, step, etc. for debugging. Does everyone here use gdb or are there any graphical tools available?

LdB
Posts: 1207
Joined: Wed Dec 07, 2016 2:29 pm

Re: Development environment for bare metal

Sat Jan 27, 2018 1:16 pm

sumeet wrote:
Sat Jan 27, 2018 12:27 pm
- I am comfortable with the editors I use and am fine without intellisense. But still, does anyone use an IDE here?
I have almost identical setups and just use VisualStudio for the IDE , I can't live without intellisense :-)

If you have VS2017 download the basic blinker example from the link you can see the VS2017 solution setup I use.
https://github.com/LdB-ECM/Raspberry-Pi ... /myBlinker
sumeet wrote:
Sat Jan 27, 2018 12:27 pm
- I use Ubuntu for development and have installed arm-none-eabi using "apt install gcc-arm-none-eabi" which was easy. I installed linaro toolchain from https://releases.linaro.org/components/ ... rch64-elf/ by extracting the tar.gz into /etc and then created symbolic links to the binaries in /etc/gcc..../bin into /usr/bin. Is this how you install linaro toolchain?[/code]
I stay on the PC and use linaro in basically the same manner as both 32 and 64 bit Intel cross compile variants are available.
sumeet wrote:
Sat Jan 27, 2018 12:27 pm
- I am using gdb to debug code in qemu. But after having used IDEs for over a decade I find it tedious to type commands like info, display, step, etc. for debugging. Does everyone here use gdb or are there any graphical tools available?
By staying in VisualStudio I can debug anything that isn't specific to PI hardware on VS in a windows command line build.
The few percent I need to debug that hits hardware I have to do exactly as you do.

On the Pi itself you can use the Microsoft freesource IDE VisualCode

Currently you can run VisualCode directly on the Pi in two ways and you can debug in both but you have linux running so not really baremetal
1.) Directly see ...... https://code.headmelted.com/
Writeup: https://www.lifehacker.com.au/2017/06/y ... berry-pis/
2.) RealVNC allow free use on Pi .. https://www.realvnc.com/en/connect/docs ... ry-pi.html

I haven't done it but if you want to dive in the deep en ARM Development Studio 5 has a community edition (AKA free)
https://developer.arm.com/products/soft ... ty-edition

SonicWave
Posts: 22
Joined: Mon Mar 19, 2018 1:10 pm

Re: Development environment for bare metal

Mon Mar 19, 2018 7:47 pm

I haven't done it but if you want to dive in the deep en ARM Development Studio 5 has a community edition (AKA free)
Which kind of programming device would I need to do bare metal developing with this IDE, probably JTAG? Are the JTAG pins of the BCM2835 available on the Boards? Is it even possible to use this IDE because "DS-5 Debugger for bare-metal development with Armv8-A Foundation Model"

LdB
Posts: 1207
Joined: Wed Dec 07, 2016 2:29 pm

Re: Development environment for bare metal

Mon Mar 19, 2018 11:49 pm

As I said I haven't tried it but yes jtag would be what I would go for and the pins are available (but you have to wire them to a plug) and there are dozens of net blogs and university presentations for doing it.

Do a net search on "Raspberry pi jtag debugger"

ARM has details of doing it on DS5 to the Pi2 but I haven't seen a Pi3 writeup
https://community.arm.com/tools/f/discu ... berry-pi-2

Return to “Bare metal, Assembly language”