Commit Graph

14236 Commits (1d1eef47ff692047be2df09c8a65adcab6ef4dab)

Author SHA1 Message Date
Mike Harrington 60b22dba19 Added exporter for Analog Devices' CrossCore Embedded Studio 2018-02-09 14:48:05 -05:00
Hasnain Virk 5e8d8e1c08 Bug fix in setting data rate
Setting up user defined data rate was found broken maybe because of
some rebase issue. Code has been setting always the default data rate
and ignoring used defined values.
2018-02-09 11:00:56 -06:00
Hasnain Virk f7c0ce6221 Making static objects SingletonPtr
We had a lot of static objects which would get constructed and hence
pull in some of the LoRaWAN code into the builds for other technologies.
Such objects have been now lazily initialized using utility class
SingletonPtr.
2018-02-09 11:00:56 -06:00
Kimmo Vaisanen 7872b6a29c Use EventQueue for elapsed time
Current implementation uses high resolution timers to calculate elapsed time.
This prevents for example deep sleep completely and causes unnecessary timer
events.

This commit changes implamentation to use EventQueue::tick() to get elapsed time.
2018-02-09 11:00:56 -06:00
Kimmo Vaisanen b0889f7d21 Move all compliance test code inside compilation flag
All compliance test related codes are now inside LORAWAN_COMPLIANCE_TEST
build flag. This will reduce memory usage in when compliance test codes
are not needed.
2018-02-09 11:00:56 -06:00
Hasnain Virk 97f1680586 [IOTCELL-270] Detaching TxNextPacketTimer
TxNextPacketTimer callback was being used for testing only (compliance testing to be precise).
Now there are independent methods and direct calls to automatic timers for the
compliance testing so there is no particular need for this timer anymore.
2018-02-09 11:00:56 -06:00
Hasnain Virk 05e2d29238 Reworking callback API
Application should be able to add some optional callbacks if it needs to.
Ofcourse there is a penalty of 8-12 bytes per callback, but there can be
certain needs of the application that needs to be met for example setting
up a link check request etc.

We have introduced a structure that contains callbacks for the application use.

 - 'events' callback is mandatory, user must assign it. Because this callback brings
   state changes for the application. We cannot segregate this into individual handlers
   because of RAM penalty.
- Other calbacks (none of them are implemented yet are optional).

Example of using the API is provided with doxygen
2018-02-09 11:00:56 -06:00
Hasnain Virk e60227cf4d Receive API typo fix
Receive API should return the length of data written to the user buffer
as the Posix APIs suggest rather than sending the pending length of data
back.
That has actually been a typo mistake which actually wnt in even with doicumentation :)
2018-02-09 11:00:56 -06:00
Hasnain Virk 6281073d8b [IOTCELL-279] Using Application provided EventQueue
The EventQueue thread in LoRaMac.cpp is disbanded and the LoRaWAN
protocol is redesigned to store a pointer for an application
provided EventQueue. It means that now the stack runs in the
same thread as application. Application provided EventQueue is used
to defer ISRs from radio driver and timer callbacks as well as the
application events are queued to the same event loop.
2018-02-09 11:00:56 -06:00
Hasnain Virk 29353a8380 Adding license text and BSD-Clause 3 2018-02-09 11:00:56 -06:00
Hasnain Virk f33ef6528b Adding LoRaWANInterface - implementing, LoRaWANBase
This class is the doorway for the user application into the
Mbed-OS implementation of LoRaWAN protocol. It implements LoRaWANBase
and hence would work with any stack implementation underneath, ensuring
seemless portability for applications.

It takes a pre-constructed object of LoRaRadio and delegates it in the
downward direction. Before calling connect() user must call initialize() function
in order to initialize stack and mac layers.

connect() APIs can be used to either provide relevent keys and connection method at
runtime or compile time (using Mbed config system).

enable_adaptive_datarate() and disable_adaptive_datarate() are used to turn on/off
automatic rate control. Otherwisem set_datarate() could be used to set a particular
data rate on the current channel.

set_confirmed_msg_retries() is valid only for CONFIRMED messages. It means that the stack will
retry for a given number of times before timing out.

set_channel_plan() and get_channel_plan() are used to set or get a particular channel plan.
These APIs are particularly useful in case of ABP (activation by personalization). Because
in case of OTAA(over the air activation), by default the stack takes in a CF List (carrier frequency list)
sent by the base station in conjunction with Network server. This list overwrites all user configured
channels or channel plan. set_channel_plan() can be used to set a single channel as well by setting the
parameter for number of channels to 1.

