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

How can I see some hidden log on Thingy:52 debug?

Hi all,

I'm working with 2.1.0 version of Thingy:52 firmware (the last version currently). Further I am working on Linux with SEGGER J-Link Commander V6.34c in order to debugging and programming Thingy:52. For this, I'm using nRF52840 DK connected to Thingy:52 by Debug Out port.

Currently I'm working on Thingy:52 accelerometer, so I want to see logs from accelerometer driver or lis3dh chip. Of course, I have set NRF_LOG_ENABLE to 1 on sdk_config.h, and I see others log messages, but none about accelerometer.

This is the log I can see:

main          :INFO:===== Thingy started! =====
m_env         :INFO:Init: 
m_motion      :INFO:Init 
m_sound       :INFO:Sound_init 
m_ble         :WARNING:Too few random bytes available. Trying again 
m_ble         :WARNING:Too few random bytes available. Trying again 
m_ble         :WARNING:Too few random bytes available. Trying again 
m_ble         :INFO:Available random bytes: 14 
m_ble         :INFO:Random value (hex): 422a20cf
m_ble_flash   :INFO:Initialization
m_ble_flash   :INFO:garbage collect success
m_ble_flash   :INFO:Loading configuration
m_ble         :INFO:m_ble: Current FW: v255.255.255 
m_env_flash   :INFO:Initialization
m_env_flash   :INFO:Loading configuration
m_env         :INFO:Init: ble_tes_init 
m_motion      :INFO:motion_service_init: ble_tms_init 
m_ui_flash    :INFO:Initialization
m_ui_flash    :INFO:Loading configuration
m_sound       :INFO:sound_service_init: ble_tss_init 
m_ble         :INFO:on_adv_evt: BLE_ADV_EVT_FAST
MAC addr-> cb:7f:32:b7:94:86 
m_ble         :INFO:nfc string: cb:7f:32:b7:94:86 422a20cf 
drv_nfc       :INFO:NFC total message size 256 bytes 
drv_nfc       :INFO:NFC used message size 117 bytes 
adv_beacon_...:INFO:app_beacon_init:
adv_beacon_...:INFO:app_beacon_start:
m_ui          :INFO:Mode: BLE_UIS_LED_MODE_BREATHE 
main          :INFO:Voltage: 3900 V, Charge: 71 %, Event type: 0 
main          :INFO:Voltage: 3890 V, Charge: 69 %, Event type: 0 
main          :INFO:Voltage: 3890 V, Charge: 69 %, Event type: 0 
main          :INFO:Voltage: 3900 V, Charge: 71 %, Event type: 0 
main          :INFO:Voltage: 3890 V, Charge: 69 %, Event type: 0 
main          :INFO:Voltage: 3900 V, Charge: 71 %, Event type: 0 
main          :INFO:Voltage: 3900 V, Charge: 71 %, Event type: 0 
main          :INFO:Voltage: 3900 V, Charge: 71 %, Event type: 0 
m_ui          :INFO:BLE connected
m_ui          :INFO:Mode: BLE_UIS_LED_MODE_BREATHE 
m_ble         :INFO:on_ble_evt: BLE_GAP_EVT_CONNECTED
main          :INFO:Thingy_ble_evt_connected 
m_ble         :INFO:on_conn_params_evt: BLE_CONN_PARAMS_EVT_SUCCEEDED
m_ble         :INFO:on_ble_evt: BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST
m_ble         :INFO:on_ble_evt: BLE_GAP_EVT_DATA_LENGTH_UPDATE
m_ble         :INFO:on_conn_params_evt: BLE_CONN_PARAMS_EVT_SUCCEEDED
main          :INFO:Voltage: 3900 V, Charge: 71 %, Event type: 0 
main          :INFO:Voltage: 3900 V, Charge: 71 %, Event type: 0 
main          :INFO:Voltage: 3900 V, Charge: 71 %, Event type: 0 
main          :INFO:Voltage: 3890 V, Charge: 69 %, Event type: 0 
main          :INFO:Voltage: 3900 V, Charge: 71 %, Event type: 0 
main          :INFO:Voltage: 3890 V, Charge: 69 %, Event type: 0 
main          :INFO:Voltage: 3890 V, Charge: 69 %, Event type: 0 
m_motion      :INFO:ble_tms_evt_handler: BLE_TMS_EVT_NOTIF_GRAVITY - 1
main          :INFO:Voltage: 3890 V, Charge: 69 %, Event type: 0 
main          :INFO:Voltage: 3890 V, Charge: 69 %, Event type: 0 

Any ideas?

Thank you in advance,

Manuel Montenegro.

