platformio / platform-nordicnrf51

Nordic nRF51: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/nordicnrf51
Apache License 2.0
20 stars 25 forks source link

Nrfjprog support #17

Closed jeanmatthieud closed 6 years ago

jeanmatthieud commented 6 years ago

Adds the possibility to use the nrfjprog tool of Nordic Semi (nrf5x command line tools) by setting upload_protocol = nrfjprogin the platformio.ini file env configuration.

ivankravets commented 6 years ago

Where are located the binaries of this tool for all architectures/OS?

zerog2k commented 6 years ago

I would like to see nrfjprog or something similar like https://github.com/NordicPlayground/nRF5-universal-prog, but afaik they all require jlink binaries, e.g. dll

@ivankravets

re: binaries, this is tricky, as you have the nrfjprog binaries from nordic plus the jlink software. Not sure of the redistribution issues here? Is it a platformio requirement that every and all frameworks, toolchains, and tools, be redistributable? Is it ever acceptable that they have to be installed by user, and some minimum configuration (in path, or setting to point to it?) required to be done by user?

ivankravets commented 6 years ago

You can configure a custom uploader via http://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#custom-uploader

jeanmatthieud commented 6 years ago

@ivankravets I don't think that the custom uploader works with other platforms than Atmel AVR.

You can download the tools here: nRF5x-Command-Line-Tools-Linux32 nRF5x-Command-Line-Tools-Linux64 nRF5x-Command-Line-Tools-OSX nRF5x-Command-Line-Tools-Win32

ivankravets commented 6 years ago

@jeanmatthieud THANK YOU SO MUCH for this PR and links to binaries.

Please re-test with the latest version of dev/platform

[env:..]
platform = https://github.com/platformio/platform-nordicnrf51.git
upload_protocol = nrfjprog
zerog2k commented 6 years ago

btw, i found a way to do this via extra_scripts... an example (on an experimental 8051 platform, using stcgal): https://github.com/zerog2k/stc_diyclock/blob/platformio/post_extra_script.py#L22-L36