Skip to content

Commit 4aa2bf6

Browse files
authored
Merge pull request #7122 from ARMmbed/5.9-release-candidate
Release candidate 2 for mbed-os-5.9.0
2 parents 6817dc4 + c9338d1 commit 4aa2bf6

File tree

32 files changed

+142
-128
lines changed

32 files changed

+142
-128
lines changed

TESTS/mbed_drivers/timer/main.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,15 @@ extern uint32_t SystemCoreClock;
4545
* 1000 ms delay: tolerance = 20500 us
4646
*
4747
* */
48-
#define DELTA_US(delay_ms) (500 + (delay_ms) * US_PER_MSEC / 50)
49-
#define DELTA_MS(delay_ms) (1 + ((delay_ms) * US_PER_MSEC / 50 / US_PER_MSEC))
50-
#define DELTA_S(delay_ms) (0.000500f + (((float)(delay_ms)) / MSEC_PER_SEC / 50))
48+
#ifdef NO_SYSTICK
49+
#define TOLERANCE 5
50+
#else
51+
#define TOLERANCE 2
52+
#endif
53+
54+
#define DELTA_US(delay_ms) (500 + (delay_ms) * US_PER_MSEC * TOLERANCE / 100)
55+
#define DELTA_MS(delay_ms) (1 + (delay_ms) * TOLERANCE / 100)
56+
#define DELTA_S(delay_ms) (0.000500f + ((float)(delay_ms)) * ((float)(TOLERANCE) / 100.f) / MSEC_PER_SEC)
5157

5258
#define TICKER_FREQ_1MHZ 1000000
5359
#define TICKER_BITS 32

