Getting Started Issue


#1

Hi, I’ve been trying to work through the wiki tutorials to get writing my own code but I’m having some trouble. This is my first attempt with anything trickier than an Arduino.

I have the nRF52840-MDK and I’m using 64bit windows 7.

I’m stuck at the https://wiki.makerdiary.com/nrf52840-mdk/nrf5-sdk/ section where you need to “make flash” the blinky program. I get an error telling me to configure the Makefie.windows file to suit my system, can anyone advise on the correct path?

C:\Users\Oisin\Documents\NRF Files\nrf52840-mdk-master\examples\nrf5-sdk\blinky\

armgcc>make flash
process_begin: CreateProcess(NULL, “C:\Program Files (x86)\GNU Tools Arm Embedde
d\6 2017-q2-update\binarm-none-eabi-gcc” --version, …) failed.
make: …/…/…/…/nrf_sdks/nRF5_SDK_15.0.0_a53641a/components/toolchain/gcc/Make
file.common:129: pipe: No error
Cannot find: ‘C:\Program Files (x86)\GNU Tools Arm Embedded\6 2017-q2-update\bin
arm-none-eabi-gcc’.
Please set values in: “C:/Users/Oisin/Documents/NRF Files/nrf52840-mdk-master/nr
f_sdks/nRF5_SDK_15.0.0_a53641a/components/toolchain/gcc/Makefile.windows”
according to the actual configuration of your system.
…/…/…/…/nrf_sdks/nRF5_SDK_15.0.0_a53641a/components/toolchain/gcc/Makefile.c
ommon:129: *** Cannot continue. Stop.


#2

Hi there,
First, pls make sure you have installed the GNU Arm Embedded Toolchain: 6-2017-q2-update. According to your system, you can download here directly: gcc-arm-none-eabi-6-2017-q2-update-win32-sha2.exe.

Then configure the toolchain path in C:/Users/Oisin/Documents/NRF Files/nrf52840-mdk-master/nr f_sdks/nRF5_SDK_15.0.0_a53641a/components/toolchain/gcc/Makefile.windows with the following settings:

GNU_INSTALL_ROOT := C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q2-update/bin/
GNU_VERSION := 6.3.1
GNU_PREFIX := arm-none-eabi

BTW, make sure that make tool works well. Just follow the step to install MSYS2 and the tools: https://wiki.makerdiary.com/nrf52840-mdk/nrf5-sdk/#installing-gnu-make

Now you can try to compile the blinky example again in MSYS2 bash. Everything should work as expected.
Pls let me know if you have any concerns.

Zelin


#3

Thanks, that worked for me. I reinstalled the GNU toolchain and set the paths as you had suggested. Maybe I donwloaded the wrong GNU toolchain the first time.


#4

Good job. :+1:


#5

Hello,

Also I have the nRF52840-MDK and I’m using 64bit windows 7.
I have built the firmware image, but I have failed to upload via pyocd.
Under msys2 environment, pyocd tool make fault message as follows.

Blockquote
$ make flash
DONE nrf52840_xxaa
Flashing: _build/nrf52840_xxaa.hex
pyocd-flashtool -t nrf52 -se _build/nrf52840_xxaa.hex
WARNING:root:pyocd-flashtool is deprecated; please use the new combined pyocd tool.
open_device
Traceback (most recent call last):
File “/usr/bin/pyocd-flashtool”, line 11, in
load_entry_point(‘pyocd==0.15.0’, ‘console_scripts’, ‘pyocd-flashtool’)()
File “/usr/lib/python3.7/site-packages/pyocd/tools/flash_tool.py”, line 155, in main
**convert_session_options(args.option))
File “/usr/lib/python3.7/site-packages/pyocd/core/helpers.py”, line 141, in session_with_chosen_probe
allProbes = ConnectHelper.get_all_connected_probes(blocking=blocking, unique_id=board_id)
File “/usr/lib/python3.7/site-packages/pyocd/core/helpers.py”, line 78, in get_all_connected_probes
allProbes = DebugProbeAggregator.get_all_connected_probes(unique_id=unique_id)
File “/usr/lib/python3.7/site-packages/pyocd/probe/aggregator.py”, line 32, in get_all_connected_probes
probes += cls.get_all_connected_probes()
File “/usr/lib/python3.7/site-packages/pyocd/probe/cmsis_dap_probe.py”, line 70, in get_all_connected_probes
return [cls(dev) for dev in DAPAccess.get_connected_devices()]
File “/usr/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py”, line 438, in get_connected_devices
all_interfaces = _get_interfaces()
File “/usr/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py”, line 47, in _get_interfaces
return INTERFACE[USB_BACKEND].get_all_connected_interfaces()
File “/usr/lib/python3.7/site-packages/pyocd/probe/pydapaccess/interface/pyusb_backend.py”, line 160, in get_all_connected_interfaces
for board in all_devices:
File “/usr/lib/python3.7/site-packages/usb/core.py”, line 1249, in device_iter
if _interop._all(tests) and (custom_match is None or custom_match(d)):
File “/usr/lib/python3.7/site-packages/pyocd/probe/pydapaccess/interface/pyusb_backend.py”, line 258, in call
device_string = dev.product
File “/usr/lib/python3.7/site-packages/usb/core.py”, line 841, in product
self._product = util.get_string(self, self.iProduct)
File “/usr/lib/python3.7/site-packages/usb/util.py”, line 311, in get_string
langids = dev.langids
File “/usr/lib/python3.7/site-packages/usb/core.py”, line 817, in langids
self._langids = util.get_langids(self)
File “/usr/lib/python3.7/site-packages/usb/util.py”, line 268, in get_langids
0
File “/usr/lib/python3.7/site-packages/usb/control.py”, line 173, in get_descriptor
data_or_wLength = desc_size)
File “/usr/lib/python3.7/site-packages/usb/core.py”, line 1025, in ctrl_transfer
self._ctx.managed_open()
File “/usr/lib/python3.7/site-packages/usb/core.py”, line 102, in wrapper
return f(self, *args, **kwargs)
File “/usr/lib/python3.7/site-packages/usb/core.py”, line 120, in managed_open
self.handle = self.backend.open_device(self.dev)
File “/usr/lib/python3.7/site-packages/usb/backend/libusb1.py”, line 787, in open_device
return _DeviceHandle(dev)
File “/usr/lib/python3.7/site-packages/usb/backend/libusb1.py”, line 643, in init
_check(_lib.libusb_open(self.devid, byref(self.handle)))
File “/usr/lib/python3.7/site-packages/usb/backend/libusb1.py”, line 593, in _check
raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
make: *** [Makefile:294: flash] Error 1

BTW, instead of msys2, I tried to install python3-win64 directly as well as pyocd.
Then I succeed to upload the firmware under cmd shell.
But That’s separated env with build and upload process.

Could you let me know how to use both build and upload under msys2?


#6

Hi,
Have you installed libusb package?
Try sudo pacman -S libusb