NRF_LOG_INIT HardFault in balloc (see stack trace below).
(gdb) bt #0 HardFault_HandlerC (hardfault_args=0x2000fed8) at /home/anne/workspace/bluenet/bart-source/src/util/cs_Error.cpp:74 #1 <signal handler called> Reading 64 bytes @ address 0x2000FEC0 Read 4 bytes @ address 0x00039142 (Data = 0xD1026822) Read 4 bytes @ address 0x000394A8 (Data = 0xB9104604) #2 0x00039142 in nrf_balloc_init (p_pool=0x461ac <log_mempool>) at /home/anne/software/nrf5_sdk/nRF5_SDK_15.2.0_9412b96/components/libraries/balloc/nrf_balloc.c:280 Reading 64 bytes @ address 0x2000FF00 Read 4 bytes @ address 0x0003617E (Data = 0xF8B1F003) #3 0x000394a8 in nrf_log_init (timestamp_func=<optimized out>, timestamp_freq=<optimized out>) at /home/anne/software/nrf5_sdk/nRF5_SDK_15.2.0_9412b96/components/libraries/log/src/nrf_log_frontend.c:133 #4 0x0003617e in main () at /home/anne/workspace/bluenet/bart-source/src/cs_Crownstone.cpp:983 Reading 64 bytes @ address 0x2000FFC0 Read 4 bytes @ address 0x0002628E (Data = 0xFA2DF016) Reading 64 bytes @ address 0x00026240 Read 4 bytes @ address 0x00026298 (Data = 0x20010000) Read 4 bytes @ address 0x00026296 (Data = 0x00000008) Read 4 bytes @ address 0x000262A4 (Data = 0x20002598) Read 4 bytes @ address 0x000262AA (Data = 0xC6A92000) #5 0x0002628e in _start () Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Code works perfectly without bootloader. However, when the bootloader is present it seems to already have initialized things? Or what exactly is happening here? Should we not call
NRF_LOG_INIT(NULL);
NRF_LOG_DEFAULT_BACKENDS_INIT();
If this is already done in the bootloader? Or should we "clean up" the bootloader in some way?
More info:
133 ret_code_t err_code = nrf_memobj_pool_init(&log_mempool); (gdb) p m_log_data Reading 1060 bytes @ address 0x20004AAC $11 = { wr_idx = 0, rd_idx = 0, mask = 255, buffer = {0 <repeats 256 times>}, timestamp_func = 0x0, p_backend_head = 0x0, log_skipping = 0, log_skipped = 0, log_dropped_cnt = 0, autoflush = false } (gdb) p log_mempool Reading 20 bytes @ address 0x0004619C $12 = { p_cb = 0xffffffff, Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) p_stack_base = 0xffffffff "", Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) p_stack_limit = 0xffffffff "", p_memory_begin = 0xffffffff, block_size = 65535 }