This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

unexpected log output

I am seeing three things I don't understand in a modified ble_app_rscs codebase. I'm hopeful that someone else can recognize my symptoms and tell me what I'm doing wrong.

I'm attaching main.c ( main.c) and I'll describe my changes:

  • I have a state machine that is supposed to determine on startup whether the device has any key information stored in flash.
  • Depending on whether the key is found or not, it advertises using an address, or address+irk.
  • If no key is found, advertising only starts when button 1 is pressed.
  • I've defined ENABLE_DEBUG_LOG_SUPPORT in the Makefile.
  • I set the central's address to a known value: A1 B2 C3 D4 E5 F6

I'm using this along with the 'relay' central/peripheral demo. The goal is to help me understand basic address-based whitelist advertising, security establishment and then key-based whitelist advertising.

The problems I have:

  1. In only one instance out of dozens of connections that have been established between the relay and the rsc peripheral have I seen an irk value stored. Occasionally, I see the central's address stored. I don't understand why the same information wouldn't be stored every time I make a connection.

  2. The log information coming from the device manager in dm_init gets garbled after several lines but before the routine finishes. When I have log support in everything enabled, the garbling prevents me from seeing my own application messages created during startup. It also appears that old log information from a previous run is still being spit out at the beginning followed by the startup debug information that I would expect, and last the garbled ending prior to dm_init completing. See attachment 2 attachment2.PNG

  3. When I write my rscs image to flash using nRFgo Studio, it appears that it restarts the firmware twice. Maybe this is normal? I don't see how the code could be resetting itself. If this is true, it would also cause a lot of text that would possibly be contributing to the 2nd problem. See attachment 3 attachment3.PNG

EDIT: I should mention that I've upped the UART tx_buffer size from 256 to 1024 and increased the baud rate from 38400 to 115200 to see what difference that might make. Also, I realize now #1 should be a separate question.

EDIT2: The third observation is as expected - it is because of nRFGo. Using the reset button on the board (yes, why hadn't I tried that already :-) doesn't exhibit this behavior. So ignore #3.

EDIT3: I've solved the garbling problem. It turns out I was calling APP_UART_FIFO_INIT twice, once in main and also by calling app_trace_init(). This means that when I thought I was increasing the tx_buffer size, I really was not because the local define UART_TX_BUF_SIZE was not used - only the one in app_trace.c was.

Parents Reply Children
No Data
Related