remove_channel_plan() or remove_channel() are used to remove a currently active channel plan or a specific
channel.

send() and receive() APIs follow posix design except the socket descriptor is replaced with port number here.

lora_event_callback() API is used to set a callback function from the application side which is used by the stack
to inform user of particular events like CONNECTED, DISCONNECTED, CRYPTO_FAILURE, TX_TIMEOUT etc.
2018-02-09 11:00:56 -06:00
Hasnain Virk 2f860d2be5 Adding LoRaWANStack class to control MAC and PHY
LoRaWANStack class is our controller layer on top of our
current MAC and PHY layer. It provides services to an implementation
of LoRaWANBase class.

It is a singleton class owing to the fact that the mac layer underneath
is not a class object. Instead, it uses the MAC via setting mib, mlme, mcps
requests and getting responses back from the mac layer using confirmations and
indications.

In essense this class is a special handle for
mac layer underneath which is predominantly reference design based.
In future we may refactor the LoRaMac.cpp code to make it object oriented
and cleaner.

At one end, it binds the application selected radio driver with the PHY layer
and at the other end it provides services to upper layers handling the mac via
well defined APIs.

For proper selection of a PHY layer, user must use Mbed config system.
For this purpose an mbed_lib.json is provided which can be overriden by the
user defined mbed_app.json. By default the EU868 band is selected as a PHY layer.
User must set relevant keys for the selected connection mechanism.
2018-02-09 11:00:56 -06:00
Hasnain Virk 5734b57c0a Adding MAC layer for LoRaWAN implementation
The actual mac algorithms are being used as it is in the reference
implementation.

We introduce an internal class that starts a thread and constructs an event queue
to handle deffered calls from interrupt context for RTOS. The code base is
compatible with Mbed-OS 2 as well.

GetPhyEventHandlers() API provides mac callback funtions for PHY layer,
which are in turn delegated to radio driver from the PHY layer.

LoRaMacInitialization() is augmented with LoRaPHY parameter which let's
the MAC layer know which particular PHY layer is in use.

LoRaMacSetTxTimer() and LoRaMacStopTxTimer() are used when duty cycle is
off for testing purpose or to support custom application timers.

If the duty cycle is off, mac and phy layer work togather to figure
out the next possible transmission time.

LoRaMacCrypto APIs are provided which provide seemless integration of
mbedTLS into mac layer for cryptography. User application is supposed to
provide proper mbedTLS configuration file.

All other APIs are retained as it is.
2018-02-09 11:00:56 -06:00
Hasnain Virk c861c321be Adding PHY layer for LoRaWAN
LoRaPHY is the abstract class for the LoRa PHY layer which governs
the LoRaRadio and provides some common functionality to all regional
implementations.
We support 10 regions and every region comes loaded with default parameters.
These parameters can be changed by the Mac layer or explicitely by the stack
controller layer using APIs provided. This layer in essence detaches Mac completely
from PHY and provides more modular approach to the entire system.
Apart from class structure, the internal functionality is directly deduced from
semtech reference implementation that's why most of the internal data structures are
used on 'as is' basis.
In addition to that, the PHY layer provides APIs to control the LoRaRadio layer, i.e.,
the lora radio driver, ensuring that the radio is accessed from a single entry point.
A seperate data structure file is added which is common to PHY layers only.
2018-02-09 11:00:56 -06:00
Hasnain Virk c9804bd167 Adding base class for LoRaWAN interfaces
All network interfaces for LoRaWAN protocol must implement this
class. In order to be compatible with Mbed-OS applications, any
implementation of this class must use the data structures and
Mbed-OS timers provided.

lorawan_data_structures may look repetitive but this is essential
as we have a plan to use a reference implementation for LoRaWAN mac
layer from Semtech. Some of the data structures provide seemless
transition from semtech implementation (as MAC layer) to the Mbed-OS
control layers above.

features/lorawan/lorastack is the placeholder for future items like mac and
phy layers. system/ will contain all the common bits.
2018-02-09 11:00:56 -06:00
Hasnain Virk 69664c5394 Adding base class for all LoRa radio drivers
All Mbed-OS drivers for LoRa radio devices must implement
this pure virtual class in order to be compliant with Mbed-OS
applications.

