Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for SARA-R410 to the Cellular HAL #1532
This PR adds support for U-blox SARA-R410 modules to the Cellular HAL.
The major difference between SARA-U2/G3 and SARA-R4 modules is the network registration process: in case of SARA-R4 the module automatically establishes a PSD (Packed Switched Data) connection as part of the network registration process, so there's no need to activate a PDP context/EPS bearer explicitly. Cellular HAL has been refactored accordingly (and in a backward-compatible way) in order to support different network registration flows.
Additionally, SARA-R4 doesn't currently support the RTS/CTS flow control and this poses a problem for the runtime modem type detection, since we first need to initialize UART without any flow control enabled, detect the modem type and then reinitialize UART if it appears that the modem does support the hardware flow control. Due to that, in my tests the modem (SARA-U270) or the AT command parser sometimes get into a weird unresponsive state (typically after a system reset), which gets resolved only after an automatic modem reset performed by the
This PR also adds a custom DNS client implementation based on LwIP, which is used specifically for SARA-R4 since the latter doesn't support DNS lookup commands.
c3a2400 reverts part of the UART initialization logic introduced by dff02e7: now the firmware initializes UART with hardware flow control enabled, then performs a runtime modem type detection and, depending on the modem type, reinitializes the UART to disable the flow control. The patch assumes that the modem still keeps the CTS pin in a correct state even if doesn't support the CTS/RTS flow control