Commit Graph

28518 Commits (f8e0e8dc52bee13718fead8d725b799f6f625aa5)

Author SHA1 Message Date
Antti Kauppila f8e0e8dc52 Fixed mbed_rtc_time_stub licence header 2020-02-06 18:37:24 +02:00
Antti Kauppila 4fadc1e773 Increment app DL counter correctly 2020-02-06 18:37:24 +02:00
Antti Kauppila 45aec0c900 Pre-cert fixes 2020-02-06 18:37:24 +02:00
Antti Kauppila 0c7f5684bb LoRaWAN: Moved keys to LoRaMacCrypto class
- Unittests updated to reflect LoRaWAN 1.1 changes
2020-02-06 18:37:24 +02:00
Antti Kauppila 27f26f2327 Auto merge problem fixed 2020-02-06 18:37:24 +02:00
Hasnain Virk 80f3b842d7 Bug fixing for Rejoins
* While starting timer for rejoin request type 0, we should multiply max
time with 1000 as the timer APIs take ms values as parameters.

* RJCountX are incremented every time a Rejoin request is sent. For MIC
calculation we need to take the previous RJCnt value in account.

* Rejoin process should start against an event otherwise it will meddle
with state machine and any ongoing traffic.

* If a Type 1 rejoin is ongoing, we should not trigger a Type 0 rejoin.

* Some bug fixes after Triage with Antti.
2020-02-06 18:37:24 +02:00
Hasnain Virk d8f7011c58 Changing precision in RX window calculation
Double precision may introduce unwanted results and it's impact is
massive on microcontrollers. So we change the precision from double to
float.
This change doesn't seem to enhance performance yet.
2020-02-06 18:37:24 +02:00
Hasnain Virk 341b5e1566 Managing Confirmed traffic based on NbTrans
In 1.1, NbTrans governs both unconfirmed and confirmed traffic.
We cannot set number of retries ourselves. Based upon NbTrans received
in linkADRReq command, we will retry. If NbTrans is 1, we will send only
one message and if ack is not received we will generate TX error event.
Its the NS now which controls how many retransmission a device can do
without incrementing Frame counter. When we fail with TX error after not
receiving an ack, we increment the frame counter. This is necessary as
the NS will drop anything with the  previous counter and it can happen
that the NS may have sent an ack but we didn't receive it.
2020-02-06 18:37:24 +02:00
Hasnain Virk 749b3d459c Adding resets in lieu to Section 6.2.3 of Spec 1.1
Rejoin requests and presence/absence of CFlist demand different
handling.
If a Rejoin request was sent we shall use RJCountX (0,1) instead of dev
nonce for key derivation.
If a Rejoin request is not of type 2, we reset mac, phy parameters
alongwith frame counters. However, if it is type 2, we reset frame
counters only.

If cflist i present, we shall always apply it as it is.
If it's not and rejoin type is not type 2, we restore default channels.
Otherwise the local channels do not change.
2020-02-06 18:37:24 +02:00
Hasnain Virk 475fe0b47f Implementing CR-FcntDwn-usage-in-FOpts-encryption
LoRaWAN specification 1.1.0 is incorrect in handling of FOpts encrytpion.
A CR was made by STMicroelectronics which correctly addresses the issue.
We have taken that CR and implemented in our code base.
2020-02-06 18:37:24 +02:00
Hasnain Virk ed93d7e026 Stopping multiple RX slot opening
Yet another rebase issue. RX processing was supposed to happen after
state setup and only once not twice.
2020-02-06 18:37:24 +02:00
Hasnain Virk 2dbbc84da4 RekeyInd mac command handling
RekeyInd Mac command was being handled incorrectly.
parse_mac_commnad_to_repeat() was missing handling for RekeyInd mac
command. Plus it is a sticky mac command as the spec says that it needs
to persist until we receive a RekeyConf mac command.
2020-02-06 18:37:24 +02:00
Hasnain Virk ce6733edc0 Removing incorrect context free
After deriving JSEncKey we were wrongly clearing the AES context.
We shouldn't clear the context until the function is done doing its job.
That was why JSINtKey derivation was wrong which would result in MIC
failures.
2020-02-06 18:37:24 +02:00
Hasnain Virk e490fbf991 Adding handling of packets with no fport field
Although we always add a port field for Uplink traffic, the spec allows
for fport field to be excluded. So there can be network server instances
which would exclude fport field from downlinks. We are now adding
handling for such situations.
2020-02-06 18:37:24 +02:00
Antti Kauppila 78a04ec77c 1.0.3 flag added and add_device_time_req updated to not support 1.0.2 2020-02-06 18:37:24 +02:00
Antti Kauppila cba835bbad set_tx_continuous_wave removed 2020-02-06 18:37:24 +02:00
Antti Kauppila 1fbeb58b85 Auto merge problems solved 2020-02-06 18:37:24 +02:00
Kimmo Vaisanen 09f3259d94 Enable RekeyInd again 2020-02-06 18:37:24 +02:00
Kimmo Vaisanen a8dbad926c Fix MIC calculation 2020-02-06 18:37:24 +02:00
Kimmo Vaisanen 6e60f2e161 MAC commands wip 2020-02-06 18:37:24 +02:00
Kimmo Vaisanen 88781d067c Fix uplink 2020-02-06 18:37:24 +02:00
Kimmo Vaisanen d48aae3692 Uplink (unstable) 2020-02-06 18:37:24 +02:00
Kimmo Vaisanen 1acb5a891e 1.1 join works 2020-02-06 18:37:24 +02:00
Antti Kauppila ccc3675a6a Rejoin logic added
BE to LE fixes, missing MLME types added

