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

nrf52832,I add a function for uart output nrf_log_frontend_std8,but nothing output on uart,why?

void nrf_log_frontend_std_8(uint8_t            severity,
                        char const * const p_str,
                        uint32_t           val0,
                        uint32_t           val1,
                        uint32_t           val2,
                        uint32_t           val3,
                        uint32_t           val4,
                        uint32_t           val5,
                        uint32_t           val6,
                        uint32_t           val7
                        ){
#if (NRF_LOG_DEFERRED == 0)
uint32_t args[] = {val0, val1, val2, val3, val4, val5,val6,val7};
nrf_log_direct_feed(severity, p_str, args, ARRAY_SIZE(args));
#else //(NRF_LOG_DEFERRED == 0)
uint32_t nargs  = 8;
uint32_t mask   = m_log_data.mask;
uint32_t wr_idx;
if (buf_prealloc(nargs, &wr_idx))
{
    // Proceed only if buffer was successfully preallocated.
    STD_HEADER_DEF(header, p_str, severity, nargs);
    m_log_data.buffer[wr_idx++ & mask] = header.raw;
    #if NRF_LOG_USES_TIMESTAMP
    m_log_data.buffer[wr_idx++ & mask] = m_log_data.timestamp_func();
    #endif //NRF_LOG_USES_TIMESTAMP
    m_log_data.buffer[wr_idx++ & mask] = val0;
    m_log_data.buffer[wr_idx++ & mask] = val1;
    m_log_data.buffer[wr_idx++ & mask] = val2;
    m_log_data.buffer[wr_idx++ & mask] = val3;
    m_log_data.buffer[wr_idx++ & mask] = val4;
    m_log_data.buffer[wr_idx++ & mask] = val5;
    m_log_data.buffer[wr_idx++ & mask] = val6;
    m_log_data.buffer[wr_idx & mask]   = val7;
}
#endif //(NRF_LOG_DEFERRED == 0)

}

but nothing output in uart.why?

Related