Commit Graph

5973 Commits (b0e9fd7438386ea40950a5b51dcde0aa066b52df)

Author SHA1 Message Date
Seppo Takalo 1a90105bd7 Remove usage of Mbed TLS internal function from DeviceKey.
DeviceKey was using mbedtls_ssl_safer_memcmp() to compare result against
buffer of equal length, but zero content. This comparison makes no sense
as the entropy function is already returning proper error, if it fails.
2019-11-18 15:47:40 +00:00
Seppo Takalo 957ed97cd7 IOTSTOR-953: Fix address calculations from SlicingBlockDevice
* Change MBED_ASSERTS() to return valid error code, so that
  checks are not bypassed on release builds.
* Fix starting address calculations so that "addr" parameter is always
  relative to SlicingDevice and "_start" is only added when calls to
  underlying storage block is made.
* Bypass BlockDevice:is_valid_*() to underlying block device.
  Slicingblockdevice was just verifying addresses independently, without
  verifying those from underlying block storage.
2019-11-18 15:47:40 +00:00
Seppo Takalo 6532f2515d Add unittest for HeapBlockDevice and change some MBED_ASSERTS to errors. 2019-11-18 15:47:40 +00:00
Seppo Takalo 5fecf6afa2 Add storage related files to baseline unittest.
* Refactor some headers to use relative path from Mbed OS root.
* Refactor some data types to compile on 64bit machines.
* Refactor some debug traces to use mbed_trace.
2019-11-18 15:47:40 +00:00
Seppo Takalo fea3fd49be Add empty unittest to generate zero baseline for untested files. 2019-11-18 15:47:40 +00:00
Wajahat Abbas 527ffa1e15 Ensure modem echo is off 2019-11-18 15:42:08 +00:00
Antti Kauppila b84057611c Baremetal profile fixes 2019-11-18 15:42:08 +00:00
Tymoteusz Bloch a191a60cd5 NSAPI DNS query IP version check for non LWIP stacks. 2019-11-18 15:42:08 +00:00
Jayasankar Nara c5fbea79cc Add API to get ipv6 link local address.
Protocols like mdns requires IPv6 link local address to be advertised in its
records (AAAA record). LWIP::Interface::bringup() API is creating IPv6 link
local address;But as of now there is no API exposed by mbed-os to get the
IPv6 link local address.

This new API is required to deliver mDNS library support on mbed-os for Cypress
platforms. Unit tested it by invoking get_ipv6_link_local_address with a simple
application.
2019-11-18 15:42:08 +00:00
mudassar-ublox 129c0a923e updated cellular context flags and cid in ublox-api 2019-11-18 15:42:08 +00:00
Janne Kiiskila 62f1b0c43c Add default TDBStore location for DISCO_H747I (end of BANK1)
Place it at the end of the bank1, last two erase sectors.
As erase sector is 128 kB, default size must be double of that.

This can't be in bank2 as that is apparently dedicated to the M4 core.

Memory map is available in;

https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/flash_data.h

