Giter VIP home page Giter VIP logo

Comments (71)

xiongyihui avatar xiongyihui commented on July 22, 2024 7

We can modify OpenSK/third_party/tock/boards/nordic/nrf52840_dongle/layout.ld to make Tock OS compatible with the nordic open bootloader.

MEMORY
{
  rom (rx)  : ORIGIN = 0x00001000, LENGTH = 124K
  prog (rx) : ORIGIN = 0x00030000, LENGTH = 704K
  ram (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
}

MPU_MIN_ALIGN = 8K;

INCLUDE ../../kernel_layout.ld

from opensk.

xiongyihui avatar xiongyihui commented on July 22, 2024 6

On nRF52840 MDK USB Dongle, we can install OpenSK without a debug adapter. See Get Started with OpenSK guide

I still can not get OpenSK with Nordic open bootloader directly. However, the open bootloader supports self-upgrade, so we can replace open bootloader with a UF2 bootloader, and then get OpenSK work with the UF2 bootloader.

from opensk.

xiongyihui avatar xiongyihui commented on July 22, 2024 4

I managed to get it work with https://github.com/makerdiary/nrf52840-mdk-usb-dongle.
We just need to change the IOs. As I don't have a jlink, I used a CMSIS-DAP debug adaptor with pyocd to flash the firmwares.
The steps are a little different.

By the way, I use gitpod.io to build the project.

  1. Run curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh to install Rust

  2. Run setup.sh

  3. Change the pins of LEDs and Buttons at OpenSK/third_party/tock/boards/nordic/nrf52840_dongle/src/main.rs

    // The nRF52840 MDK USB Dongle LEDs
    const LED1_PIN: Pin = Pin::P0_04;           // not connected to a LED
    const LED2_R_PIN: Pin = Pin::P0_23;
    const LED2_G_PIN: Pin = Pin::P0_22;
    const LED2_B_PIN: Pin = Pin::P0_24;
    
    // The nRF52840 MDK USB Dongle button
    const BUTTON_PIN: Pin = Pin::P0_18;
    const BUTTON_RST_PIN: Pin = Pin::P0_03;     // not connected
    
    const UART_RTS: Pin = Pin::P0_05;
    const UART_TXD: Pin = Pin::P0_06;
    const UART_CTS: Pin = Pin::P0_07;
    const UART_RXD: Pin = Pin::P0_08;
    
  4. Run board=nrf52840_dongle ./deploy.sh os to build Tock OS

    The Tock OS firmware nrf52840_dongle.elf is at third_party/tock/boards/nordic/nrf52840_dongle/target/thumbv7em-none-eabi/release/

    gitpod /workspace/OpenSK $ ls third_party/tock/boards/nordic/nrf52840_dongle/target/thumbv7em-none-eabi/release/
    build  deps  examples  incremental  nrf52840_dongle  nrf52840_dongle.bin  nrf52840_dongle.d  nrf52840_dongle.elf
    
  5. Run pyocd flash -t nrf52840 nrf52840_dongle.elf to flash the Tock OS into the dongle.

  6. Run board=nrf52840_dongle ./deploy.sh app to build the OpenSK app

    The app contains two parts padding.bin and cortex-m4.tbf at target/tab/

    gitpod /workspace/OpenSK $ ls target/tab/
    cortex-m4.elf  cortex-m4.tbf  ctap2.tab  padding.bin
    
  7. Run pyocd flash -t nrf52840 --format bin -a 0x40000 cortex-m4.tbf and pyocd flash -t nrf52840 --format bin -a 0x30000 padding.bin to flash the app

    cortex-m4.tbf should be written to the address 0x40000. padding.bin should be written to the address 0x30000.

from opensk.

dennisg avatar dennisg commented on July 22, 2024 4

So... I got DFU flashing working for the standard nrf52840 dongle.

The comment @MatchstickUK made, the makerdiary wiki and most of the changes in PR #6 of course were instrumental for getting it to work!

A fork that works for me can be found at dennisg/openSK.

In the root I have added a script that leads you through the complete process: flash_nrf52840_using_dfu.sh.

notes:

  • I installed bin2hex.py and hexmerge.py in /usr/local/bin
  • I use nrfutil to flash the hex, so using the original bootloader/ DFU that the dongle is shipped with
$ dmesg
...
[853099.670504] usb 1-2: New USB device found, idVendor=1915, idProduct=521f
[853099.670510] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[853099.670514] usb 1-2: Product: OpenSK
[853099.670519] usb 1-2: Manufacturer: Nordic Semiconductor ASA
[853099.670565] usb 1-2: SerialNumber: v0.1
[853099.673438] hid-generic 0003:1915:521F.001F: hiddev2,hidraw4: USB HID v1.10 Device [Nordic Semiconductor ASA OpenSK] on usb-0000:00:14.0-2/input0

from opensk.

jmichelp avatar jmichelp commented on July 22, 2024 4

Please be patient. I'm working on integrating all of that nicely into the main repository and the deploy.py script.

At the end, one should be able to flash OpenSK firmware using:

  • Segger JLink (it will leverage tockloader)
  • OpenOCD (it will also leverage tockloader)
  • pyOCD
  • Nordic DFU
  • No programmer (it will only produce a HEX file which will be handy for continuous integration and testing purpose or if a flashing method is not supported).

from opensk.

jmichelp avatar jmichelp commented on July 22, 2024 3

Thanks all for your contributions.

Regarding JLink probes, multiple things:

  1. If you're not using them for commercial use, check if you're not eligible for their EDU (or EDU mini) version which is more affordable.

  2. Of course you can use other probes to program the dongle. JLink is the one that was already supported in Tock OS (and more specifically the tockloader tool) and it's embedded in the Nordic nRF52840-DK development kit. We're mentioning this as a tested/validated solution.

Regarding using another probe than the JLink, I tried a while ago with a Black Magic Probe and OpenOCD without success. I haven't tried with pyOCD instead. I'll give it a try and add documentation about it.

Regarding supporting the Nordic DFU bootloader, that's something we will indeed think about. Because it will also spare the cost of the Tag-Connect cable (even though one can also use a breadboard and press fit headers on the castellated holes for SWD).

Finally about supporting the nRF52840 MDK board, it's for sure possible but as mentioned in the review of the pull request, we would prefer the boards to be added directly to Tock OS instead of having to maintain patches for this. The patches we currently have in our repository are changes that are in the process of being upstreamed and we hope that we will soon be able to fully remove them from our repository.

from opensk.

irtimmer avatar irtimmer commented on July 22, 2024 3

When you flash using DFU a init packet is sent containing the information which is used for the bootloader settings. It contains a CRC value and app size which is used to validate the flashed data and is used to check the application during boot. I think the application state is part of the flashed image. Meaning after key generation the CRC value of the image is changed and OpenSK will no longer boot.

I'm not sure if my theory is completely correct but at least I found a workaround. As the flash is not wiped when flashing a new image you just need to flash only Tock after running flash_nrf52840_using_dfu.sh. This will change the app size and the CRC value in the bootloader, so only the Tock code is verified by the bootloader.

nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 1 --application $OUTPUT/nrf52840_dongle.hex $OUTPUT/tock.zip
nrfutil dfu usb-serial -pkg $OUTPUT/tock.zip -p /dev/ttyACM0

from opensk.

MatchstickUK avatar MatchstickUK commented on July 22, 2024 1

@gregvinyard the Building OpenSK page https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/opensk/building/ covers using bin2hex.py and hexmerge.py to built a single .hex file to install via UF2 bootloader.

I'm guessing someone has already tried using the output of that with nRF Connect Programmer ?

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024 1

from opensk.

sissaias avatar sissaias commented on July 22, 2024 1

Hello everyone

I upgraded bash as suggested now using @dennisg fork I am getting the follow request for j-link:

Screenshot 2020-03-02 at 21 33 29

from opensk.

sissaias avatar sissaias commented on July 22, 2024 1

@dennisg I have to say after spending days on OSX, I decided to do it on Linux. Your flash script worked. The key now works fine. Thanks everyone for your help next move to find somewhere to print a case

from opensk.

elfmimi avatar elfmimi commented on July 22, 2024 1

No, I haven't. I'll try to dig it out. pls wait few days.

from opensk.

jmichelp avatar jmichelp commented on July 22, 2024

The main requirement today is the Nordic nRF52840 SOC.

The two development boards that Nordic made around their chip (the NRF52840-DK and the NRF52840-Dongle) are already supported but it's pretty easy to adapt the code to support a custom design around the Nordic chip. You need 1 button and at least 1 LED to be wired to the chip.

Supporting another chip than the Nordic is also possible but requires more effort.

from opensk.

tmikaeld avatar tmikaeld commented on July 22, 2024

Seems great, unfortunately I know nothing of programming hardware.

But if someone else is interested, this dongle would be a great match for OpenSK:

https://github.com/makerdiary/nrf52840-mdk-usb-dongle

It has a really small form-factor and is available with a form-fit shell, I already made a suggestion to integrate OpenSK in their github.

from opensk.

brouhaha avatar brouhaha commented on July 22, 2024

Just FYI, the official Nordic nRF52840 dongle sells for $10, which is less than the price of the Makerdiary dongle. The design of the Nordic dongle is open. It doesn't come with a case, but if you have a 3D printer...

from opensk.

tmikaeld avatar tmikaeld commented on July 22, 2024

@brouhaha I looked at having the shell printed, but the shell is much larger, less durable and doesn't have a ring to have it in a key-chain. Plus, the MD dongle size is smaller, which I prefer - I'm too used to the smaller form-factor of Yubikeys.

from opensk.

mikejrh avatar mikejrh commented on July 22, 2024

Is it possible to program the NRF52840 USB Dongle as a security key without additional hardware ?

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

Google is presenting OpenSK as a tool for developers and hobbyists.
The Nordic Dongle costs about $10.
The associated hardware to program it costs roughly $1000, per installation guide.
Try to come up with a cheaper solution for us hobbyists. $1000 is more than I spent on my 3D printer.

from opensk.

brouhaha avatar brouhaha commented on July 22, 2024

There are a multitude of options for programming the nRF52, none of which cost $1000. The Nordic nRF52 DK board can be used, and sells for $40.

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

It looks like nRF Connect Programmer can do the job:
https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial
Maybe the install guide could reference this? All it shows are the very expensive JProbe accessories.

from opensk.

elfmimi avatar elfmimi commented on July 22, 2024

I tried RAYTAC MDBT50Q-RX and it worked.
https://www.raytac.com/product/ins.php?index_id=89

Note: you need to tweak pin settings for the led and the button. It would be safer to also change the pin for uart so that it won’t interfere with the reset pin.

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

It looks like the MDBT50Q-RX does not include a bootloader, so you also need a MDBT50Q-RX to do the programming? Sure beats anything JLink for cost though. The NRF52840 does appear to include the DFU Bootloader, so programming by USB is possible.

from opensk.

xiongyihui avatar xiongyihui commented on July 22, 2024

If you have two nRF52840 MDK USB Dongle, you can use one as a CMSIS-DAP debug adapter with OpenOCD or pyOCD

See https://github.com/xiongyihui/mbed-CMSIS-DAP

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

Well that leaves open the question. Can you use the nRF52840 dongle bootloader to install OpenSK on itself, using just the one dongle - or does that destroy the bootloader? May be time to buy a second dongle...

from opensk.

elfmimi avatar elfmimi commented on July 22, 2024

I think it can be done. I mean, it should be possible to install OpenSK with ordinary bootloaders and without using any jtag/swd adapters.

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

Man - you are getting there! Glad I asked!
Now to just not lose track of this information...
And - Thanks!

from opensk.

MatchstickUK avatar MatchstickUK commented on July 22, 2024

Google is presenting OpenSK as a tool for developers and hobbyists.
The Nordic Dongle costs about $10.
The associated hardware to program it costs roughly $1000, per installation guide.
Try to come up with a cheaper solution for us hobbyists. $1000 is more than I spent on my 3D printer.

The larger nRF52840 DK board spec lists it as "comes with an on-board SEGGER J-Link debugger allowing programming and debugging both the on-board SoC and external SoCs through the debug out header" so could one of those be used to provide the required support to the dongle ?

from opensk.

Raboo avatar Raboo commented on July 22, 2024

We can modify OpenSK/third_party/tock/boards/nordic/nrf52840_dongle/layout.ld to make Tock OS compatible with the nordic open bootloader.

@xiongyihui would this mean you can program the dongle with nRF Connect Programmer?
It would be super awesome if you could make a PR for Tock OS to also support nordic open bootloader.

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

Let me second the Super Awesome. Us low budget users will thank you forever!

from opensk.

tmikaeld avatar tmikaeld commented on July 22, 2024

@xiongyihui Amazing! I'll start ordering a bunch :-D

from opensk.

gregvinyard avatar gregvinyard commented on July 22, 2024

Regarding the nRF Connect Programmer, it looks like you need hex files. The build script creates elf files. Is there a way to convert elf to hex? Or modify the build script to output hex files?

from opensk.

gregvinyard avatar gregvinyard commented on July 22, 2024

Thanks @MatchstickUK . Apparently I have a lot to learn, heh. I was able to convert the bin and tbf files to hex and flash them using nRF Connect Programmer, but OpenSK doesn't run. I didn't brick the dongle, I can flash again. No idea what I'm doing though. Time to do some more reading. :-)

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

Keep posting here please. You are ahead of me - and I am learning a lot.
I have found The OpenSK tools really do not like Windows - but WSL works really well.
Command line only (I loaded up Ubuntu 1804) and it is shaping up.
nRF Connect Programmer uses a lot of X libraries - does it require a GUI? That might get bounced over to Windows proper.

from opensk.

kaeltis avatar kaeltis commented on July 22, 2024

Easier flashing of the nRF52840 Dongle would indeed be awesome.
I bought a JLink EDU Mini but can't figure out a good way to connect it to the dongle. I can't really find anyting that doesnt require soldering wires to the nRF52840 Dongle or the JLink EDU Mini directly or a cable that is almost more expensive than the dongle and edu mini combined.

I'll try and build my own cable to just push against the pads but have to wait for the 0.05" headers.

from opensk.

dennisg avatar dennisg commented on July 22, 2024

mmhh... It seems that when I flash the dongl it works, but as soon as I unplug/ replug the dongle the bootloader enters DFU state immediately. Will need to do some research on that, still...

from opensk.

gregvinyard avatar gregvinyard commented on July 22, 2024

@dennisg That's so cool! Making progress. :-)

Something I was planning on trying this weekend is using nrfutil to generate a DFU settings file. From what I've read, DFU will look for an application to launch, and if it doesn't find one will put the device into DFU mode. The DFU settings file tells DFU what memory address the application to launch is at.

So what I'm hoping, is if we set TockOS to live at 0x1000, and then padding at 0x30000 and OpenSK at 0x40000, and then create a DFU settings file that says the application to launch is at 0x1000, then we'll be good. I don't really know how TockOS knows where to look for OpenSK though. I'm assuming it will find it the same way it does when you flash the dongle without keeping DFU. I don't know though, because I also read that TockOS expects certain things to exist starting at 0x00. But, @xiongyihui was able to get TockOS working at 0x1000 with a UF2 bootloader, so I think it will be fine.

If you try this before me, let us know if it works!

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

@dennisg - I am so sorry - my lack of git-foo is showing. When I clone your repository, it does not have your recent updates, like flash_nrf52840_using_dfu.sh. How do I get your current updates? I know I could open that one - and copy - paste it - but that seems gauche.

from opensk.

elfmimi avatar elfmimi commented on July 22, 2024

@rmm200 cd OpenSK ;: and then
git checkout nrf52840_dongle_bootloader

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

from opensk.

dennisg avatar dennisg commented on July 22, 2024

from opensk.

dennisg avatar dennisg commented on July 22, 2024

thanks @irtimmer, I've applied your suggestion to the script and can confirm it works

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

@dennisg As you make updates to your branch, git checkout nrf52840_dongle_bootloader will pick up the new changes?
And man - thanks to everyone participating in this effort. You will be helping a lot of people!

from opensk.

dennisg avatar dennisg commented on July 22, 2024

@rmm200, since you checked out the project already, use git pull while you are in the project folder

from opensk.

zappos23 avatar zappos23 commented on July 22, 2024

Hi @dennisg, I tried cloning your repo and when I run the ./setup.sh to build the tock os, i got errors when it tries to apply the patch from your branch. if I skip the patch, I think I won't be getting the fixes you guys have made.. may I know what is the right steps to build the os and the app? Thanks

from opensk.

dennisg avatar dennisg commented on July 22, 2024

@zappos23 yes, my bad... sorry. I messed up the patch, but I hope that my last commit will fix it for you , so please git pull again and ./reset.sh and ./setup.sh.

from opensk.

zappos23 avatar zappos23 commented on July 22, 2024

@dennisg thanks a lot for the fix.. i will try it out

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

Worked for me. Thanks!

from opensk.

DG1001 avatar DG1001 commented on July 22, 2024

@dennisg tanks for your patches, works for me too!

from opensk.

zappos23 avatar zappos23 commented on July 22, 2024

Thank you all for the workaround. Got it working with the default bootloader.

from opensk.

mikejrh avatar mikejrh commented on July 22, 2024

Is this now ready to install without additional hardware ? Could a newbie guide be provided ? Thanks.

from opensk.

rmm200 avatar rmm200 commented on July 22, 2024

+1 on the request for a newbie guide...
I got the libraries and patches all installed. A few words on the next steps would sure help.

from opensk.

sissaias avatar sissaias commented on July 22, 2024

I bought the Nordic USB dongle to create a a FIDO key using OPENSK. I can't afford to spent £1000 to buy extra hardware. Is there another guide to program the board using just software tools like the Nordic Desktop Tools. @dennisg did you manage to get it working?

from opensk.

dennisg avatar dennisg commented on July 22, 2024

@sissaias yes I did: have a look at dennisg/OpenSK. After the generic installation instructions, run the flash_nrf52840_using_dfu.sh script and if all's well your dongle will have been programmed correctly

from opensk.

sissaias avatar sissaias commented on July 22, 2024

@sissaias yes I did: have a look at dennisg/OpenSK. After the generic installation instructions, run the flash_nrf52840_using_dfu.sh script and if all's well your dongle will have been programmed correctly

Thank you will give it a try tonight.

@dennisg I am getting these errors:

WOPR ॐ ~/Projects/OpenSK:(9d15h10m|git@nrf52840_dongle_bootloader)
1264 ± ./flash_nrf52840_using_dfu.sh ✹
Compiling tock-cells v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/libraries/tock-cells)
Compiling tock-registers v0.5.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/libraries/tock-register-interface)
Compiling enum_primitive v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/libraries/enum_primitive)
Compiling tock_rt0 v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/libraries/tock-rt0)
Compiling nrf52840_dongle v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/boards/nordic/nrf52840_dongle)
Compiling kernel v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/kernel)
Compiling cortexm v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/arch/cortex-m)
Compiling nrf5x v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/chips/nrf5x)
Compiling capsules v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/capsules)
Compiling cortexm4 v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/arch/cortex-m4)
Compiling nrf52 v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/chips/nrf52)
Compiling nrf52840 v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/chips/nrf52840)
Compiling components v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/boards/components)
Compiling nrf52dk_base v0.1.0 (/Users/sissaias/Projects/OpenSK/third_party/tock/boards/nordic/nrf52dk_base)
Finished release [optimized + debuginfo] target(s) in 21.67s
text data bss dec hex filename
114176 1708 260436 376320 5be00 target/thumbv7em-none-eabi/release/nrf52840_dongle
make: objcopy: No such file or directory
make: *** [target/thumbv7em-none-eabi/release/nrf52840_dongle.hex] Error 1
cp: third_party/tock/boards/nordic/nrf52840_dongle/target/thumbv7em-none-eabi/release/nrf52840_dongle.hex: No such file or directory
./deploy.sh: line 59: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
ERROR: File not found: target/tab/padding.bin
ERROR: File not found: target/tab/cortex-m4.tbf
Traceback (most recent call last):
File "/usr/local/bin/hexmerge.py", line 178, in
sys.exit(main())
File "/usr/local/bin/hexmerge.py", line 158, in main
ih = intelhex.IntelHex(fname)
File "/usr/local/lib/python3.7/site-packages/intelhex/init.py", line 90, in init
self.loadhex(source)
File "/usr/local/lib/python3.7/site-packages/intelhex/init.py", line 199, in loadhex
fobj = open(fobj, "r")
FileNotFoundError: [Errno 2] No such file or directory: 'target/dfu/nrf52840_dongle.hex'
Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 5, in
from nordicsemi.main import cli
File "/usr/local/lib/python3.7/site-packages/nordicsemi/main.py", line 52, in
from nordicsemi.dfu.dfu_transport_serial import DfuTransportSerial
File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 53, in
from nordicsemi.dfu.dfu_trigger import DFUTrigger
File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_trigger.py", line 48, in
import usb1
File "/usr/local/lib/python3.7/site-packages/usb1/init.py", line 61, in
from . import libusb1
File "/usr/local/lib/python3.7/site-packages/usb1/libusb1.py", line 199, in
libusb = _loadLibrary()
File "/usr/local/lib/python3.7/site-packages/usb1/libusb1.py", line 173, in _loadLibrary
return dll_loader('libusb-1.0' + suffix, **loader_kw)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/init.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libusb-1.0.dylib, 6): image not found
Insert the dongle, make it go into DFU mode...
Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 5, in
from nordicsemi.main import cli
File "/usr/local/lib/python3.7/site-packages/nordicsemi/main.py", line 52, in
from nordicsemi.dfu.dfu_transport_serial import DfuTransportSerial
File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 53, in
from nordicsemi.dfu.dfu_trigger import DFUTrigger
File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_trigger.py", line 48, in
import usb1
File "/usr/local/lib/python3.7/site-packages/usb1/init.py", line 61, in
from . import libusb1
File "/usr/local/lib/python3.7/site-packages/usb1/libusb1.py", line 199, in
libusb = _loadLibrary()
File "/usr/local/lib/python3.7/site-packages/usb1/libusb1.py", line 173, in _loadLibrary
return dll_loader('libusb-1.0' + suffix, **loader_kw)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/init.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libusb-1.0.dylib, 6): image not found
Okay, make it go into DFU mode one more time...
Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 5, in
from nordicsemi.main import cli
File "/usr/local/lib/python3.7/site-packages/nordicsemi/main.py", line 52, in
from nordicsemi.dfu.dfu_transport_serial import DfuTransportSerial
File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 53, in
from nordicsemi.dfu.dfu_trigger import DFUTrigger
File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_trigger.py", line 48, in
import usb1
File "/usr/local/lib/python3.7/site-packages/usb1/init.py", line 61, in
from . import libusb1
File "/usr/local/lib/python3.7/site-packages/usb1/libusb1.py", line 199, in
libusb = _loadLibrary()
File "/usr/local/lib/python3.7/site-packages/usb1/libusb1.py", line 173, in _loadLibrary
return dll_loader('libusb-1.0' + suffix, **loader_kw)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/init.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libusb-1.0.dylib, 6): image not found
Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 5, in
from nordicsemi.main import cli
File "/usr/local/lib/python3.7/site-packages/nordicsemi/main.py", line 52, in
from nordicsemi.dfu.dfu_transport_serial import DfuTransportSerial
File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 53, in
from nordicsemi.dfu.dfu_trigger import DFUTrigger
File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/dfu_trigger.py", line 48, in
import usb1
File "/usr/local/lib/python3.7/site-packages/usb1/init.py", line 61, in
from . import libusb1
File "/usr/local/lib/python3.7/site-packages/usb1/libusb1.py", line 199, in
libusb = _loadLibrary()
File "/usr/local/lib/python3.7/site-packages/usb1/libusb1.py", line 173, in _loadLibrary
return dll_loader('libusb-1.0' + suffix, **loader_kw)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/init.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libusb-1.0.dylib, 6): image not found
WOPR ॐ ~/Projects/OpenSK:(9d15h10m|git@nrf52840_dongle_bootloader)
1265 ±

