The ble-nrf51822 implementation of the BLE API generated callbacks for radio
notification events without using the minar scheduler and at very high
priority. This functionality is replaced by posting events through minar
when YOTTA_CFG_MBED_OS is defined. Note that minar could not be used directly
to post callbacks because radio notification events are handled at very high
priority, which caused a hard-fault when minar tries to enter a critical
section. Alternatively, a Timeout was used to post the callback in another
context with lower priority.
Change assembly sequence that starts the Nordic bootloader to remove
MOV instruction before cheks of IPSR. The MOV might be translated into a ADDS
that could change the APSR and cause a wrong branch to be taken.
The assemble sequence within an mbedOS application that starts the nordic
bootloader was being modified by the compiler. The result is that DFU enabled
applications could never start the bootloader correctly. This is because the
GCC compiler was translating a MOV instruction into a ADDS, which sets the
conditional flags in APSR before a conditional branch was executed. The result
of the incorrect branch caused the program to believe that it was in interrupt
mode when this was not the case.
Currently it just blindly writes beyond the end of the array, leading to impossible-to-find bugs.
It doesn't help that the limit on the number of characteristics doesn't seem to be documented anywhere.
S110 compatibility is already present, but this patch adds proper handling
of observer/central related features:
* Gap::startScan will return BLE_ERRROR_NOT_IMPLEMENTED (instead of
* nRF5xGattClient uses the default GattClient implementation when S110 is
in use. All if its methods return NOT_IMPLEMENTED.
Example: for an application that acts as both a central and a peripheral,
using S110 will make the ble.gap().startScan() call return
BLE_ERROR_NOT_IMPLEMENTED, and advertisement features will continue
In addition, with GCC, this patch will free 344 bytes of RAM and 2504
bytes of flash.
Instead of relying on build macros to know which oscillator we're
supposedly using, check the value of LFCLKSRC register. This way, we can
trust mbed's init code to fallback on the internal clock if the user
specified a wrong target.
This change, along with the mbed patch that selects clock source
dynamically, will allow lots of application to still run and provide
FOTA, when the wrong Nordic platform is specified.
Signed-off-by: Jean-Philippe Brucker <firstname.lastname@example.org>