Commit Graph

3073 Commits (mbed-os-5.9.6)

Author SHA1 Message Date
Hasnain Virk 5da9794156 LoRaWAN: Wrong return code for JoinRequest retry
51f92b0efd introduced
handling for connection attempts while a connection was already underway or have been
completed. Unfortunately a similar check slipped through and the stack was not able to continue
sending join requests if an error happened.
2018-07-27 13:43:54 -05:00
ccli8 974c52b416 Fix Greentea test code with Cortex-M23/M33
Enlarge stack size of forked thread for Cortex-M23/M33 targets
2018-07-27 13:30:07 -05:00
David Saada 20387d41d3 Unity: Add macros for test skipping.
The TEST_SKIP and TEST_SKIP_UNLESS macros (w/ and w/o messages) allow the test
to skip the test case execution from the point the macro was called (without
failing the test).
2018-07-27 13:30:00 -05:00
Steven Cooreman 43c81dee40 Add EFM32GG11 Ethernet driver 2018-07-27 13:29:56 -05:00
David Saada a8d99d619f NVStore tests: Tune memory consumption; stop threads greafully
- Tune thread stack size in nvstore test using heap stats
- Stop threads gracefully instead of killing them (in multi-thread test)
2018-07-27 13:29:55 -05:00
Hasnain Virk 5d50cf1836 Streamlining connect() API with posix like retcodes
For ABP: First call to connect() or connect(params) will return LORAWAN_STATUS_OK
         and a CONNECTED event will be sent. Any subsequent call will return
         LORAWAN_STATUS_ALREADY_CONNECTED (posix EISCONN) and no event is generated.

FOR OTAA: First call to connect() or connect(params) will return LORAWAN_STATUS_CONNECT_IN_PROGRESS
          and a CONNECTED event will be sent whenever the JoinAccept is received. If the application
          calls connect again before receiving the CONNECTED event, LORAWAN_STATUS_BUSY will be returned.
          After the CONNECTED event is dispatched, any subsequent call to connect() or connect(params) API
          will be returned with LORWAN_STATUS_ALREADY_CONNECTED.

No new parameters are accepted after the first call. The application must disconnect before making
a connect() call with new parameters.
2018-07-15 22:54:26 -05:00
Hasnain Virk 000adb03f0 Updating docs
API documentation is updated to clear how the connection related return codes will
work from now on.
2018-07-15 22:54:26 -05:00
Hasnain Virk b6fbb97892 LoRaWAN: Handling re-joining when already Joined
This is a remedy for the issue #7230.
While the device is joining, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned.
However, if the device is already joined, we will return LORAWAN_STATUS_ALREADY_CONNECTED.
2018-07-15 22:54:26 -05:00
Mirela Chirica 5d05e443bb Cellular: Fix socket_send unit test 2018-07-15 22:53:59 -05:00
Ari Parkkila 594e5283be Cellular: Removed max_packet_size 2018-07-15 22:53:59 -05:00
Kevin Bracey 063092f256 Add Apache licenses to ns_hal files 2018-07-15 22:53:45 -05:00
Kevin Bracey 23cf0ed7a6 Add option to make Nanostack use global event queue 2018-07-15 22:53:45 -05:00
Mirela Chirica 0d52fc3a20 Cellular: More unit tests for ATHandler's read routines 2018-07-15 22:53:45 -05:00
Mirela Chirica de2290aed6 Cellular: Fix for ATHandler's read string and hexstring NULL termination 2018-07-15 22:53:44 -05:00
Brendan McDonnell a65e92ea95 FatFs 0.13b hotfix - fix readdir() never terminates when dir is full.
http://elm-chan.org/fsw/ff/patches.html
http://elm-chan.org/fsw/ff/ff13b_p1.diff
https://github.com/ARMmbed/mbed-os/issues/5780
2018-07-15 22:53:31 -05:00
ccli8 6de4b3532c Fix memory leakage with MBR on exiting error path 2018-07-15 22:53:30 -05:00
Tero Jääskö 7e68ac09e6 netsocket: dns: make dns-cache-size:0 remove whole DNS cache code
Setting ""nsapi.dns-cache-size": 0" still left some of the DNS
caching code in. Add crude #if to remove all of it.
This allows one to save 429 bytes of flash and 48 bytes of RAM on
ARMC5 builds.
2018-07-15 22:48:50 -05:00
Amanda Butler 1f155291be Copy edit LoRaWANBase.h
Copy edit for precise language and comma use.
2018-07-15 22:48:50 -05:00
Amanda Butler 59097d0611 Copy edit LoRaWANinterface.h
Copy edit for precise language and comma use.
2018-07-15 22:48:50 -05:00
Hasnain Virk 62165514ee Correcting doxygen
Use of MSG_FLAGS was updated in previous PRs but the doc was not updated
accordingly.
2018-07-15 22:48:50 -05:00
mudassar-ublox 603adcfade Cellular: Fixed set_sim_pin method calling 2018-07-15 22:48:50 -05:00
Hasnain Virk 0d2e199280 LoRaWAN: Fixing transport of fatal TX timeout event
This commit fixes the issue reported in #7285.
If the radio is unable to transmit, its a fatal error and can happen
both while joining or sending a normal packet. In the case of such
a catastrophy we ought to tell the application that this happened.

