Hi nRF team,
We are developing our custom board with nrf52840 for BLE mesh and nrf21540 as range extender . Now we have the provision to use gpio or spi to control nrf21540.
We got some Radio test example from nrf5SDK. As we didn't find any proper example nrf21540 + ble . we are trying to integrate the radio test example into the ble_blinky
code for nrf52840.
We validated the GPIO's are connected properly. Now when we use the function from radio test example given in nrf21540.c and nrf21540.h . The device is not advertising.
I'm attaching the code that we modified is below ,
int main(void)
{
// Initialize.
log_init();
// leds_init();
timers_init();
// buttons_init();
nrf21540_init();
nrf21540_ant_set(NRF21540_ANT1);
nrf21540_pwr_mode_set(NRF21540_PWR_MODE_A);
// nrf21540_tx_set(NRF21540_EXECUTE_NOW,NRF21540_EXEC_MODE_NON_BLOCKING);
power_management_init();
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
conn_params_init();
// Start execution.
NRF_LOG_INFO("Blinky example started.");
advertising_start();
// Enter main loop.
for (;;)
{
idle_state_handle();
}
}
1. Is this the right way?
2. After nrf21540_init(); function . To switch between Rx and Tx mode shall we use nrf21540_tx_set() and nrf21540_rx_set() function
3. According to nrf21540 we have to switch between Rx and Tx mode ( PA/LNA ) . From the radio test example it is not clear how to achieve this. What events we should look for to switch between Tx and Rx mode. Can you help us to get this done?
Thanks & Regards