This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is a pure Linux development environment possible for nRF52?

Hello everyone,

I'm brand-new here. I have developed quite a bit of software on desktop PC's, but this is my first experience with embedded programming. A few weeks ago, I was handed an nRF52 development board, a temporary computer for development work, and told to go figure it out. I followed Nordic's tutorial, based on Windows and Keil MicroVision. I got Blinky compiled, and flashed it to the board. I haven't bothered with Bluetooth yet.

Keil's free version of MicroVision limits executable files to just 32 KB. My employer has a few licenses for IAR Embedded Workbench, but they must be shared between all of us who want access. I am waiting my turn. I have read several links that suggest that Nordic's development kit also works with gcc. I may not have to use Keil or IAR.

And perhaps, I don't even have to use Windows? My permanent computer has arrived. I greatly prefer Linux, so that's what I installed first. When I plug the nRF52 board into my Linux machine, a USB media device called JLink appears. If I can compile ARM executable code and flash the board from Linux, that would be great. From my reading, I know about gcc-arm-embedded. But I do not know how to set it up. I am reading every question here on the Nordic Developer Zone with the key words gcc and/or Linux. There are hundreds of them. If anyone knows a shortcut to the posts which explain how to set up an embedded development toolchain in a pure Linux setting, I would appreciate the pointers.

As a second option, I have Windows 7 running as a guest virtual machine (to run one Windows-native app that I must use). I could set up mingw-w64 on my Windows VM, so that I can run gcc from the guest. I am attempting this right now, but to make this arrangement work I need to fix a hardware sharing problem. When I connect the Nordic board to the USB in a configuration which should forward the board from the host (Linux) OS to the guest (Windows) OS, the guest crashes.

Option 3: I can set up a full dual-boot system, with independent partitions for Linux and Win7. But nothing makes me more nervous than a bare-metal Windows device with full Internet access. (In point of fact, the loaner computer that I received when I first got here harbored a virus, which was trying to attach itself to my executables!) And I would actually prefer to access both working environments at the same time.

Thanks for reading this all the way through, and thanks for your help.

Parents
  • I'm developing software for nrf51 on OS/X using gcc. I think its much more long time stable to use just a compiler and make (and maybe a tool like cmake) for a project and leave the decision for an optional IDE to the individual developers.

    I prefere make files over some xml-like IDE-projects settings, because changes to a makefile can be tracked by version managment tools like git/svn very well. If someone changes a compiler setting in an IDE project setting, it usually results in some undocumented changes in a large xml file.

    I've worked on a project where 4 different micro controllers where used from 3 different vendors. If we where using the vendors prefered IDE and compiler, we would have to use at least 2 different flavors of windows and 3 modified versions of eclipse ;-)

    Here is a small example of a nrf51 project, that uses GCC and should work without any changes on OS/X, windows (with mingw of cause) and linux: github.com/.../nrf51

    • CMakeLIsts.txt: that's some kind of makefile
    • gcc_nrf51_common.ld, nrf51_xxaa.ld: slightly changed linker scripts from nordic
    • system_nrf51.h, system_nrf51422.c, gcc_startup_nrf51.s : startup filed provided by nordic
    • runtime.cpp: minimum runtime support for C++

    In addition, you will need the SDK, that contains headers that decribe the layout of the registers.

    hth Torsten

Reply
  • I'm developing software for nrf51 on OS/X using gcc. I think its much more long time stable to use just a compiler and make (and maybe a tool like cmake) for a project and leave the decision for an optional IDE to the individual developers.

    I prefere make files over some xml-like IDE-projects settings, because changes to a makefile can be tracked by version managment tools like git/svn very well. If someone changes a compiler setting in an IDE project setting, it usually results in some undocumented changes in a large xml file.

    I've worked on a project where 4 different micro controllers where used from 3 different vendors. If we where using the vendors prefered IDE and compiler, we would have to use at least 2 different flavors of windows and 3 modified versions of eclipse ;-)

    Here is a small example of a nrf51 project, that uses GCC and should work without any changes on OS/X, windows (with mingw of cause) and linux: github.com/.../nrf51

    • CMakeLIsts.txt: that's some kind of makefile
    • gcc_nrf51_common.ld, nrf51_xxaa.ld: slightly changed linker scripts from nordic
    • system_nrf51.h, system_nrf51422.c, gcc_startup_nrf51.s : startup filed provided by nordic
    • runtime.cpp: minimum runtime support for C++

    In addition, you will need the SDK, that contains headers that decribe the layout of the registers.

    hth Torsten

Children
Related