A fix for the radio driver will also be patched.
2018-06-29 17:11:50 +01:00
jeromecoutant 8397a9d38b TARGET_STM USB astyle 2018-06-29 17:11:50 +01:00
jeromecoutant 5612dac3b7 TARGET_STM_EMAC astyle 2018-06-29 17:11:50 +01:00
jeromecoutant 66a099867e TARGET_STM mbedtls astyle 2018-06-29 17:11:50 +01:00
Teppo Järvelin 92eab0f99f Cellular: improved observing of disconnect for callbacks. 2018-06-29 17:10:17 +01:00
Antti Yli-Tokola 88798899ae Update mbed-coap to version 4.5.0
Fix error:  IIOTCLT-2769 - mbed-coap: extra response received after registration

Added own flag to enable blockwise support, without setting default blockwise
payload size. This allows to receive blockwise messages while still sending
without blockwise.

Fix CoAP request blockwise response handling
When request is sent, response can have blockwise option set. All requests must
be stored to the linked list.
2018-06-29 17:10:17 +01:00
Teppo Järvelin 90f67902ba Cellular: review fixes for cellularinformation tests. 2018-06-29 17:10:17 +01:00
Teppo Järvelin 789a1c1720 Cellular: added greentea tests for CellularInformation. 2018-06-29 17:10:17 +01:00
Teppo Järvelin 7e82eb5647 Cellular: added more CellularInformation unit tests. 2018-06-29 17:10:17 +01:00
Christopher Haster 69ed638e2e Fixed issue with MBR init asserting on bad partition size 2018-06-29 17:10:17 +01:00
Vincent Coubard a5df9176a9 Nordic BLE: Fix return value verification 2018-06-29 17:10:17 +01:00
Vincent Coubard 2d97c91561 Nordi BLE: Fix formatting 2018-06-29 17:10:17 +01:00
Vincent Coubard 5711b295da Nordic BLE:
Cancel pairing if the device fail to allocate the resources necessary for the pairing operation.
2018-06-29 17:10:17 +01:00
Vincent Coubard 01f5c456f3 Nordic BLE: Fix pairing cancellation.
Depending on the role and the current state of the local device; pairing cancelation should be made with a call to a specific function. Normally the Nordic stack would reject invalid calls if the device is not in the correct state; therefore it was assumed that it was possible to detect the state from sd errors. Unfortunatelly this is not true with the latest softdevices as some calls succeed even if the device is not in the right state.

To solve that issue cancelation looks at the current state of the device first to select the right function that will trigger the pairing cancellation.

