openhaystack-firmware: NRF51822 Firmware not working

So I have 4 NRF51822 Bluetooth modules and flashed 2 of them with the original openhaystack firmware which worked fine and flashed 2 with this firmare, with 2 different builds with the following command:

NRF_MODEL=nrf51 BOARD=BOARD_ALIEXPRESS ADV_KEY_BASE64=*MYBASE64ADVKEY* make build

When reading: https://github.com/acalatrava/openhaystack-firmware/issues/2 I figured lets test with the other board config with the following command: NRF_MODEL=nrf51 BOARD=BOARD=BOARD_SIMPLE ADV_KEY_BASE64=*MYBASE64ADVKEY* make build

But both of them fail to show up in OHS: afbeelding

Running on a macbook 13 inch 2020 v13.5

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 33 (4 by maintainers)

Most upvoted comments

WAIT WUTH, I just redid everything again, and just issued: NRF_MODEL=nrf51 BOARD=BOARD_ALIEXPRESS ADV_KEY_BASE64=*KEY* make patch with the patched board from @mowtschan and my own key this time I made sure the thing was off by making a small short on the board (just touching the + with the -) and now it is showing up!

I wouldn’t question it hahahaha. Niceee

@mowtschan As far as I understand, your PR is about using the internal RC instead of the external XTAL. The contents of “simple_board.h” that I have are matching your version. Compiling this results into

BUILD OPTIONS:
  SoftDevice  s130
  SDK         11
  nRF         nrf51822
  RAM         16 kB
  FLASH       256 kB
  Board       BOARD_SIMPLE
 
rm -rf ../../nrf5x-base/make/../dfu/_build
rm -rf _build/
rm -f *.jlink
rm -f JLink.log
rm -f .gdbinit
  CC        ../../nrf5x-base/make/../sdk/nrf51_sdk_11.0.0/components/toolchain/system_nrf51.c
  CC        ble_stack.c
  CC        main.c
  CC        openhaystack.c
  CC        ../../nrf5x-base/make/../sdk/nrf51_sdk_11.0.0/components/softdevice/common/softdevice_handler/softdevice_handler.c
  CC        ../../nrf5x-base/make/../sdk/nrf51_sdk_11.0.0/components/libraries/util/app_util_platform.c
  CC        ../../nrf5x-base/make/../sdk/nrf51_sdk_11.0.0/components/drivers_nrf/common/nrf_drv_common.c
  CC        ../../nrf5x-base/make/../sdk/nrf51_sdk_11.0.0/components/drivers_nrf/delay/nrf_delay.c
  CC        ../../nrf5x-base/make/../sdk/nrf51_sdk_11.0.0/components/libraries/util/app_error.c
  CC        ../../nrf5x-base/make/../sdk/nrf51_sdk_11.0.0/components/libraries/util/app_error_weak.c
  AS        ../../nrf5x-base/make/../startup/startup_nrf51.s
  LD        _build/openhaystack-alternative_s130.elf
/Applications/ArmGNUToolchain/11.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /Applications/ArmGNUToolchain/11.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-closer.o): in function `_close_r':
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/newlib-cygwin/newlib/libc/reent/closer.c:47: warning: _close is not implemented and will always fail
/Applications/ArmGNUToolchain/11.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /Applications/ArmGNUToolchain/11.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-lseekr.o): in function `_lseek_r':
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/newlib-cygwin/newlib/libc/reent/lseekr.c:49: warning: _lseek is not implemented and will always fail
/Applications/ArmGNUToolchain/11.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /Applications/ArmGNUToolchain/11.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-readr.o): in function `_read_r':
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/newlib-cygwin/newlib/libc/reent/readr.c:49: warning: _read is not implemented and will always fail
/Applications/ArmGNUToolchain/11.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /Applications/ArmGNUToolchain/11.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-writer.o): in function `_write_r':
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/newlib-cygwin/newlib/libc/reent/writer.c:49: warning: _write is not implemented and will always fail
  HEX       _build/openhaystack-alternative_s130.hex
  BIN       _build/openhaystack-alternative_s130.bin
  LST       _build/openhaystack-alternative_s130.lst
  SIZE      _build/openhaystack-alternative_s130.elf
   text	   data	    bss	    dec	    hex	filename
   5088	   1408	    892	   7388	   1cdc	_build/openhaystack-alternative_s130.elf
mkdir -p compiled
mergehex -m ../../nrf5x-base/sdk/nrf51_sdk_11.0.0/components/softdevice/s130/hex/s130_nrf51_2.0.0_softdevice.hex _build/openhaystack-alternative_s130.hex -o compiled/nrf51_firmware.hex
Parsing input files.
Merging file "s130_nrf51_2.0.0_softdevice.hex" into output.
Merging file "openhaystack-alternative_s130.hex" into output.
Storing merged file.
objcopy --input-target=ihex --output-target=binary compiled/nrf51_firmware.hex compiled/nrf51_firmware.bin

Flashing the resulting .bin is effectively the same as earlier: no beacon found.

Those messages about missing implementations are somehow concerning, to be honest.

@bruvv Removing the cables and shorting the power on the module after programming didn’t help in my case. Given that the original OHS FW works straight out of the box (tried it again successfully) is suggesting to me that the problem is not necessarily in the flashing or resets, but something in the binary.

Thanks a lot @Itheras and @mowtschan learned a lot 😃 Going to close this one and enjoy my tags

and just as a reminder: from readme

In case you can't or don't want to build the firmware, you can just patch existing firmware with your advertisement key from OpenHaystack app:

NRF_MODEL=nrf51 BOARD=BOARD_ALIEXPRESS ADV_KEY_BASE64=YOUR_ADVERTISEMENT_KEY make patch

@Itheras thanks for noticing, I just flashed your nrf51 firmware since I am missing the crystal, thanks @mowtschan for also pitching in. As far as I know, when using BOARD=BOARD_SIMPLE That is meant for my aliexpress board but without the crystal.

Try this delete everything in the output . then use this command. NRF_MODEL=nrf51 make build . after it finish building sent this command NRF_MODEL=nrf51 BOARD=BOARD_ALIEXPRESS ADV_KEY_BASE64=YOUR_ADVERTISEMENT_KEY make patch . then flash as before but use the bin that says patched.

let me know if that works.