Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relay tx and rx not setting antenna switch manually #49

Closed
disruptivedesign opened this issue Mar 8, 2024 · 1 comment
Closed

Relay tx and rx not setting antenna switch manually #49

disruptivedesign opened this issue Mar 8, 2024 · 1 comment

Comments

@disruptivedesign
Copy link

Hello,
I am working on a port of this code for the STM32WL in a RAK3172. I have noticed that the following Tx and Rx functions in the new relay code do not explicitly set the antenna direction with the smtc_modem_hal_set_ant_switch() call.

SMTC_MODEM_HAL_PANIC_ON_FAILURE( ral_set_tx( &( rp->radio->ral ) ) == RAL_STATUS_OK );

wor_ral_callback_start_tx
wor_ral_callback_start_rx

In general the lr1_stack_mac_layer handles the Tx cases as follows:
smtc_modem_hal_start_radio_tcxo( ); smtc_modem_hal_set_ant_switch( true ); SMTC_MODEM_HAL_PANIC_ON_FAILURE( ral_set_tx( &( rp->radio->ral ) ) == RAL_STATUS_OK );

In my testing if you break point at the ral_set_tx instances and inside the smtc_modem_hal_set_ant_switch you'll see that at least the very first Tx up during the join process will have the antenna in receive mode. Perhaps this is also the case in later transmits as well if there is a race condition between when the tx task is scheduled and when the antenna direction get set elsewhere.

@lbm-team
Copy link
Contributor

Hi @disruptivedesign

This problem has been found by our team and it will be fixed in the next release.

Other functions are impacted ( wor_ral_callback_start_cad, relay_rxr_tx_launch_callback, wor_ral_callback_start_tx and wor_ral_callback_start_rx) by the same issue.

In the mean time, you can call smtc_modem_hal_set_ant_switch after the TCXO startup function to choose the antenna direction.

@lbm-team lbm-team closed this as completed May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants