Commit Graph

34010 Commits (b1adec9028d89034c0c8f9bd60e7ed473d6c3f5d)

Author SHA1 Message Date
Arto Kinnunen b1adec9028 Merge commit 'fa7202c2e699b26a024d38657a6e495e073fea07'
* commit 'fa7202c2e699b26a024d38657a6e495e073fea07':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 4a3c5c525b..225a4af94f
2021-09-23 13:13:36 +03:00
Arto Kinnunen fa7202c2e6 Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 4a3c5c525b..225a4af94f
225a4af94f Remove files from tests folder
58d2c8fa82 Merge remote-tracking branch 'origin/release_internal' into release_external
921b4b3273 Wi-SUN FAN 1.1 dynamic MDR data request enabler
b8722e81b1 Corrected BR removing of waiting list entry when supplicant is in key storage
0d54d7ab39 Adjust trace levels (#2692)
681d9eae8d Added reset for pan id and version to BR network start
30d4fb2ed9 Renaming and cleaning ws bootstrap (#2688)
e0da19dbf0 Add Wi-SUN host configuration (#2690)
50ecc3d0f0 Refactoring Wi-SUN stack (#2686)
9d2386d484 Renamed operation mode to operating mode.
2f755bcfdb RF config resolver and some refactoring (#2683)
86c6d19e06 Fixed WS IE PCAP read operation wrong length usage.
cd3a4c2a62 Config: Remove additional HAVE_WS_ROUTER (#2684)
cdd7f2d868 Added API for configure supported Phy capability.
a00a3c0a02 Wi-SUN FAN 1.1 PCAP IE update
2d063d3b4a Moved State machine and timer functions to own files
edb8bec609 Corrected system time check function return values
85358a635b Moved Wi-SUN Bootstrap Event handling to separate device handlers
61cbdde485 MAC to support mode switch on single channel (#2678)
1006d29e4d Added storing of PAN ID to NVM in BBR
7bf0028c66 Corrected system time jump detection on BR startup
e60974d815 Split Wi-SUN bootstrap to device types
a3f341266e MAC data req: API to support mode switch (#2674)
cad5122a90 Removed automatic network size configuration (#2673)
35d313224a MAC: Callback set to resolve PHY mode ID (#2672)
0c5faca469 Added support for large system time changes (e.g. due to NTP) (#2670)
c94b306431 LFN version and LGTK Hash IE advertisment and learn
8e075119f6 Use FAN version constant  instead of pure number
a5566b22b2 Channel Plan 2 validation and FAN 1.0 reject
42dba4151e Wi-Sun IE FAN 1.1 update
1d56070c24 EU channel plan ids (FAN 1.1) supported (#2668)
fc4f41fb30 Add test API empty function
37efc7ec25 Add version 1.1 basic support
e1558fbb1a Implemented mode switch PHR build and parse (#2665)
cbd8a15d31 Corrected frame counter storing threshold check
37f7ae95eb Time configuration distribution using DHCPv6 vendor data
7415bc724b Added checks for Border Router frame counter space exhaustion (#2660)
f1a65ecbe8 Mode switch PHY API (#2663)
e54231b5d4 Do not check buffer age when virtual RF driver used (#2662)
cc8c7bd38f arm_network_certificate_chain_set() returns -2 when PANA is disabled
319dd91bce Fix dubious semicolon in #define
2ff51abeca Remove extra '\n' in traces
19376c8837 Simplify array indexes
c808661836 Fix ASAN warnings about overflows in bit shifts
f998008f60 Fix use-after-free in mac_helper_coordinator_address_set()
4d04541d70 Wi-SUN header and Paylod IE element lenght future proof update.
935898badf Medium network PAN_TIMEOUT changed to 30 minutes
1af7cfeb24 Updated nanostack to be compatible with mbed TLS 3.0 (#2657)
29744e0e46 If Router Solicitation creation fails no longer tries to retry the RS right away (#2655)
2b889e92b0 Added automatic test procedure triggering during bootstrap
ed9eb0503f GTKs are removed only when fresh GTK hash is received
81ecdc24f8 Added empty function for test procedure trigger
14439b4aa9 Added support for triggering test procedures
b8a67a9e36 Update CHANGELOG.md for Nanostack 14.0.0 (#2649)

git-subtree-dir: connectivity/nanostack/sal-stack-nanostack
git-subtree-split: 225a4af94f3faf5ca3726e86bc96cdda4c99a469
2021-09-23 13:04:04 +03:00
Jaeden Amero 4cfbea43ca
Merge pull request #15078 from OpenNuvoton/nuvoton_m2354_tfm_1.4_fix
M2354: Fix TF-M 1.4
2021-09-17 11:31:25 +01:00
Chun-Chieh Li bbc5ad9505 M2354: Fix TF-M 1.4
1.  In TF-M, fix NSPE interrupt-disabled NSC call broken. Check:
    https://developer.trustedfirmware.org/T966
2.  In TF-M, enable mcuboot log enabled forcibly. This is to help check firmware update process.
3.  Update readme and script
2021-09-17 13:44:58 +08:00
mbedmain 810adf9aa8 Update Mbed version block 2021-09-16 12:15:02 +01:00
Anna Bridge 7feef5981e
Merge pull request #15061 from pan-/fix-event-queue-background-fn-change
Fix replacement of event queue background.
2021-09-16 11:34:34 +01:00
Jaeden Amero 8698a5516c
Merge pull request #15073 from rwalton-arm/fix_greentea_ctest
CMake: QSPIFBlockDevice: Guard unit test directory
2021-09-15 17:41:54 +01:00
Robert Walton fca7323f73 CMake: QSPIFBlockDevice: Guard unit test directory
In the QSPIFBlockDevice component we checked if BUILD_TESTING was
enabled before adding the QSPIFBlockDevice/UNITTESTS subdirectory. In
the parent blockdevice/CMakeLists.txt we added the QSPIFBlockDevice
subdirectory to the build under two separate conditions:

* when "QSPIF" is present in MBED_TARGET_LABELS
* when building only unit tests

This wasn't quite enough, as when we build greentea tests for some
targets QSPIF is enabled in MBED_TARGET_LABELS, causing the
QSPIFBlockDevice subdirectory and its unit tests to be added when
building greentea tests. This caused a test failure on targets which
enable QSPIF:

```
The following tests FAILED:
	 40 - qspif-unittest_NOT_BUILT (Not Run)
```

To fix this we need to specifically check that we're not building
greentea tests before adding the QSPIFBlockDevice/UNITTESTS directory to
the project.

Part of this issue is our reliance on MBED_TARGET_LABELS to pull
features in to the build. We should refactor our usage of
MBED_TARGET_LABELS and use CMake target dependencies where possible.
Then we wouldn't need to add subdirectories under various, often
conflicting, scenarios. Instead the targets would always be available
and we would just choose which ones to actually build in different cases
using CMake target linking.
2021-09-15 11:38:30 +01:00
Jaeden Amero 64a34193b1
Merge pull request #15050 from rwalton-arm/TF-Mv1.4.0
Update to TF-M v1.4.0
2021-09-15 08:38:07 +01:00
Robert Walton a43103faac TFM: MUSCA: Import partition maps from upstream
Import the latest partition headers from upstream. We no longer need to
patch the headers to define the BL2 macro as we now define it in the
scatter files for the MUSCA targets.
2021-09-14 17:32:42 +01:00
Robert Walton 33e57ee577 TFM: Remove BL2 macro workaround for mbed-cli1/ARMClang
We worked around an issue with mbed-cli1 not recognising the BL2 macro
from targets.json by adding patched versions of region_defs.h and
flash_layout.h for ARM_MUSCA targets. In the patched headers we defined
the BL2 macro to ensure it can be picked up by the ARM scatter files
that include the headers.

The current solution is not robust, because it means that the
aforementioned headers easily become out of date. A workaround of
defining the macros in the scatter files which need them was suggested
in https://github.com/ARMmbed/mbed-os/issues/14762

This commit applies the suggested changes to the ARM_MUSCA scatter
files.
2021-09-14 17:32:42 +01:00
Robert Walton 98e3730bf2 PSA: Reinstate deprecated macro
PSA_ALG_AEAD_WITH_TAG_LENGTH has been replaced with
PSA_ALG_AEAD_WITH_SHORTENED_TAG upstream. We could just update
psa_util.h to use the new macro, but we still have some targets that
only support older versions of PSA, so we reinstate the removed macro.
2021-09-14 17:32:42 +01:00
Lingkai Dong c7df1221cc psa: Include mbedtls_svc_key_id.h for TF-M
We have added definitions that are needed by Mbed TLS's PSK key exchange
but missing from TF-M's PSA to `mbedtls_svc_key_id.h`. To pick up those
definitions, TF-M's `psa/crypto_values.h' needs to include
`mbedtls_svc_key_id.h`.
2021-09-14 17:32:42 +01:00
Jaeden Amero 78b17b6717 tfm: Add mbedtls_ecc_group_to_psa.h to crypto_extra.h
Include mbedtls_ecc_group_to_psa.h from crypto_extra.h so that clients
of PSA within Mbed OS do not need to behave differently depending on
which PSA implementation they are using.

This solution is not ideal as it makes it more difficult to update the
TF-M-provided psa/crypto_extra.h. We'll have to see what other options
we have for including additional headers based on the Mbed OS
configuration.
2021-09-14 17:32:42 +01:00
Robert Walton aeee26019e targets: ARM_MUSCA: Update tfm_target_names
The directory structure upstream has changed. Now ARM_MUSCA board
support has been moved under an "arm" subdirectory. Update targets.json
with the new locations.
2021-09-14 17:32:42 +01:00
Robert Walton 56ffd54dd4 tfm: Move tfm_ns_interface.c
tfm_ns_interface.c is intended to be overriden by clients to support
different targets. We copy this file from upstream into the mbed-os
platform library. We also have a specific "strong" overridden version
for the NU_M2354 target, which is located in its target library.
Previously the implementations in the platform library were decorated
with __attribute__(weak), and we provided a strong definition for the
NU_M2354 target. This worked fine because of weak linking, the linker
will pick the first "strong" definition and use that, avoiding any ODR
violations. However, upstream have removed __attribute__(weak) from the
function definitions, which caused multiply defined symbol errors when
trying to build the NU_M2354 target.

To work around the above issue, we remove the common definition in the
platform library; instead we copy the file to the Musca B1 and Musca S1
target libaries. This means the appropriate tfm_ns_interface.c is only
included in the build when compiling for the specific target which uses
it.
2021-09-14 17:32:42 +01:00
Robert Walton 6850192508 tools: tfm: Update bin_utils 2021-09-14 17:32:42 +01:00
Robert Walton 3d17e1646c "Update secure binaries for [('NU_M2354', 'GNUARM')]" 2021-09-14 17:32:42 +01:00
Robert Walton d11bac087c "Update secure binaries for [('ARM_MUSCA_S1', 'ARMCLANG')]" 2021-09-14 17:32:42 +01:00
Robert Walton f28a6eab4f "Update secure binaries for [('ARM_MUSCA_B1', 'ARMCLANG')]" 2021-09-14 17:32:42 +01:00
Robert Walton c48361b841 "Update directory platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST" 2021-09-14 17:32:42 +01:00
Jaeden Amero eff8fda16c
Merge pull request #15067 from ARMmbed/fix_flash_overflow_callback_big_test
Greentea: Fix flash overflown issue in callback_big test
2021-09-14 17:04:13 +01:00
Rajkumar Kanagaraj 77960d351b Greentea: Fix flash overflown issue in callback_big test
The "Callback_big" greentea test has six test cases that require
a minimum above 36kb ROM to build all test cases. LPC1114 target
has only 32KB ROM memory, so the limit 6th test case to include
or exclude based on the target minimum ROM size.

Note:
In LPC1114 target, callback_big test has ROM overflow build issue
for both Mbed CLI1 and CLI2.
2021-09-14 15:28:06 +01:00
Jaeden Amero 6fd39f4d27
Merge pull request #15066 from ARMmbed/fix_platform_wait_ns_test_cmake
CMake: Fix platform wait_ns greentea test Cmake
2021-09-14 13:21:19 +01:00
Rajkumar Kanagaraj ad18cc88a6 CMake: Fix platform wait_ns greentea test Cmake
Mbed CLI 2 generates TARGET_ARM_FM macro as a string in mbed_config.cmake
under the MBED_TARGET_DEFINITIONS list. Fix the "if defined" check for
TARGET_ARM_FM by searching for the TARGET_ARM_FM string in the
MBED_TARGET_DEFINITIONS list. This allows us to skip or include the test from CMake.
2021-09-13 14:30:23 +01:00
Jaeden Amero 756830e776
Merge pull request #14989 from LDong-Arm/sfdp_sector_maps_multi
SFDP: Add support for multiple configurations and sector maps
2021-09-13 10:09:27 +01:00
Vincent Coubard db4b02c5b1 Fix replacement of event queue background.
This was discovered when EventQueue::background was called with a nullptr.
It crashes the software as it tries to call into a nullptr.
2021-09-10 12:13:09 +01:00
Martin Kojtal f96b930f82
Merge pull request #15022 from jeromecoutant/PR_STM32U5
STM32U5 new family introduction
2021-09-10 12:07:50 +01:00
Lingkai Dong 9ade440860 CYW9P62S1_43012EVB_01: Enable QSPI and QSPIF
QSPIF was disabled on CYW9P62S1_43012EVB_01 because its S25FS512S
flash chip has multiple configurations but our SFDP parser did not
support this scenario. Now having added support for this, we can
enable QSPIF (the component label for QSPIFBlockDevice) and QSPI
(the label for Quad-SPI communication).
2021-09-10 11:40:01 +01:00
Lingkai Dong 6bb23815c5 SFDP: Add support for multiple configurations and sector maps
A Sector Map Parameter Table contains a sequence of the following
descriptors:
* (Optional) configuration detection command descriptors, one for
each command to run to determine the current configuration. This
exists only if the flash layout is configurable.
* Sector map descriptors, one for each possible configuration. On
a flash device with a non-configurable layout, there is only one
such descriptor.

Previously we only supported the non-configurable case with a single
descriptor. This commit adds support for multiple configurations.
2021-09-10 11:40:01 +01:00
Lingkai Dong f88bf828ab QSPIFBlockDevice: Add unit test for the S25FS512S quirk
Add a test case to verify that the quirk on `CR1NV` and `CR3NV`
registers get applied by `QSPIFBlockDevice` when the flash device
is S25FS512S.

`QSPIFBlockDevice` depends on the SFDP functions and the `QSPI` class,
but we can't use gMock on them because:
* SFDP functions are global functions, whereas gMock only supports
mocking class member functions.
* A mocked class is injected into the test subject, but passing a
preexisting `QSPI` instance into `QSPIFBlockDevice` is not possible
(unless we resort to pointers). For details, see comments in
test_QSPIFBlockDevice.cpp.

So fakes of the `QSPI` class and any SFDP functions involved are
defined in test_QSPIFBlockDevice.cpp.
2021-09-10 11:33:34 +01:00
Lingkai Dong 23a79ef459 QSPIFBlockDevice: Add quirk to ignore overlaying sectors on S25FS512S
The entire flash chip S25FS512S consists of uniform 256KB sectors.
Additionally, it has three configurations:
* 0x01: Eight 4KB sectors (32KB in total) overlaying the start of
the first 256KB sector
* 0x03: Eight 4KB sectors (32KB in total) overlaying the end of the
last 256KB sector
* 0x05: No overlaying sectors

The active configuration is determined from bit fields of two
registers, CR1NV and CR3NV.

Mbed OS does not currently support partially overlaying sectors,
meaning that with eight 4KB sectors overlay a 256KB sectors, the
remaining 224KB (== 256KB - 8 * 4KB) of the big sector can't be
correctly handled. Supporting such scenario would involve a large
amount of rewriting in Mbed OS's BlockDevice, SFDP and their tests,
and may increase the code size.

So, this commit applies a quirk to always report configuration 0x05
(no overlaying sectors). Even if 0x01 or 0x03 is the real configuration,
they are compatible with the 0x05 configuration because 256KB sectors
exist in all cases.

Note: This quirk does *not* change actual configurations on hardware,
because registers CR1NV and CR3NV are one-time configurable (OTP) -
each bit field has a factory value of 0 and can be changed to 1 by the
user but not back to 0. So QSPIFBlockDevice avoids changing them.
2021-09-10 10:49:37 +01:00
Lingkai Dong 6032671b41 QSPIFBlockDevice: Add quirk for inconsistent CR3NV register value
Cypress S25FS512S's SFDP table suggests that bit-1 of the register
CR3NV on 25FS512S should equal 1. But it is a known issue that the
value is actually 0 on hardware. So if we query the value of CR3NV
during configuration detection, we can't find a configuration that
matches the SFDP data. This issue has been discussed in the Linux MTD
(Memory Technology Devices) mailing list:
https://linux-mtd.infradead.narkive.com/ylHK6CyT/spi-nor-fs512s-incorrect-cr3nv-1-value

This commit adds a quirk to report bit-1 of CR3NV as 1.

Note: In Mbed OS, vendor-specific quirks can only be handled in block
devices. The SFDP functions assume data from hardware to be correct.
So this quirk is in the block device.
2021-09-10 10:49:37 +01:00
Jerome Coutant 4ef3b6cc9c STM32U5: README update 2021-09-10 11:16:17 +02:00
Jerome Coutant 90510bb401 STM32U5: targets.json 2021-09-10 11:16:17 +02:00
Jerome Coutant 84959256b7 STM32U5 : B_U585I_IOT02A introduction 2021-09-10 11:16:17 +02:00
Jerome Coutant 8114954054 STM32U5 : NUCLEO_U575ZI_Q introduction 2021-09-10 11:16:17 +02:00
Jerome Coutant 724c378c42 STM32U5 : STM32U5xxxxx sub-families 2021-09-10 11:16:16 +02:00
Jerome Coutant f45b1890aa STM32U5 specific driver files 2021-09-10 11:16:16 +02:00
Jerome Coutant e2ca71d1bf STM32U5: generic STM32 driver files update 2021-09-10 11:16:16 +02:00
Jerome Coutant 69c7cb4d59 STM32U5 CMSIS update 2021-09-10 11:16:16 +02:00
Jerome Coutant 3a1eb190d1 STM32U5 / GPIO HAL : GPIO_AF3_TIM1 is missing 2021-09-10 11:16:16 +02:00
Jerome Coutant 16a40c3ff1 STM32U5 ST_HAL_SPI workaround
Internal ticket 112451
2021-09-10 11:16:16 +02:00
Jerome Coutant 8bdd782a30 STM32U5 / CMSIS : USB_OTG patch 2021-09-10 11:16:16 +02:00
Jerome Coutant 59affad91c STM32U5: STM32Cube_FW_U5_V1.0.0 2021-09-10 11:16:08 +02:00
Jerome Coutant 234d5ff9ba ARM PACK MANAGER: add STM32U575ZI and STM32U585 2021-09-10 11:16:07 +02:00
Lingkai Dong 8dfad16f5d QSPIFBlockDevice: Use fully-qualified include path
In Mbed OS, each library has an `include/<library>/` subdirectory
containing headers. The recommended way to include a header is
`#include "<library>/<header>.h"` to avoid potential conflicts with
any external modules that have same names of headers.

This is not enforced yet, and both include/ and include/<component>/
are in a library's include paths, to avoid breaking preexisting
Mbed projects that don't follow the recommendation. But code within
Mbed OS should follow it at least.
2021-09-10 10:15:22 +01:00
Martin Kojtal 5a3f3f7330
Merge pull request #15051 from hallard/STM32_LPTIM_Prescaler
Allow to use all STM32 targets prescaler for LPTIM
2021-09-10 09:52:04 +01:00
Lingkai Dong e04a16fd9f QSPI: Move destructor into source file
This allows the entire QSPI class to be mocked/faked for unit testing
purpose, without dependencies from the real implementation such as
`qspi_free()` from the HAL.
2021-09-10 09:46:02 +01:00
Lingkai Dong 0cb62c4944 SFDP: unit tests: Fix Configuration ID in fake test data
The second byte of the sector map descriptor is the configuration ID.
On a device with non-configurable layout, the only available map
descriptor's configuration ID must be 0x00 as required by the
JESD216D standard. This value is important, because we will check
each descriptor's configuration ID when we support multiple
configurations.

Note: The test data is fake - when we modified real data of a
configurable device to become non-configurable for test purpose, we
forgot to change this field.
2021-09-10 09:46:02 +01:00