I have tried to build my own firmware for ruuvitag and flashed it with dev board. It looked fine until i got a permaent red light at bootup. I thought it was my fault, so i erased tag memory and flashed back full hex with nrfjprog following this suggestion from the forum https://f.ruuvi.com/t/recovery-of-ruuvitag-from-scratch/1084, but nothing changed. Stiil permanent red light. So i tried flashing even the newest release from github (https://github.com/ruuvi/ruuvitag_fw/releases/download/v2.5.9/ruuvi_firmware_full_2.5.9.hex), but i got no luck. I tried from nrfConnect Android app, but the sensor is not showing up. I also changed the battery,but the result is still the same. Is there something else i can try or the sensor is definetely broken?
Thank you for your help!
Have you tried stepping in your program with Segger Embedded Studio or other debugger? It might give some clues on why you’re having red light on.
Most common reason is that there’s a leftover bootloader, but if you’re done a full erase it should not be an issue here.
I used the --eraseall option in nrfjprog, so i don’t think is a leftover bootloader…
From SES debbugger it looks like it is stuck in an endless loop while trying to execute task_advertisement_init(). Is this hardware related?
This could be related to crystals or DC/DC converter. If you can step into the function you can probably narrow down the exact error
From the debugger it looks like the code is stuck on this call from nrf_sdm.h file:
SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lf_cfg_t const * p_clock_lf_cfg, nrf_fault_handler_t fault_handler));
What could cause this? SES debugger is not helpful in assembler section
My guess is the crystals or corrupted hex.
The softdevice enable would fail ifs softdevice is not present or if 32 kHz or 32 MHz crystal is damaged. If you’re 100% sure that you programmed the _full hex and it’s not corrupted
MD5 (ruuvi_firmware_full_2.5.9.hex) = 258ac8c786106b9570bf4935e2227a57)
the crystals are most probable cause.
I’ve seen similar error where softdevice fails to start up on device where the 32 kHz crystal was cracked, in that unit the tuning for was clearly visible and manufacturer part number had torn off.