Skip to content

Mts dragonfly l471 qg #8382

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1356126
adding TARGET MTS_DRAGONFLY_L471QG
cedrickkukela-cd Jun 8, 2018
cc1c296
Ublox and PinName fixes
cedrickkukela-cd Jun 15, 2018
8aeb0c4
target fix
cedrickkukela-cd Jun 15, 2018
b12b08b
fixing onboard modem init bug on mts dragonfly l471
cedrickkukela-cd Jun 22, 2018
5a4a2a0
change startup and s file names to match target
cedrickkukela-cd Jun 23, 2018
20943c0
delete file
cedrickkukela-cd Jun 23, 2018
aa49765
remove blanks
cedrickkukela-cd Jun 23, 2018
86e1a27
changes to support mts dragonfly nano ppp
cedrickkukela-cd Jun 23, 2018
cc3fd08
Rev c pin name fix
cedrickkukela-cd Jul 18, 2018
f617619
REV D change for modem on
cedrickkukela-cd Aug 29, 2018
8a09249
target changes
cedrickkukela-cd Aug 29, 2018
eed8a52
Fix rev D radio init/power/reset and add back bootloader capability
felser Aug 29, 2018
f4daabb
Fixed spacing/tabs and clean up targets.json
felser Sep 4, 2018
52815c2
Remove commented out code
felser Sep 4, 2018
cbdfec5
Rebased on master mbed-os 9/7/18
felser Sep 10, 2018
24b7687
Rebase and changes for Dragonfly nano support
felser Sep 19, 2018
96ffa34
Decrease heap size in IAR linker so tests compile and use SRAM2 for I…
felser Sep 24, 2018
baab349
Fix so building for other targets does not fail
felser Sep 24, 2018
d819f02
Remove LOWPOWERTIMER as it has been replaced by LPTICKER
felser Sep 25, 2018
f9a68b9
Fix rebase conflict file
felser Sep 26, 2018
a78e6ea
Fix broken cellular_device test and delete commented code
felser Sep 27, 2018
e56df4a
Add header so cellular_power tests compile and run
felser Sep 27, 2018
fb1aec3
Delete commented out merge conflict resolution
felser Oct 1, 2018
6c600f5
Configure IAR stack size to 1KB
felser Oct 2, 2018
fd7bcc4
Fixed merge problem
Oct 11, 2018
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
18 changes: 12 additions & 6 deletions features/cellular/TESTS/api/cellular_network/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ static void test_activate_context()
static void test_connect()
{
TEST_ASSERT(nw->connect() == NSAPI_ERROR_OK);
char count = 0;
while ((nw->get_connection_status() != NSAPI_STATUS_GLOBAL_UP) && (count++ < 60)) {
wait(1);
}
nsapi_connection_status_t st = nw->get_connection_status();
TEST_ASSERT(st == NSAPI_STATUS_GLOBAL_UP);
}
Expand All @@ -223,7 +227,7 @@ static void test_other()
// can't test values as they are optional
nsapi_error_t err = nw->get_rate_control(reports, timeUnit, uplinkRate);
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
if (strcmp(devi, "QUECTEL_BG96") != 0 && strcmp(devi, "TELIT_HE910") != 0) { // QUECTEL_BG96 does not give any specific reason for device error
if (strcmp(devi, "QUECTEL_BG96") != 0 && strcmp(devi, "TELIT_HE910") != 0 && strcmp(devi, "SARA4_PPP") != 0) { // QUECTEL_BG96 does not give any specific reason for device error
if (err == NSAPI_ERROR_DEVICE_ERROR) {
TEST_ASSERT(((AT_CellularNetwork *)nw)->get_device_error().errCode == 100 && // 100 == unknown command for modem
((AT_CellularNetwork *)nw)->get_device_error().errType == 3); // 3 == CME error from the modem
Expand All @@ -234,7 +238,7 @@ static void test_other()
err = nw->get_apn_backoff_timer(uplinkRate);
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR || err == NSAPI_ERROR_PARAMETER);
if (err == NSAPI_ERROR_DEVICE_ERROR) {
if (strcmp(devi, "QUECTEL_BG96") != 0 && strcmp(devi, "TELIT_HE910") != 0) { // QUECTEL_BG96 does not give any specific reason for device error
if (strcmp(devi, "QUECTEL_BG96") != 0 && strcmp(devi, "TELIT_HE910") != 0 && strcmp(devi, "SARA4_PPP") != 0) { // QUECTEL_BG96 does not give any specific reason for device error
TEST_ASSERT(((AT_CellularNetwork *)nw)->get_device_error().errCode == 100 && // 100 == unknown command for modem
((AT_CellularNetwork *)nw)->get_device_error().errType == 3); // 3 == CME error from the modem
}
Expand Down Expand Up @@ -320,7 +324,7 @@ static void test_other()

TEST_ASSERT(nw->set_blocking(true) == NSAPI_ERROR_OK);

if (strcmp(devi, "QUECTEL_BG96") != 0) {
if (strcmp(devi, "QUECTEL_BG96") != 0 && strcmp(devi, "SARA4_PPP") != 0) {
// QUECTEL_BG96 timeouts with this one, tested with 3 minute timeout
CellularNetwork::operator_names_list op_names;
err = nw->get_operator_names(op_names);
Expand All @@ -344,7 +348,7 @@ static void test_other()
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
if (err == NSAPI_ERROR_DEVICE_ERROR) {
// if device error then we must check was that really device error or that modem/network does not support the commands
if (!(strcmp(devi, "TELIT_HE910") == 0 || strcmp(devi, "QUECTEL_BG96") == 0)) {
if (!(strcmp(devi, "TELIT_HE910") == 0 || strcmp(devi, "QUECTEL_BG96") == 0 || strcmp(devi, "SARA4_PPP") == 0)) {
TEST_ASSERT((((AT_CellularNetwork *)nw)->get_device_error().errType == 3) && // 3 == CME error from the modem
((((AT_CellularNetwork *)nw)->get_device_error().errCode == 100) || // 100 == unknown command for modem
(((AT_CellularNetwork *)nw)->get_device_error().errCode == 50))); // 50 == incorrect parameters // seen in wise_1570 for not supported commands
Expand All @@ -358,7 +362,7 @@ static void test_other()
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_DEVICE_ERROR);
if (err == NSAPI_ERROR_DEVICE_ERROR) {
// if device error then we must check was that really device error or that modem/network does not support the commands
if (!(strcmp(devi, "TELIT_HE910") == 0 || strcmp(devi, "QUECTEL_BG96") == 0)) {
if (!(strcmp(devi, "TELIT_HE910") == 0 || strcmp(devi, "QUECTEL_BG96") == 0 || strcmp(devi, "SARA4_PPP") == 0)) {
TEST_ASSERT((((AT_CellularNetwork *)nw)->get_device_error().errType == 3) && // 3 == CME error from the modem
((((AT_CellularNetwork *)nw)->get_device_error().errCode == 100) || // 100 == unknown command for modem
(((AT_CellularNetwork *)nw)->get_device_error().errCode == 50))); // 50 == incorrect parameters // seen in wise_1570 for not supported commands
Expand All @@ -371,6 +375,8 @@ static void test_disconnect()
nsapi_connection_status_t st = nw->get_connection_status();
TEST_ASSERT(st == NSAPI_STATUS_GLOBAL_UP);
TEST_ASSERT(nw->disconnect() == NSAPI_ERROR_OK);
// wait to process URC's, received after disconnect
rtos::Thread::wait(500);
}

static void test_detach()
Expand All @@ -384,7 +390,7 @@ static void test_detach()

TEST_ASSERT(nw->detach() == NSAPI_ERROR_OK);
// wait to process URC's, received after detach
rtos::Thread::wait(50);
rtos::Thread::wait(500);
st = nw->get_connection_status();
TEST_ASSERT(st == NSAPI_STATUS_DISCONNECTED);
}
Expand Down
1 change: 1 addition & 0 deletions features/cellular/TESTS/api/cellular_power/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include "mbed.h"

#include "AT_CellularPower.h"
#include "CellularDevice.h"
#include "../../cellular_tests_common.h"
#include CELLULAR_STRINGIFY(CELLULAR_DEVICE.h)
Expand Down
3 changes: 2 additions & 1 deletion features/cellular/framework/AT/AT_CellularDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ CellularInformation *AT_CellularDevice::open_information(FileHandle *fh)
void AT_CellularDevice::close_network()
{
if (_network) {
release_at_handler(&_network->get_at_handler());
ATHandler *atHandler = &_network->get_at_handler();
delete _network;
_network = NULL;
release_at_handler(atHandler);
}
}

Expand Down
4 changes: 3 additions & 1 deletion features/cellular/framework/common/CellularTargets.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ namespace mbed {
#endif
#elif TARGET_UBLOX_C027
#define CELLULAR_DEVICE UBLOX_PPP
#else
#elif TARGET_MTS_DRAGONFLY_L471QG
#define CELLULAR_DEVICE SARA4_PPP
//#else
//#error Cellular target not defined, see cellular/targets.h
//#define CELLULAR_TARGET <target-modem>
//#define MDMTXD <pin-name>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2017, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "SARA4_PPP.h"
#include "SARA4_PPP_CellularNetwork.h"
#include "SARA4_PPP_CellularPower.h"

using namespace mbed;
using namespace events;

static const AT_CellularBase::SupportedFeature unsupported_features[] = {
AT_CellularBase::AT_CGSN_WITH_TYPE,
AT_CellularBase::AT_CGDATA,
AT_CellularBase::SUPPORTED_FEATURE_END_MARK
};

SARA4_PPP::SARA4_PPP(EventQueue &queue) : AT_CellularDevice(queue)
{
AT_CellularBase::set_unsupported_features(unsupported_features);
}

SARA4_PPP::~SARA4_PPP()
{
}

AT_CellularNetwork *SARA4_PPP::open_network_impl(ATHandler &at)
{
return new SARA4_PPP_CellularNetwork(at);
}

AT_CellularPower *SARA4_PPP::open_power_impl(ATHandler &at)
{
return new SARA4_PPP_CellularPower(at);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2017, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef SARA4_PPP_H_
#define SARA4_PPP_H_

#include "AT_CellularDevice.h"

namespace mbed {

class SARA4_PPP : public AT_CellularDevice {

public:
SARA4_PPP(events::EventQueue &queue);
virtual ~SARA4_PPP();

public: // CellularDevice
virtual AT_CellularNetwork *open_network_impl(ATHandler &at);
virtual AT_CellularPower *open_power_impl(ATHandler &at);
};

} // namespace mbed

#endif // SARA4_PPP_H_
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2017, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "SARA4_PPP_CellularNetwork.h"

using namespace mbed;

SARA4_PPP_CellularNetwork::SARA4_PPP_CellularNetwork(ATHandler &atHandler) : AT_CellularNetwork(atHandler)
{
}

SARA4_PPP_CellularNetwork::~SARA4_PPP_CellularNetwork()
{
}

bool SARA4_PPP_CellularNetwork::get_modem_stack_type(nsapi_ip_stack_t requested_stack)
{
return requested_stack == IPV4_STACK ? true : false;
}

AT_CellularNetwork::RegistrationMode SARA4_PPP_CellularNetwork::has_registration(RegistrationType reg_type)
{
return (reg_type == C_REG || reg_type == C_GREG) ? RegistrationModeLAC : RegistrationModeDisable;
}

nsapi_error_t SARA4_PPP_CellularNetwork::set_access_technology_impl(RadioAccessTechnology opRat)
{
_op_act = RAT_CATM1;
return NSAPI_ERROR_OK;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2017, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef SARA4_PPP_CELLULAR_NETWORK_H_
#define SARA4_PPP_CELLULAR_NETWORK_H_

#include "AT_CellularNetwork.h"

namespace mbed {

class SARA4_PPP_CellularNetwork : public AT_CellularNetwork {
public:
SARA4_PPP_CellularNetwork(ATHandler &atHandler);
virtual ~SARA4_PPP_CellularNetwork();

protected:
virtual bool get_modem_stack_type(nsapi_ip_stack_t requested_stack);

virtual RegistrationMode has_registration(RegistrationType rat);

virtual nsapi_error_t set_access_technology_impl(RadioAccessTechnology opRat);
};

} // namespace mbed

#endif // SARA4_PPP_CELLULAR_NETWORK_H_
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2017, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "SARA4_PPP_CellularPower.h"

#include "onboard_modem_api.h"

using namespace mbed;

SARA4_PPP_CellularPower::SARA4_PPP_CellularPower(ATHandler &atHandler) : AT_CellularPower(atHandler)
{

}

SARA4_PPP_CellularPower::~SARA4_PPP_CellularPower()
{

}

nsapi_error_t SARA4_PPP_CellularPower::on()
{
#if MODEM_ON_BOARD
::onboard_modem_init();
::onboard_modem_power_up();
#endif
return NSAPI_ERROR_OK;
}

nsapi_error_t SARA4_PPP_CellularPower::off()
{
#if MODEM_ON_BOARD
::onboard_modem_power_down();
#endif
return NSAPI_ERROR_OK;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2017, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef SARA4_PPP_CELLULARPOWER_H_
#define SARA4_PPP_CELLULARPOWER_H_

#include "AT_CellularPower.h"

namespace mbed {

class SARA4_PPP_CellularPower : public AT_CellularPower {
public:
SARA4_PPP_CellularPower(ATHandler &atHandler);
virtual ~SARA4_PPP_CellularPower();

public: //from CellularPower

virtual nsapi_error_t on();

virtual nsapi_error_t off();
};

} // namespace mbed

#endif // SARA4_PPP_CELLULARPOWER_H_
Loading