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

[boron|bsom] u-blox R510 support #2359

Merged
merged 23 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
94fe8d2
Squashed commit of the following:
technobly Jun 18, 2021
f9bfe75
Squashed commit of the following:
technobly Jun 18, 2021
0ec79d1
Handle erroneous -1 AcT response from CEREG and COPS commands on R510
scott-brust Jul 1, 2021
5c23ab7
Use ncp_id from OTP to determine modem type
scott-brust Jul 15, 2021
9a5f399
[gen3] add back some things missing after rebase
technobly Aug 3, 2021
ed255b2
[gen3] Enable full cone NAT support
technobly Aug 19, 2021
a43fbe5
[cellular_hal] adds AT command response callback handler and a way to…
technobly Jun 29, 2021
d57d127
[wip] adds R510 NCP FW update support
technobly Jul 2, 2021
cfc8233
show ncpId() when powering on modem
technobly Jul 19, 2021
b7edb85
[gen3] implements R510 NCP FW update support
technobly Aug 11, 2021
9135889
Adds preferred Cypher and TLS v1.2 to The Matrix of https setup commands
technobly Aug 12, 2021
173901c
adds qualify state to FW update process
technobly Aug 12, 2021
33a975d
implements System feature FEATURE_NCP_FW_UPDATES and performs NCP FW …
technobly Aug 13, 2021
d002c3f
Implements CGDCONT? check for valid APN to speed up connection proces…
technobly Aug 30, 2021
a8fac7a
more R510 NCP FW update support
technobly Sep 10, 2021
bc83a46
Remove R510 support for Gen2
technobly Sep 10, 2021
cd8b191
adds modemEmergencyHardReset() for R510
technobly Sep 17, 2021
7d7e7b2
Removes System feature FEATURE_NCP_FW_UPDATES and some cleanup
technobly Sep 18, 2021
6ea5752
Remove R510 FOTA support
technobly Sep 20, 2021
e5b06e4
addressing PR comments
technobly Sep 21, 2021
36bf790
Remove more R510 FOTA support
technobly Sep 21, 2021
cc216d4
Removes define for R510 FOTA support
technobly Sep 27, 2021
0001b97
fixes TEST=wiring/no_fixture_cellular for R510
technobly Sep 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions hal/inc/cellular_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ cellular_result_t cellular_get_active_sim(int* sim_type, void* reserved);
*/
cellular_result_t cellular_process(void* reserved, void* reserved1);

/**
* Start NCP FW Update
*/
int cellular_start_ncp_firmware_update(bool update = false, void* reserved = NULL);

#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 4 additions & 1 deletion hal/network/lwip/ppp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ void Client::init() {
netif_set_client_data(&if_, netifClientDataIdx_, this);
UNLOCK_TCPIP_CORE();

