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

What's the non-Windows way to flash an nRF51882? (POSIX nrfjprog?)

I'm just getting started with the nRF51 Eval Kit, I have the 5.1 SDK installed, using Mac OS X for development. I also have the GCC ARM toolchain installed. Firstly, I had to hack the Makefile.common to properly pick up the Makefile.posix (rather than Makefile.windows) and was able to build the example(s) I am interested in.

Next, I need to program/flash the pca10000/pca10001 boards. I tried "make flash", but it's looking for a tool called 'nrfjprog' which is not in the SDK. A quick bit of searching in the forums here says that you get it by running the MSI installer ... which is Windows only.

Any ideas? Is the source available for nrfjprog? Is there some alternative?

Thanks.

  • There is no posix standard for USB communication unfortunately. The "J" in nrfjprog is because it is talking to a Segger J-Link Lite. J-link makes some OS X binaries Segger J-Link but they are just the minimum for debugging.

    I would love to develop on OS X too but most companies just don't have enough users to make those tools worth their time to develop and support. You might have some luck with OpenOCD but I don't have the time to figure that out.

  • this is what i use in my makefile it works for linux and OS X

    FLASH_SCRIPT=$(OUTPUT_BINARY_DIRECTORY)/upload.script .PHONY: flash flash: $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin echo "power on" > $(FLASH_SCRIPT) echo "r" >> $(FLASH_SCRIPT) echo "loadbin $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin 0x00014000" >> $(FLASH_SCRIPT) echo "r" >> $(FLASH_SCRIPT) echo "qc" >> $(FLASH_SCRIPT) JLinkExe -Device nrf51822 -If SWD $(FLASH_SCRIPT)

  • I'd recommend you to take a look at this GitHub repository, which contains Makefiles that you can use to flash from either Linux or OS X. They require the J-Link tools to be installed, and be available in your PATH. The GCC path can either be set in Makefile.posix or manually in the project Makefile.

  • Thanks, I'll take a look.

    BTW: There is no Makefile.posix in the 5.1 SDK ZIP (version 36092), so I just cloned Makefile.windows and edited it. Although I did have to edit lines 9-13 of Makefile.common because the "ifeq ($(OS),Windows_NT)" was commented out and it would always read Makefile.windows.

  • Makefile.posix isn't really an official file, it's just something I've made for private use, and hence it is not included in the official zip.

Related