Issues flashing nrf52833 device with v1.8.0 bricking device

Hi, 

I have encountered issues flashing a NRF52833 board which is on a custom PCB. I have picked the project up from another developer so it is somewhat developed already. The project is using the v1.8.0 sdk. I have the SDK installed and worked, I am able to build the project without issue. I am developing with vs code and the nrf connect addon. Following instructions left by the previous developer I set the environment up, and build the hex file successfully. I used both jflash-lite and nrfconnect to flash. The first couple of attempts were successful and then the board became unresponsive. I have tried on 3 boards all which became unresponsive. 

I went back to the original developer to work through the problem and I used his instance of the project for comparison, with his instance he could flash the device without issue. He has a copy of my instance inline with his (so that they became identical on his machine) and found that when flashing his board became unresponsive also. 

The only additional changes I could find from previous releases in the build config were additional cmake cmds:

"-DBOARD_ROOT=\"c:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833\"",
"-Dmcuboot_DTC_OVERLAY_FILE=\"C:/ncs/v1.8.0/nrf/modules/mcuboot/usb.overlay\"",
"-Dmcuboot_OVERLAY_CONFIG=\"C:/ncs/v1.8.0/nrf/subsys/partition_manager/partition_manager_enabled.conf\""


I performed a full reinstallation of sdk and clean project without additional cmake cmds, and was able to eventually achieve flashing the device with a release config that was repeatable without issue... 

5023.prjRelease.conf

With that working, but not understanding what causes the issue on either my setup or the previous developers, I then needed to build a debug instance to make code changes and see the output. Using this config I built the project, and immediately experience the same bricked device issue. 
This is the output from the debug build session which bricked the board. Would you be able to offer any insight into what is causing the issue? We are board 4 PCBs bricked now, where any command line recovery tools timeout with:

Connecting to J-Link...
Bank selection: BankAddr=0x00000000 Enabled
Bank selection: BankAddr=0x10001000 Enabled
Loader selection: BankAddr=0x00000000 Loader=Default
Loader selection: BankAddr=0x10001000 Loader=Default
Connecting to target...
ERROR: Could not connect to target.
Done.
Debug session build output:

 *  Executing task: nRF Connect: Generate config nrf52833dk_nrf52833 for c:\Users\voidn_l4qz259\Documents\GitHub\Eclateral\AsclepiusFirmware\Asclepius_reader_nrf52833 

Building Asclepius_reader_nrf52833
C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/build_debug c:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833 --pristine --board nrf52833dk_nrf52833 -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/prjDebugManufacturing.conf -DBOARD_ROOT=c:/users/voidn_l4qz259/documents/github/eclateral/asclepiusfirmware/asclepius_reader_nrf52833"

-- west build: generating a build system
Including boilerplate (Zephyr base): C:/ncs/v1.8.0/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833
-- Zephyr version: 2.7.0 (C:/ncs/v1.8.0/zephyr), build: v2.7.0-ncs1
-- Found Python3: C:/ncs/v1.8.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
-- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
-- Board: nrf52833dk_nrf52833
-- Cache files will be written to: C:/ncs/v1.8.0/zephyr/.cache
-- Found dtc: C:/ncs/v1.8.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (c:/ncs/v1.8.0/toolchain/opt)
-- Found BOARD.dts: C:/ncs/v1.8.0/zephyr/boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833.dts
-- Found devicetree overlay: C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/boards/nrf52833dk_nrf52833.overlay
-- Generated zephyr.dts: C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/build_debug/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/build_debug/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/build_debug/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/build_debug/zephyr/dts.cmake

warning: BT_DIS_MODEL (defined at C:/ncs/v1.8.0/zephyr/subsys/bluetooth/services\Kconfig.dis:26,
subsys/bluetooth\services\Kconfig.dis:26) was assigned the value 'v0.0.1' but got the value ''.
Check these unsatisfied dependencies: ((BT_DIS && BT_CONN && BT_RPC_STACK) || (BT_DIS && BT_CONN &&
BT_HCI && BT)) (=n). See
http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BT_DIS_MODEL.html and/or look up
BT_DIS_MODEL in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: BT_DIS_MANUF (defined at C:/ncs/v1.8.0/zephyr/subsys/bluetooth/services\Kconfig.dis:32,
subsys/bluetooth\services\Kconfig.dis:32) was assigned the value 'Eclateral' but got the value ''.
Check these unsatisfied dependencies: ((BT_DIS && BT_CONN && BT_RPC_STACK) || (BT_DIS && BT_CONN &&
BT_HCI && BT)) (=n). See
Parsing C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/Kconfig
Loaded configuration 'C:/ncs/v1.8.0/zephyr/boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833_defconfig'
Merged configuration 'c:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/prjDebugManufacturing.conf'
Configuration saved to 'C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/build_debug/zephyr/.config'
Kconfig header saved to 'C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/build_debug/zephyr/include/generated/autoconf.h'
http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BT_DIS_MANUF.html and/or look up
BT_DIS_MANUF in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: BT_DIS_FW_REV_STR (defined at
C:/ncs/v1.8.0/zephyr/subsys/bluetooth/services\Kconfig.dis:117,
subsys/bluetooth\services\Kconfig.dis:117) was assigned the value 'v0.0.7' but got the value ''.
Check these unsatisfied dependencies: ((BT_DIS_FW_REV && BT_DIS && BT_CONN && BT_RPC_STACK) ||
(BT_DIS_FW_REV && BT_DIS && BT_CONN && BT_HCI && BT)) (=n). See
http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BT_DIS_FW_REV_STR.html and/or look up
BT_DIS_FW_REV_STR in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.

-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/ncs/v1.8.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
CMake Warning at C:/ncs/v1.8.0/zephyr/subsys/bluetooth/host/CMakeLists.txt:103 (message):
  CONFIG_BT_FIXED_PASSKEY is enabled

    A fixed passkey is easy to deduce during the pairing procedure, do not use in
    production.


CMake Warning at C:/ncs/v1.8.0/zephyr/subsys/usb/CMakeLists.txt:22 (message):
  CONFIG_USB_DEVICE_VID has default value 0x2FE3.

  This value is only for testing and MUST be configured for USB products.