from opensk.

dennisg avatar dennisg commented on July 22, 2024

Hi @sissaias, I'm running this on linux, untested on OSX, sorry.

your root cause is this:

make: objcopy: No such file or directory
make: *** [target/thumbv7em-none-eabi/release/nrf52840_dongle.hex] Error 1
cp: third_party/tock/boards/nordic/nrf52840_dongle/target/thumbv7em-none-eabi/release/nrf52840_dongle.hex: No such file or directory
./deploy.sh: line 59: declare: -A: invalid option

which means that it cannot find objcopy used to generate the hex file.

A little bit further in the logs I see that when deploy.sh is run from the script, there seems to be a mismatch w.r.t. arguments fed into declare and lastly libusb-1.0 cannot be found.

I'm afraid I cannot help you to solve this since I do not have a mac for testing.

from opensk.

zappos23 avatar zappos23 commented on July 22, 2024

I had this problem on my MacOS too. Most probably it's due to old bash version not supporting declare option.
I think you could either removed the declare in the sh file or update your bash. Thanks

from opensk.

jmichelp avatar jmichelp commented on July 22, 2024

Portability issues should have been fixed. The deploy.sh script is gone.
If you're not using code from this repository I suggest you open an issue on the forked repository to tell them to update their fork

from opensk.

