Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Make exception for v2 115k2 for retransmission timeout
Browse files Browse the repository at this point in the history
v2 firmware does not work properly when the retransmission timeout is set too high
  • Loading branch information
bihanssen committed Oct 25, 2017
1 parent bdd2e4f commit 7b2d050
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hex/sd_api_v2/sdk110_connectivity.patch
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,28 @@ diff --git a/components/serialization/common/transport/ser_phy/ser_phy_hci.c b/c
@@ -37,6 +37,8 @@
(SER_HAL_TRANSPORT_MAX_PKT_SIZE + PKT_HDR_SIZE + PKT_CRC_SIZE))
#define BAUD_TIME_us (1000000uL / SER_PHY_UART_BAUDRATE_VAL)

+#define PKT_TYPE_RESET 5
+
#define TX_EVT_QUEUE_SIZE 16
#define RX_EVT_QUEUE_SIZE 16
#define PKT_TYPE_VENDOR_SPECIFIC 14 /**< Packet type vendor specific. */
@@ -48,7 +50,7 @@
@@ -48,7 +50,11 @@
#define INITIAL_SEQ_NUMBER INITIAL_ACK_NUMBER_EXPECTED /**< Initial acknowledge number transmitted. */
#define INVALID_PKT_TYPE 0xFFFFFFFFu /**< Internal invalid packet type value. */
#define MAX_TRANSMISSION_TIME_ms (MAX_PACKET_SIZE_IN_BITS * BAUD_TIME_us / 1000uL) /**< Max transmission time of a single application packet over UART in units of mseconds. */
-#define RETRANSMISSION_TIMEOUT_IN_ms (10uL * MAX_TRANSMISSION_TIME_ms) /**< Retransmission timeout for application packet in units of mseconds. */
+#if SER_PHY_UART_BAUDRATE == UART_BAUDRATE_BAUDRATE_Baud115200
#define RETRANSMISSION_TIMEOUT_IN_ms (10uL * MAX_TRANSMISSION_TIME_ms) /**< Retransmission timeout for application packet in units of mseconds. */
+#else
+#define RETRANSMISSION_TIMEOUT_IN_ms (100uL * MAX_TRANSMISSION_TIME_ms) /**< Retransmission timeout for application packet in units of mseconds. */

+#endif

#ifdef HCI_LINK_CONTROL
#define HCI_PKT_SYNC 0x7E01u /**< Link Control Packet: type SYNC */
@@ -756,6 +758,11 @@ static void hci_slip_event_handler(ser_phy_hci_slip_evt_t * p_event)
@@ -756,6 +762,11 @@ static void hci_slip_event_handler(ser_phy_hci_slip_evt_t * p_event)
event.evt.ser_phy_slip_evt.evt_params.received_pkt.p_buffer,
event.evt.ser_phy_slip_evt.evt_params.received_pkt.num_of_bytes);

+ if (packet_type == PKT_TYPE_RESET)
+ {
+ NVIC_SystemReset();
Expand Down

0 comments on commit 7b2d050

Please sign in to comment.