Skip to content

Commit

Permalink
Merge pull request ARMmbed#11110 from ARMmbed/release-candidate
Browse files Browse the repository at this point in the history
Release candidate for mbed-os-5.13.2
  • Loading branch information
evedon authored Jul 26, 2019
2 parents 5941d17 + 337c5b4 commit b81aeff
Show file tree
Hide file tree
Showing 85 changed files with 4,003 additions and 2,046 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.cpp text
*.h text
*.s text
*.S text
*.sct text
*.ld text
*.txt text
Expand Down
3 changes: 2 additions & 1 deletion TESTS/mbed-crypto/sanity/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

#include "psa/crypto.h"

#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
#error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping.
#endif
Expand All @@ -24,7 +26,6 @@
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "psa/crypto.h"
#include "entropy.h"
#include "entropy_poll.h"

Expand Down
2 changes: 1 addition & 1 deletion TESTS/mbed_drivers/watchdog/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ using utest::v1::Harness;

using namespace mbed;

Thread wdg_kicking_thread;
Thread wdg_kicking_thread(osPriorityNormal, 768);
Semaphore kick_wdg_during_test_teardown(0, 1);

void wdg_kicking_thread_fun()
Expand Down
2 changes: 1 addition & 1 deletion TESTS/mbed_hal/watchdog/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ using utest::v1::Harness;

const watchdog_config_t WDG_CONFIG_DEFAULT = { .timeout_ms = WDG_TIMEOUT_MS };

Thread wdg_kicking_thread;
Thread wdg_kicking_thread(osPriorityNormal, 768);
Semaphore kick_wdg_during_test_teardown(0, 1);

void wdg_kicking_thread_fun()
Expand Down
4 changes: 2 additions & 2 deletions TESTS/mbed_hal_fpga_ci_test_shield/analogin/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ using namespace utest::v1;

#define analogin_debug_printf(...)

#define DELTA_FLOAT 0.03f // 3%
#define DELTA_U16 1965 // 3%
#define DELTA_FLOAT 0.05f // 5%
#define DELTA_U16 3277 // 5%

const PinList *form_factor = pinmap_ff_default_pins();
const PinList *restricted = pinmap_restricted_pins();
Expand Down
3 changes: 2 additions & 1 deletion TESTS/mbed_hal_fpga_ci_test_shield/i2c/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ void i2c_test_byte_read(PinName sda, PinName scl)
// Reset tester stats and select I2C
tester.peripherals_reset();
tester.select_peripheral(MbedTester::PeripheralI2C);
tester.set_next_from_slave(0);
for (int i = 0; i < TRANSFER_COUNT; i++) {
data_in[i] = 0;
}
Expand Down Expand Up @@ -413,7 +414,7 @@ void i2c_test_byte_read(PinName sda, PinName scl)
TEST_ASSERT_EQUAL(num_nacks, tester.num_nacks());
TEST_ASSERT_EQUAL(checksum, tester.get_send_checksum());
TEST_ASSERT_EQUAL(0, tester.state_num());
TEST_ASSERT_EQUAL(((TRANSFER_COUNT + 2) & 0xFF), tester.get_next_from_slave());
TEST_ASSERT_EQUAL(((TRANSFER_COUNT) & 0xFF), tester.get_next_from_slave());
TEST_ASSERT_EQUAL(num_writes, tester.num_writes());
TEST_ASSERT_EQUAL(num_reads, tester.num_reads());

Expand Down
2 changes: 2 additions & 0 deletions TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ void pwm_period_fill_test(PinName pin, uint32_t period_ms, uint32_t fill_prc, pw
break;
}

wait(PERIOD_FLOAT(period_ms));

tester.io_metrics_start();