-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/voidn_l4qz259/Documents/GitHub/Eclateral/AsclepiusFirmware/Asclepius_reader_nrf52833/build_debug
-- west build: building application
[1/273] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
[2/273] Generating include/generated/driver-validation.h
[3/273] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
[4/273] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
[5/273] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
[6/273] Generating include/generated/offsets.h
[7/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/utils/addr_utils.c.obj
[8/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
[9/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
[10/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
[11/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
[12/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
[13/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
[14/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/dfu/img_util/flash_img.c.obj
[15/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
[16/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
[17/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
[18/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
[19/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
[20/273] Building ASM object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj
[21/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
[22/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/console/getline.c.obj
[23/273] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
[24/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
[25/273] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
[26/273] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
[27/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_line.c.obj
[28/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/ring_buffer.c.obj
[29/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/bas.c.obj
[30/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_store.c.obj
[31/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_nvs.c.obj
[32/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_init.c.obj
[33/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/usb_work_q.c.obj
[34/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map.c.obj
[35/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/usb_device.c.obj
[36/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map_default.c.obj
[37/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/fs/nvs/nvs.c.obj
[38/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings.c.obj
[39/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/usb_transfer.c.obj
[40/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
[41/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/pm_ctrl.c.obj
[42/273] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v1.8.0/modules/crypto/tinycrypt/lib/source/utils.c.obj
[43/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/stream/stream_flash.c.obj
[44/273] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v1.8.0/modules/crypto/tinycrypt/lib/source/cmac_mode.c.obj
[45/273] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v1.8.0/modules/crypto/tinycrypt/lib/source/aes_encrypt.c.obj
[46/273] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v1.8.0/modules/crypto/tinycrypt/lib/source/ecc_dh.c.obj
[47/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/power.c.obj
[48/273] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v1.8.0/modules/crypto/tinycrypt/lib/source/aes_decrypt.c.obj
[49/273] Generating linker_zephyr_prebuilt.cmd
[50/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/class/cdc_acm.c.obj
[51/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy/policy_residency.c.obj
[52/273] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
[53/273] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
[54/273] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/usb_descriptor.c.obj
[55/273] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
[56/273] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
[57/273] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
[58/273] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
[59/273] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v1.8.0/modules/crypto/tinycrypt/lib/source/ecc.c.obj
[60/273] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
[61/273] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault_s.S.obj
[62/273] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
[63/273] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
[64/273] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
[65/273] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
[66/273] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
[67/273] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
[68/273] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
[69/273] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/reset.S.obj
[70/273] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/irq_init.c.obj
[71/273] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fpu.c.obj
[72/273] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
[73/273] Building C object zephyr/lib/libc/newlib/CMakeFiles/lib__libc__newlib.dir/libc-hooks.c.obj
[74/273] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
[75/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/util/src/mcumgr_util.c.obj
[76/273] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_core_mpu.c.obj
[77/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/smp/src/smp.c.obj
[78/273] Linking C static library zephyr\arch\common\libisr_tables.a
[79/273] Linking C static library zephyr\arch\arch\arm\core\aarch32\libarch__arm__core__aarch32.a
[80/273] Building C object modules/tinycbor/CMakeFiles/..__modules__lib__tinycbor__zephyr.dir/C_/ncs/v1.8.0/modules/lib/tinycbor/src/cbor_buf_reader.c.obj
[81/273] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_mpu.c.obj
[82/273] Building C object modules/tinycbor/CMakeFiles/..__modules__lib__tinycbor__zephyr.dir/C_/ncs/v1.8.0/modules/lib/tinycbor/src/cborerrorstrings.c.obj
[83/273] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
[84/273] Linking C static library zephyr\lib\libc\newlib\liblib__libc__newlib.a
[85/273] Building C object modules/segger/CMakeFiles/modules__segger.dir/SEGGER_RTT_zephyr.c.obj
[86/273] Building C object modules/tinycbor/CMakeFiles/..__modules__lib__tinycbor__zephyr.dir/C_/ncs/v1.8.0/modules/lib/tinycbor/src/cbor_buf_writer.c.obj
[87/273] Building C object modules/tinycbor/CMakeFiles/..__modules__lib__tinycbor__zephyr.dir/C_/ncs/v1.8.0/modules/lib/tinycbor/src/cborencoder.c.obj
[88/273] Building C object modules/tinycbor/CMakeFiles/..__modules__lib__tinycbor__zephyr.dir/C_/ncs/v1.8.0/modules/lib/tinycbor/src/cborparser_dup_string.c.obj
[89/273] Building C object modules/segger/CMakeFiles/modules__segger.dir/C_/ncs/v1.8.0/modules/debug/segger/SEGGER/SEGGER_RTT.c.obj
[90/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/errno.c.obj
[91/273] Linking C static library zephyr\arch\arch\arm\core\aarch32\mpu\libarch__arm__core__aarch32__mpu.a
[92/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/main_weak.c.obj
[93/273] Linking C static library zephyr\arch\common\libarch__common.a
[94/273] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\libarch__arm__core__aarch32__cortex_m.a
[95/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/banner.c.obj
[96/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/version.c.obj
[97/273] Building C object modules/tinycbor/CMakeFiles/..__modules__lib__tinycbor__zephyr.dir/C_/ncs/v1.8.0/modules/lib/tinycbor/src/cborparser.c.obj
[98/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
[99/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/device.c.obj
[100/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mem_slab.c.obj
[101/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/thread.c.obj
[102/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/kheap.c.obj
[103/273] Linking C static library modules\segger\libmodules__segger.a
[104/273] Linking C static library modules\tinycbor\lib..__modules__lib__tinycbor__zephyr.a
[105/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/init.c.obj
[106/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/system_work_q.c.obj
[107/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/idle.c.obj
[108/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/msg_q.c.obj
[109/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mutex.c.obj
[110/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/pipes.c.obj
[111/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sem.c.obj
[112/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mailbox.c.obj
[113/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/xip.c.obj
[114/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/stack.c.obj
[115/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/queue.c.obj
[116/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timer.c.obj
[117/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timeout.c.obj
[118/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/condvar.c.obj
[119/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/poll.c.obj
[120/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mempool.c.obj
[121/273] Building C object CMakeFiles/app.dir/src/main.c.obj
../src/main.c: In function 'main':
../src/main.c:352:57: warning: passing argument 1 of 'fsm_notifyBatteryStatus' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
  352 |             uint8_t timerFlag = fsm_notifyBatteryStatus(&checkBatteryStatusFlag);
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/main.c:24:
../src/fsm.h:30:42: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'volatile uint8_t *' {aka 'volatile unsigned char *'}
   30 | uint8_t fsm_notifyBatteryStatus(uint8_t *readyToNotify);
      |                                 ~~~~~~~~~^~~~~~~~~~~~~
[122/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/work.c.obj
[123/273] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
[124/273] Building C object CMakeFiles/app.dir/src/spi_wrapper.c.obj
[125/273] Building C object CMakeFiles/app.dir/src/i2c_wrapper.c.obj
[126/273] Building C object CMakeFiles/app.dir/src/nrf52Port.c.obj
../src/nrf52Port.c: In function 'nrf52Port_toggleLed1Blue':
../src/nrf52Port.c:182:9: warning: unused variable 'i' [-Wunused-variable]
  182 |     int i = gpio_pin_toggle(LEDGpioPort0, LED1_BLUE);
      |         ^
../src/nrf52Port.c: In function 'nrf52Port_toggleLed1Green':
../src/nrf52Port.c:188:9: warning: unused variable 'i' [-Wunused-variable]
  188 |     int i = gpio_pin_toggle(LEDGpioPort0, LED1_GREEN);
      |         ^
../src/nrf52Port.c: In function 'nrf52Port_toggleLed1Red':
../src/nrf52Port.c:194:9: warning: unused variable 'i' [-Wunused-variable]
  194 |     int i = gpio_pin_toggle(LEDGpioPort1, LED1_RED);
      |         ^
At top level:
../src/nrf52Port.c:64:13: warning: 'initResetGpio' defined but not used [-Wunused-function]
   64 | static void initResetGpio(void)
      |             ^~~~~~~~~~~~~
[127/273] Building C object CMakeFiles/app.dir/src/bq25121.c.obj
[128/273] Building C object CMakeFiles/app.dir/src/Impedance.c.obj
[129/273] Building C object CMakeFiles/app.dir/src/SqrWaveVoltammetry.c.obj
../src/SqrWaveVoltammetry.c: In function 'RampDacRegUpdate':
../src/SqrWaveVoltammetry.c:469:5: warning: enumeration value 'SWV_STATE3' not handled in switch [-Wswitch]
  469 |     switch (AppSWVCfg.RampStateSWV)
      |     ^~~~~~
../src/SqrWaveVoltammetry.c:469:5: warning: enumeration value 'SWV_STATE4' not handled in switch [-Wswitch]
[130/273] Building C object CMakeFiles/app.dir/src/RampTest.c.obj
../src/RampTest.c: In function 'RampDacRegUpdate':
../src/RampTest.c:466:9: warning: enumeration value 'RAMP_STATE2' not handled in switch [-Wswitch]
  466 |         switch (AppRAMPCfg.RampState)
      |         ^~~~~~
../src/RampTest.c:466:9: warning: enumeration value 'RAMP_STATE3' not handled in switch [-Wswitch]
[131/273] Building C object CMakeFiles/app.dir/src/EEPROM.c.obj
[132/273] Building C object CMakeFiles/app.dir/src/parser.c.obj
[133/273] Building C object CMakeFiles/app.dir/src/uart_interface.c.obj
[134/273] Building C object CMakeFiles/app.dir/src/build_config.c.obj
[135/273] Building C object CMakeFiles/app.dir/src/ChronoAmperometric.c.obj
../src/ChronoAmperometric.c:25:1: warning: missing braces around initializer [-Wmissing-braces]
   25 | {
      | ^
......
   48 |         .RtiaCalValue = 0,
      |                         {}
../src/ChronoAmperometric.c: In function 'AppCHRONOAMPTransientMeasureGen':
../src/ChronoAmperometric.c:314:169: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses]
  314 |     AD5940_WriteReg(REG_AFE_LPDACDAT0, (uint32_t)((AppCHRONOAMPCfg.Vzero - 200) / DAC6BITVOLT_1LSB) << 12 | (int32_t)((AppCHRONOAMPCfg.SensorBias) / DAC12BITVOLT_1LSB) + VzeroCode * 64);
      |                                                                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
[136/273] Building C object CMakeFiles/app.dir/src/AD5940_Temperature.c.obj
../src/AD5940_Temperature.c: In function 'AD5940_TempPlatformCfg':
../src/AD5940_Temperature.c:53:17: warning: unused variable 'gpio_cfg' [-Wunused-variable]
   53 |   AGPIOCfg_Type gpio_cfg;
      |                 ^~~~~~~~
[137/273] Building C object CMakeFiles/app.dir/src/AFE_interface.c.obj
../src/AFE_interface.c:2083:37: warning: "/*" within comment [-Wcomment]
 2083 |         if (resultsCanBeTaken == 1) /*(typeOfmeasurement != M_RET_TYPE_PRINT_CYCLE) && (typeOfmeasurement != 0)*/
      |                                      
../src/AFE_interface.c:2061:22: warning: 'pImp' defined but not used [-Wunused-variable]
 2061 | static fImpPol_Type *pImp;
      |                      ^~~~
../src/AFE_interface.c:2059:14: warning: 'Re' defined but not used [-Wunused-variable]
 2059 | static float Re = 0;
      |              ^~
../src/AFE_interface.c:2045:32: warning: 'IMPMeasurement' defined but not used [-Wunused-variable]
 2045 | static AFE_ParametersStructure IMPMeasurement =
      |                                ^~~~~~~~~~~~~~
../src/AFE_interface.c:2043:13: warning: 'startProcess' defined but not used [-Wunused-variable]
 2043 | static bool startProcess = false;
      |             ^~~~~~~~~~~~
../src/AFE_interface.c:2041:17: warning: 'dataCounter' defined but not used [-Wunused-variable]
 2041 | static uint16_t dataCounter = 0; //counter of samples of one measurement
      |                 ^~~~~~~~~~~
../src/AFE_interface.c:2040:16: warning: 'typeOfmeasurement' defined but not used [-Wunused-variable]
 2040 | static uint8_t typeOfmeasurement = 0;
      |                ^~~~~~~~~~~~~~~~~
../src/AFE_interface.c:1867:13: warning: 'initPlatformFirstTimeWithWriteReg' defined but not used [-Wunused-function]
 1867 | static void initPlatformFirstTimeWithWriteReg(void)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/AFE_interface.c:1398:13: warning: 'setVoltagesToZero' defined but not used [-Wunused-function]
 1398 | static void setVoltagesToZero(void)
      |             ^~~~~~~~~~~~~~~~~
../src/AFE_interface.c:1066:13: warning: 'AFEOpenAllSwitches' defined but not used [-Wunused-function]
 1066 | static void AFEOpenAllSwitches(void)
      |             ^~~~~~~~~~~~~~~~~~
[138/273] Linking C static library zephyr\kernel\libkernel.a
[139/273] Building C object CMakeFiles/app.dir/src/usb.c.obj
../src/usb.c: In function 'usb_handler':
../src/usb.c:38:5: warning: enumeration value 'USB_DC_ERROR' not handled in switch [-Wswitch]
   38 |     switch (status)
      |     ^~~~~~
../src/usb.c:38:5: warning: enumeration value 'USB_DC_RESET' not handled in switch [-Wswitch]
../src/usb.c:38:5: warning: enumeration value 'USB_DC_CONFIGURED' not handled in switch [-Wswitch]
../src/usb.c:38:5: warning: enumeration value 'USB_DC_SUSPEND' not handled in switch [-Wswitch]
../src/usb.c:38:5: warning: enumeration value 'USB_DC_RESUME' not handled in switch [-Wswitch]
../src/usb.c:38:5: warning: enumeration value 'USB_DC_INTERFACE' not handled in switch [-Wswitch]
../src/usb.c:38:5: warning: enumeration value 'USB_DC_SET_HALT' not handled in switch [-Wswitch]
../src/usb.c:38:5: warning: enumeration value 'USB_DC_CLEAR_HALT' not handled in switch [-Wswitch]
../src/usb.c:38:5: warning: enumeration value 'USB_DC_SOF' not handled in switch [-Wswitch]
../src/usb.c:38:5: warning: enumeration value 'USB_DC_UNKNOWN' not handled in switch [-Wswitch]
../src/usb.c:49:9: warning: 'return' with a value, in function returning void [-Wreturn-type]
   49 |  return chargingStatus;
      |         ^~~~~~~~~~~~~~
../src/usb.c:36:13: note: declared here
   36 | static void usb_handler(enum usb_dc_status_code status, const uint8_t *param)
      |             ^~~~~~~~~~~
../src/usb.c: In function 'interrupt_handler':
../src/usb.c:61:18: warning: unused variable 'rb_len' [-Wunused-variable]
   61 |    int recv_len, rb_len;
      |                  ^~~~~~
../src/usb.c: In function 'USB_init':
../src/usb.c:80:11: warning: unused variable 'dtr' [-Wunused-variable]
   80 |  uint32_t dtr = 0U;
      |           ^~~
[140/273] Building C object CMakeFiles/app.dir/src/led.c.obj
../src/led.c:103:13: warning: 'resultNotValid' defined but not used [-Wunused-variable]
  103 | static bool resultNotValid = true;
      |             ^~~~~~~~~~~~~~
../src/led.c:82:13: warning: 'toggleLedsBatteryTooLow' defined but not used [-Wunused-variable]
   82 | static bool toggleLedsBatteryTooLow = false;
      |             ^~~~~~~~~~~~~~~~~~~~~~~
../src/led.c:16:13: warning: 'toggleLedGreenMeasurementInProgress' defined but not used [-Wunused-variable]
   16 | static bool toggleLedGreenMeasurementInProgress = false;
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/led.c:15:13: warning: 'toggleLedsPercent' defined but not used [-Wunused-variable]
   15 | static bool toggleLedsPercent = false;
      |             ^~~~~~~~~~~~~~~~~
[141/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
[142/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
[143/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
[144/273] Building C object CMakeFiles/app.dir/src/ad5940.c.obj
../src/ad5940.c: In function 'AD5940_SoftRst':
../src/ad5940.c:2998:3: warning: implicit declaration of function 'printk'; did you mean 'printf'? [-Wimplicit-function-declaration]
 2998 |   printk("AFE Softrest Write Register successfull\n");
      |   ^~~~~~
      |   printf
../src/ad5940.c: In function 'AD5940_ADCPGACal':
../src/ad5940.c:3224:31: warning: 'HSDACCode' may be used uninitialized in this function [-Wmaybe-uninitialized]
 3224 |       hsloop_cfg.WgCfg.WgCode = HSDACCode;
      |       ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
[145/273] Building C object CMakeFiles/app.dir/src/led_controller.c.obj
../src/led_controller.c: In function 'batteryStatusHandler':
../src/led_controller.c:40:5: warning: implicit declaration of function 'batteryLedControl' [-Wimplicit-function-declaration]
   40 |     batteryLedControl(GetChargingInProgress(), GetBatteryCapacity());
      |     ^~~~~~~~~~~~~~~~~
../src/led_controller.c: At top level:
../src/led_controller.c:136:6: warning: conflicting types for 'batteryLedControl'
  136 | void batteryLedControl(bool chargingStatus, uint8_t batteryCapacity)
      |      ^~~~~~~~~~~~~~~~~
../src/led_controller.c:40:5: note: previous implicit declaration of 'batteryLedControl' was here
   40 |     batteryLedControl(GetChargingInProgress(), GetBatteryCapacity());
      |     ^~~~~~~~~~~~~~~~~
[146/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
[147/273] Building C object zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj
[148/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
[149/273] Building C object CMakeFiles/app.dir/src/BLE_module.c.obj
../src/BLE_module.c: In function 'receiveCharacteristicReadCallback':
../src/BLE_module.c:224:50: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]
  224 |  printk("transmitReadCallback: BleCb.transmit = %s\n", lastCommand);
      |                                                 ~^     ~~~~~~~~~~~
      |                                                  |     |
      |                                                  |     int
      |                                                  char *
      |                                                 %d
../src/BLE_module.c: In function 'transmitCharacteristicReadCallback':
../src/BLE_module.c:250:2: warning: 'return' with no value, in function returning non-void [-Wreturn-type]
  250 |  return;
      |  ^~~~~~
../src/BLE_module.c:231:16: note: declared here
  231 | static ssize_t transmitCharacteristicReadCallback(struct bt_conn *conn, const struct bt_gatt_attr *attr,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/BLE_module.c: In function 'receiveCharacteristicWriteCallback':
../src/BLE_module.c:263:65: warning: format '%d' expects argument of type 'int', but argument 2 has type 'uint8_t *' {aka 'unsigned char *'} [-Wformat=]
  263 |  printk("\nReceive parameter write callback: recevied packet = %d \n", receivedValue);
      |                                                                ~^      ~~~~~~~~~~~~~
      |                                                                 |      |
      |                                                                 int    uint8_t * {aka unsigned char *}
      |                                                                %hhn
../src/BLE_module.c: In function 'BLE_sendTestResults':
../src/BLE_module.c:406:35: warning: format '%d' expects a matching 'int' argument [-Wformat=]
  406 |   printk("get recevied command = %d\n");
      |                                  ~^
      |                                   |
      |                                   int
../src/BLE_module.c: In function 'uIDInformationWriteCallback':
../src/BLE_module.c:594:5: warning: implicit declaration of function 'EEPROM_writeUIDInformation'; did you mean 'EEPROM_readUIDInformation'? [-Wimplicit-function-declaration]
  594 |     EEPROM_writeUIDInformation(&uIDInformation[0]);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |     EEPROM_readUIDInformation
../src/BLE_module.c: In function 'BLE_getDeviceName':
../src/BLE_module.c:605:9: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  605 |  return bt_get_name();
      |         ^~~~~~~~~~~~~
../src/BLE_module.c: In function 'receiveCharacteristicWriteCallback':
../src/BLE_module.c:305:1: warning: control reaches end of non-void function [-Wreturn-type]
  305 | }
      | ^
At top level:
../src/BLE_module.c:514:31: warning: 'auth_cb_display' defined but not used [-Wunused-variable]
  514 | static struct bt_conn_auth_cb auth_cb_display = {
      |                               ^~~~~~~~~~~~~~~
[150/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
[151/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
[152/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
[153/273] Building C object CMakeFiles/app.dir/src/fsm.c.obj
../src/fsm.c: In function 'fsm_initReaderState':
../src/fsm.c:408:40: warning: passing argument 1 of 'EEPROM_readUIDInformation' from incompatible pointer type [-Wincompatible-pointer-types]
  408 |     status = EEPROM_readUIDInformation(&uIDInfo);
      |                                        ^~~~~~~~
      |                                        |
      |                                        char (*)[32]
In file included from ../src/fsm.c:21:
../src/EEPROM.h:187:37: note: expected 'char *' but argument is of type 'char (*)[32]'
  187 | int EEPROM_readUIDInformation(char *UidInfo);
      |                               ~~~~~~^~~~~~~
../src/fsm.c:465:35: warning: passing argument 2 of 'k_timer_init' from incompatible pointer type [-Wincompatible-pointer-types]
  465 |     k_timer_init(&inactvityTimer, inactivityShutDown, NULL);
      |                                   ^~~~~~~~~~~~~~~~~~
      |                                   |
      |                                   void (*)(void)
In file included from C:/ncs/v1.8.0/zephyr/include/zephyr.h:18,
                 from ../src/fsm.c:7:
C:/ncs/v1.8.0/zephyr/include/kernel.h:1379:22: note: expected 'k_timer_expiry_t' {aka 'void (*)(struct k_timer *)'} but argument is of type 'void (*)(void)'
 1379 |     k_timer_expiry_t expiry_fn,
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~
../src/fsm.c: In function 'fsm_standByBleConnectedState':
../src/fsm.c:549:9: warning: implicit declaration of function 'BLE_ClearTransmitReceivedCommand'; did you mean 'BLE_setTransmitReceivedCommand'? [-Wimplicit-function-declaration]
  549 |         BLE_ClearTransmitReceivedCommand();
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         BLE_setTransmitReceivedCommand
../src/fsm.c: In function 'fsm_readingFlashState':
../src/fsm.c:600:13: warning: implicit declaration of function 'EEPROM_resetReadIndex'; did you mean 'EEPROM_readWriteIndex'? [-Wimplicit-function-declaration]
  600 |             EEPROM_resetReadIndex();
      |             ^~~~~~~~~~~~~~~~~~~~~
      |             EEPROM_readWriteIndex
../src/fsm.c:601:13: warning: implicit declaration of function 'BLE_clearIndexCounter' [-Wimplicit-function-declaration]
  601 |             BLE_clearIndexCounter();
      |             ^~~~~~~~~~~~~~~~~~~~~
../src/fsm.c:602:13: warning: implicit declaration of function 'BLE_clearTestResultCommandFlag' [-Wimplicit-function-declaration]
  602 |             BLE_clearTestResultCommandFlag();
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fsm.c:603:13: warning: implicit declaration of function 'BLE_clearPacketNumber' [-Wimplicit-function-declaration]
  603 |             BLE_clearPacketNumber();
      |             ^~~~~~~~~~~~~~~~~~~~~
../src/fsm.c: In function 'fsm_receivingParametersState':
../src/fsm.c:631:5: warning: enumeration value 'LeverLifted' not handled in switch [-Wswitch]
  631 |     switch (CassetteLeverStatus)
      |     ^~~~~~
../src/fsm.c: In function 'fsm_measuringState':
../src/fsm.c:739:9: warning: implicit declaration of function 'SetTemperatureForBLE' [-Wimplicit-function-declaration]
  739 |         SetTemperatureForBLE(temperature);
      |         ^~~~~~~~~~~~~~~~~~~~
../src/fsm.c: In function 'fsm_bleSendingDataState':
../src/fsm.c:860:22: warning: implicit declaration of function 'BLE_getRequestedPacketIndex' [-Wimplicit-function-declaration]
  860 |                 if ((BLE_getRequestedPacketIndex()+1) > (measurementIndex + 1) * maxNumberOfPacketsPerElectrode)
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fsm.c:876:21: warning: implicit declaration of function 'BLE_setIndexCounter' [-Wimplicit-function-declaration]
  876 |                     BLE_setIndexCounter(BLE_getRequestedPacketIndex() - (measurementIndex * maxNumberOfPacketsPerElectrode));
      |                     ^~~~~~~~~~~~~~~~~~~
../src/fsm.c:886:47: warning: format '%d' expects argument of type 'int', but argument 2 has type 'uint8_t (*)(void)' {aka 'unsigned char (*)(void)'} [-Wformat=]
  886 |                     printk("device status is %d compared to %d\n", BLE_getDeviceStatus, DS_SENTINEL_VALUE);
      |                                              ~^                    ~~~~~~~~~~~~~~~~~~~
      |                                               |                    |
      |                                               int                  uint8_t (*)(void) {aka unsigned char (*)(void)}
../src/fsm.c: In function 'parser_ParseCommandsMethod':
../src/fsm.c:1003:23: warning: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
 1003 |         int icValue = atoi(token + 2);
      |                       ^~~~
../src/fsm.c:1047:25: warning: implicit declaration of function 'EEPROM_writeUIDInformation'; did you mean 'EEPROM_readUIDInformation'? [-Wimplicit-function-declaration]
 1047 |                result = EEPROM_writeUIDInformation(&uIDInfo[0]);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                         EEPROM_readUIDInformation
../src/fsm.c: In function 'actionHandler':
../src/fsm.c:1102:18: warning: passing argument 1 of 'ReadPort' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1102 |         ReadPort(token, command);
      |                  ^~~~~
../src/fsm.c:113:28: note: expected 'char *' but argument is of type 'const char *'
  113 | static void ReadPort(char* token,CommandInfo* command);
      |                      ~~~~~~^~~~~
../src/fsm.c:1106:22: warning: passing argument 1 of 'ReadRegister' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1106 |         ReadRegister(token, command);
      |                      ^~~~~
../src/fsm.c:115:32: note: expected 'char *' but argument is of type 'const char *'
  115 | static void ReadRegister(char* token,CommandInfo* command);
      |                          ~~~~~~^~~~~
../src/fsm.c:1110:20: warning: passing argument 1 of 'ReadMemory' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1110 |         ReadMemory(token, command);
      |                    ^~~~~
../src/fsm.c:114:30: note: expected 'char *' but argument is of type 'const char *'
  114 | static void ReadMemory(char* token,CommandInfo* command);
      |                        ~~~~~~^~~~~
../src/fsm.c:1114:20: warning: passing argument 1 of 'ReadObject' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1114 |         ReadObject(token, command);
      |                    ^~~~~
../src/fsm.c:116:30: note: expected 'char *' but argument is of type 'const char *'
  116 | static void ReadObject(char* token,CommandInfo* command);
      |                        ~~~~~~^~~~~
../src/fsm.c:1118:19: warning: passing argument 1 of 'WritePort' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1118 |         WritePort(token,command);
      |                   ^~~~~
../src/fsm.c:109:29: note: expected 'char *' but argument is of type 'const char *'
  109 | static void WritePort(char* token,CommandInfo* command);
      |                       ~~~~~~^~~~~
../src/fsm.c:1122:23: warning: passing argument 1 of 'WriteRegister' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1122 |         WriteRegister(token, command);
      |                       ^~~~~
../src/fsm.c:111:33: note: expected 'char *' but argument is of type 'const char *'
  111 | static void WriteRegister(char* token,CommandInfo* command);
      |                           ~~~~~~^~~~~
../src/fsm.c:1126:21: warning: passing argument 1 of 'WriteMemory' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1126 |         WriteMemory(token, command);
      |                     ^~~~~
../src/fsm.c:110:31: note: expected 'char *' but argument is of type 'const char *'
  110 | static void WriteMemory(char* token,CommandInfo* command);
      |                         ~~~~~~^~~~~
../src/fsm.c:1130:21: warning: passing argument 1 of 'WriteObject' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1130 |         WriteObject(token, command);
      |                     ^~~~~
../src/fsm.c:112:31: note: expected 'char *' but argument is of type 'const char *'
  112 | static void WriteObject(char* token,CommandInfo* command);
      |                         ~~~~~~^~~~~
../src/fsm.c: In function 'WriteRegister':
../src/fsm.c:1263:78: warning: passing argument 3 of 'bq25121_writeRegister' makes integer from pointer without a cast [-Wint-conversion]
 1263 |             result = bq25121_writeRegister(&BQ25Dev, command->actionAddress, token);
      |                                                                              ^~~~~
      |                                                                              |
      |                                                                              char *
In file included from ../src/fsm.c:24:
../src/bq25121.h:173:73: note: expected 'uint8_t' {aka 'unsigned char'} but argument is of type 'char *'
  173 | int bq25121_writeRegister(BQ25121_Device *dev, uint8_t address, uint8_t value);
      |                                                                 ~~~~~~~~^~~~~
../src/fsm.c: In function 'ReadMemory':
../src/fsm.c:1522:13: warning: unused variable 'temp' [-Wunused-variable]
 1522 |     uint8_t temp;
      |             ^~~~
At top level:
../src/fsm.c:140:16: warning: 'noMoreResultsInEEPROMFlag' defined but not used [-Wunused-variable]
  140 | static uint8_t noMoreResultsInEEPROMFlag = 0; /*< signals when there is no more results in eeprom */
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\ncs\v1.8.0\toolchain\opt\arm-none-eabi\include\stdio.h:800,
                 from ../src/ad5940.h:18,
                 from ../src/AFE_interface.h:16,
                 from ../src/parser.h:16,
                 from ../src/BLE_module.h:33,
                 from ../src/fsm.c:19:
../src/fsm.c: In function 'sendvalidResponse':
../src/fsm.c:1635:46: warning: '%d' directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Wformat-truncation=]
 1635 |     snprintf(bytesCount, sizeof(bytesCount), "%d", command->noOfBytes);
      |                                              ^~~~
../src/fsm.c:1635:47: note: format string is defined here
 1635 |     snprintf(bytesCount, sizeof(bytesCount), "%d", command->noOfBytes);
      |                                               ^~
In file included from c:\ncs\v1.8.0\toolchain\opt\arm-none-eabi\include\stdio.h:800,
                 from ../src/ad5940.h:18,
                 from ../src/AFE_interface.h:16,
                 from ../src/parser.h:16,
                 from ../src/BLE_module.h:33,
                 from ../src/fsm.c:19:
../src/fsm.c:1635:46: note: directive argument in the range [0, 255]
 1635 |     snprintf(bytesCount, sizeof(bytesCount), "%d", command->noOfBytes);
      |                                              ^~~~
../src/fsm.c:1635:5: note: '__builtin_snprintf' output between 2 and 4 bytes into a destination of size 2
 1635 |     snprintf(bytesCount, sizeof(bytesCount), "%d", command->noOfBytes);
      |     ^~~~~~~~
[154/273] Building C object zephyr/soc/arm/common/cortex_m/CMakeFiles/soc__arm__common__cortex_m.dir/arm_mpu_regions.c.obj
[155/273] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
[156/273] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread_common.c.obj
[157/273] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/nanosleep.c.obj
[158/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/uuid.c.obj
[159/273] Building C object zephyr/subsys/bluetooth/common/CMakeFiles/subsys__bluetooth__common.dir/dummy.c.obj
[160/273] Building C object zephyr/subsys/bluetooth/common/CMakeFiles/subsys__bluetooth__common.dir/rpa.c.obj
[161/273] Building C object zephyr/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/soc.c.obj
[162/273] Building C object zephyr/subsys/bluetooth/common/CMakeFiles/subsys__bluetooth__common.dir/log.c.obj
[163/273] Building C object zephyr/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/power.c.obj
[164/273] Linking C static library app\libapp.a
[165/273] Linking C static library zephyr\soc\arm\common\cortex_m\libsoc__arm__common__cortex_m.a
[166/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/addr.c.obj
[167/273] Linking C static library zephyr\lib\posix\liblib__posix.a
[168/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_ecc.c.obj
[169/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/settings.c.obj
[170/273] Linking C static library zephyr\libzephyr.a
[171/273] Linking C static library zephyr\subsys\bluetooth\common\libsubsys__bluetooth__common.a
[172/273] Linking C static library zephyr\soc\arm\nordic_nrf\nrf52\libsoc__arm__nordic_nrf__nrf52.a
[173/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_common.c.obj
[174/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/buf.c.obj
[175/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/ecc.c.obj
[176/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/l2cap.c.obj
[177/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/adv.c.obj
[178/273] Building C object zephyr/subsys/mgmt/mcumgr/CMakeFiles/subsys__mgmt__mcumgr.dir/buf.c.obj
[179/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/id.c.obj
[180/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/keys.c.obj
[181/273] Building C object zephyr/subsys/mgmt/mcumgr/CMakeFiles/subsys__mgmt__mcumgr.dir/smp.c.obj
[182/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/conn.c.obj
[183/273] Building C object zephyr/subsys/mgmt/mcumgr/CMakeFiles/subsys__mgmt__mcumgr.dir/smp_bt.c.obj
[184/273] Building C object zephyr/subsys/dfu/boot/CMakeFiles/subsys__dfu__boot.dir/mcuboot.c.obj
[185/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_core.c.obj
[186/273] Building C object zephyr/drivers/sensor/nrf5/CMakeFiles/drivers__sensor__nrf5.dir/temp_nrf5.c.obj
[187/273] Building C object zephyr/drivers/clock_control/CMakeFiles/drivers__clock_control.dir/clock_control_nrf.c.obj
[188/273] Building C object zephyr/subsys/random/CMakeFiles/subsys__random.dir/rand32_entropy_device.c.obj
[189/273] Building C object zephyr/subsys/net/CMakeFiles/subsys__net.dir/buf.c.obj
[190/273] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj
[191/273] Linking C static library zephyr\subsys\mgmt\mcumgr\libsubsys__mgmt__mcumgr.a
[192/273] Linking C static library zephyr\drivers\clock_control\libdrivers__clock_control.a
[193/273] Building C object zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twi.c.obj
[194/273] Linking C static library zephyr\drivers\sensor\nrf5\libdrivers__sensor__nrf5.a
[195/273] Building C object zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_common.c.obj
[196/273] Linking C static library zephyr\subsys\dfu\boot\libsubsys__dfu__boot.a
[197/273] Linking C static library zephyr\subsys\net\libsubsys__net.a
[198/273] Building C object zephyr/drivers/console/CMakeFiles/drivers__console.dir/uart_console.c.obj
[199/273] Linking C static library zephyr\subsys\random\libsubsys__random.a
[200/273] Building C object zephyr/drivers/usb/device/CMakeFiles/drivers__usb__device.dir/usb_dc_nrfx.c.obj
[201/273] Linking C static library zephyr\drivers\gpio\libdrivers__gpio.a
[202/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/att.c.obj
[203/273] Building C object zephyr/drivers/hwinfo/CMakeFiles/drivers__hwinfo.dir/hwinfo_weak_impl.c.obj
[204/273] Linking C static library zephyr\drivers\i2c\libdrivers__i2c.a
[205/273] Linking C static library zephyr\drivers\console\libdrivers__console.a
[206/273] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/flash_page_layout.c.obj
[207/273] Building C object zephyr/drivers/hwinfo/CMakeFiles/drivers__hwinfo.dir/hwinfo_nrf.c.obj
[208/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/smp.c.obj
[209/273] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/soc_flash_nrf.c.obj
[210/273] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/__/__/misc/empty_file.c.obj
[211/273] Linking C static library zephyr\drivers\usb\device\libdrivers__usb__device.a
[212/273] Building C object zephyr/drivers/spi/CMakeFiles/drivers__spi.dir/spi_nrfx_spim.c.obj
[213/273] Building C object zephyr/drivers/spi/CMakeFiles/drivers__spi.dir/spi_nrfx_spi.c.obj
[214/273] Building C object zephyr/drivers/entropy/CMakeFiles/drivers__entropy.dir/entropy_nrf5.c.obj
[215/273] Linking C static library zephyr\drivers\flash\libdrivers__flash.a
[216/273] Building C object zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/sys_clock_init.c.obj
[217/273] Linking C static library zephyr\drivers\hwinfo\libdrivers__hwinfo.a
[218/273] Building C object modules/nrf/lib/multithreading_lock/CMakeFiles/..__nrf__lib__multithreading_lock.dir/multithreading_lock.c.obj
[219/273] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
[220/273] Building C object zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/nrf_rtc_timer.c.obj
[221/273] Building C object modules/nrf/lib/fatal_error/CMakeFiles/..__nrf__lib__fatal_error.dir/fatal_error.c.obj
[222/273] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/gatt.c.obj
[223/273] Linking C static library zephyr\drivers\spi\libdrivers__spi.a
[224/273] Building C object modules/nrf/subsys/bluetooth/controller/CMakeFiles/..__nrf__subsys__bluetooth__controller.dir/crypto.c.obj
[225/273] Building C object modules/nrf/drivers/mpsl/clock_control/CMakeFiles/..__nrf__drivers__mpsl__clock_control.dir/nrfx_clock_mpsl.c.obj
[226/273] Linking C static library zephyr\drivers\timer\libdrivers__timer.a
[227/273] Building C object modules/nrf/subsys/bluetooth/controller/CMakeFiles/..__nrf__subsys__bluetooth__controller.dir/hci_internal.c.obj
[228/273] Linking C static library modules\nrf\lib\multithreading_lock\lib..__nrf__lib__multithreading_lock.a
[229/273] Building C object modules/nrf/subsys/mpsl/init/CMakeFiles/..__nrf__subsys__mpsl__init.dir/mpsl_init.c.obj
[230/273] Linking C static library zephyr\drivers\entropy\libdrivers__entropy.a
[231/273] Linking C static library zephyr\drivers\serial\libdrivers__serial.a
[232/273] Building C object modules/nrf/drivers/mpsl/flash_sync/CMakeFiles/..__nrf__drivers__mpsl__flash_sync.dir/flash_sync_mpsl.c.obj
[233/273] Building C object modules/nrf/subsys/bluetooth/controller/CMakeFiles/..__nrf__subsys__bluetooth__controller.dir/hci_driver.c.obj
[234/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/mdk/system_nrf52833.c.obj
[235/273] Linking C static library modules\nrf\lib\fatal_error\lib..__nrf__lib__fatal_error.a
[236/273] Linking C static library zephyr\subsys\bluetooth\host\libsubsys__bluetooth__host.a
[237/273] Building C object modules/mcuboot/boot/bootutil/zephyr/CMakeFiles/mcuboot_util.dir/C_/ncs/v1.8.0/bootloader/mcuboot/boot/bootutil/src/bootutil_public.c.obj
[238/273] Linking C static library modules\nrf\subsys\mpsl\init\lib..__nrf__subsys__mpsl__init.a
[239/273] Linking C static library modules\nrf\drivers\mpsl\clock_control\lib..__nrf__drivers__mpsl__clock_control.a
[240/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_systick.c.obj
[241/273] Linking C static library modules\nrf\subsys\bluetooth\controller\lib..__nrf__subsys__bluetooth__controller.a
[242/273] Linking C static library modules\nrf\drivers\mpsl\flash_sync\lib..__nrf__drivers__mpsl__flash_sync.a
[243/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_nvmc.c.obj
[244/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
[245/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_power.c.obj
[246/273] Linking C static library modules\mcuboot\boot\bootutil\zephyr\libmcuboot_util.a
[247/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_spi.c.obj
[248/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_spim.c.obj
[249/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_twi_twim.c.obj
[250/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
[251/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt_log.c.obj
[252/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/cmd/img_mgmt/src/img_mgmt_util.c.obj
[253/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/cmd/img_mgmt/src/img_mgmt.c.obj
[254/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/cmd/img_mgmt/src/img_mgmt_state.c.obj
[255/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_ppi.c.obj
[256/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_twi.c.obj
[257/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/cmd/os_mgmt/src/os_mgmt.c.obj
[258/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/cborattr/src/cborattr.c.obj
[259/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/cmd/os_mgmt/src/stubs.c.obj
[260/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c.obj
[261/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/mgmt/src/mgmt.c.obj
[262/273] Building C object modules/mcumgr/CMakeFiles/..__modules__lib__mcumgr.dir/cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c.obj
[263/273] Linking C static library modules\mcumgr\lib..__modules__lib__mcumgr.a
[264/273] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v1.8.0/modules/hal/nordic/nrfx/drivers/src/nrfx_usbd.c.obj
[265/273] Linking C static library modules\hal_nordic\nrfx\libmodules__hal_nordic__nrfx.a
[266/273] Linking C executable zephyr\zephyr_prebuilt.elf

[267/273] Generating linker.cmd
[268/273] Generating isr_tables.c, isrList.bin
[269/273] Generating dev_handles.c
[270/273] Building C object zephyr/CMakeFiles/zephyr_final.dir/misc/empty_file.c.obj
[271/273] Building C object zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj
[272/273] Building C object zephyr/CMakeFiles/zephyr_final.dir/dev_handles.c.obj
[273/273] Linking C executable zephyr\zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:      241812 B       512 KB     46.12%
            SRAM:       54803 B       128 KB     41.81%
        IDT_LIST:          0 GB         2 KB      0.00%
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: nRF Connect: Flash: Asclepius_reader_nrf52833/build_debug (active) 

Flashing build_debug to 261010810
C:\Windows\system32\cmd.exe /d /s /c "west flash -d c:\Users\voidn_l4qz259\Documents\GitHub\Eclateral\AsclepiusFirmware\Asclepius_reader_nrf52833\build_debug --snr 261010810"

-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner nrfjprog
-- runners.nrfjprog: Flashing file: c:\Users\voidn_l4qz259\Documents\GitHub\Eclateral\AsclepiusFirmware\Asclepius_reader_nrf52833\build_debug\zephyr\zephyr.hex
[error] [ Worker] - Access protection is enabled, can't read device version.
[error] [ Client] - Encountered error -90: Command read_device_info executed for 14 milliseconds with result -90
[error] [ Client] - Encountered error -90: Command read_memory_descriptors executed for 14 milliseconds with result -90
[error] [ Worker] - Can't read memory descriptors, ap-protection is enabled.
[error] [ Client] - Encountered error -90: Command erase_file executed for 61 milliseconds with result -90
[error] [  nRF52] - Failed while detecting device memory block protection status!                                      
[error] [  nRF52] - Failed while erasing device. -90: Access protection is enabled, can't read device version.
[error] [ Worker] - Access protection is enabled, can't read device version.
ERROR: The operation attempted is unavailable due to readback protection in
ERROR: your device. Please use --recover to unlock the device.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
ERROR: runners.nrfjprog: Flashing failed because the target must be recovered.
  To fix, run "west flash --recover" instead.
  Note: this will recover and erase all flash memory prior to reflashing.
FATAL ERROR: command exited with status 16: nrfjprog --program 'c:\Users\voidn_l4qz259\Documents\GitHub\Eclateral\AsclepiusFirmware\Asclepius_reader_nrf52833\build_debug\zephyr\zephyr.hex' --sectoranduicrerase -f NRF52 --snr 261010810

 *  The terminal process terminated with exit code: 16. 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: nRF Connect: Flash: Asclepius_reader_nrf52833/build_debug (active) 

Flashing build_debug to 261010810
C:\Windows\system32\cmd.exe /d /s /c "west flash -d c:\Users\voidn_l4qz259\Documents\GitHub\Eclateral\AsclepiusFirmware\Asclepius_reader_nrf52833\build_debug --snr 261010810 --recover"

-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner nrfjprog
-- runners.nrfjprog: Recovering and erasing all flash memory.
Recovering device. This operation might take 30s.
Erasing user code and UICR flash areas.
Writing image to disable ap protect.
-- runners.nrfjprog: Flashing file: c:\Users\voidn_l4qz259\Documents\GitHub\Eclateral\AsclepiusFirmware\Asclepius_reader_nrf52833\build_debug\zephyr\zephyr.hex
[ #################### ]   6.636s | Erase file - Done erasing                                                          
[ #################### ]   1.470s | Program file - Done programming                                                    
WARNING: A programming operation has been performed without --verify.
WARNING: Programming can fail without error.
Enabling pin reset.
Applying pin reset.
-- runners.nrfjprog: Board with serial number 261010810 flashed successfully.
 *  Terminal will be reused by tasks, press any key to close it. 
  • Hi,

    The first couple of attempts were successful and then the board became unresponsive.

    Is there any difference between when it worked and when it stopped workign? Did you flash with different firmware, or in a different way, using different tools, or similar?

    where any command line recovery tools timeout with:

    By being bricked, you are refering tro the unability to recover the device? Could it be that somehow you are usign different board or config files or that there are local changes in one of the SDKs you have checked out?

    The reason I ask is that there are two typical issues for seemingly bricking custom boards:

    1. Firwmare that enables the DCDC but the hardware does not have the inductors needed for the DCDC. If that is the case, the device will become unresponsive and impossible to debug after enabling the DCDC.
    2. If using the high voltage regulator, the defult volage after an erase all operation will be set back to 1.8 V unless the UICR is properly programmed with settings for a different voltage.

    Of this 1 is probably most likely, so I wonder if you have the DCDC inductors, and if not, if you have configured the project to not enable it? If the DCDC is enabled, you can recover by halding with a debugger imediately after a power cycle, before firmware has time to enable the DCDC (a simple way to do this is to write a small script or similar that calls "nrfjprog --recover" in a loop, while you power-cycle the device until it succeeds (at some point execution should be halted before the DCDC is enabled).

    Debug session build output:

    This is more of a generic comment, but there is a high number of wearnings in this build, so many that trivial warnings can easily mask imortant ones. I woudl suggest that you work through them and make the code build without warnings.

  • Hi, thanks for the feedback and taking the time to look into the issue. I will try to answer in order;
    - The only difference currently between working and not working is performing a release or debug build inline with .conf files attached in the original post. Flashing the release build with j-flash was working okay, then using the debug build tool in vs code/nrf connect failed/

    - Yes 'bricked' ... the device appears to not boot. Not activity can be seen and no attempts to flash/erase/recover is successful. The two config files attached only have two lines diiferent:

    CONFIG_OPAL_RELEASE_BUILD=y/n (contextual to build)
    CONFIG_BOOTLOADER_MCUBOOT=y/n (contextual to build). 

    We have meticulously gone through local SDKs for potential differences and have not been able to find anything different from when things worked for the previous developer. Changes to the local sdk are adding the attached defconfig and dts files to \ncs\v1.8.0\zephyr\boards\arm\nrf52833dk_nrf52833\, overwriting prjMCUBoot.conf to \ncs\v1.8.0\bootloader\mcuboot\boot\zephyr\prj.conf and updating \ncs\v1.8.0\bootloader\mcu\boot\zephyr\Kconfig to point to a local .pem key file. 

    nrf52833dk_nrf52833.dtsprjMCUBOOT.conf

    # SPDX-License-Identifier: Apache-2.0
    
    CONFIG_SOC_SERIES_NRF52X=y
    CONFIG_SOC_NRF52833_QIAA=y
    CONFIG_BOARD_NRF52833DK_NRF52833=y
    
    # Enable MPU
    CONFIG_ARM_MPU=y
    
    # Enable hardware stack protection
    CONFIG_HW_STACK_PROTECTION=y
    
    # Enable RTT
    CONFIG_USE_SEGGER_RTT=y
    
    # enable GPIO
    CONFIG_GPIO=y
    
    # enable uart driver
    CONFIG_SERIAL=y
    
    # enable console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    # additional board options
    CONFIG_GPIO_AS_PINRESET=n
    


    I did not design the board, but I understand that 3.3v (2.5-5.5v) to the VDDH pin should enable the high voltage regulator. I did spot another thread along the lines of the DCDC and used a script to repeatedly try to recover the device whilst power cycling. It worked for somebody after ~100 attempts, but unfortunately did not for me.




    In neither .conf files is there a reference to DCDC, however I can see in the project build directories it is referenced in a few places for example build\mcuboot\zephyr\.config &build\mcuboot\zephyr\include\generated:

    CONFIG_BOARD_ENABLE_DCDC=y
    CONFIG_SOC_DCDC_NRF52X=y

    Noted on the warnings/errors; as the project was inherited I have not wanted to change things yet as to risk introducing further unknown issues, but I will take a look at tackling the warnings now. The main issue is getting to a point that I can test flashing a device without bricking it.

    I think this addresses everything in your reply. Please let me know if you need any further details/info and if you can suggest any changes or tests I can run to prevent further bricked devices.


  • Hi,

    I see from the parts of the schematic you shared that VDDH is not used, and that the DCDC inductors are included, so enabling the DCDC should not cause any problems.

    The observations that the boards become more or less unrecoverable, but that you sometimes are able to recover by a recover operation in a loop while power cycling is also a bit ambigious. The fact that it sometimes works indicate that firmware plays a part (and that haldting and erasing before a certain step helps, but then I would expect it to always work i the end given enough attempts).

    I am also wondering wha tthe difference is bretween what you have build (failign) and your colleague have build before (working). Can you share the zephyr.dts and .config from the build folder for both the working and non-working build? Those will hold the compiled confiugration an ddevicetree that are being used in the end (after all overlays etc are taken into account). Are there any differences there? Also, can you share the full schematic? (You can do that in a private case where you refer to this). Are there any other observations or differences you have seen?

    Lastly, can you check if there are any local changes in the code repositories your colleague has compared to what you have? Both for your specific project, but also in the nRF Connect SDK components? (No theck the SDK componnets, I recomen dusing "west status", as that will check the status of all git repositories in the SDK).

  • Hi,

    Thanks for the reply. My apologies if it wasnt clear in the previous posts, but once bricked I have not been able to recover. I have followed the instructions elsewhere on the forum to create a script to try to brute force a recovery, but it did not work. I will follow up with a private ticket referring back to this one which includes the mentioned information. 

  • Hi Ben,

    Thank you. Let us continue in the private ticket for now

Related