@@ -69,7 +69,12 @@ static struct nrf5_802154_data nrf5_data;
69
69
70
70
#define DRX_SLOT_PH 0 /* Placeholder delayed reception window ID */
71
71
#define DRX_SLOT_RX 1 /* Actual delayed reception window ID */
72
- #define PH_DURATION 10 /* Duration of the placeholder window, in microseconds */
72
+ #define PH_DURATION 10 /* Duration of the placeholder window, in microseconds */
73
+ /* When scheduling the actual delayed reception window an adjustment of
74
+ * 800 us is required to match the CSL tranmission timing for unknown
75
+ * reasons. This is a temporary workaround until the root cause is found.
76
+ */
77
+ #define DRX_ADJUST 800
73
78
74
79
#if defined(CONFIG_IEEE802154_NRF5_UICR_EUI64_ENABLE )
75
80
#if defined(CONFIG_SOC_NRF5340_CPUAPP )
@@ -795,7 +800,7 @@ static void nrf5_config_csl_period(uint16_t period)
795
800
796
801
static void nrf5_schedule_rx (uint8_t channel , uint32_t start , uint32_t duration )
797
802
{
798
- nrf5_receive_at (start , duration , channel , DRX_SLOT_RX );
803
+ nrf5_receive_at (start - DRX_ADJUST , duration , channel , DRX_SLOT_RX );
799
804
800
805
/* The placeholder reception window is rescheduled for the next period */
801
806
nrf_802154_receive_at_cancel (DRX_SLOT_PH );
@@ -928,22 +933,23 @@ static int nrf5_configure(const struct device *dev,
928
933
929
934
/* nRF5 radio driver callbacks */
930
935
931
- void nrf_802154_received_timestamp_raw (uint8_t * data , int8_t power , uint8_t lqi ,
932
- uint32_t time )
936
+ void nrf_802154_received_timestamp_raw (uint8_t * data , int8_t power , uint8_t lqi , uint32_t time )
933
937
{
934
938
for (uint32_t i = 0 ; i < ARRAY_SIZE (nrf5_data .rx_frames ); i ++ ) {
935
939
if (nrf5_data .rx_frames [i ].psdu != NULL ) {
936
940
continue ;
937
941
}
938
942
939
943
nrf5_data .rx_frames [i ].psdu = data ;
940
- nrf5_data .rx_frames [i ].time = time ;
941
944
nrf5_data .rx_frames [i ].rssi = power ;
942
945
nrf5_data .rx_frames [i ].lqi = lqi ;
943
946
947
+ #if !defined(CONFIG_NRF_802154_SER_HOST ) && defined(CONFIG_NET_PKT_TIMESTAMP )
948
+ nrf5_data .rx_frames [i ].time = nrf_802154_first_symbol_timestamp_get (time , data [0 ]);
949
+ #endif
950
+
944
951
if (data [ACK_REQUEST_BYTE ] & ACK_REQUEST_BIT ) {
945
- nrf5_data .rx_frames [i ].ack_fpb =
946
- nrf5_data .last_frame_ack_fpb ;
952
+ nrf5_data .rx_frames [i ].ack_fpb = nrf5_data .last_frame_ack_fpb ;
947
953
} else {
948
954
nrf5_data .rx_frames [i ].ack_fpb = false;
949
955
}
0 commit comments