Parents
  • Hi Manuel,

    Add this in sdk_config.h.

    #define NRF_LOG_ENABLED 1
    
    #define NRF_LOG_DEFAULT_LEVEL 4

    Increase the NRF_LOG_DEFAULT_LEVEL to 4 to get out debug messages as you can see in "drv_motion.c":

    #if NRF_LOG_ENABLED
        void print_sensor_status(void)
        {
            long acc_bias[NUM_AXES];
            long gyr_bias[NUM_AXES];
            long mag_bias[NUM_AXES];
            int acc_accuracy;
            int gyr_accuracy;
            int mag_accuracy;
            
            inv_get_accel_bias(acc_bias, NULL);
            inv_get_gyro_bias(gyr_bias, NULL);
            inv_get_compass_bias(mag_bias);
            
            acc_accuracy = inv_get_accel_accuracy();
            gyr_accuracy = inv_get_gyro_accuracy();
            mag_accuracy = inv_get_mag_accuracy();
            
            NRF_LOG_DEBUG("Acc bias: ");
            NRF_LOG_DEBUG("X: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(acc_bias[0]));
            NRF_LOG_DEBUG("Y: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(acc_bias[1]));
            NRF_LOG_DEBUG("Z: "NRF_LOG_FLOAT_MARKER" \r\n", NRF_LOG_FLOAT(acc_bias[2]));
            
            NRF_LOG_DEBUG("Gyr bias: "); 
            NRF_LOG_DEBUG("X: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(gyr_bias[0]));
            NRF_LOG_DEBUG("Y: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(gyr_bias[1]));
            NRF_LOG_DEBUG("Z: "NRF_LOG_FLOAT_MARKER" \r\n", NRF_LOG_FLOAT(gyr_bias[2]));
    
            NRF_LOG_DEBUG("Mag bias: ");
            NRF_LOG_DEBUG("X: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(mag_bias[0]/(2^16)));
            NRF_LOG_DEBUG("Y: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(mag_bias[1]/(2^16)));
            NRF_LOG_DEBUG("Z: "NRF_LOG_FLOAT_MARKER" \r\n", NRF_LOG_FLOAT(mag_bias[2]/(2^16)));
    
            NRF_LOG_DEBUG("Accur: Acc: %d, gyr: %d, mag: %d \r\n", acc_accuracy, gyr_accuracy, mag_accuracy);
        }
    #endif

Reply
  • Hi Manuel,

    Add this in sdk_config.h.

    #define NRF_LOG_ENABLED 1
    
    #define NRF_LOG_DEFAULT_LEVEL 4

    Increase the NRF_LOG_DEFAULT_LEVEL to 4 to get out debug messages as you can see in "drv_motion.c":

    #if NRF_LOG_ENABLED
        void print_sensor_status(void)
        {
            long acc_bias[NUM_AXES];
            long gyr_bias[NUM_AXES];
            long mag_bias[NUM_AXES];
            int acc_accuracy;
            int gyr_accuracy;
            int mag_accuracy;
            
            inv_get_accel_bias(acc_bias, NULL);
            inv_get_gyro_bias(gyr_bias, NULL);
            inv_get_compass_bias(mag_bias);
            
            acc_accuracy = inv_get_accel_accuracy();
            gyr_accuracy = inv_get_gyro_accuracy();
            mag_accuracy = inv_get_mag_accuracy();
            
            NRF_LOG_DEBUG("Acc bias: ");
            NRF_LOG_DEBUG("X: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(acc_bias[0]));
            NRF_LOG_DEBUG("Y: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(acc_bias[1]));
            NRF_LOG_DEBUG("Z: "NRF_LOG_FLOAT_MARKER" \r\n", NRF_LOG_FLOAT(acc_bias[2]));
            
            NRF_LOG_DEBUG("Gyr bias: "); 
            NRF_LOG_DEBUG("X: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(gyr_bias[0]));
            NRF_LOG_DEBUG("Y: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(gyr_bias[1]));
            NRF_LOG_DEBUG("Z: "NRF_LOG_FLOAT_MARKER" \r\n", NRF_LOG_FLOAT(gyr_bias[2]));
    
            NRF_LOG_DEBUG("Mag bias: ");
            NRF_LOG_DEBUG("X: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(mag_bias[0]/(2^16)));
            NRF_LOG_DEBUG("Y: "NRF_LOG_FLOAT_MARKER" ",     NRF_LOG_FLOAT(mag_bias[1]/(2^16)));
            NRF_LOG_DEBUG("Z: "NRF_LOG_FLOAT_MARKER" \r\n", NRF_LOG_FLOAT(mag_bias[2]/(2^16)));
    
            NRF_LOG_DEBUG("Accur: Acc: %d, gyr: %d, mag: %d \r\n", acc_accuracy, gyr_accuracy, mag_accuracy);
        }
    #endif

Children
No Data
Related