Memory map does not have this information, but issue [11617](https://github.com/ARMmbed/mbed-os/issues/11617) has.
2019-11-18 15:42:08 +00:00
Janne Kiiskila 03745c8ed9 DISCO_H747I - define default storage (TDB_INTERNAL)
DeviceKey needs the definition of the default storage place,
define it to be TDB_INTERNAL (as for the other boards).
2019-11-18 15:42:08 +00:00
jeromecoutant aa83d2395f GREENTEA: init trace if trace is enabled in json 2019-11-18 15:42:08 +00:00
Mirela Chirica 586ce90e27 Cellular: Added write_hex_string to AT handler 2019-11-18 15:42:08 +00:00
desmond.chen 9b123b8d70 Handle legacy process event first on connection complete 2019-11-18 15:42:08 +00:00
Lei Zhang 818a652e86 MIDDLEWARE-2134: Fix spurious link up/down when AP IP address range changes
Fixed additional link down/up events in whd_wifi_link_state_change_handler by checking additional condition during the transition.
2019-11-18 15:42:08 +00:00
midd 64f9b596bf Update the internal kvstore size to from 7k to 65K for device that use the internal flash for kvstore 2019-11-18 15:42:08 +00:00
Lei Zhang b654b76a3c Add synchronization and switching between SoftAP/STA
- A shared mutex is added for synchronization
- ScopedMutexLock is used to to protect
  - SoftAP: start, stop
  - STA: scan, join, disconnect
- Fix switching issue between SoftAP and STA mode for primary interface
  - Avoid reinit primary interface by getting mapping the current interface to the other one which is already on
  - In concurrent mode, STA is the default if it is up, otherwise SoftAP is default.
  - For non-concurrent mode, the most recent started interface is set as default.
2019-11-18 15:42:08 +00:00
Lei Zhang 66e8133ddb Allow WhdAccessPoint scan result with extended parameters
- Add WhdAccessPoint to include additional WHD scan info
- To save memory, only move assignment is supported for WhdAccessPoint
- Add scan_whd to scan for WhdAccessPoint
- Set set_blocking(false) to unsupported by return NSAPI_ERROR_UNSUPPORTED
2019-11-18 15:42:08 +00:00
Chun-Chieh Li 9a7d69cc03 DeviceKey: Fix random key doesn't generate on MBEDTLS_ENTROPY_HARDWARE_ALT
Originally, when DEVICE_TRNG is defined, MBEDTLS_ENTROPY_HARDWARE_ALT will also be defined
accordingly to provide entropy source. This is fine for targets supporting TRNG. However, for
targets without TRNG, it is also possible to provide non-TRNG entropy source solution via the
define MBEDTLS_ENTROPY_HARDWARE_ALT. Related discussion can be found at:

https://github.com/ARMmbed/mbed-os/issues/11680
2019-11-18 15:42:08 +00:00
jeromecoutant c9590ae131 Avoid compilation if target doesn't support EMAC 2019-11-18 15:42:08 +00:00
jeromecoutant 77892384e9 STM32 EMAC: move from TARGET_STM_EMAC to TARGET_STM 2019-11-18 15:42:08 +00:00
Mukund Ghonasgi 0c81b46ce7 Update BT Firmware to version 128.
Fixes issues in BT firmware operation in low power mode.
2019-11-18 15:42:08 +00:00
Vikas Katariya b6f5046b67 Fix enum type to align with psa-arch-tests
This is related to https://github.com/ARMmbed/mbed-os/issues/11256
When TARGET_PSA is enabled on Cortex-A boards, the SECURE
is redeclared. So to minimize the impact we can redeclare this in
val.h which is used only by Mbed. And `security_t` itself is used in
mbed-os\components\TARGET_PSA\TESTS, but the SECURE string is not used.

Renamed to `caller_security_t` which aligns with
https://github.com/ARM-software/psa-arch-tests
2019-11-18 15:42:08 +00:00
Ilia Penev 1400e0f240 Fix Quectel M26 context hang 2019-11-18 15:42:08 +00:00
mudassar-ublox 665eee829b fix apn check 2019-11-18 15:42:08 +00:00
Antti Kauppila 83607653e2 Fix build issue 2019-11-18 15:42:08 +00:00
Antti Kauppila 9bc37458eb Cleaned up Mbed LWIP configurations 2019-11-18 15:42:08 +00:00
Mukund Ghonasgi 67fdf6c6f9 Address ARM Code review feedback. 2019-11-18 15:42:08 +00:00
Mukund Ghonasgi 64be6a7604 Update Target Cypress Specific Cordio BT Driver to keep Host MCU active for the duration BT device asserts HOST WAKE. This change fixes race condition in Cypress Cordio driver. 2019-11-18 15:42:08 +00:00
Alexandre Bourdiol 5418d70813 DISCO_H747I Dualcore support
Add 2 targets for DISCO_H747I dualcore:
* DISCO_H747I      -> for CM7 core
* DISCO_H747I_CM4  -> for CM4 core

Current restrictions:
* TICKLESS deactivated
* DeepSleep not supported (DeepSleep wrapped to sleep)

Warning: use of the same IP (example I2C1) by both core at the same time is not prevented,
but is strongly not recommended.
Some Hardware Semaphore are use for common IP, to manage concurrent access by both cores: Flash, GPIO, RCC.

Warning: Drag and drop of binary to DISCO_H747I will flash CM7.
         In order to flash CM4, one can use STM32 CubeProgrammer tool.
2019-11-18 15:42:08 +00:00
Kimmo Vaisanen a7868daa89 Cellular: Change visibility of _is_connected as protected
AT_CellularContext::do_connect() is a virtual API and therefore can be overwritten in
inherited class. The problem was that it sets AT_CellularContext::_is_connected flag but
earlier it was set as private member making it impossible to set in overwritten do_connect()
method.

This commit fixes the problem by changing _is_connected as protected enabling its use
in inherited class.
2019-11-18 15:42:08 +00:00
Sathish Kumar Mani 9acdd53144 Fixes IPv6 multicast join issue
Problem Statement:
During multicast join sequence, InternetSocket::join_multicast_group() calls InternetSocket::modify_multicast_group(). modify_multicast_group() sets up the multicast group address (i.e., mreq.imr_multiaddr) to be joined and the interface address (i.e., mreq.imr_interface) to be used for the multicast join request. The interface address is initialized with the default value, which sets the version of interface address to NSAPI_UNSPEC. This results in LWIP::setsockopt() API to attempt IPv6 multicast join on the IPv4 interface address, hence IPv6 multicast join always fails with the protocol error.

Fix:
Initialize interface address version based on the multicast address version in LWIP::setsockopt(), before attempting multicast join operation.
2019-11-18 15:42:08 +00:00
Ron Eldor 463f00e723 Fix Failure in cc ecdh_alt montgomery curve
Change the order of the input keys and output secret given and
returned from the CC API, to address correct endianity.
2019-11-18 15:42:08 +00:00
Jarkko Paso 9051e21f39 Merge commit 'ffb05c770964013a9f1ee9fb89d25e9fd09e886d'
* commit 'ffb05c770964013a9f1ee9fb89d25e9fd09e886d':
  Squashed 'features/nanostack/coap-service/' changes from e9edb1b..b919a33
2019-10-16 12:06:09 +01:00
Jarkko Paso a8c0491173 Merge commit '3e6cb31659a56d343c7b8fe37645f195eb87ffcf'
* commit '3e6cb31659a56d343c7b8fe37645f195eb87ffcf':
  Squashed 'features/nanostack/sal-stack-nanostack/' changes from c473148..0824752
2019-10-16 12:05:57 +01:00
Kyle Kearney 65def89e94 Make devicekey remainder test more meaningful
As of 722628be02, the "remainder" configuration
also uses the default location near the end of flash. Which makes the two tests
nearly identical with the exception that the "last two sectors" test correctly
handles parts with a low (possibly 1:1) erase size to program size ratio.
Therefore, change the "remainder" test to instead be a "default" test that uses
the tdb_internal_address/size values, so that it
a.) tests something meaningfully different and
b.) tests using the custom TDB address/size values if they are provided.
c.) functions correctly on devices where the default sector-based size computation
    does not work (e.g. because of the low erase size to program size ratio)
    and therefore a custom location and size has been specified.
