drivers: ieee802154: cc13xx_cc26xx_subg: fix initial CMD_FS

The frequency synchronization command requires a proper frequency to be
set in order to be successfully executed. The command not being executed
leads to unnecessary internal error handling wrt command scheduling.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This commit is contained in:
Florian Grandel 2023-09-07 13:56:32 +02:00 committed by Johan Hedberg
parent 0c1c443fc6
commit f2979edd5c

View file

@ -923,6 +923,7 @@ static struct ieee802154_radio_api
static int ieee802154_cc13xx_cc26xx_subg_init(const struct device *dev)
{
struct ieee802154_cc13xx_cc26xx_subg_data *drv_data = dev->data;
uint16_t freq, fract;
RF_Params rf_params;
RF_EventMask events;
@ -944,11 +945,13 @@ static int ieee802154_cc13xx_cc26xx_subg_init(const struct device *dev)
return -EIO;
}
/* Run CMD_FS with frequency 0 to ensure RF_currClient is not NULL.
* RF_currClient is a static variable in the TI RF Driver library.
* If this is not done, then even CMD_ABORT fails.
/* Run CMD_FS for channel 0 to place a valid CMD_FS command in the
* driver's internal state which it requires for proper operation.
*/
(void)drv_channel_frequency(0, &freq, &fract);
drv_data->cmd_fs.status = IDLE;
drv_data->cmd_fs.frequency = freq;
drv_data->cmd_fs.fractFreq = fract;
events = RF_runCmd(drv_data->rf_handle, (RF_Op *)&drv_data->cmd_fs,
RF_PriorityNormal, NULL, 0);
if (events != RF_EventLastCmdDone) {