The LDREX/STREX implementations of the compare-and-swap functions were
weak (they could spuriously fail when the value was expected), whereas
the critial section implementation was strong, and the documentation has
no suggestion that there might be spurious failures.
Rationalise by adding a retry loop for STREX failure, so that it only
returns false when the value is not expected.
Fixes https://github.com/ARMmbed/mbed-os/issues/5556
Combination of mbed 2 builds (~40 minutes), littlefs testing (~15
minutes), and miscellaneous testing pushed the current CI over
Travis's limit of 1 hour per job.
However, by using Travis's matrix includes, we can spin up different
jobs for the various logical components being tested.
Not all devices have enough heap to fit a simulated heap block device,
however using a simulated heap block device is preferred if available
(reduced flash wear, faster testing).
Added MBED_TEST_SIM_BLOCKDEVICE for tests that only need a simulated
block device (wear_leveling + resilience), and added support for targets
that are known to have enough heap.
GattServer::write on Nordic's targets use sd_ble_gatts_hvx to send an
handle value Notification or Indication; This function can fail if the
connection handle is invalid or if Updates are not enabled for this
connection.
This patch workaround those limitations.
Timer code was written based on integer multiple HF clock frequencies. EFR32 doesn't conform to that (38.4), and so the timestamp ticks were off by 1%. Enough to trip up some CI tests on TB_SENSE_12 (#5496)
Need to avoid a TX packet error from messing up the TX FIFO. Since this API will return busy if a packet is in transmission anyways, this is acceptable.
This patch handles the case of SPI slave mode without MISO (NC).
In case MISO is not connected, we consider that SPI will be configured in
3 wires mode (CLK / MOSI / CS, but no MISO). In this case, the MOSI line
is bi-directional : SPI_DIRECTION_1LINE.
But as this is not supported yet in slave mode, we force it to
SPI_DIRECTION_2LINES. In this case slave SPI will receive data on MOSI
but nothing will be sent back to master as MISO is not connected.
Unfortunately there are several issues colluding to force the timeout
this high.
1. The tests push littlefs to the limits of how many errors it can
handle before failing. As a side effect this causes a massive amount
of debug/warn/error logging about the situation.
2. The logging can't be turned off for specific tests. Note: This might
change with the introduction of test-configs.
3. Logging is fixed to a baud rate of 9600. Previous testing was carried
out with a baud rate of 115200, which is the reason for the original
timeout.
armcc fopen allocated a mutex using the retargeted system-level
_mutex_initialize function. Interestingly, malloc also uses this
same _mutex_initialization function, which prevents a full solution
relying on malloc. The solution previously implemented involved using
the rtx mutex pool for the first 8 mutexes, then falling back on
malloc.
The previous implementation relied on osMutexNew returning an error
on out-of-memory. An unrelated change causes osMutexNew to instead
assert (except for release mode). This meant if you exceed 8 system-
level mutexes in armcc you will hit an assert. Since the filesystem
code can call fopen an unlimited number of times, this is a problem.
Solution is to keep track of which static mutexes we've allocated, so
we know before calling osMutexNew if we need to call malloc.
Also _mutex_free never deallocated the malloced mutexes, which would
cause fopen to leak memory.
The difference gcc targets differ with format strings in some odd
(but not against the rules) ways. Most notable, the uint32_t in
i386/x86_64 gcc uses %d, whereas on cortex-m gcc uses %ld.
This makes dealing with warnings on code that goes between the two
rather annoying.
5ee20e8 Fixed pipefail issue that was preventing CI from reporting errors
bf78b09 Added directory list for synchronizing in flight directories
e169d06 Removed vestigial function declaration
git-subtree-dir: littlefs
git-subtree-split: 5ee20e8d774adf0bb538269870b3552fdfc0e046