This class comes loaded with all necessary data structures.
The implementations of this class can come out of tree.
2018-02-09 11:00:56 -06:00
Vincent Coubard 2e64b710a1 Ble: fix size function in advertising_data_t and address_t. 2018-02-09 16:43:29 +00:00
Przemyslaw Stekiel b6a01de070 K64F lp ticker driver - calculation bug fix.
Delta calculation from lp_ticker_set_interrupt() function:
delta_us = timestamp > now_us ? timestamp - now_us : (uint32_t)((uint64_t)timestamp + 0xFFFFFFFF - now_us);

Lets assume that timestam == now_us.
Expected delta value should be 0 and in this current version is 0xFFFFFFFF.

The following condition:
timestamp > now_us
should have the following form:
timestamp >= now_us

Additionally modified us ticker driver to provide the same logic.
2018-02-09 14:29:24 +01:00
Jarno Lamsa fd92fe1906 Add void *param to loopback functions 2018-02-09 13:58:56 +02:00
Arto Kinnunen ff47193a0a Add API for reading interface ID 2018-02-09 13:23:39 +02:00
Deepak Venugopal 7d555a3db7 Merge commit '7197b5fd51825257ee04dac5dfd0d16ea1896853'
* commit '7197b5fd51825257ee04dac5dfd0d16ea1896853':
  Squashed 'features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/' changes from c9bf20f..43c7ec2