LoRaWAN 1.1 Features added (Some LoRaPhy impl missing still + some TODOs in code)

- MLME confirm handling refactored
- Rejoin handling missing
- new CF_LIST mechanism missing (+resets involved)
- NVM handling missing

Rejoin logic added
2020-02-06 18:37:24 +02:00
Antti Kauppila 0d3283e3a0 LoRaWAN 1.1 Features added (Some LoRaPhy impl missing still + some TODOs in code)
- MLME confirm handling refactored
- Rejoin handling missing
- new CF_LIST mechanism missing (+resets involved)
- NVM handling missing

Fixed automerge issue
2020-02-06 18:37:24 +02:00
Martin Kojtal 8dc15ee6e1
Merge pull request #12293 from mirelachirica/remove_empty_api
Cellular: Remove API's empty default implemetations
2020-02-06 09:05:40 +00:00
Martin Kojtal 9017957638
Merge pull request #12377 from miteshdedhia7/pr/psoc6cm0p-update-1.1.0
Update psoc6cm0p asset to 1.1.0
2020-02-06 09:05:10 +00:00
Martin Kojtal 952799ccc8
Merge pull request #12270 from VeijoPesonen/bugfix_sfdp_parse_sfdp_headers
BUGFIX: SFDP Sector Map Table Parameter ID LSB is 0x81
2020-02-06 08:48:16 +00:00
Martin Kojtal 9e0642d518
Merge pull request #12359 from NXPmicro/MXRT1050_Bootloader_Support
MXRT1050: Add bootloader support
2020-02-06 08:10:45 +00:00
Martin Kojtal acece11e7a
Merge pull request #12320 from mtomczykmobica/ONME-3433
ONME-3433 ESP8266 driver support for UDP get - modified ESP8266 drive…
2020-02-06 08:10:00 +00:00
midd 3dbfed058e Update psoc6cm0p asset to 1.1.0 2020-02-05 12:40:17 -08:00
Martin Kojtal 96861107f5
Merge pull request #12251 from kivaisan/remove_friends_from_statemachine
Cellular: Remove friend definitions from cellular state machine
2020-02-05 14:51:29 +00:00
Martin Kojtal 32675cc6ac
Merge pull request #11874 from fkjagodzinski/armc6_build-enable_lto_for_release
ARMC6: Add a build profile extension with the link-time optimizer enabled
2020-02-05 14:42:16 +00:00
Martin Kojtal a039979851
Merge pull request #12370 from 0xc0170/MarceloSalazar-FIX_OKDO_ODIN_12361
OKDO_ODIN_W2: Reenable lp-ticker and BLE
2020-02-05 14:08:59 +00:00
Martin Kojtal e3ad1cae55
Merge pull request #12334 from AriParkkila/cell-c030-r412m
Update cellular drivers/tests for UBLOX_C030_R412M
2020-02-05 12:50:11 +00:00
Martin Kojtal edb39c603c
Merge pull request #12366 from OpenNuvoton/nuvoton_m2351_gcc
M2351: Support GCC
2020-02-05 12:48:03 +00:00
Marcelo Salazar b2ac793775 OKDO_ODIN_W2: Reenable lp-ticker and BLE 2020-02-05 12:36:04 +00:00
Martin Kojtal b140fd0766
Merge pull request #12369 from hugueskamba/hk-fixlpc1768-baremetal
LPC1768: Fix ARM toolchain baremetal by defining 2 memory region
2020-02-05 11:26:57 +00:00
Martin Kojtal 841b846b46
Merge pull request #12362 from ABOSTM/L0_CUBE_HAL_REWORK_NO_MORE_OVERRUN
TARGET_STM: L0 CUBE SPI async mode send next byte after previous one is read
2020-02-05 10:17:13 +00:00
Hugues Kamba 193e49c6b7 LPC1768: Fix ARM toolchain baremetal by defining 2 memory region
The changes are based on the scatter file in TOOLCHAIN_ARM_MICRO
2020-02-05 08:50:11 +00:00
Chun-Chieh Li 9faa236dfc M2351: Refactor startup file
1.  Re-organize to make clear for all targets/toolchains support in single startup file
2.  Inline assembly syntax is limited, esp. on IAR. Try paving the way for accessing external symbols still in inline assembly instead of re-write in assembly.
2020-02-05 10:14:26 +08:00
Chun-Chieh Li c168e147d6 M2351: Support GCC
1.  Enable GCC support on non-secure targets
2.  Disable GCC support on secure targets becasue of GCC bug (as of 9-2019-q4-major): In non-secure entry function, callee-saved registers must be restored, but they are incorrectly cleared at optimization level "Os".
2020-02-05 10:11:48 +08:00
Mahesh Mahadevan 013b651988 MXRT1050: Add bootloader support
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-02-04 10:37:06 -06:00
Martin Kojtal 0b7c78be8a
Merge pull request #12363 from 0xc0170/fix_mergify_release_version
Mergify: fix release version label
2020-02-04 15:30:18 +00:00
Martin Kojtal b33573ed27
Merge pull request #12317 from NXPmicro/MXRT_FlashSupport
MXRT1050 Flash support
2020-02-04 15:25:22 +00:00
Martin Kojtal cee2a352a7
Merge pull request #12357 from ABOSTM/F103_ADC3_NOT_SUPPORTING_COMMON_SETTINGS
TARGET_STM32F1: don't set ADC common register when ADC doesn't support it
2020-02-04 15:24:51 +00:00
Martin Kojtal 0b0ae16bf9 Mergify: fix release version label
Check if release review is not applied for merged PR. If not, we use "release version missing" label.
2020-02-04 13:36:37 +00:00
Alexandre Bourdiol 315220832f TARGET_STM: L0 CUBE SPI async mode send next byte after previous one read
In STM32 Cube HAL, in interrupt mode (async),
2 bytes can be prepared in hardware registers without any read
(1 in regular register, the other in shift register),
but Only 1 RX byte can stored in hardware register, specially when there is no hardware FIFO.
If interrupt handling is fast enough, each read is made in parralele of the write.
But if interrupt handling is too long or is interrupted for too long,
it can happen that one read byte is lost (overrun).
For STM32F4, Tickless has been deactivated to avoid such issue.
For STM32L0, we don't want to deactivate tickless,
because those chips are specially design for lowpower.

So instead of removing SPI async mode,
we propose to change the HAL behavior specially for L0:
each byte is send only when previous read is performed.
Thus only 1 RX byte at a time which is saved in hardware register.
This prevent overrun, but it introduceS some latency between each byte send,
this is why it is not applied to all STM32 families.
2020-02-04 13:26:49 +01:00
Maciej Bocianski 083e3e569d armc6: make lto an optional profile 2020-02-04 12:38:39 +01:00
Maciej Bocianski 57ac6c83d6 component PSA: keep SVCHandler_main/tfm_pendsv_do_schedule symbol in LTO builds
Add a "used" attribute to SVCHandler_main/tfm_pendsv_do_schedule to fix ARMC6 build with
the "-flto" flag.

This attribute, attached to a function/variable, means that code must be emitted
for the function even if it appears that the function is not referenced.
2020-02-04 12:38:38 +01:00