Commit b85eda30 authored by Donald Chen's avatar Donald Chen

h5 timing, remove segger baud workaround, 115200 baud.

parent 91f73f21
......@@ -74,7 +74,7 @@
#endif
#ifdef __linux__
#define DEFAULT_UART_PORT_NAME "/dev/ttyACM0"
#define DEFAULT_BAUD_RATE 1000000
#define DEFAULT_BAUD_RATE 115200
#endif
enum
......
......@@ -87,7 +87,7 @@
#endif
#ifdef __linux__
#define DEFAULT_UART_PORT_NAME "/dev/ttyACM0"
#define DEFAULT_BAUD_RATE 1000000
#define DEFAULT_BAUD_RATE 115200
#endif
#define ADVERTISING_INTERVAL_40_MS 64 /**< 0.625 ms = 40 ms */
......@@ -777,7 +777,7 @@ int main(int argc, char * argv[])
fflush(stdout);
m_adapter = adapter_init(serial_port, baud_rate);
sd_rpc_log_handler_severity_filter_set(m_adapter, SD_RPC_LOG_TRACE);
sd_rpc_log_handler_severity_filter_set(m_adapter, SD_RPC_LOG_INFO);
error_code = sd_rpc_open(m_adapter, status_handler, ble_evt_dispatch, log_handler);
if (error_code != NRF_SUCCESS)
......
......@@ -74,9 +74,9 @@ const uint8_t PACKET_RETRANSMISSIONS =
// Other constants
// Duration to wait for state ACTIVE after open is called
const auto OPEN_WAIT_TIMEOUT = std::chrono::milliseconds(2000);
const auto OPEN_WAIT_TIMEOUT = std::chrono::milliseconds(5000);
// Duration to wait before continuing UART communication after reset is sent to target
const auto RESET_WAIT_DURATION = std::chrono::milliseconds(300);
const auto RESET_WAIT_DURATION = std::chrono::milliseconds(500);
#pragma region Public methods
H5Transport::H5Transport(Transport *_nextTransportLayer, const uint32_t retransmission_interval)
......@@ -177,6 +177,9 @@ uint32_t H5Transport::open(const status_cb_t &status_callback, const data_cb_t &
if (waitForState(STATE_ACTIVE, OPEN_WAIT_TIMEOUT))
{
std::stringstream ss;
ss << "h5_transport got STATE_ACTIVE";
log(SD_RPC_LOG_WARNING, ss.str());
return NRF_SUCCESS;
}
else
......
......@@ -149,6 +149,7 @@ uint32_t UartBoost::open(const status_cb_t &status_callback, const data_cb_t &da
serialPort->set_option(parity);
serialPort->set_option(characterSize);
#ifdef SEGGER_WORKAROUND
// SEGGER J-LINK-OB VCOM has an issue when auto-detecting UART flow control
// The VCOM implementation keeps the detected flow-control state if the baud rate
// is the same as the previous open of UART (MDK-1005).
......@@ -164,14 +165,18 @@ uint32_t UartBoost::open(const status_cb_t &status_callback, const data_cb_t &da
return NRF_ERROR_SD_RPC_SERIAL_PORT;
}
#endif
#if !defined(__APPLE__)
#ifdef SEGGER_WORKAROUND
// Set dummy baud rate
auto baudRate = asio::serial_port::baud_rate(DUMMY_BAUD_RATE);
serialPort->set_option(baudRate);
#else
auto baudRate = uartSettingsBoost.getBoostBaudRate();
#endif
// Set requested baud rate
baudRate = uartSettingsBoost.getBoostBaudRate();
serialPort->set_option(baudRate);
#else
// Workaround for setting non-standard baudrate on macOS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment