Skip to content

Rollup 5.11rc v3 #8862

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

Merged
merged 18 commits into from
Nov 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d3812f3
ONME-3983 Fix the defects found in IPV4 testing against packet dropping
Nov 15, 2018
a1d2ac7
[Wio 3G] Adding IAR exporting definition
ytsuboi Nov 17, 2018
a655a53
Cellular: more gracefully disconnect.
Nov 16, 2018
df74f64
DISCO_L072CZ: remove ADC_VBAT pin definition
bcostm Nov 20, 2018
55d4db5
NUCLEO_F030/F070: remove ADC_VBAT pin definition
bcostm Nov 20, 2018
04c9283
S2-LP: Cleaned thread deprecation warnings
Nov 22, 2018
9095635
Cellular: Fixed bc95 to accept only RAT_NB1 as it's only valid rat th…
Nov 23, 2018
811ff21
Corrected detect_code for TMPM4G9
Nov 23, 2018
a35deac
DISCO_F746NG: add bootloader support
bcostm Nov 23, 2018
e1b60b1
Merge branch 'disco_f746ng_bootloader' of https://github.com/bcostm/m…
0xc0170 Nov 24, 2018
a4362f0
Merge branch 'master' of https://github.com/ganesh-ramachandran/mbed-…
0xc0170 Nov 24, 2018
ab7d2dd
Merge branch 'fix_bc95_todo' of https://github.com/jarvte/mbed-os int…
0xc0170 Nov 24, 2018
d535e22
Merge branch 'IOTTHD-2972' of https://github.com/JarkkoPaso/mbed-os i…
0xc0170 Nov 24, 2018
0ec41ce
Merge branch 'F0_adc_vbat' of https://github.com/bcostm/mbed-os into …
0xc0170 Nov 24, 2018
ad37c84
Merge branch 'disco-l072_adc_vbat' of https://github.com/bcostm/mbed-…
0xc0170 Nov 24, 2018
c873dc0
Merge branch 'ONME-3983' of https://github.com/mtomczykmobica/mbed-os…
0xc0170 Nov 24, 2018
5ad7c3e
Merge branch 'gracefully_disconnect' of https://github.com/jarvte/mbe…
0xc0170 Nov 24, 2018
6c1c169
Merge branch 'wio3g-export' of https://github.com/SeeedJP/mbed-os int…
0xc0170 Nov 24, 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
2 changes: 1 addition & 1 deletion TESTS/netsocket/tcp/tcpsocket_echotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace utest::v1;

namespace {
static const int SIGNAL_SIGIO = 0x1;
static const int SIGIO_TIMEOUT = 5000; //[ms]
static const int SIGIO_TIMEOUT = 20000; //[ms]

static const int BUFF_SIZE = 1200;
static const int PKTS = 22;
Expand Down
2 changes: 1 addition & 1 deletion TESTS/netsocket/tcp/tcpsocket_echotest_burst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace utest::v1;

namespace {
static const int SIGNAL_SIGIO = 0x1;
static const int SIGIO_TIMEOUT = 5000; //[ms]
static const int SIGIO_TIMEOUT = 20000; //[ms]

static const int BURST_CNT = 100;
static const int BURST_SIZE = 1220;
Expand Down
2 changes: 1 addition & 1 deletion TESTS/netsocket/tcp/tcpsocket_endpoint_close.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace utest::v1;

namespace {
static const int SIGNAL_SIGIO = 0x1;
static const int SIGIO_TIMEOUT = 5000; //[ms]
static const int SIGIO_TIMEOUT = 20000; //[ms]
}

static void _sigio_handler(osThreadId id)
Expand Down
2 changes: 1 addition & 1 deletion TESTS/netsocket/tcp/tcpsocket_recv_timeout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace utest::v1;

namespace {
static const int SIGNAL_SIGIO = 0x1;
static const int SIGIO_TIMEOUT = 5000; //[ms]
static const int SIGIO_TIMEOUT = 20000; //[ms]
}

static void _sigio_handler(osThreadId id)
Expand Down
2 changes: 1 addition & 1 deletion TESTS/netsocket/tcp/tcpsocket_thread_per_socket_safety.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using namespace utest::v1;
namespace {
static const int SIGNAL_SIGIO1 = 0x1;
static const int SIGNAL_SIGIO2 = 0x2;
static const int SIGIO_TIMEOUT = 5000; //[ms]
static const int SIGIO_TIMEOUT = 20000; //[ms]

Thread thread(osPriorityNormal, tcp_global::TCP_OS_STACK_SIZE);
volatile bool running = true;
Expand Down
358 changes: 192 additions & 166 deletions components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion features/cellular/framework/API/CellularNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class CellularNetwork {
*/
virtual nsapi_error_t get_attach(AttachStatus &status) = 0;

/** Request detach from a network.
/** Request detach and deregister from a network.
*
* @return NSAPI_ERROR_OK on success
* NSAPI_ERROR_DEVICE_ERROR on failure
Expand Down
34 changes: 26 additions & 8 deletions features/cellular/framework/AT/ATHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char
_previous_at_timeout(timeout),
_at_send_delay(send_delay),
_last_response_stop(0),
_fh_sigio_set(false),
_processing(false),
_ref_count(1),
_is_fh_usable(true),
Expand Down Expand Up @@ -109,9 +108,7 @@ ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char
set_tag(&_info_stop, CRLF);
set_tag(&_elem_stop, ")");

_fileHandle->set_blocking(false);

set_filehandle_sigio();
set_file_handle(fh);
}

void ATHandler::set_debug(bool debug_on)
Expand Down Expand Up @@ -154,6 +151,8 @@ FileHandle *ATHandler::get_file_handle()
void ATHandler::set_file_handle(FileHandle *fh)
{
_fileHandle = fh;
_fileHandle->set_blocking(false);
set_filehandle_sigio();
}

void ATHandler::set_is_filehandle_usable(bool usable)
Expand Down Expand Up @@ -312,11 +311,7 @@ void ATHandler::process_oob()

void ATHandler::set_filehandle_sigio()
{
if (_fh_sigio_set) {
return;
}
_fileHandle->sigio(mbed::Callback<void()>(this, &ATHandler::event));
_fh_sigio_set = true;
}

void ATHandler::reset_buffer()
Expand Down Expand Up @@ -1230,3 +1225,26 @@ void ATHandler::debug_print(const char *p, int len)
}
#endif // MBED_CONF_CELLULAR_DEBUG_AT
}

bool ATHandler::sync(int timeout_ms)
{
tr_debug("AT sync");
// poll for 10 seconds
for (int i = 0; i < 10; i++) {
lock();
set_at_timeout(timeout_ms, false);
// For sync use an AT command that is supported by all modems and likely not used frequently,
// especially a common response like OK could be response to previous request.
cmd_start("AT+CMEE?");
cmd_stop();
resp_start("+CMEE:");
resp_stop();
restore_at_timeout();
unlock();
if (!_last_err) {
return true;
}
}
tr_error("AT sync failed");
return false;
}
9 changes: 7 additions & 2 deletions features/cellular/framework/AT/ATHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ class ATHandler {
*/
void set_is_filehandle_usable(bool usable);

/** Synchronize AT command and response handling to modem.
*
* @param timeout_ms ATHandler timeout when trying to sync. Will be restored when function returns.
* @return true is synchronization was successful, false in case of failure
*/
bool sync(int timeout_ms);

protected:
void event();
#ifdef AT_HANDLER_MUTEX
Expand Down Expand Up @@ -211,8 +218,6 @@ class ATHandler {
uint16_t _at_send_delay;
uint64_t _last_response_stop;

bool _fh_sigio_set;

bool _processing;
int32_t _ref_count;
bool _is_fh_usable;
Expand Down
27 changes: 22 additions & 5 deletions features/cellular/framework/AT/AT_CellularContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define DEVICE_TIMEOUT 5 * 60 * 1000 // 5 minutes

#if NSAPI_PPP_AVAILABLE
#define AT_SYNC_TIMEOUT 1000 // 1 second timeout
#include "nsapi_ppp.h"
#endif

Expand Down Expand Up @@ -557,6 +558,8 @@ void AT_CellularContext::do_connect()
tr_error("Failed to open data channel!");
call_network_cb(NSAPI_STATUS_DISCONNECTED);
_is_connected = false;
} else {
_is_context_activated = true;
}
}
#else
Expand Down Expand Up @@ -630,13 +633,17 @@ nsapi_error_t AT_CellularContext::disconnect()
_at.lock();
_at.set_file_handle(_at.get_file_handle());
_at.set_is_filehandle_usable(true);
//_at.sync(); // consume extra characters after ppp disconnect, also it may take a while until modem listens AT commands
if (!_at.sync(AT_SYNC_TIMEOUT)) { // consume extra characters after ppp disconnect, also it may take a while until modem listens AT commands
tr_error("AT sync failed after PPP Disconnect");
}
_at.unlock();
#endif // NSAPI_PPP_AVAILABLE
_at.lock();

// deactivate a context only if we have activated
if (_is_context_activated) {
// CGACT and CGATT commands might take up to 3 minutes to respond.
_at.set_at_timeout(180 * 1000);
_is_context_active = false;
size_t active_contexts_count = 0;
_at.cmd_start("AT+CGACT?");
Expand All @@ -662,17 +669,27 @@ nsapi_error_t AT_CellularContext::disconnect()
// 3GPP TS 27.007:
// For EPS, if an attempt is made to disconnect the last PDN connection, then the MT responds with ERROR
if (_is_context_active && (rat < CellularNetwork::RAT_E_UTRAN || active_contexts_count > 1)) {
_at.clear_error();
_at.cmd_start("AT+CGACT=0,");
_at.write_int(_cid);
_at.cmd_stop_read_resp();
}
}

if (!_at.get_last_error()) {
_is_connected = false;
call_network_cb(NSAPI_STATUS_DISCONNECTED);
if (_new_context_set) {
_at.clear_error();
_at.cmd_start("AT+CGDCONT=");
_at.write_int(_cid);
_at.cmd_stop_read_resp();
}
_at.clear_error();
_at.cmd_start("AT+CGATT=0");
_at.cmd_stop_read_resp();
_at.restore_at_timeout();
}

_is_connected = false;
call_network_cb(NSAPI_STATUS_DISCONNECTED);

return _at.unlock_return_error();
}

Expand Down
3 changes: 3 additions & 0 deletions features/cellular/framework/AT/AT_CellularNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ nsapi_error_t AT_CellularNetwork::detach()
_at.cmd_start("AT+CGATT=0");
_at.cmd_stop_read_resp();

_at.cmd_start("AT+COPS=2");
_at.cmd_stop_read_resp();

call_network_cb(NSAPI_STATUS_DISCONNECTED);

return _at.unlock_return_error();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ AT_CellularNetwork::RegistrationMode QUECTEL_BC95_CellularNetwork::has_registrat
nsapi_error_t QUECTEL_BC95_CellularNetwork::set_access_technology_impl(RadioAccessTechnology opRat)
{
if (opRat != RAT_NB1) {
//TODO: Set as unknown or force to NB1?
_op_act = RAT_UNKNOWN;
// only rat that is supported by this modem
_op_act = RAT_NB1;
return NSAPI_ERROR_UNSUPPORTED;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ typedef enum {
// ADC internal channels
ADC_TEMP = 0xF0,
ADC_VREF = 0xF1,
ADC_VBAT = 0xF2,

// Arduino connector namings
A0 = PA_0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ typedef enum {
// ADC internal channels
ADC_TEMP = 0xF0,
ADC_VREF = 0xF1,
ADC_VBAT = 0xF2,

// Arduino connector namings
A0 = PA_0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
**/

#include "stm32f7xx.h"
#include "nvic_addr.h"
#include "mbed_error.h"

/*!< Uncomment the following line if you need to relocate your vector Table in
Expand Down Expand Up @@ -92,7 +93,7 @@ void SystemInit(void)
#ifdef VECT_TAB_SRAM
SCB->VTOR = RAMDTCM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#else
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; /* Vector Table Relocation in Internal FLASH */
#endif

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ typedef enum {
// ADC internal channels
ADC_TEMP = 0xF0,
ADC_VREF = 0xF1,
ADC_VBAT = 0xF2,

// Arduino connector namings
A0 = PA_0,
Expand Down
3 changes: 2 additions & 1 deletion targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -3460,6 +3460,7 @@
],
"release_versions": ["2", "5"],
"device_name": "STM32F746NG",
"bootloader_supported": true,
"overrides": {
"network-default-interface-type": "ETHERNET"
}
Expand Down Expand Up @@ -7299,7 +7300,7 @@
"USTICKER"
],
"device_name": "TMPM4G9F15FG",
"detect_code": ["7016"],
"detect_code": ["7015"],
"release_versions": ["5"],
"bootloader_supported": true
},
Expand Down
3 changes: 3 additions & 0 deletions tools/export/iar/iar_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@
"STM32F439ZI": {
"OGChipSelectEditMenu": "STM32F439ZI\tST STM32F439ZI"
},
"STM32F439VI": {
"OGChipSelectEditMenu": "STM32F439VI\tST STM32F439VI"
},
"LPC1768": {
"OGChipSelectEditMenu": "LPC1768\tNXP LPC1768"
},
Expand Down