2018-02-09 13:18:25 +02:00
Deepak Venugopal 7197b5fd51 Squashed 'features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/' changes from c9bf20f..43c7ec2
43c7ec2 Merge branch 'release_internal' into release_external
ed76459 Merge pull request #1558 from ARMmbed/IOTTHD-2195
8d3bcb7 Add new function to unit tests
56f66a4 Review correction
8b7d018 Move indirect queue size public API to net_interface
d877c9e Review corrections
c25e476 Remove Eclipse project files for external release
d51f442 Merge branch 'release_internal' into release_external
135c48d Increase Thread SED buffer size for big packets
70931a7 Fix indirect queue packet ordering
10e51a4 API for changing Thread SED parent buffer size
6122d24 dereference null value issue fixed. (#1557)
d1378dc Clear IPv6 neighbor cache in partition change (#1554)
7610e91 Child neighbor entry updates (#1550)
c727295 cleared neighbours with child address that are not ours (#1549)
80b4d72 Thread partition merge mode TLV change (#1546)
edd7599 RLOC was updated before clearing child info (#1547)
a666056 router short address set to 0xfffe for non routers (#1543)
759ab05 delete route set and link set entries for a router ID (#1540)
23a1265 REED advertisement handling (Thread spec 5.16.3): (#1535)
0a32cb4 added active and pending timestamps to child update response (#1533)
d0eec80 Fix error case memory leak (#1537)
da9860f Pending set after link sync (#1526)
ffa1569 Thread router network data update after link sync (#1530)
3b46d8d Fix defects found by coverity (#1529)
3a57101 Fix compiler warnings and update traces (#1523)
c288227 Add extension check for partition weight drop in parent selection (#1521)
d8dea28 network data cleared after router forms new partition (#1525)
44a85e5 removed router flagging for thread_management_server file (#1524)
1cbced9 Merge pull request #1520 from ARMmbed/IOTTHD-2105_2
3d07365 Review corrections to network data clearing
22a0375 Clear network data from lost children
ffd8517 added a new thread management function (#1519)
80af9cb Thread BR network data clearing (#1518)
5a6f6b5 thread nvm valgrind uninitialized data fix (#1517)
d5e2198 Add API for partition weighting set (#1513)
8811d6f multicast forwarding scope changed and address registration updated. (#1516)
c277384 printf to tr_info (#1515)
bb21264 Thread combined nvm test (#1507)
76f7725 Primary BBR fixes from interop (#1512)
12ed5ab FHSS unit test: fixed fhss mac interface test (cherry picked from commit 805eb42e4416b00cc018dc32dceb353d0b6c8bb6)
dd21ea9 Remvoed unnecessary trace print's.
cb6e78b FHSS unit test: fixed fhss beacon tasklet test (cherry picked from commit abe6d671b058f4f069741eab24d51e4d62d550b0)
237b3d4 Fhss info print (#1486)
0f39a47 FHSS: Do not update synch monitor right after superframe change (cherry picked from commit 99d50ad9d7f8dad80f10c2a4303f4e75ab31a3c2)
c9a098f Fixed Timeoout force which actually never generate timeout.
957c7fb Pana server and client update:
ae230e5 FHSS: Update Beacon synch info in critical state
84bd8a4 FHSS: Synchronization must be done in critical state
fb1b163 Pan coordinator blacklist update
39fe6ba Added missing HAVE_RPL compiler flag
16a1bc5 MLE bootsrap and message timeout update
eeb2d39 enable BBR to support multicast registration in non   commercial networks (#1509)
4ea2bf8 uri modified. (#1510)
f443853 timeout corrected for neighbour entry (#1508)
ea93c1f Thread dev conf taken use (#1503)
5d5b239 bug fix in bbr start (#1505)
8dbd521 commented a trace. (#1504)
145dbdf device conf copy fix (#1502)
f60268f eid&random mac moved to device conf struct (#1497)
df18635 Let MAC choose address when mesh forwarding
42f916b fixed BBR stop to remove network data and routing information (#1500)
e058c2a pbbr changes (#1499)
1ece307 Merge pull request #1485 from ARMmbed/merge_release_back
dda8164 thread address handling updated. (#1496)
1dc21a1 thread extension fixes. (#1495)
543fe98 Merge branch 'release_internal'
bade70e Dua req changes (#1494)
1979df8 added status to MLR response and implemeted BMLR.ntf multicast. (#1492)
1807c01 mle class initialisation (#1488)
d809831 Merge pull request #1479 from ARMmbed/merge_release_to_master
bce812d Update license to Thread test file (#1483)
aaa4b1f Revert eclipse file removal

git-subtree-dir: features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack
git-subtree-split: 43c7ec255fd25e21e272c7373d011791327f8724
2018-02-09 13:18:25 +02:00
Wilfried Chauveau e13245c303 add few files to gitignore list 2018-02-09 10:57:31 +00:00
Deepak Venugopal dc7be499ad Merge commit 'df0dc6cd3395ceb44eed35d0b2f341ba7e3e0b91'
* commit 'df0dc6cd3395ceb44eed35d0b2f341ba7e3e0b91':
  Squashed 'features/nanostack/FEATURE_NANOSTACK/coap-service/' changes from 8689fca..f6281ed
2018-02-09 12:55:16 +02:00
Deepak Venugopal df0dc6cd33 Squashed 'features/nanostack/FEATURE_NANOSTACK/coap-service/' changes from 8689fca..f6281ed
f6281ed CoAP transaction delete improvements (#91)
a4bb497 Add check for interface when receiving CoAP request (#92)
bca55ce Fix invalid memory read error (#90)

git-subtree-dir: features/nanostack/FEATURE_NANOSTACK/coap-service
git-subtree-split: f6281ed1888ae372760fd2380e7523b8a95affab
2018-02-09 12:55:16 +02:00
andreas.larsson 34099ba294 Added missing lwip_md5_init and lwip_md5_free as suggested by:
https://github.com/ARMmbed/mbed-os/issues/6003#issuecomment-364127671
2018-02-09 12:55:10 +02:00
Andreas Larsson 67772a5e95 Added u-blox ODIN-W2 driver binaries v2.4 rc1 2018-02-09 12:54:47 +02:00
Jarno Lamsa 282f3c9da2 Add support for error cases for lwip and nanostack 2018-02-09 12:44:31 +02:00
Teemu Kultala 5a7482667e NSAPI status callback changes
This is the original content of feature-status-callbacks, reviewed in
https://github.com/ARMmbed/mbed-os/pull/5457
2018-02-09 12:44:31 +02:00
Prashant Ravi 011dbffff5 Fixing coding style
Fix Details: HAL API for loguart is different that UART. Initially we
didnt have support for loguart in the mbed api. These changes have been
made to support the loguart from the mbed api by using the correct HAL
api calls
2018-02-09 16:35:33 +08:00
Juha Ylinen 38ceb9339e lwip: enable EMAC IPv6 support 2018-02-09 10:11:44 +02:00
TomoYamanaka f6c6e79145 Fix NVIC Wrapper include
Renesas mbed boards incorporate NVIC Wrapper because Cortex-A9 use GIC. For example, NVIC_SystemReset() is defined in nvic_wrapper.c and declared in nvic_wrapper.h.
Because I removed one of include processing accidentally, I fixed the lack.
This supplements PR #5890.
2018-02-09 11:53:43 +09:00
ccli8 0271df1fa5 [NUC472/M453/M487/NANO130] Rework RTC
The rework includes the following:
1. Support year range beyond H/W RTC 2000~2099.
2. Refine RTC register access with low-power clock source
2018-02-09 10:47:18 +08:00
Christopher Haster df1896b6c0 littlefs: Fix incorrect lookahead population before ack
Rather than tracking all in-flight blocks blocks during a lookahead,
littlefs uses an ack scheme to mark the first allocated block that
hasn't reached the disk yet. littlefs assumes all blocks since the
last ack are bad or in-flight, and uses this to know when it's out
of storage.

However, these unacked allocations were still being populated in the
lookahead buffer. If the whole block device fits in the lookahead
buffer, _and_ littlefs managed to scan around the whole storage while
an unacked block was still in-flight, it would assume the block was
free and misallocate it.

The fix is to only fill the lookahead buffer up to the last ack.
The internal free structure was restructured to simplify the runtime
calculation of lookahead size.
2018-02-08 18:53:19 -06:00
Deepika 4e89c9261f RTX changes pulled in from d20b8aad7f5e
RTX5: Added TrustZone Module Identifier configuration for Idle and Timer Thread
2018-02-08 15:52:17 -06:00
Deepika cf65e2b125 Pulling in CMSIS commit 05fa9d328a
Systick handler switch to secure/nonsecure issues addressed:
1. Switch to secure/nonsecure context save/restore is based on 6th bit in
LR register, correct the bug (R7 instead of LR was used for decision)
2. Prevent R7 from being corrupted in Sys_ContextSave
3. Branch when non-secure rather than secure
2018-02-08 12:40:20 -06:00
Martin Kojtal 04f0f2b1aa
Merge pull request #5604 from betzw/betzw_tests_netsocket_wb
TESTS/NETSOCKET: Refinement of `netsocket` tests
2018-02-08 15:25:45 +00:00
Martin Kojtal 9f6eb14ae2
Merge pull request #5996 from ashok-rao/br-BL600
Adding LAIRD_BL600 MTB
2018-02-08 15:23:07 +00:00
Martin Kojtal 65e751bafb
Merge pull request #6025 from karsev/thread_api_adds
Mesh-api setters for eui64 and pskd
2018-02-08 15:22:02 +00:00
Martin Kojtal e8efe11c0e
Merge pull request #6031 from OpenNuvoton/nuvoton_m2351_cthunk
M23: Fix CThunk error on Cortex-M23
2018-02-08 15:21:24 +00:00
Martin Kojtal b7908a64c4
Merge pull request #6033 from anttiylitokola/master
Update mbed-coap to version 4.2.0
2018-02-08 15:20:37 +00:00
Martin Kojtal 8e8b3d3bbd
Merge pull request #6036 from bcostm/dev_move_DISCO_L072CZ
DISCO_L072CZ_LRWAN1: move target folder
2018-02-08 15:19:08 +00:00
jeromecoutant e0e6e5a9e5 DISCO_F303VC : Align clock configuration with STM32 family 2018-02-08 14:25:46 +01:00
jeromecoutant e8e4af3c7a DISCO_F303VC : add IAR files 2018-02-08 14:25:45 +01:00
jeromecoutant 1ab4030f20 DISCO_F303VC : wrong STDIO pins 2018-02-08 14:25:45 +01:00
deepikabhavnani 4076788d51 Non Secure flag is required for pre-processing of linker file 2018-02-07 22:48:47 -06:00
Cruz Monrreal 0978062dae
Merge pull request #5971 from maciejbocianski/ticker_tests_fix
Ticker tests fix
2018-02-07 20:17:39 -06:00
Cruz Monrreal 02eeb7af41
Merge pull request #6030 from deepikabhavnani/correct_arch
M33: -march not required if -mcpu is set
2018-02-07 20:07:11 -06:00
Cruz Monrreal 1c5c1c79d0
Merge pull request #6027 from ithinuel/fix-target-names-for-murata-abz-and-adv-wise-1510
rename MURATA type ABZ & WISE 1510 to their expected name
2018-02-07 20:06:50 -06:00
Cruz Monrreal f8cc42689c
Merge pull request #5970 from TomoYamanaka/master
RZ_A1LU: Fix TRNG function
2018-02-07 20:06:17 -06:00