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
  • 1.) Download the arm-none-eabi compiler for linux. 2.) Download the Java JDK (needed by eclipse). 3.) Download eclipse for c/c++ development 4.) Get eclipse working with arm-non-eabi compiler. 5.) Create a makefile based project in eclipse and select existing code, use the nordic sdk base folder. 6.) Each project has an example makefile, look at these and use them as guidance. Also example linker scripts but you shouldnt have to touch these. 7.) get a project compiling with gcc. You'll have to build for the targets in the makefile.

    -You can download some segger tool plugins for eclipse and debug from eclipse.

    To flash from linux: download latest nRF5x tools (i think these are supported for linux). now use nrfjprog to flash hex files to your board. use pynrfjprog to write scripts and automate process. use mergehex to merge hex files (if you want to).

    • This is very undetailed - I know. but it might help. there are tutorials out there for each step but youll have to do some search.

    figure a quick answer was better than nothing. maybe someone else can help more. good luck! -Mike

  • Thanks for your reply. I'm a little confused by steps 4 and 5. Does Eclipse actually use GNU make? Or does it perform the jobs that make would do, using information in its project files?

    In case my system configuration matters: Ubuntu 15.04 x86_64, Eclipse 4.5.0, gcc-arm-none-eabi 4.8.3. I took care to download only 64-bit packages. I have also downloaded and extracted nRF5x_MDK_8_0_4_GCC, nRF52_SDK_0.9.1_3639cc9, and s132_nrf52_1.0.0-3.alpha.

    I am building and executing C that runs on my host machine successfully from within Eclipse.

    From the Eclipse main menu, if I click File > New > C Project, a dialog appears. On the right side of the window, the toolchain selector shows "Cross GCC" and "Linux GCC". If I uncheck the box at the bottom of the window, five more toolchains appear, but not the ARM Embedded toolchain. How do I add ARM Embedded to this list?

    Thanks!

Reply
  • Thanks for your reply. I'm a little confused by steps 4 and 5. Does Eclipse actually use GNU make? Or does it perform the jobs that make would do, using information in its project files?

    In case my system configuration matters: Ubuntu 15.04 x86_64, Eclipse 4.5.0, gcc-arm-none-eabi 4.8.3. I took care to download only 64-bit packages. I have also downloaded and extracted nRF5x_MDK_8_0_4_GCC, nRF52_SDK_0.9.1_3639cc9, and s132_nrf52_1.0.0-3.alpha.

    I am building and executing C that runs on my host machine successfully from within Eclipse.

    From the Eclipse main menu, if I click File > New > C Project, a dialog appears. On the right side of the window, the toolchain selector shows "Cross GCC" and "Linux GCC". If I uncheck the box at the bottom of the window, five more toolchains appear, but not the ARM Embedded toolchain. How do I add ARM Embedded to this list?

    Thanks!

Children
No Data
Related