Skip to content

Not showing battery level nRF52810 #33

Description

@omarkhali

Last login: Thu Dec  4 14:17:49 on ttys001
omar@Mac-mini-OMAR ~ %
cd /Users/omar/Downloads/heystack-nrf5x-master/nrf52810/armgcc

source venv/bin/activate

make clean

make HAS_BATTERY=1 stflash-nrf52810_xxaa-patched
    ADV_KEYS_FILE=36KFLD_keyfile
    GNU_INSTALL_ROOT=/Users/omar/Downloads/heystack-nrf5x-master/nrf-sdk/gcc-arm-none-eabi-6-2017-q2-update/bin/

openocd -f openocd.cfg -c "init; halt; nrf5 mass_erase; reset; exit"

openocd -f openocd.cfg -c "init; halt; program _build/nrf52810_xxaa_s112_patched.bin verify; reset; exit"

zsh: command not found: #
zsh: unknown file attribute: ^
zsh: command not found: #
rm -rf _build
zsh: command not found: #
mkdir _build
cd _build && mkdir nrf52810_xxaa
Compiling file: es_battery_voltage_saadc.c
Compiling file: nrfx_saadc.c
Assembling file: gcc_startup_nrf52810.S
Compiling file: nrf_log_backend_rtt.c
Compiling file: nrf_log_backend_serial.c
Compiling file: nrf_log_backend_uart.c
Compiling file: nrf_log_default_backends.c
Compiling file: nrf_log_frontend.c
Compiling file: nrf_log_str_formatter.c
Compiling file: app_button.c
Compiling file: app_error.c
Compiling file: app_error_handler_gcc.c
Compiling file: app_error_weak.c
Compiling file: app_scheduler.c
Compiling file: app_timer.c
Compiling file: app_util_platform.c
Compiling file: hardfault_implementation.c
Compiling file: nrf_assert.c
Compiling file: nrf_atfifo.c
Compiling file: nrf_atflags.c
Compiling file: nrf_atomic.c
Compiling file: nrf_balloc.c
Compiling file: nrf_fprintf.c
Compiling file: nrf_fprintf_format.c
Compiling file: nrf_memobj.c
Compiling file: nrf_pwr_mgmt.c
Compiling file: nrf_ringbuf.c
Compiling file: nrf_section_iter.c
Compiling file: nrf_strerror.c
Compiling file: system_nrf52810.c
Compiling file: boards.c
Compiling file: nrf_drv_clock.c
Compiling file: nrfx_atomic.c
Compiling file: nrfx_clock.c
Compiling file: nrfx_gpiote.c
Compiling file: nrfx_prs.c
Compiling file: main.c
In file included from ../../main.c:54:0:
../../main.h:43:9: note: #pragma message: RTC_FREQUENCY: (32768 / (31 + 1))
 #pragma message("RTC_FREQUENCY: " _STRINGIFY(COMPUTED_RTC_FREQUENCY))
         ^~~~~~~
../../main.h:44:9: note: #pragma message: MAX_TIMER_INTERVAL_SECONDS: (0xFFFFFF / (32768 / (31 + 1)))
 #pragma message("MAX_TIMER_INTERVAL_SECONDS: " _STRINGIFY(COMPUTED_MAX_TIMER_INTERVAL))
         ^~~~~~~
Compiling file: ble_stack.c
Compiling file: SEGGER_RTT.c
Compiling file: SEGGER_RTT_Syscalls_GCC.c
Compiling file: SEGGER_RTT_printf.c
Compiling file: ble_advdata.c
Compiling file: ble_conn_params.c
Compiling file: ble_conn_state.c
Compiling file: ble_srv_common.c
Compiling file: nrf_ble_gatt.c
Compiling file: nrf_ble_qwr.c
Compiling file: utf.c
Compiling file: ble_lbs.c
Compiling file: nrf_sdh.c
Compiling file: nrf_sdh_ble.c
Compiling file: nrf_sdh_soc.c
Linking target: _build/nrf52810_xxaa.out
   text    data     bss     dec     hex filename
  11916     160     776   12852    3234 _build/nrf52810_xxaa.out