Note: the call to sd_ble_gap_authenticate was missing in the previous algorithm
2018-06-29 17:10:17 +01:00
Vincent Coubard e8b783b702 Nordic BLE: Store locally role for a given connection. 2018-06-29 17:10:17 +01:00
Vincent Coubard a6eefdfdcf Nordic BLE: Add default parameter to get the local instance of nrF5xn 2018-06-29 17:10:17 +01:00
Vincent Coubard c4ecbfb796 Nordic BLE: Improve return of nRF5xn::getGap.
Return the derived type instead of the abstract one. This is legal as C++ supports covariant returns.
2018-06-29 17:10:17 +01:00
Teppo Järvelin 9527ab33a8 Cellular: fixed unit tests after rebasing with master. 2018-06-29 17:10:17 +01:00
Teppo Järvelin 0e4ca1c46b Cellular: Added network unit tests. 2018-06-29 17:10:17 +01:00
Teppo Järvelin 440c10ad88 Cellular: added greentea tests for CellularNetwork. 2018-06-29 17:10:17 +01:00
Kari Haapalehto b955eb7e49 Add binary drivers for MTB_USI_WM_BN_BM_22 and MTB_ADV_WISE_1530 2018-06-29 17:10:17 +01:00
paul-szczepanek-arm a0b20720dd reuse existing call 2018-06-29 17:10:17 +01:00
paul-szczepanek-arm 338a8fc696 use sets to apply limits 2018-06-29 17:10:17 +01:00
paul-szczepanek-arm c17c674c82 add setScanParams overload 2018-06-29 17:10:17 +01:00
Amanda Butler e60566e85e Copy edit CellularConnectionFSM.h
Copy edit for consistent tense and comma usage.
2018-06-29 17:10:17 +01:00
Teppo Järvelin 83fbeea304 Cellular: fixed defect where SIM interface was closed too early causing crash with certain configurations. 2018-06-29 17:10:17 +01:00
Mika Leppänen 787ea51bad K64F, K66F: Update the ENET PHY driver
PHY init and autonegotation is split into own functions.
2018-06-29 17:10:17 +01:00
Mika Leppänen f1416c76fa Added delay to K64F/K66F ethernet TX when all descriptors are in use
Currently, if all TX descriptors are in use and IP stack calls K64F/K66F
ethernet driver link out, link out drops the packet. Added 10ms delay
to link out to wait for a descriptor to become available before dropping
the packet.
2018-06-29 17:10:17 +01:00
Mika Leppänen 9d062c0352 Non-blocking K64F/K66F ethernet power up
Changed K64F/K66F power up to return without waiting for link up i.e. for
the ethernet cable to be connected. This is needed for non-blocking use
of driver e.g. for using the driver from event queue.
2018-06-29 17:10:17 +01:00
Hasnain Virk 600efe9906 Remaining style fixes 2018-06-29 17:10:17 +01:00
Hasnain Virk e8f9f4d9f2 Adding valid frequency check for RXParamSetup cmd
We must check for a valid value of a frequency being sent
by the network server.
2018-06-29 17:10:17 +01:00
Hasnain Virk 6ab0c0b688 Adding port in trace & streamlining continuous RX2 2018-06-29 17:10:17 +01:00
Hasnain Virk 2db1b9a01d Queuing the automatic uplink
If the automatic uplink is sent directly the call-stack becomes larger than 1K
which may cause serious problems in debug builds. Just to have a respite between
RX and TX we queue an event for the automatic uplink rather than directly undergoing
an automatic uplink.
2018-06-29 17:10:17 +01:00
Hasnain Virk d10dee1449 Adding precise timing for receive delays
RX1 and 2 delays needed to be more precise and aggregate tx time was
drifiting because of timing difference between actual tx interrupt and
our processing of that interrupt ever so slightly.

We now take a timestamp of the tx interrupt and take a time diff while
instantiating delay timers. The timestamp is then used to update the aggregate
tx time.

Two new methods are introduced in the LoRaMac class which provide current
timing and current receive slot. These functions are used by LoRaWANStack
for its processing.
2018-06-29 17:10:17 +01:00
Teppo Järvelin 2cadd9d05c Cellular: fixed unit tests after rebase with latest changes. 2018-06-29 17:10:17 +01:00
Teppo Järvelin 33461805cb Cellular: Added power and sim greentea and unit tests. 2018-06-29 17:10:17 +01:00
Seppo Takalo cfe9225e4f Fix typo: WifiInterface -> WiFiInterface and add missing return.
Default WiFiInterface did not even build. And when it was fixed to build,
it was always returning NULL.
2018-06-29 17:10:17 +01:00
Seppo Takalo ecef1f55f7 Fix default interface selection by using correct macro names.
Code was written using MBED_CONF_DEFAULT_* but the mbed_lib.json file
that created these values is prefixed with "nsapi" and therefore
final macros are MBED_CONF_NSAPI_DEFAULT_*
2018-06-29 17:10:17 +01:00
Mika Leppänen 3bc03e3f5d Changed DNS global class definitions to singletons
This saves memory on platforms without network interface.
2018-06-29 17:10:17 +01:00
Mika Leppänen 50a79a6705 Disabled STM ethernet driver hardware checksum calculation
No need for driver level hardware IPv4/TCP/UDP/ICMP checksum insertion
since LWIP and nanostack handles those already.

