Commit Graph

34246 Commits (15579bdf0c141349a7ee0db5bf2215a1eedd301f)

Author SHA1 Message Date
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 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 from ARMmbed/fix_platform_wait_ns_test_cmake
CMake: Fix platform wait_ns greentea test Cmake
2021-09-14 13:21:19 +01:00
Jerome Coutant 79ae89f740 connectivity tests: avoid crash with null pointer 2021-09-14 10:46:52 +02: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
Jerome Coutant abe2e48ae8 STM32L5/STM32U5 : CAN suport 2021-09-13 13:55:33 +02:00
Jaeden Amero 756830e776
Merge pull request 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 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 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
Lingkai Dong 50183d2ee4 SFDP: unit tests: Move unshared test data into case
Some test data in test_sfdp.cpp is used by one test case only, so
we turn it into a local variable.
2021-09-10 09:46:02 +01:00
Lingkai Dong b5e7dd9d32 SFDP: Add more parameters to the reader callback
The SFDP functions parse SFDP data which is fetched by a callback
called `sfdp_reader` provided by {SPIF,QSPIF,OSPIF}BlockDevice.
Currently, this callback interface only takes a read address and an RX
buffer to store output data. This has been enough, because other SPI
parameters are always the same when fetching the SFDP table only -
they are just hardcoded in each reader.

But in the future we will add support for flash devices with multiple
configurations (in a subsequent commit), and to detect which
configuration is enabled, we will need to send detection commands
which require device-dependent SPI parameters:
* address size
* instruction
* dummy cycles

This commit
* turns the above SPI parameters from predefined/hardcoded values
into parameters of the callback
* lets the SFDP functions pass the above parameters to the callback
(Note: To read the SFDP table itself, those values are constants
defined by the standard, not tied to any particular device, so they
can be known to the SFDP functions)
* updates the callbacks implemented by {SPIF,QSPIF,OSPIF}BlockDevice
* updates the mock callback for unit tests and expectations
2021-09-10 09:46:02 +01:00
Lingkai Dong 2581254492 SFDP: Fix sector map table allocation check
When passing an allocation size directly to `std::make_unique`,
`std::nothrow` is unavailable, so any failed allocation results in
an exception which we cannot catch because Mbed OS is compiled with
`-fno-exceptions`. To fix this, chain `std::make_unique` with
`new (std::nothrow)`, and the allocated `unique_ptr` retains the
`nullptr` property.
2021-09-10 09:45:11 +01:00
Lingkai Dong 7a8ff5f115 drivers: Add missing OSPI.cpp to CMakeLists.txt 2021-09-10 09:45:11 +01:00
Jerome Coutant fe1adbcc86 Lora drivers: explicit lib requirement 2021-09-10 09:07:15 +02:00
Martin Kojtal 82036c85df
Merge pull request from jeromecoutant/PR_WIFI_TEST
connectivity-netsocket-tests-tests-network-wifi test suite configuration simplification
2021-09-09 13:14:56 +01:00
Jerome Coutant bce33b01ff connectivity-netsocket-tests-tests-network-wifi update2
- add minor print to make debug easier
- remove not useful part
2021-09-09 10:23:42 +02:00
Jerome Coutant 787605cec4 connectivity-netsocket-tests-tests-network-wifi update
Use default NSAPI configuration
2021-09-09 10:23:33 +02:00
Martin Kojtal f89655f2da
Merge pull request from mat-kalinowski/sendrecv_message
New feature: send/recv message implementation added to network stack
2021-09-09 08:35:19 +01:00
Martin Kojtal 3305dc1494
Merge pull request from world-direct/feature/reduceTLSspam
Reduce spam on trace because of calling read/write while handshaking
2021-09-09 08:34:27 +01:00
Martin Kojtal 9eed4272f5
Merge pull request from OpenNuvoton/nuvoton_m2354_tfm_import_mcu_partition
M2354: Fix incorrectly resolved peripheral base with security
2021-09-09 08:00:37 +01:00
Martin Kojtal 4f576481b3
Merge pull request from saheerb/master
set locale in mbed-os-env Docker image
2021-09-09 07:16:51 +01:00
Jaeden Amero 988d165f8f
Merge pull request from LDong-Arm/bd_greentea_fixes
Fix Thread::start() and general_block_device test's thread allocation/deallocation
2021-09-08 17:09:29 +01:00
mateusz.kalinowski ad0eb0eaa6 Moving alignment information in the nsapi_msghdr_t
Macro MBED_ALIGN expands in C to _Alignas which can't be used in the
type declaration. This patch moves it to the first type definition
which makes this code compile properly in CPP and C.
2021-09-08 15:26:41 +01:00
Martin Kojtal 3031898929
Merge pull request from OpenNuvoton/nuvoton_m2354_tfm_fw_version
M2354: Generate unique MCUboot image version
2021-09-08 14:47:54 +01:00