Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where can I find info on uploading new firmware? #1

Open
bdruth opened this issue May 31, 2022 · 26 comments
Open

Where can I find info on uploading new firmware? #1

bdruth opened this issue May 31, 2022 · 26 comments

Comments

@bdruth
Copy link

bdruth commented May 31, 2022

I love the compact NRF51822 "beacon" module that you're using in your picture - where can I find info on setting these up to write new firmware? Hopefully something step-by-step on where to solder connections, etc.? Thanks!

p.s. this is the one I found on ali

@dakhnod
Copy link
Owner

dakhnod commented Jun 3, 2022

Are you talking about the round module of the square box?

Anyway, the one you found is pretty much the one I am using.

First of all, you need a JLink debugger. I am using a JLink edu that costs around 20€.

After that, you somehow need to break out the single-wire-connection.

To attach to the debug and voltage pins on the round board I am just using crocodile clips.

Just comment here once you got everything together.

@digitaltrousers
Copy link

Hi @dakhnod . Is there a reason Jlink is specified? Would something like the below work instead? In my country these are a lot more readily available and don't have to pay over 40EUR postage.

@dakhnod
Copy link
Owner

dakhnod commented Jun 11, 2022

@digitaltrousers I have no experience with any other boards.
I've heard that things like OpenOCD might work, but never worked with those.

After all, the nRF51 just speaks SWD, so you should have options.

@bdruth
Copy link
Author

bdruth commented Jun 11, 2022

@dakhnod - it'll take me a bit to get the JLink - I'll check back here when I've got it. Unless @digitaltrousers has luck with the picoprobe approach first :)

@lspeltie
Copy link

@bdruth
I successfully flashed it with an STLink V/2 and OpenOCD. I have a board very much like the one you linked but it was missing the low frequency crystal so it wouldn't work with the configuration for boards/beacon_round.h. I had to swap in some of the config from beacon_big.

Firmware working very well so far. Now to see how long the battery will last.

@0xsyit
Copy link

0xsyit commented Jul 1, 2022

does anyone have a picture with the pin outs? i just got my in Round Beacons from aliexpress im still waiting on the the little vibro-motors

EDIT
nvm i got it, here is a picture i found just in case anyone else needs it
HTB1T3LzoZbI8KJjy1zdq6ze1VXaa

@dakhnod
Copy link
Owner

dakhnod commented Jul 1, 2022

There should be two pairs of contact points on the board. One pair is for power, the one close to the battery soldier point is 3v.

The other pair (very close to the nrf51 ic) is swd, you need to trial and error those.

@0xsyit
Copy link

0xsyit commented Jul 1, 2022

There should be two pairs of contact points on the board. One pair is for power, the one close to the battery soldier point is 3v.

The other pair (very close to the nrf51 ic) is swd, you need to trial and error those.

Thank you, i was too afraid to break it. Im trying to understand how did you attach the vibrator motor, because i dont see anything hehe, i might be blind or too stupid :)

@dakhnod
Copy link
Owner

dakhnod commented Jul 1, 2022

Not sure what vibration motor you are talking about. I am using a vibration sensor, attached at the same contacts as the button.

@0xsyit
Copy link

0xsyit commented Jul 1, 2022

yes i mean vibration sensor, apologies for confusion. Thank you. I also noticed my Beacons are slightly different, there is few contacts on the left are exposed
photo_2022-07-01 06 49 17
t

@dakhnod
Copy link
Owner

dakhnod commented Jul 1, 2022

Oh, right, you're missing the 32khz crystal

@0xsyit
Copy link

0xsyit commented Jul 1, 2022

oh man, thats not good is it?

@dakhnod
Copy link
Owner

dakhnod commented Jul 1, 2022

It's okay, you just need to adjust the board config to use the internal Oszillator. Search for LFSRC or something similar in the board configs and you should be able to find reference. That will lead to a slightly higher power consumption, but nothing too worrying.

@0xsyit
Copy link

0xsyit commented Jul 1, 2022

Thank you kind sir :)

@biemster
Copy link

biemster commented Jul 9, 2022

I have the exact same board as @0xsyit , and just to confirm (this is my first nRF project) the low freq source should be changed in the sdk_config.h, #define CLOCK_CONFIG_LF_SRC 0 instead of 1?

@biemster
Copy link

biemster commented Jul 9, 2022

That didn't seem to do the trick :( @lspeltie I see that you had a similar issue, what config from beacon_big did you swap in? (@dakhnod should this discussion go to a new issue?)

@dakhnod
Copy link
Owner

dakhnod commented Jul 9, 2022

@biemster congratz to starting your first nRF project! I was struggling a lot with the whole setup back in the day, and it still poses quite a challenge every now and then.

You should set the proper value for NRF_CLOCK_LFCLKSRC.
You can compare this and this file to see examples.

Since you don't have a crystal, you need this configuration, which uses the internal RC circuit instead of an external XTAL.

@biemster
Copy link

biemster commented Jul 9, 2022

Thanks @dakhnod , that's clear instruction.
I've made the edit and used an stlink v2 and openocd to flash the s130 softdevice to the beacon and the nrf51822_xxac.hex to 0x1c000, but it's still not showing up on nrfconnect :(
I've put my own key in the keys.h file, so that shouldn't be the issue.
I guess I have to experiment some more, I'll write back when it works.

EDIT: also the ble_app_beacon_pca10028_s130.hex and even blinky_pca10028_s130.hex from the SDK does not work when I use this method, so there must be something going wrong with flashing

EDIT2: it works now! softdevice s130 v2 has an APP_CODE_BASE of 0x1b000, as opposed to 0x1c000 for v1, and I had to write the nrf51822_xxac.bin instead of the hex for some reason..
Awesome work @dakhnod , I'll keep experimenting with these!

@digitaltrousers
Copy link

@bdruth, if you're still wondering about flashing using the Pi Pico, it worked fine for me, although I had to slow it down from the default 1MHz. I just took a zero off the line:
adapter speed 1000
in the openocd/scripts/target/nrf51.cfg file.

@dakhnod
Copy link
Owner

dakhnod commented Jul 10, 2022

If you have a suitable debugger I would highly advise you to get RTT to work to read the debug output of my code.

@jrusi
Copy link

jrusi commented Apr 9, 2023

@dakhnod how is it possible to get the battery status in OpenHaystack app?

@dakhnod
Copy link
Owner

dakhnod commented Apr 9, 2023

@jrusi no idea. Also, I don't think my app is really compatible with OoenHaystack, since they use different key derivation mechanisms.

@rkreutz
Copy link

rkreutz commented May 22, 2024

A bit late to the party, but @dakhnod could you point to what vibration sensor you were using on your project? I have no idea of what kind of sensor could be used along with the small battery the beacon has. Thanks

@dakhnod
Copy link
Owner

dakhnod commented May 22, 2024

@rkreutz it was an sw-18020 or something. Incredibly simple, reliable and 0 idle current.

@rkreutz
Copy link

rkreutz commented May 23, 2024

That's helpful thanks. And you mentioned you just attached it to the button, did you actually solder it or just put it on contact with the button's terminals?

@dakhnod
Copy link
Owner

dakhnod commented May 23, 2024

Soldered it. I don't see a reliable way of connecting it otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants