This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

debugging using QtCreator on Mac

Hi

I have been trying to get QtCreator configured such that I can use it as my IDE for the nrf51822 on Mac OSX. I use the NRF51DK as hardware, but also had it working using my own board and a Jlink Lite.

As a starting point I have been reading this post: devzone.nordicsemi.com/.../

Here's what I did in a nutshell:

  • Installed latest version of QtCreator (3.4.1) image description
  • Enabled the Baremetal plugin image description
  • configured the bare metal plugin (in preferences->baremetal) to point to the right gdb server on port 2331 (the default port on the jlink gdb server): Add>default, renamed it to Jlink GDB server, and added 1 command in the init commands: load - this will make sure that the software is uploaded to the flash before debugging image description
  • added a bare metal device (in preferences->Devices) and named it nrf51822, pointed to the gdb server provider added in previous step image description
  • Added the compiler - installed the arm gcc toolchain ( launchpad.net/gcc-arm-embedded) and point to it in preferences>build&run>compilers: Add>GCC, renamed to ARM GCC, pointed compiler path to the arm-none-eabi-gcc executable, left everything else as default image description
  • added debugger (preferences>build&run>Debuggers), renamed it to gdb, pointed to executable arm-none-eabi-gdb-py image description
  • added a kit (preferences>build&run>kits), named it nrf51822 also, selected device type Bare Metal Device, selected the Device made in one of the previous steps, idem for Compiler and Debugger, left Sysroot empty, set Qt version to none, left Qt mkspec empty image description
  • changed default projects directory and default build director in preferences>build&run>General the latter because I do not like the default location for the build files, but not really necessary image description
  • saved the content of the QBS file as found in answer of question in above mentioned link (devzone.nordicsemi.com/.../) in myproject.qbs and opened that file in QtCreator
  • in the projects view: add kit - nrf51822, and removed the default desktop kit which was created on opening of the qbs file

image description

  • adapted the qbs file to my project's content
  • build

From that I got a build error on Mac OSX. Apparently when compiling using a gcc based toolchain on MacOSX, it adds a build step automatically called dsymutil. Up till now I found no way to solve this other then this trick: copied /usr/bin/dsymutil to arm-gcc-none-eabi-dsymutil in the arm gcc bin directory (same directory as the xxx-gcc an xxx-gdb-py). Compilation goes fine then.

  • Debug: I installed the jlink tools from segger and started the gdb server from a terminal window, using command JLinkGDBServer -device nrf51822 -if swd -speed 4000 GDB server then starts on localhost port 2331. Then add breakpoints and start debugging (with the green 'play' button) in Qt Creator. Joehoe! :-)

One note: in the qbs script, the output file has extension .out. In fact this an .elf file.

Something else: should this post be moved to a blog post?

Related