// FIXME: do we need this workaround for R510?
// XXX:
if (platform_primary_ncp_identifier() == PLATFORM_NCP_SARA_R410) {
if (platform_primary_ncp_identifier() == PLATFORM_NCP_SARA_R410 ||
platform_primary_ncp_identifier() == PLATFORM_NCP_SARA_R510)
{
// SARA R4 PPP implementation is broken and often times we receive
// an empty or non-conflicting Configure-Request in an already opened state
// which, if we follow the state machine to the T, should restart the negotiation
Expand Down
37 changes: 11 additions & 26 deletions hal/network/ncp/cellular/cellular_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "at_command.h"
#include "at_response.h"
#include "cellular_enums_hal.h"
#include "cellular_ncp_dev_mapping.h"

#include <limits>

Expand Down Expand Up @@ -193,32 +194,7 @@ int cellular_device_info(CellularDevice* info, void* reserved) {
CHECK(client->getIccid(info->iccid, sizeof(info->iccid)));
CHECK(client->getImei(info->imei, sizeof(info->imei)));
if (info->size >= offsetof(CellularDevice, dev) + sizeof(CellularDevice::dev)) {
switch (client->ncpId()) {
case PLATFORM_NCP_SARA_U201:
info->dev = DEV_SARA_U201;
break;
case PLATFORM_NCP_SARA_G350:
info->dev = DEV_SARA_G350;
break;
case PLATFORM_NCP_SARA_R410:
info->dev = DEV_SARA_R410;
break;
case PLATFORM_NCP_QUECTEL_BG96:
info->dev = DEV_QUECTEL_BG96;
break;
case PLATFORM_NCP_QUECTEL_EG91_E:
info->dev = DEV_QUECTEL_EG91_E;
break;
case PLATFORM_NCP_QUECTEL_EG91_NA:
info->dev = DEV_QUECTEL_EG91_NA;
break;
case PLATFORM_NCP_QUECTEL_EG91_EX:
info->dev = DEV_QUECTEL_EG91_EX;
break;
default:
info->dev = DEV_UNKNOWN;
break;
}
info->dev = cellular_dev_from_ncp((PlatformNCPIdentifier)client->ncpId());
}
if (info->size >= offsetof(CellularDevice, radiofw) + sizeof(CellularDevice::radiofw)) {
CHECK(client->getFirmwareVersionString(info->radiofw, sizeof(info->radiofw)));
Expand Down Expand Up @@ -623,3 +599,12 @@ int cellular_get_active_sim(int* simType, void* reserved) {
}
return 0;
}

int cellular_start_ncp_firmware_update(bool update, void* reserved) {
const auto mgr = cellularNetworkManager();
CHECK_TRUE(mgr, SYSTEM_ERROR_UNKNOWN);
const auto client = mgr->ncpClient();
CHECK_TRUE(client, SYSTEM_ERROR_UNKNOWN);
CHECK(client->startNcpFwUpdate(update));
return SYSTEM_ERROR_NONE;
}
1 change: 1 addition & 0 deletions hal/network/ncp/cellular/cellular_ncp_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class CellularNcpClient: public NcpClient {
virtual int enterDataMode() = 0;
virtual int getMtu() = 0;
virtual int urcs(bool enable) = 0;
virtual int startNcpFwUpdate(bool update) = 0;
};

inline CellularNcpClientConfig::CellularNcpClientConfig() :
Expand Down
6 changes: 5 additions & 1 deletion hal/network/ncp_client/quectel/quectel_ncp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ int QuectelNcpClient::on() {
return SYSTEM_ERROR_NONE;
}
// Power on the modem
LOG(TRACE, "Powering modem on, ncpId: 0x%02x", ncpId());
auto r = modemPowerOn();
if (r != SYSTEM_ERROR_NONE && r != SYSTEM_ERROR_ALREADY_EXISTS) {
return r;
Expand Down Expand Up @@ -1531,6 +1532,10 @@ int QuectelNcpClient::urcs(bool enable) {
return SYSTEM_ERROR_NONE;
}

int QuectelNcpClient::startNcpFwUpdate(bool update) {
return 0;
}

void QuectelNcpClient::connectionState(NcpConnectionState state) {
if (ncpState_ == NcpState::DISABLED) {
return;
Expand Down Expand Up @@ -1816,7 +1821,6 @@ int QuectelNcpClient::modemPowerOn() {
if (!modemPowerState()) {
ncpPowerState(NcpPowerState::TRANSIENT_ON);

LOG(TRACE, "Powering modem on");
// Power on, power on pulse >= 100ms
// NOTE: The BGPWR pin is inverted
HAL_GPIO_Write(BGPWR, 1);
Expand Down
1 change: 1 addition & 0 deletions hal/network/ncp_client/quectel/quectel_ncp_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class QuectelNcpClient: public CellularNcpClient {
virtual int enterDataMode() override;
virtual int getMtu() override;
virtual int urcs(bool enable) override;
virtual int startNcpFwUpdate(bool update) override;

auto getMuxer() {
return &muxer_;
Expand Down
Loading