To start direct connectable advertising on the cordio stack, the programmer should call the function DmConnAccept instead of the function DmAdvStart .
This functions expect the target address and address type as parameter, which are passed to the controller when the programmer sets the advertising parameters and not known when advertising_enable is called.
Therefore, this information should be kept in memory when advertising parameters are set and retrieved when advertising is enable to choose the right call to start (or stop) advertising.
Timeout of direct advertising is also handled in an uncommon way, a connection timeout is received. Similarly, DmConnClose should be called to stop connectable direct advertising.
The state is kept in an array of direct_adv_cb_t. Each items contains a peer address, the peer address type, the connection handle and the advertising handle as well as a state which indicate if the advertising is running, pending or not used.
When advertising parameters are set, the state is updated to match the target address or disable direct advertising management for the advertising set being configured.
When advertising is enabled, the pal dispatch the operation to the right calls (DmAdvStart/DmConnAccept or DmAdvStop/DmConnClose).
When an advertising timeout happen or a connection is made, the pal cleans any direct advertising state of this advertising set
Nothing in the Bluetooth standard prevents update of advertising payload while advertising is active.
This limitation wasn't present in previous version of the stack and is not present for extended advertising.
TF-M provides its own PSA headers for TF-M targets. Single v7-M targets
need to get PSA crypto from Mbed Crypto.
Note that we don't yet move crypto_struct.h to its new location. This is
to avoid breaking v8-M targets for the time being. When TF-M provides
the PSA implementation on v8-M, we will add crypto_struct.h to the
correct place.
Likewise, none of the PSA-implementing source is moved out of
COMPONENT_PSA_SRV_IMPL yet, as still must not be built for PSA NS
targets. When PSA NS targets switch to using TF-M provided
implementations rather than MBED_PSA_SRV, we can take the source out of
COMPONENT_PSA_SRV_IMPL.
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
The Mbed TLS import script is quite fragile, and depends on certain lines to be
present in the files it adjusts to be able to do the modifications it needs to
to allow Mbed TLS to build within Mbed OS.
Thsi commit changes the `adjust-config.sh` script to look for a the end of the
config.h file, defined as "#endif /* MBEDTLS_CONFIG_H */" rather than the
include line for "check_config.h".
That's because the inclusion of "check_config.h" is being removed upstream in
Mbed TLS to fix another issue.
In PR #8876 when we added Cordio support for nRF52* targets,
we attempted to use an RTOS idle hook to workaround sleep
latency issues. However, the condition to bypass sleeps
never gets satisfied, and BLE nRF52* targets have generally
worked fine over the past year.
This commit removes the hook to avoid dependency on RTOS,
enabling BLE on bare metal.
Note that documentation for random_max_start_delay config setting has
been changed to indicate that the setting is in seconds, and always has
been. No functional change.
Reverts commit 10481f2f7e partially.
Changes made to ExhaustibleBlockDevice hides simulated flash degradation
which is the assumed behavior. Converted back to original behavior.
Mbed Crypto has been remerged back into Mbed TLS. Update the
Mbed TLS importer script with the relevant parts of the
Mbed Crypto importer.
Signed-off-by: Darryl Green <darryl.green@arm.com>
Remove all PSA S-mode only code, as it is unused. Only PSA S targets
would use the code, and we've removed those targets in a previous
commit.
Ensure all tests for S-mode code we are deleting is also removed, even
if that code would run in NS-mode. Keep any tests that also test our PSA
emulation support (for single v7-M targets).
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
Remove PSA v8-M S target binaries will be built outside of Mbed OS and
added in as binaries which NS targets consume. Mbed OS no longer
implements PSA for v8-M targets, so there is no reason for it to build
PSA S targets.
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
BLOCK2 code-branch was missing handling for duplicate packets. As part of the fix, added also
a call to update the duplicate package data via a new function
sn_coap_protocol_update_duplicate_package_data_all.
The new implementation handles all CoAP messages, not just those with COAP_MSG_TYPE_ACKNOWLEDGEMENT.
Add also 4.13 (Request Entity Too Large) responses to duplicate info list.
Add client library configurations for DEFAULT_RESPONSE_TIMEOUT and SN_COAP_DUPLICATION_MAX_TIME_MSGS_STORED.
Increased the default timeouts of DEFAULT_RESPONSE_TIMEOUT and SN_COAP_DUPLICATION_MAX_TIME_MSGS_STORED to 300 seconds.
These two are critical parameters for low-bandwidth high-latency networks. The defaults should be more geared towards such networks that are likely to have issues with transmissions.
The increased defaults can increase the runtime HEAP usage when there is a lot of duplicates or retransmissions.
tests-filesystem-general_filesystem declares BlockDevice and FileSystem
pointers as globals. If these are initialized to their respective
default_instance values in the declaration, the LFS init happens during
OS startup when __libc_init_array() is invoked by mbed_toolchain_init().
If the filesystem blockdevice does not currently contain a valid filesystem
(e.g. the chip has just been erased), then LFS will flag this as corruption
and abort the mounting process.
This cleanup process can take long enough (and is running pre-main) that
greentea times out waiting for the device to respond to its sync packet,
and resets the device.
To resolve this, move the initialization into the first test case
(bd_init_fs_reformat) right before it initializes and formats the
blockdevice and filesystem.
Fixed following issues in BG96 offloaded DNS:
- Fixed mbed-os 6 API change for asynchronous DNS callback. Return value is no longer
an error value but in success case the amount of DNS records
- Asynchronous request returns request ID instead of NSAPI_ERROR_OK. BG96 supports only
one asynchronouse DNS query at the time, so ID 1 is used.
- BG96 does not support multi-ip DNS responses, so disabled multi-ip tests
For actual connections, full ConnectionParameters is used. But
as per BLE specification, Generic Access Service can display
preferred connection parameters which is a smaller subset and
ConnectionParams_t matches exactly. Thus we rename/repurpose
it to PreferredConnectionParams_t.
The callback on_connected() in ConnectionEventMonitorEventHandler
contains a parameter ConnectionParams_t which is superceded by
ConnectionParameters. Since it's not used, remove it.
Functions in Cordio for device name & appearance are currently
unused as they are both part of and dependent on deprecated
Mbed OS BLE APIs.
Nonetheless we want to keep them (and disable using macros)
so we can reintroduce them and make improvements in the future
as needed.
This is based on (and supercedes) PR #10772.
As the switches between old and new APIs do not exist anymore,
we create a function for legacy advertising set creation.
-Check pointer before writing to it. It allows application to ask
only some of the stagger values.
-Change type of data_amount in get_stagger_estimate_to_address to be
uint16_t.
Add getsockopt options NSAPI_LATENCY and NSAPI_STAGGER to read
network specific timing constraints from socket.
-NS_LATENCY returns estimated latency to given address.
-NSAPI_STAGGER returns estimated initial delay that application
should wait before transmitting data to network.
Application can use the new options to avoid network congestion by
adjusting transmission delays and retry timeouts.
Earlier if mbed-trace was disabled but debug-at enabled, some AT trace codes were still
enabled causing unnecessary code size increase.
This commit fixes the issue that AT debug trace code is enabled only when both
mbed-trace.enable and cellular.debug-at are enabled.
Reduces binary size by about ~340bytes when mbed-trace is disabled but debug-at enabled.
set_ip_address API can be used to set a static IPv4 address or IPv6 link-local
address to network stack.
This is needed for example in cellular use cases where device gets multiple IP
addresses from cellular context.
Rework TDBStore::calc_area_params so that it can handle situations where
the block device size is not an even multiple of the sector size (while
retaining its ability to handle non-uniform erase sizes).
This avoids intermittent asserts on boards where TDBStore is implemented
in internal flash, in which case the size of the block device varies
with the application size and a minor change (or a shift in optimization
level) can shift TDBStore from an odd to an even number of sectors.
Issue: The problem is that there is a race condition introduced in that the LWIP thread is relying on the
interface as it is taken down by a application thread while calling disconnect.
In disconnect api called from application context, whd_emac_wifi_link_state_changed() will refer to netif interface
structure in its callback api netif_link_irq(netif). This netif will be cleared by remove_etherent_interface().
whd_emac_wifi_link_state_changed will post message to tcpip_thread. tcpip_thread will process the message and
call the callback api netif_link_irq(netif)
Calling sequence is whd_emac_wifi_link_state_changed -> remove_etherent_interface(). Hence there is a timing issue
that netif might be cleared first before tcpip thread process the message netif_link_irq(netif)
Fix: remove_etherent_interface() will post message to tcpip thread and tcpip thread process the message delete_interface()
which will actually remove the inferface from the netif_list.
Calling sequence is whd_emac_wifi_link_state_changed() message post -> remove_etherent_interface() message post.
message processing order netif_link_irq(netif) -> delete_interface().
Since both the processing is handled in single thread, processing of message is handled sequentially.
These changes are for TFM_DUALCPU and TFM_V8M platforms.
The initialization happens after mbed-os kernel is kicked off and
when the thread is up and running.
We are initializing the following for TFM_DUALCPU platforms:
* IPC Interrupts for syncing multi-core platforms.
* NS Mailbox to receive messages.
* NS interface.
We are only initializing Non-secure interface for TFM_V8M platforms.
mbed_tfm_init() in tfm_mbed_boot.c overrides the WEAK mbed_tfm_init()
for a specific platform.
Signed-off-by: Vikas Katariya <vikas.katariya@arm.com>
Relevant modifications:
1. Support degrading QSPI0/1 to SPI4/5 for normal SPI transfer
2. Fix with BSP crypto driver API change
3. Fix with BSP PDMA driver API change
4. Make necessary modifications to pass FPGA CI Test Shield tests
5. Don't distinguish pinmap among parts e.g. M480 LG. Application users must take care.
STORE_SECTORS is a hard requirement. If there are fewer than 2 pages
then the kvstore will not work, because the garbage collection process
relies on having at least two sectors to work with.
STORE_PAGES is a heuristic. It is a reasonable default to use if the
application does not specify the amount of flash to use for TDBStore.
But if an application knows that a smaller number of pages will suffice
for its specific needs, then that is valid and should be permitted.