wait(NUM_OF_PERIODS * PERIOD_FLOAT(period_ms));
Expand Down
4 changes: 2 additions & 2 deletions TESTS/mbed_hal_fpga_ci_test_shield/spi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void spi_async_handler()
{
int event = spi_irq_handler_asynch(&spi);

if (event == SPI_EVENT_COMPLETE) {
if (event & SPI_EVENT_COMPLETE) {
async_trasfer_done = true;
}
}
Expand Down Expand Up @@ -136,7 +136,7 @@ void spi_test_common(PinName mosi, PinName miso, PinName sclk, PinName ssel, SPI

async_trasfer_done = false;

spi_master_transfer(&spi, tx_buf, TRANSFER_COUNT, rx_buf, TRANSFER_COUNT, 8, (uint32_t)spi_async_handler, 0, DMA_USAGE_NEVER);
spi_master_transfer(&spi, tx_buf, TRANSFER_COUNT, rx_buf, TRANSFER_COUNT, 8, (uint32_t)spi_async_handler, SPI_EVENT_COMPLETE, DMA_USAGE_NEVER);
while (!async_trasfer_done);

for (int i = 0; i < TRANSFER_COUNT; i++) {
Expand Down
26 changes: 20 additions & 6 deletions TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ static void uart_test_common(int baudrate, int data_bits, SerialParity parity, i
serial_init(&serial, tx, rx);
serial_baud(&serial, baudrate);
serial_format(&serial, data_bits, parity, stop_bits);
#if DEVICE_SERIAL_FC
if (use_flow_control) {
serial_set_flow_control(&serial, FlowControlRTSCTS, rts, cts);
} else {
serial_set_flow_control(&serial, FlowControlNone, NC, NC);
}
#endif

// Reset tester stats and select UART
tester.peripherals_reset();
Expand Down Expand Up @@ -277,9 +279,11 @@ void test_init_free(PinName tx, PinName rx, PinName cts = NC, PinName rts = NC)
serial_init(&serial, tx, rx);
serial_baud(&serial, 9600);
serial_format(&serial, 8, ParityNone, 1);
#if DEVICE_SERIAL_FC
if (use_flow_control) {
serial_set_flow_control(&serial, FlowControlRTSCTS, rts, cts);
}
#endif
serial_free(&serial);
}

Expand All @@ -302,28 +306,38 @@ void test_common_no_fc(PinName tx, PinName rx)

Case cases[] = {
// Every set of pins from every peripheral.
Case("init/free, FC on", all_ports<UARTPort, DefaultFormFactor, test_init_free>),
Case("init/free, FC off", all_ports<UARTNoFCPort, DefaultFormFactor, test_init_free_no_fc>),

// One set of pins from every peripheral.
Case("basic, 9600, 8N1, FC on", all_peripherals<UARTPort, DefaultFormFactor, test_common<9600, 8, ParityNone, 1> >),
Case("basic, 9600, 8N1, FC off", all_peripherals<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<9600, 8, ParityNone, 1> >),

// One set of pins from one peripheral.
// baudrate
Case("19200, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<19200, 8, ParityNone, 1> >),
Case("19200, 8N1, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<19200, 8, ParityNone, 1> >),
Case("38400, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<38400, 8, ParityNone, 1> >),
Case("38400, 8N1, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<38400, 8, ParityNone, 1> >),
Case("115200, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<115200, 8, ParityNone, 1> >),
Case("115200, 8N1, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<115200, 8, ParityNone, 1> >),
// stop bits
Case("9600, 8N2, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<9600, 8, ParityNone, 2> >),

#if DEVICE_SERIAL_FC
// Every set of pins from every peripheral.
Case("init/free, FC on", all_ports<UARTPort, DefaultFormFactor, test_init_free>),

// One set of pins from every peripheral.
Case("basic, 9600, 8N1, FC on", all_peripherals<UARTPort, DefaultFormFactor, test_common<9600, 8, ParityNone, 1> >),

// One set of pins from one peripheral.
// baudrate
Case("19200, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<19200, 8, ParityNone, 1> >),
Case("38400, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<38400, 8, ParityNone, 1> >),
Case("115200, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<115200, 8, ParityNone, 1> >),
// data bits: not tested (some platforms support 8 bits only)
// parity
Case("9600, 8O1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<9600, 8, ParityOdd, 1> >),
Case("9600, 8E1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<9600, 8, ParityEven, 1> >),
// stop bits
Case("9600, 8N2, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<9600, 8, ParityNone, 2> >),
Case("9600, 8N2, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<9600, 8, ParityNone, 2> >),
#endif
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
Expand Down
2 changes: 2 additions & 0 deletions TESTS/psa/attestation/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

#include "psa/crypto.h"

#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
#error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping.
#endif // TARGET_PSA
Expand Down
3 changes: 2 additions & 1 deletion TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

#include "psa/crypto.h"

#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)) || (!defined(COMPONENT_PSA_SRV_IPC)))
#error [NOT_SUPPORTED] These tests can run only on SPM-enabled targets and where Mbed Crypto is ON - skipping.
#endif
Expand All @@ -24,7 +26,6 @@
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "psa/crypto.h"
#include "entropy.h"
#include "entropy_poll.h"
#include "test_partition_proxy.h"
Expand Down
3 changes: 2 additions & 1 deletion TESTS/psa/crypto_init/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
* limitations under the License.
*/

#include "psa/crypto.h"

#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
#error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping.
#endif // TARGET_PSA

#include "greentea-client/test_env.h"
#include "unity/unity.h"
#include "utest/utest.h"
#include "crypto.h"
#include "entropy.h"
#include "entropy_poll.h"

Expand Down
10 changes: 4 additions & 6 deletions components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/MbedTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,6 @@ static bool _firmware_header_valid(BlockDevice &flash, bool &valid)
static bool _firmware_get_active_bank(BlockDevice &flash, bool &second_bank_active)
{
uint8_t buf[sizeof(SYNC_WORD)];
size_t pos = 0;
size_t read_size;

if (flash.read(buf, FLASH_SECTOR_SIZE - sizeof(SYNC_WORD), sizeof(SYNC_WORD)) != BD_ERROR_OK) {
return false;
Expand Down Expand Up @@ -708,7 +706,7 @@ bool MbedTester::firmware_dump(mbed::FileHandle *dest, mbed::Callback<void(uint8
return false;
}
ssize_t write_size = dest->write(buf, read_size);
if (write_size != read_size) {
if ((uint32_t)write_size != read_size) {
sys_pin_mode_disabled();
return false;
}
Expand Down Expand Up @@ -761,7 +759,7 @@ bool MbedTester::firmware_dump_all(mbed::FileHandle *dest, mbed::Callback<void(u
return false;
}
ssize_t write_size = dest->write(buf, read_size);
if (write_size != read_size) {
if ((uint32_t)write_size != read_size) {
sys_pin_mode_disabled();
return false;
}
Expand Down Expand Up @@ -1154,7 +1152,7 @@ uint8_t MbedTester::io_expander_read_index(int index, IOExpanderReg reg_type)
}

int read_success = io_expander_i2c_read(i2c_index, dev_addr, reg, read_byte, 1);
// MBED_ASSERT(read_success == 0);
MBED_ASSERT(read_success == 0);
uint8_t bit = (read_byte[0] & (1 << reg_bit)) >> reg_bit;
return bit;
}
Expand Down Expand Up @@ -1489,7 +1487,7 @@ uint8_t MbedTester::io_expander_read_bb(PinName pin, IOExpanderReg reg_type)
}

int read_success = io_expander_i2c_read_bb(sda, scl, dev_addr, reg, read_byte, 1);
// MBED_ASSERT(read_success == 0);
MBED_ASSERT(read_success == 0);
uint8_t bit = (read_byte[0] & (1 << reg_bit)) >> reg_bit;
return bit;
}
Expand Down
7 changes: 7 additions & 0 deletions components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ void find_ports(std::list<PortType> &matched_ports, std::list<PortType> &not_mat
FormFactorType::pin_to_string(port.pins[i]), port.pins[i]);
continue;
}
if (pinmap_list_has_peripheral(pinmap_restricted_peripherals(), port.peripheral)) {
utest_printf("Skipping %s peripheral %i with pin %s (%i)\r\n", pin_type,
port.peripheral, FormFactorType::pin_to_string(port.pins[i]), port.pins[i]);
continue;
}
// skipp pin searching if single pin port type
if (PortType::pin_count > 1) {
find_port_pins<PortType, FormFactorType>(port);
Expand Down Expand Up @@ -511,6 +516,7 @@ typedef Port<1, AnalogoutMaps, DefaultFormFactor, TF1> AnalogoutPort;
#endif

#if DEVICE_SERIAL
#if DEVICE_SERIAL_FC
struct UARTMaps {
static const PinMap *maps[];
static const char *const pin_type_names[];
Expand All @@ -520,6 +526,7 @@ const PinMap *UARTMaps::maps[] = { serial_tx_pinmap(), serial_rx_pinmap(), seria
const char *const UARTMaps::pin_type_names[] = { "TX", "RX", "CLS", "RTS" };
const char *const UARTMaps::name = "UART";
typedef Port<4, UARTMaps, DefaultFormFactor, TF4> UARTPort;
#endif

struct UARTNoFCMaps {
static const PinMap *maps[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include "bb_ble_api.h"
#include "bb_ble_api_reslist.h"
#include "bb_ble_api_pdufilt.h"
#include "pal_bb_ble.h"
#include "pal_crypto.h"
#include "stack/platform/include/pal_bb_ble.h"
#include "stack/platform/include/pal_crypto.h"
#include "wsf_assert.h"
#include "ll_math.h"
#include "util/bda.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "wsf_msg.h"
#include "wsf_trace.h"
#include "util/bstream.h"
#include "pal_crypto.h"
#include "stack/platform/include/pal_crypto.h"
#include <string.h>

/*************************************************************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "ll_math.h"
#include "wsf_msg.h"
#include "wsf_trace.h"
#include "pal_crypto.h"
#include "stack/platform/include/pal_crypto.h"
#include <string.h>

/*************************************************************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
/*************************************************************************************************/

#include "pal_types.h"
#include "stack/platform/include/pal_types.h"

/**************************************************************************************************
Macros
Expand Down
5 changes: 1 addition & 4 deletions features/cellular/framework/AT/AT_CellularContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,7 @@ void AT_CellularContext::check_and_deactivate_context()
}

if (_new_context_set) {
_at.clear_error();
_at.cmd_start("AT+CGDCONT=");
_at.write_int(_cid);
_at.cmd_stop_read_resp();
delete_current_context();
}

_at.restore_at_timeout();
Expand Down
2 changes: 1 addition & 1 deletion features/mbedtls/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mbedtls-2.18.0-rc3
mbedtls-2.18.1
2 changes: 1 addition & 1 deletion features/mbedtls/importer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#

# Set the mbed TLS release to import (this can/should be edited before import)
MBED_TLS_RELEASE ?= mbedtls-2.18.0-rc3
MBED_TLS_RELEASE ?= mbedtls-2.18.1
MBED_TLS_REPO_URL ?= [email protected]:ARMmbed/mbedtls-restricted.git

# Translate between mbed TLS namespace and mbed namespace
Expand Down
1 change: 1 addition & 0 deletions features/mbedtls/inc/mbedtls/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ int mbedtls_platform_set_snprintf( int (*snprintf_func)( char * s, size_t n,
* the destination buffer is too short.
*/
#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_VSNPRINTF)
#include <stdarg.h>
/* For Older Windows (inc. MSYS2), we provide our own fixed implementation */
int mbedtls_platform_win32_vsnprintf( char *s, size_t n, const char *fmt, va_list arg );
#endif
Expand Down
8 changes: 4 additions & 4 deletions features/mbedtls/inc/mbedtls/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
* Major, Minor, Patchlevel
*/
#define MBEDTLS_VERSION_MAJOR 2
#define MBEDTLS_VERSION_MINOR 17
#define MBEDTLS_VERSION_MINOR 18
#define MBEDTLS_VERSION_PATCH 0

/**
* The single version number has the following structure:
* MMNNPP00
* Major version | Minor version | Patch version
*/
#define MBEDTLS_VERSION_NUMBER 0x02110000
#define MBEDTLS_VERSION_STRING "2.17.0"
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.17.0"
#define MBEDTLS_VERSION_NUMBER 0x02120000
#define MBEDTLS_VERSION_STRING "2.18.0"
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.18.0"

#if defined(MBEDTLS_VERSION_C)

Expand Down
2 changes: 1 addition & 1 deletion features/mbedtls/mbed-crypto/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mbedcrypto-1.1.0d2
mbedcrypto-1.1.1
2 changes: 1 addition & 1 deletion features/mbedtls/mbed-crypto/importer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# Set the Mbed Crypto release to import (this can/should be edited before
# import)
CRYPTO_RELEASE ?= mbedcrypto-1.1.0d2
CRYPTO_RELEASE ?= mbedcrypto-1.1.1
CRYPTO_REPO_URL ?= [email protected]:ARMmbed/mbed-crypto.git

# Translate between Mbed Crypto namespace and Mbed OS namespace
Expand Down
2 changes: 2 additions & 0 deletions features/mbedtls/mbed-crypto/src/ecp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2004,8 +2004,10 @@ static unsigned char ecp_pick_window_size( const mbedtls_ecp_group *grp,
* Make sure w is within bounds.
* (The last test is useful only for very small curves in the test suite.)
*/
#if( MBEDTLS_ECP_WINDOW_SIZE < 6 )
if( w > MBEDTLS_ECP_WINDOW_SIZE )
w = MBEDTLS_ECP_WINDOW_SIZE;
#endif
if( w >= grp->nbits )
w = 2;

Expand Down
Loading

0 comments on commit b81aeff

Please sign in to comment.