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

nRF52 BLE debugging tutorial (e.g., using error logging macros)

Folks,

Have been using Keil MDK Lite in the past, in a Win VM. Larger code (over 32KB) plus the convenience of running without a VM layer have led me to switch to NetBeans/gcc/gdb directly on my MacBook Pro (latest Sierra OS release). (Thanks, Mohammad, for the excellent tutorial on setting up this environment :-)

Now attempting to get the HID Mouse BLE peripheral sample code running. Compiles and loads fine. App dies after initial advertising call(s). Struggling with debugging this to see exactly where it crashes. Suspect I'm lacking requisite skills in several areas and would appreciate your guidance on additional tutorials, etc., which would get me up to speed as efficiently as possible:

  • Target is the nRF52-DK, using SDK 13.0.0, with Soft Device S132 and project blue_app_hid_mouse from within that SDK. Is that a compatible combination.
  • gdb and NetBeans UI for it are new to me. Are there any good, concise tutorials for that combination or individually?
  • Have used error logging macros before in Keil, etc., environment, but am stumbling around with them now in the current IDE combo. Any tutorial or docs on their effective use?
  • How does the serial data from the error logging get buffered? For example, when a fatal error occurs, can I depend that all error logging serial output has completed or is some of it still in a RAM buffer?
  • How do I insure that fatal errors log to the flash memory, and how do I examine this data using the NetBeans/gdb combo?

Thanks in advance for responses and supporting my "just in time" learning strategy :-)

Mike

  • Hi Mike,

    I'm not very familiar with both macOS and NetBeans, but there are something you should check:

    • You should use S132 softdevice v4.0.2 if you use SDK v13. That softdevice included in the SDK at \components\softdevice\s132\hex

    • Can you run compile and run a normal application \examples\peripheral\blinky? such as the blinky example ? (you need to erase softdevice to run this example)

    • You can then try to use gdb to debug the blinky example, just to exercise debugging.

    • You can test UART using \examples\peripheral\uart example.

    • Then you can start testing BLE example, I would suggest to test with ble_app_hrm example .

  • Thanks for the response, Hung Bui.

    Have been through all those steps -- but in my earlier Keil MDK environment. Probably worth repeating them now with NetBeans/gdb environment, before jumping into the "deep end" with the full HID example :-) Will try that and let you know the results.....

Related