Preparing: _build/nrf52810_xxaa.hex
Preparing: _build/nrf52810_xxaa.bin
DONE nrf52810_xxaa
merging application and softdevice... : nrf52810_xxaa
mergehex -m _build/nrf52810_xxaa.hex ../../nrf-sdk/nRF5_SDK_15.3.0_59ac345/components/softdevice/s112/hex/s112_nrf52_6.1.1_softdevice.hex -o _build/nrf52810_xxaa_s112.hex
Parsing input files.
Merging file "nrf52810_xxaa.hex" into output.
Merging file "s112_nrf52_6.1.1_softdevice.hex" into output.
Storing merged file.
python -c "from intelhex import IntelHex; ih = IntelHex(); ih.loadhex('_build/nrf52810_xxaa_s112.hex'); ih.tobinfile('_build/nrf52810_xxaa_s112.bin')"
Patching nrf52810_xxaa
cp _build/nrf52810_xxaa_s112.bin _build/nrf52810_xxaa_s112_patched.bin
xxd -p -c 100000 36KFLD_keyfile | xxd -r -p | dd of=_build/nrf52810_xxaa_s112_patched.bin skip=1 bs=1 seek=112760 conv=notrunc
28+0 records in
28+0 records out
28 bytes transferred in 0.000070 secs (400000 bytes/sec)
#xxd -p -c 100000 _build/nrf52810_xxaa_s112_patched.bin | grep -q 2d6e20454e444f464b455953454e444f464b455953454e444f464b455953210a || (echo "The key was not patched correctly!"; exit 1)
'/Users/omar/Downloads/heystack-nrf5x-master/nrf-sdk/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-objcopy' -I binary -O elf32-littlearm -B arm _build/nrf52810_xxaa_s112_patched.bin _build/nrf52810_xxaa_s112_patched.elf
flashing application and softdevice...
openocd -f openocd.cfg -c "init; halt; nrf5 mass_erase; program _build/nrf52810_xxaa_s112_patched.bin verify; reset; exit";
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

nRF52 device has a CTRL-AP dedicated to recover the device from AP lock.
A high level adapter (like a ST-Link) you are currently using cannot access
the CTRL-AP so 'nrf52_recover' command will not work.
Do not enable UICR APPROTECT.

Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.243973
Info : [nrf52.cpu] Cortex-M4 r0p1 processor detected
Info : [nrf52.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
[nrf52.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x61000000 pc: 0x00011682 msp: 0x20005fc0
Info : nRF52810-QFAA(build code: D1) 192kB Flash, 24kB RAM
Info : Mass erase completed.
[nrf52.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
Warn : Adding extra erase range, 0x0001bf2c .. 0x0001bfff
** Programming Finished **
** Verify Started **
** Verified OK **
zsh: command not found: #
zsh: command not found: #
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

nRF52 device has a CTRL-AP dedicated to recover the device from AP lock.
A high level adapter (like a ST-Link) you are currently using cannot access
the CTRL-AP so 'nrf52_recover' command will not work.
Do not enable UICR APPROTECT.

Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.240795
Info : [nrf52.cpu] Cortex-M4 r0p1 processor detected
Info : [nrf52.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
[nrf52.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x61000000 pc: 0x00011682 msp: 0x20005fc0
Info : nRF52810-QFAA(build code: D1) 192kB Flash, 24kB RAM
Info : Mass erase completed.
zsh: command not found: #
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

nRF52 device has a CTRL-AP dedicated to recover the device from AP lock.
A high level adapter (like a ST-Link) you are currently using cannot access
the CTRL-AP so 'nrf52_recover' command will not work.
Do not enable UICR APPROTECT.

Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.240795
Info : [nrf52.cpu] Cortex-M4 r0p1 processor detected
Info : [nrf52.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
[nrf52.cpu] halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8
[nrf52.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
Info : nRF52810-QFAA(build code: D1) 192kB Flash, 24kB RAM
Warn : Adding extra erase range, 0x0001bf2c .. 0x0001bfff
** Programming Finished **
** Verify Started **
** Verified OK **
(venv) omar@Mac-mini-OMAR armgcc % 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions