This commit takes some of the work done on the SPI class from #8445, and
refines it, to provide the per-peripheral mutex functionality.
This also implements GPIO-based SSEL, which exposes a new
select()/deselect() API for users to group transfers, and should work on
every platform (unlike the HAL-based SSEL). This requires users to use a
new constructor to avoid backwards compatibility issues.
To activate the per-peripheral mutex, the HAL must define SPI_COUNT and
provide spi_get_peripheral_name(). (In #8445 this is a reworked
spi_get_module, but the name is changed here to avoid a collision with
existing HALs - this commit is designed to work without wider HAL
changes).
Fixes: #9149
Few boards may fail the write actions due to HW limitations (like critical
drivers that disable flash operations). Just retry a few times until success.
In addition, remove the redundant retries in NVStore (not needed now).
The DEVICE_FOO macros are always defined (either 0 or 1).
This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
DEVICE_SERIAL is always defined (either 0 or 1).
Remove the faulty checks introduces in commit
26b9a1f6a3 and replace them with
value checks as originally implemented.
Fixes#8913
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
- Consider data section in GCC_ARM toolchain
- Consider init_array section in IAR toolchain
- Rename macro to FLASHIAP_APP_ROM_END_ADDR for clarity sake
Make the following changes:
-Allow a vector specific ARM MPU driver by defining MBED_MPU_CUSTOM
-Allow ROM address to be configured for ARMv7-M devices by
setting the define MBED_MPU_ROM_END
-Add ROM write protection
-Add new functions and lock
-enable at boot
-disable during flash programming
Rename MpuXnLock to ScopedMpuXnLock so it has the same naming
convention as ScopedMutexLock. Also make this class inherit from
NonCopyable to prevent misuse.
When programming flash using the FlashIAP API allow execution from
ram. Many devices require flashing to be done from RAM.
Also allow execution from ram when running the low level flash tests.
Current serial implementation has a send_break() command which
sends a break command on the UART for a fixed amount of time.
Added functions to allow users to send a break in a non-blocking
fashion, as well as for a user-specified amount of time.