Related to issue: https://github.com/ARMmbed/mbed-os/issues/7227
2018-06-29 17:10:17 +01:00
Vincent Coubard 8f29bf5b9e Nordic BLE: Accept connection parameter update
A peer device that sends a connection parameter update may get block if it doesn't receive a response.

This patch accept the peer request unconditionnally. At some point this event will be managed by the application.
2018-06-29 17:10:17 +01:00
David Saada dc3092fd9a Support erasing of more than one erase unit in the exhaustible block device 2018-06-29 17:10:17 +01:00
Kevin Bracey 1fde01c243 Add API to read Thread EUI-64
Previously get_mac_address on a ThreadInterface returned the EUI-64
reported by the radio driver. This was required for commissioning, but
was inconsistent with other interfaces, and the API concept.

5.9.0 inadvertently changed this so that get_mac_address returned the
actual MAC address used by the radio, which is a hash result of the
EUI-64 for Thread.

The original "return the EUI-64" form was somewhat faulty, as
get_mac_address would not return the EUI-64 set by set_device_eui64() or
another mechanism before connect() was called.

Rather than revert to old behaviour, add a new API to get the device
EUI-64 to ThreadInterface, alongside the existing set API.
2018-06-29 17:10:17 +01:00
Antti Yli-Tokola b60abe1c3b Update mbed-coap to version 4.4.4
Fixes one error: IOTCLT-2638 Hardfault during reconnection retry with Thread
2018-06-29 17:10:17 +01:00
Mika Leppänen 92a4cb2bc8 Added missing license to header of the file 2018-06-15 13:34:21 +01:00
Mika Leppänen dbbfdbc312 Added UBLOX_C027/ARCH_PRO memory configurations 2018-06-15 13:34:21 +01:00
Mika Leppänen eee607b51a Corrected TX buffer reclaim error
When all TX descriptors were reserved in a row so that TX buffer
reclaim interrupt did not happen during reservation sequence, after
the interrupt occurred, TX buffer reclaim did no longer free buffers.

This happened because when all descriptors were in use, last free
index pointed to consumed index.
2018-06-15 13:34:21 +01:00
Mika Leppänen b744b50dca Ported NXP LPCxx ethernet driver to unified EMAC 2018-06-15 13:34:21 +01:00
Teppo Järvelin 77b0fc371b Cellular: Semaphore wasn't released in easycellular release build. 2018-06-15 13:30:56 +01:00
Mika Leppänen f94b2ea263 Increased LWIP main worker thread stack size for debug builds
LWIP stack is configured to be 1200 as default. Without debug enabled,
maximum stack size used for asynchronous DNS operations is 880 bytes. With
debug enabled maximum used stack size is 1248. Added configuration
to LWIP to increase stack size by 25 percent when debug is enabled on build.
2018-06-15 13:30:56 +01:00
Teppo Järvelin 97cdbf769d Cellular: release resources in state machine. Made sure that athandler does not try process urc's after switch to data mode. 2018-06-15 13:30:56 +01:00
Yoshihiro TSUBOI 7bc411eedb Changed suggested things
Removed context check from do_user_authentication.
2018-06-15 13:30:56 +01:00
Yoshihiro TSUBOI b3ebb5229a Changed suggested points
Changed accessibility cellular features member functions, fixed minor target issues
2018-06-15 13:30:56 +01:00
ytsuboi 4b1d0875b7 Adding platform 2018-06-15 13:30:56 +01:00
Teppo Järvelin a771f0458a Cellular: fixed unit tests to compile after rebasing to latest. 2018-06-15 13:30:56 +01:00
Teppo Järvelin 64e8363d69 Cellular: added more unit tests for CellularDevice. 2018-06-15 13:30:56 +01:00
Teppo Järvelin d5a6baf5cd Cellular: added greentea test for cellular device. 2018-06-15 13:30:56 +01:00
paul-szczepanek-arm bf6407e3b7 check that flags have the IRK stored before retrieving it 2018-06-15 13:30:56 +01:00
paul-szczepanek-arm d07d966d0f missing return
function would potentially send a reject and accept at the same time
2018-06-15 13:30:56 +01:00
Kevin Bracey 172c69ec0d Correct PPPCellularInterface::get_gateway()
Two cascading copy-paste errors stopped this working:

  * PPPCellularInterface::get_gateway() called
    nsapi_ppp_get_ip_address();
  * nsapi_ppp_get_gateway() called the interface's get_netmask().

