crownstone / bluenet

Bluenet is the in-house firmware on Crownstone hardware. Functions: switching, dimming, energy monitoring, presence detection, indoor localization, switchcraft.
https://crownstone.rocks
91 stars 62 forks source link

RTT logging in bootloader does not work well. #154

Closed vliedel closed 2 years ago

vliedel commented 2 years ago

With the following config:

CS_SERIAL_ENABLED=SERIAL_ENABLE_RX_AND_TX
SERIAL_VERBOSITY=SERIAL_INFO
CS_UART_BINARY_PROTOCOL_ENABLED=1
CS_SERIAL_NRF_LOG_ENABLED=0
CS_SERIAL_NRF_LOG_PIN_TX=6
CS_SERIAL_BOOTLOADER_NRF_LOG_ENABLED=1

I do not always get RTT logs from the bootloader. I only seem to get bootloader RTT logs when:

Other things I tried:

mrquincle commented 2 years ago

Perhaps https://devzone.nordicsemi.com/f/nordic-q-a/20708/rtt-logging-from-application-started-by-bootloader helps. The JLink page provides quite some information on RTT: https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/ but it narrows down to setting the .rtt_cb and .rtt_buffers sections.

Plain UART is almost always easier. As is just using gdb to step through stuff.

vliedel commented 2 years ago

Today I've been working with RTT logs in the application, and that only works after resetting the crownstone: make reset. The make debug_server probably halts the cpu.

mrquincle commented 2 years ago

Does this require action? Or is just debugging the bootloader alone without app (with RTT) or debugging both with the app (with UART) sufficient?

mrquincle commented 2 years ago

There are issues with debugging that have to do with bugs in the Nordic code. Would say about this: won't fix.