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

log message printing problem

 Hello,

There is a problem printing the log message.
I am using SDK12.3, keil compiler and segger J-Link.
After modifying the project a little, normal log output is not available, but I can't find which part of the change has occurred.

#define DOOR_LOCK_DEST  "ELEVATOR CONTROL"

NRF_LOG_RAW_INFO ("* target: %s\r\n", (uint32_t)DOOR_LOCK_DEST);

 - Normal output before project modification in RTTviewer
 00> * target: ELEVATOR CONTROL
 - Actual output after project modification in RTTviewer
 00> * target: s

NRF_LOG_PROC("* build date : %s %s\r\n", (uint32_t)__DATE__, (uint32_t)__TIME__);

  - Actual output after project modification in RTTviewer
 00> * build date : s s

please help me.

thanks

Parents
  • Hi,

    NRF_LOG_PROC does not seem to be part of nRF5 SDK v12.3.0 from what I can tell. (I did not find it using a global text search over the full SDK folder.) Can you try with one of the documented logger macros instead? E.g. NRF_LOG_INFO()?

    Alternatively, share the definition of NRF_LOG_PROC from your project?

    Regards,
    Terje

  •  Hellow,

    I used (uint32_t) before and got desirable results in other projects.

    Sure, there were no warning and error.

    Below is the code and compile results.

    They are same as other projects.

    Is there any setting parameter I don't know?

    ****************************************************************************************

    #define NRF_LOG_PROC NRF_LOG_RAW_INFO

    #define DOOR_LOCK_DEST "ELEVATOR CONTROL"


    #ifdef MSG_DEVICE_INFO
    void displayDeviceInfo1(void)
    {
    // NRF_LOG_INIT(NULL);
    NRF_LOG_PROC("*** system start ***\r\n");
    NRF_LOG_PROC("* target : %s\r\n", (char *)DOOR_LOCK_DEST); // (uint32_t)
    NRF_LOG_PROC("* doorlock type : %d\r\n", DOORLOCK_TYPE);
    NRF_LOG_PROC("* HW version : %d\r\n", HW_REV);
    NRF_LOG_PROC("* FW version : %d.%02d\r\n", FW_MAJOR, FW_MINOR);
    NRF_LOG_PROC("* build date : %s %s\r\n", (char *)__DATE__, (char *)__TIME__);
    #ifdef DFU_SUPPORT
    NRF_LOG_PROC("DFU_SUPPORT\r\n");
    #endif

    // NRF_LOG_FLUSH();
    // NRF_LOG_PROC("* flash - global paramter addr : 0x%08X\r\n", PSTORAGE_DEVICE_GLOBAL_ADDR);
    // NRF_LOG_PROC("* flash - cbook header addr : 0x%08X\r\n", PSTORAGE_DEVICE_CDB_HEAD_ADDR);
    // NRF_LOG_PROC("* flash - cbook addr : 0x%08X\r\n", PSTORAGE_DEVICE_CODEBOOK_ADDR);
    // NRF_LOG_PROC("* flash - log addr : 0x%08X\r\n", PSTORAGE_DEVICE_LOG_ADDR);
    // NRF_LOG_PROC("* flash - swap addr : 0x%08X\r\n", PSTORAGE_DEVICE_SWAP_ADDR);
    // NRF_LOG_PROC("* flash - bootloader addr : 0x%08X\r\n", BOOTLOADER_ADDRESS);
    // NRF_LOG_FLUSH();
    }

    void displayDeviceInfo2(void)
    {
    // uint32_t err_code __attribute__((unused));
    // bool IsReset;
    // ble_date_time_t bdt;

    // err_code = drv_rtc_date_time_read(&bdt, &IsReset);
    // NRF_LOG_PROC("* time : %04u.%02u.%02u %02u:%02u:%02u\r\n", \
    // bdt.year, bdt.month, bdt.day, bdt.hours, bdt.minutes, bdt.seconds);

    print_mac_addr(m_MAC_Address[0]);
    print_mac_addr(m_MAC_Address[1]);
    NRF_LOG_PROC("* %s start!\r\n", (char *)DEVICE_NAME);
    }
    #endif

    ****************************************************************************************

    * compile result

    compiling main.c...
    ..\main.c(442): error: #167: argument of type "char *" is incompatible with parameter of type "uint32_t"

    RF_LOG_PROC
    "* target : %s\r\n", (char *)DOOR_LOCK_DEST); // (uint32_t)
    ..\main.c(446): error: #167: argument of type "char *" is incompatible with parameter of type "uint32_t"

    RF_LOG_PROC
    "* build date : %s %s\r\n", (char *)__DATE__, (char *)__TIME__);
    ..\main.c(446): error: #167: argument of type "char *" is incompatible with parameter of type "uint32_t"

    RF_LOG_PROC
    "* build date : %s %s\r\n", (char *)__DATE__, (char *)__TIME__);
    ..\main.c(473): error: #167: argument of type "char *" is incompatible with parameter of type "uint32_t"

    RF_LOG_PROC
    "* %s start!\r\n", (char *)DEVICE_NAME);
    ..\main.c: 0 warnings, 4 errors

  • The result is same.

    char *p_test = "Testing string";

    NRF_LOG_PROC("*** system start ***\r\n");
    NRF_LOG_PROC("* target : %s\r\n", (uint32_t)p_test); // DOOR_LOCK_DEST);

    ****************************

    00> *** system start ***

    00> * target : s

Reply Children
No Data
Related