First bug has always been there - second one was introduced in 5.9.

AT_CellularNetwork currently lacks calls to get both netmask and gateway
- this patch would be needed for that when added.
2018-06-15 13:30:56 +01:00
Ari Parkkila 09e14567fe Cellular: Disable Greentea tracing to consume less memory 2018-06-15 13:30:56 +01:00
Kevin Bracey 0e676883c8 NSAPI: Use IPv6 conversion routines from frameworks
Share IPv6 conversion code with mbed_trace, Nanostack and
mbed client.

Output formatting is better, being conformant to RFC 5952.
2018-06-15 13:30:56 +01:00
Russ Butler 607f78213d Fix USB on Kinetis devices
Set correct SYSMPU register for proper USB operation.  This bug was
introduced when the SYSMPU register names and defines were updated
in the commit:
"K64F: Updated the SYSMPU SDK driver"
93f8cfed05
2018-06-15 13:30:56 +01:00
Ari Parkkila 0aff4e836b Cellular: Enable AT debug also when mbed-trace is disabled 2018-06-15 13:30:56 +01:00
Teemu Kultala 80464502fa more effective port randomisation 2018-06-15 13:30:56 +01:00
Teemu Kultala 394b2f157d random socket port number 2018-06-15 13:30:56 +01:00
Teppo Järvelin 33653e89e3 Review fix: - set ppp_active false if close fails in ppp disconnect. - unset sigio in ppp disconnect - take ownership of filehandle in CellularNetwork::disconnect even in case of failure 2018-06-15 13:30:56 +01:00
Teppo Järvelin 7a53ed276e Fixed ppp disconnect hangs when connection failure. 2018-06-15 13:30:56 +01:00
Amanda Butler 0d8b331eb0 Copy edit README.md
Tweak bullet's phrasing to clarify meaning
2018-06-15 13:30:56 +01:00
David Saada 4d7a15e0f1 Fix NVStore README file (changed APIs) 2018-06-15 13:30:56 +01:00
Kimmo Vaisanen 58230e0786 Lora: Check for valid ABP params
Check that ABP dev_addr and nwk_id is non-zero and keys are not null.
2018-06-15 13:30:56 +01:00
Hasnain Virk e6e3993d4a dr_range bitfield should be unsigned integer
If the value is an integer, the 4th bit is used for sign, so you can store
values upto 7 only whereas the datarate values could go upto 15. That's why
we need to turn this to an unsigned integer so that the last bit can also be used.
2018-06-15 13:30:56 +01:00
Hasnain Virk 1a074acbb5 Style changes only
Travis astyle check pointed out some of the style mismatches in the code.
Not all of them are worth changing as they make the code unreadable and
some of them are semantically wrong.

So in this commit, we have attempted to pick the most important style
mismatches and rectify.
2018-06-15 13:30:56 +01:00
Hasnain Virk c705f94e49 Moving missing public data structures
A few of the structures were missing from the storage space which is
visible topublic APIs. Suc structures are now being added.
2018-06-15 13:30:56 +01:00
Kimmo Vaisanen 05ee60f8cb Lora: All API methods should check if stack has been initialized 2018-06-15 13:30:56 +01:00
cyliangtw 790d24740a Support default tz_module for event loop & lwip 2018-06-15 13:30:56 +01:00
Kevin Bracey cfed8228eb Nanostack EMAC - avoid initialisation race
Hard fault was possible if packet reception occurred during
initialisation. Adjust start-up ordering and add NULL check to
avoid.
2018-06-15 13:30:56 +01:00
Kevin Bracey b2a6e94cd8 Kinetis EMAC: Correct TX ring pointer array size
TX pointer array was using RX ring length in its declaration.
Wasted memory if RX ring > TX ring, as is the default, but would
be broken if RX ring < TX ring.
2018-06-15 13:30:56 +01:00
Kevin Bracey cedccc7daf Kinetis EMAC: Make number of buffers configurable
16 RX buffers and 8 TX buffers is probably excessive. Nanostack
version of driver successfully used 4+4, and data pump should be
broadly equivalent.

This means that switching K64F devices from Nanostack to EMAC increases
base heap usage by 18K - observed in Nanostack border router builds.

Add a config option to make it possible to lower the number of buffers.
Defer consideration of lowering the default to later.
2018-06-15 13:30:56 +01:00