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

Problem using PPI with RADIO and SPI

Hello,

I'm developing a program using nrf52832 DK and SDK V15.

I want to activate the SPI transmission when NRF_RADIO->EVENTS_END occurs using the PPI. I follow the PPI example that I found in the SDK. When I insert in my code the pp_init()

function

static void ppi_init(void)
{
	err_code = nrf_drv_ppi_init();
	
	//I stuck here, before nrf_drv_ppi_channel_alloc() function
	err_code = nrf_drv_ppi_channel_alloc(&m_ppi_channel1);		
	
	err_code = nrf_drv_ppi_channel_assign(m_ppi_channel1,(uint32_t)&NRF_RADIO->EVENTS_END, nrf_drv_spi_start_task_get(&spi));
	
	nrf_drv_ppi_channel_enable(m_ppi_channel1);
	
}

I get stuck in a loop (the code jump directly to ther else statement):

/**
 * Function examines current header and omits pushed strings and packets which are in progress.
 */
static bool invalid_packets_pushed_str_omit(nrf_log_header_t const * p_header, uint32_t * p_rd_idx)
{
    bool ret = false;
    if ((p_header->base.generic.type == HEADER_TYPE_PUSHED) || (p_header->base.generic.in_progress == 1))
    {
        if (p_header->base.generic.in_progress == 1)
        {
            switch (p_header->base.generic.type)
            {
            case HEADER_TYPE_STD:
                *p_rd_idx += (HEADER_SIZE + p_header->base.std.nargs);
                break;
            case HEADER_TYPE_HEXDUMP:
                *p_rd_idx += (HEADER_SIZE + p_header->base.hexdump.len);
                break;
            default:
                ASSERT(0);
                break;
            }
        }
        else
        {
            *p_rd_idx +=
                    (PUSHED_HEADER_SIZE + p_header->base.pushed.len + p_header->base.pushed.offset);
        }
        ret = true;
    }
    return ret;
}

Parents
  • Hi,

     

    You can safely use PPI directly when the softdevice is enabled, but as a general rule; please check your err_code returns.

    This is a function inside the nrf_log, and it looks like it is stuck for some reason. Hard to tell why without a call stack trace. Is your logging session open (either via RTT or UART) ? If you do not use the nrf_log module, I'd recommend that you disable it in your sdk_config.h

     

    Best regards,

    Håkon

     

Reply
  • Hi,

     

    You can safely use PPI directly when the softdevice is enabled, but as a general rule; please check your err_code returns.

    This is a function inside the nrf_log, and it looks like it is stuck for some reason. Hard to tell why without a call stack trace. Is your logging session open (either via RTT or UART) ? If you do not use the nrf_log module, I'd recommend that you disable it in your sdk_config.h

     

    Best regards,

    Håkon

     

Children
Related