dennisg avatar dennisg commented on July 22, 2024

Hi @jmichelp, I updated the fork, still untested but I will hopefully soon find time to do so; are you interested in knowing how to flash a regular nrf52840 dongle with your application without the use of expensive hardware? Do you care to help with your knowledge to fix the 'double flashing' ? I would really appreciate your input!

from opensk.

mlberlin avatar mlberlin commented on July 22, 2024

@dennisg awesome work! Many thanks! One small correction: the 1st argument of deploy.py in your bash script flash_nrf52840_using_dfu.sh should read app not os:

./deploy.py app --board=nrf52840_dongle

This probably also does away with your problem @sissaias.

from opensk.

jmichelp avatar jmichelp commented on July 22, 2024

@dennisg Of course we're interested :) I actually bought myself 2 makerdiary dongles so that I can experiment/test.
I'll do my best to help merging your contribution to the main repository.

from opensk.

dennisg avatar dennisg commented on July 22, 2024

from opensk.

dennisg avatar dennisg commented on July 22, 2024

@jmichelp Okay, I moved as much as possible/ seemed sensible from the bash script to the deploy.py and made it possible, using a --dfu flag, to bypass tockloader completely and only generate the hex files. Also updated the Tock OS main.rs for the nordic dongle (in most certainly a very dirty way, I'm no Rust developer) to set the table_offset_vector during compile time. Please have a look, sigh, do a face-palm and then point me to a better way to do it. thanks!

from opensk.

dennisg avatar dennisg commented on July 22, 2024

This is an overview of the memory layout if you load the hex files in nrf programmer.

2020-03-05-124712_609x1481_scrot

from opensk.

ejeyaseelan avatar ejeyaseelan commented on July 22, 2024

it would be helpful to have an updated write up on how to program this onto a new dongle with factory defaults on windows, linux and macos.

I am on windows and I got the files compiled in gitpod.

I have the nrf desktop connect app, not sure whats the best to proceed without frying my dongle.

thx

from opensk.

jbalius avatar jbalius commented on July 22, 2024

Has anyone tried
Minew C2-7001 Nordic NRF52840 Dongle?

https://aliexpress.com/item/4000127809241.html

from opensk.

jmichelp avatar jmichelp commented on July 22, 2024

No we haven't.
They say it's a buttonless dongle though which is an issue for FIDO2 because we need the button to validate user presence.

from opensk.

jbalius avatar jbalius commented on July 22, 2024

No we haven't. They say it's a buttonless dongle though which is an issue for FIDO2 because we need the button to validate user presence.

Actually it has a button. I have picture and schematics of it:
minew
MS04SF7_SCH_V1.0_a.pdf

As I understand they are suggesting it can be used without a button for some applications.

from opensk.

jmichelp avatar jmichelp commented on July 22, 2024

So, according to the schematics you provided, the board is equivalent to the nRF52840 Dongle from Nordic. Both LEDs and buttons are wired the same. Like on the Nordic dongle, one button acts as a reset button and the other one will be used for User Presence.

You should be able to flash OpenSK using the board definition nrf52840_dongle_dfu (simply follow the instructions we have for the Nordic nRF52840 dongleflashing over DFU and you should be fine).

from opensk.

wezm avatar wezm commented on July 22, 2024

I tried RAYTAC MDBT50Q-RX and it worked. https://www.raytac.com/product/ins.php?index_id=89

Note: you need to tweak pin settings for the led and the button. It would be safer to also change the pin for uart so that it won’t interfere with the reset pin.

@elfmimi I have one of these, did you publish your tweaks anywhere? I can work out the changes to the pins myself but figured if you've already done it I would ask first.

from opensk.

elfmimi avatar elfmimi commented on July 22, 2024

Here you are. @wezm
https://gist.github.com/elfmimi/e8ffd589fc7ca3794641803700d734aa

from opensk.

wezm avatar wezm commented on July 22, 2024

Here you are. @wezm

Wonderful, thank you.

from opensk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.