TESTS/mbed_hal/common_tickers/main.cpp

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -344,20 +344,34 @@ void ticker_increment_test(void)
344344
} else { // high frequency tickers
345345

346346
uint32_t num_of_cycles = NUM_OF_CYCLES;
347+
const uint32_t repeat_count = 20;
348+
const uint32_t max_inc_val = 100;
347349

348350
uint32_t base_tick_count = count_ticks(num_of_cycles, 1);
349351
uint32_t next_tick_count = base_tick_count;
350352
uint32_t inc_val = 0;
353+
uint32_t repeat_cnt = 0;
351354

352-
while (inc_val < 100) {
353-
355+
while (inc_val < max_inc_val) {
354356
next_tick_count = count_ticks(num_of_cycles + inc_val, 1);
355357

356358
if (next_tick_count == base_tick_count) {
357359

358-
/* Same tick count, so increase num of cycles. */
359-
inc_val++;
360+
/* Same tick count, so repeat 20 times and than
361+
* increase num of cycles by 1.
362+
*/
363+
if (repeat_cnt == repeat_count) {
364+
inc_val++;
365+
repeat_cnt = 0;
366+
}
367+
368+
repeat_cnt++;
360369
} else {
370+
/* Check if we got 1 tick diff. */
371+
if (next_tick_count - base_tick_count == 1 ||
372+
base_tick_count - next_tick_count == 1) {
373+
break;
374+
}
361375

362376
/* It is possible that the difference between base and next
363377
* tick count on some platforms is greater that 1, in this case we need
@@ -366,12 +380,8 @@ void ticker_increment_test(void)
366380
*/
367381
num_of_cycles /= 2;
368382
inc_val = 0;
383+
repeat_cnt = 0;
369384
base_tick_count = count_ticks(num_of_cycles, 1);
370-
371-
if (next_tick_count - base_tick_count == 1 ||
372-
base_tick_count - next_tick_count == 1) {
373-
break;
374-
}
375385
}
376386
}
377387

TESTS/mbed_platform/stats_sys/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ void test_sys_info()
3232
mbed_stats_sys_t stats;
3333
mbed_stats_sys_get(&stats);
3434

35-
#if defined(MBED_VERSION)
36-
TEST_ASSERT_NOT_EQUAL(0, stats.os_version);
37-
#endif
38-
3935
#if defined(__CORTEX_M)
4036
TEST_ASSERT_NOT_EQUAL(0, stats.cpu_id);
4137
#endif

cmsis/RTE_Components.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
#define CMSIS_device_header <cmsis.h>
2020

21+
#if defined(MBED_CONF_RTOS_PRESENT)
2122
#include "mbed_rtx_conf.h"
23+
#endif
2224
#include "mbed_cmsis_conf.h"
2325

2426
#endif

features/FEATURE_BLE/ble/generic/SecurityDb.h

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -584,28 +584,32 @@ class SecurityDb {
584584
WhitelistDbCb_t cb,
585585
::Gap::Whitelist_t *whitelist
586586
) {
587-
for (size_t i = 0; i < get_entry_count() && i < whitelist->capacity; i++) {
587+
for (size_t i = 0; i < get_entry_count() && whitelist->size < whitelist->capacity; i++) {
588588
entry_handle_t db_handle = get_entry_handle_by_index(i);
589589
SecurityDistributionFlags_t* flags = get_distribution_flags(db_handle);
590590

591591
if (!flags) {
592592
continue;
593593
}
594594

595+
SecurityEntryIdentity_t* identity = read_in_entry_peer_identity(db_handle);
596+
if (!identity) {
597+
continue;
598+
}
599+
600+
memcpy(
601+
whitelist->addresses[whitelist->size].address,
602+
identity->identity_address.data(),
603+
sizeof(BLEProtocol::AddressBytes_t)
604+
);
605+
595606
if (flags->peer_address_is_public) {
596-
whitelist->addresses[i].type = BLEProtocol::AddressType::PUBLIC;
607+
whitelist->addresses[whitelist->size].type = BLEProtocol::AddressType::PUBLIC;
597608
} else {
598-
whitelist->addresses[i].type = BLEProtocol::AddressType::RANDOM_STATIC;
609+
whitelist->addresses[whitelist->size].type = BLEProtocol::AddressType::RANDOM_STATIC;
599610
}
600611

601-
SecurityEntryIdentity_t* identity = read_in_entry_peer_identity(db_handle);
602-
if (identity) {
603-
memcpy(
604-
whitelist->addresses[i].address,
605-
identity->identity_address.data(),
606-
sizeof(BLEProtocol::AddressBytes_t)
607-
);
608-
}
612+
whitelist->size++;
609613
}
610614

611615
cb(whitelist);

features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ ble_error_t GenericSecurityManager::purgeAllBondingState(void) {
142142
ble_error_t GenericSecurityManager::generateWhitelistFromBondTable(Gap::Whitelist_t *whitelist) const {
143143
if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE;
144144
if (eventHandler) {
145+
if (!whitelist) {
146+
return BLE_ERROR_INVALID_PARAM;
147+
}
145148
_db->generate_whitelist_from_bond_table(
146149
mbed::callback(eventHandler, &::SecurityManager::EventHandler::whitelistFromBondTable),
147150
whitelist

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/nRF5xGap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ void nRF5xGap::on_connection(Gap::Handle_t handle, const ble_gap_evt_connected_t
12661266
const resolving_list_entry_t* entry = get_sm().resolve_address(
12671267
evt.peer_addr.addr
12681268
);
1269-
MBED_ASSERT(entry == NULL);
1269+
MBED_ASSERT(entry != NULL);
12701270

12711271
peer_addr_type = convert_identity_address(entry->peer_identity_address_type);
12721272
peer_address = entry->peer_identity_address.data();

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xCrypto.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ namespace vendor {
4747
namespace nordic {
4848

4949
CryptoToolbox::CryptoToolbox() : _initialized(false) {
50+
mbedtls_platform_setup(&_platform_context);
5051
mbedtls_entropy_init(&_entropy_context);
5152
mbedtls_ecp_group_init(&_group);
5253
int err = mbedtls_ecp_group_load(
@@ -59,6 +60,7 @@ CryptoToolbox::CryptoToolbox() : _initialized(false) {
5960
CryptoToolbox::~CryptoToolbox() {
6061
mbedtls_ecp_group_free(&_group);
6162
mbedtls_entropy_free(&_entropy_context);
63+
mbedtls_platform_teardown(&_platform_context);
6264
}
6365

6466
bool CryptoToolbox::generate_keys(

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xCrypto.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class CryptoToolbox : mbed::NonCopyable<CryptoToolbox> {
132132
void swap_endian(uint8_t* buf, size_t len);
133133

134134
bool _initialized;
135+
mbedtls_platform_context _platform_context;
135136
mbedtls_entropy_context _entropy_context;
136137
mbedtls_ecp_group _group;
137138
};

features/FEATURE_UVISOR/includes/uvisor/api/inc/uvisor_deprecation.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#define __UVISOR_DEPRECATION_H__
1919

2020
#if defined(UVISOR_PRESENT) && UVISOR_PRESENT == 1
21-
#warning "Warning: You are using FEATURE_UVISOR, which is unsupported as of Mbed OS 5.9."
21+
#warning "Warning: uVisor is superseded by the Secure Partition Manager (SPM) defined in the ARM Platform Security Architecture (PSA). \
22+
uVisor is deprecated as of Mbed OS 5.10, and being replaced by a native PSA-compliant implementation of SPM."
2223
#endif
2324

2425
#endif // __UVISOR_DEPRECATION_H__

0 commit comments

Comments
 (0)