The is_conf_tdb_internal variable is unused and therefore removed.
2019-10-16 11:58:32 +01:00
Michal Paszta 2eb2dcf923 Fix memory leak on NetworkInterface destruction
We dynamically allocate memory in every add_event_listener(), but we do not free it on NetworkInterface destruction.
2019-10-16 11:58:32 +01:00
Kimmo Vaisanen a0b33ee1a4 Cellular: Remove old deprecated tests
Cellular tests have been replaced with generic mbed-os netsocket and network interface tests.
2019-10-16 11:58:32 +01:00
Matthew Macovsky 08a2709993 Allow for arbitrary QSPI alt sizes
The QSPI spec allows alt to be any size that is a multiple of the
number of data lines. For example, Micron's N25Q128A uses only a
single alt cycle for all read modes (1, 2, or 4 bits depending on
how many data lines are in use).
2019-10-16 11:58:32 +01:00
mudassar-ublox d12a051068 setting timeout before send command 2019-10-16 11:58:32 +01:00
Ari Parkkila 5b9741094f Cellular: Fix CellularStateMachine to not loop on power state 2019-10-16 11:58:32 +01:00
Ari Parkkila 2eab0fbee4 Cellular: Fix resolving of DNS server IPv4/6 address 2019-10-16 11:58:32 +01:00
int_szyk 95766d71ac thread_mle_message_handler: fix null comparison.
Fixes Coverity issue about comparing nullptr.
2019-10-16 11:53:52 +01:00
int_szyk e7b5a4f32b sn_coap_builder: remove unnecessary code.
Fixes Coverity issue about unused variable.
2019-10-16 11:53:52 +01:00
int_szyk 85f104755f CellularStack: remove unnecessary assignment.
Fixes Coverity issue about unused variable.
2019-10-16 11:53:52 +01:00
int_szyk 2d2fdf7cf9 CellularUtil prefer_ipv6: check length.
Fixes Coverity issue about not checking the length of string before copying it.
2019-10-16 11:53:52 +01:00
Janne Kiiskila 04767f3022 AT_CellularDevice.cpp - unused variable err warning
We get this compiler warning;

Compile [  7.9%]: AT_CellularDevice.cpp
[Warning] AT_CellularDevice.cpp@206,18: variable 'err' set but not used [-Wunused-but-set-variable]

Due to the fact, that the code that would actually use this variable
is behind trace flags. Based on review feedback from Antti Kauppila and
Kimmo Väisänen, adding same flagging also for that.
- Reason being - the operation needs to be within the locks.
2019-10-16 11:53:52 +01:00
Ari Parkkila 78f3292036 Cellular: Fix setting of PDP context ID (cid) 2019-10-16 11:53:52 +01:00
Mirela Chirica 9dab079d33 Cellular: Removed not used variable 2019-10-16 11:53:52 +01:00