From 2cfea4fabafdeab73c9a6194116037d04b337bd8 Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Wed, 21 Aug 2019 12:39:24 +0100 Subject: [PATCH 1/9] target TT_: fix compilation errors They define slave for spi, rtc but do not contain implementation - removing them. Fixes #11143 --- targets/targets.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/targets/targets.json b/targets/targets.json index 78e4170cb4..1ddc55a93d 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -8860,15 +8860,11 @@ "PORTINOUT", "PORTOUT", "PWMOUT", - "RTC", "SERIAL", "SLEEP", "SPI", - "SPISLAVE", - "SPI_ASYNCH", "I2C", "I2CSLAVE", - "I2C_ASYNCH", "STDIO_MESSAGES", "MPU" ], From 4d5bf75ae699861d511786ee8910a6aa6011a708 Mon Sep 17 00:00:00 2001 From: Marcelo Salazar Date: Fri, 23 Aug 2019 11:11:56 +0100 Subject: [PATCH 2/9] Fix ELMO_F411RE detect code --- targets/targets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/targets.json b/targets/targets.json index 1ddc55a93d..651aa07149 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -2824,7 +2824,7 @@ "default_toolchain": "uARM", "extra_labels_add": ["STM32F4", "STM32F411xE", "STM32F411RE"], "supported_toolchains": ["ARM", "uARM", "GCC_ARM"], - "detect_code": ["----"], + "detect_code": ["0410"], "device_has_add": ["MPU"], "device_has_remove": ["SERIAL_FC"], "default_lib": "small", From 695e930f09ccc38234db21bce068e746907829b2 Mon Sep 17 00:00:00 2001 From: Mahesh Mahadevan Date: Fri, 23 Aug 2019 14:42:34 -0500 Subject: [PATCH 3/9] KL43Z: Enable USBDevice Signed-off-by: Mahesh Mahadevan --- targets/targets.json | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/targets.json b/targets/targets.json index 651aa07149..61a3735217 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -1314,6 +1314,7 @@ "SPI", "SPISLAVE", "STDIO_MESSAGES", + "USBDEVICE", "FLASH" ], "release_versions": ["2", "5"], From 4a0ca21edd1ad33f02e3b953e515e9f39146e745 Mon Sep 17 00:00:00 2001 From: Qinghao Shi Date: Sat, 24 Aug 2019 00:39:41 +0100 Subject: [PATCH 4/9] BLE TEST: remove duplicated and failing test --- .../TESTS/cordio_hci/transport/main.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp index 67067b83fb..4492aee531 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp @@ -225,23 +225,6 @@ static uint8_t reset_cmd[] = { 0 // parameter length }; -void test_reset_command() -{ - CordioHCIDriver &driver = CordioHCIHook::get_driver(); - CordioHCITransportDriver &transport_driver = CordioHCIHook::get_transport_driver(); - - driver.initialize(); - - CordioHCIHook::set_data_received_handler(hci_driver_rx_reset_handler); - - transport_driver.write(HCI_CMD_TYPE, sizeof(reset_cmd), reset_cmd); - uint32_t events = wait_for_event(); - - TEST_ASSERT_EQUAL(RESET_RECEIVED_FLAG, events); - - driver.terminate(); -} - #define EXPECTED_CONSECUTIVE_RESET 10 void test_multiple_reset_command() @@ -266,7 +249,6 @@ void test_multiple_reset_command() } Case cases[] = { - Case("Test reset command", test_reset_command), Case("Test multiple reset commands", test_multiple_reset_command) }; From 5820a3172ff04ead032cfcaf47c04b94ad00c62a Mon Sep 17 00:00:00 2001 From: Kyle Kearney Date: Fri, 23 Aug 2019 10:58:57 -0700 Subject: [PATCH 5/9] Fix typos in comments --- features/storage/kvstore/conf/kv_config.cpp | 2 +- features/storage/kvstore/tdbstore/TDBStore.cpp | 4 ++-- platform/source/mbed_error.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/storage/kvstore/conf/kv_config.cpp b/features/storage/kvstore/conf/kv_config.cpp index a69ca94a7d..e476f2de4a 100644 --- a/features/storage/kvstore/conf/kv_config.cpp +++ b/features/storage/kvstore/conf/kv_config.cpp @@ -388,7 +388,7 @@ BlockDevice *_get_blockdevice_FLASHIAP(bd_addr_t start_address, bd_size_t size) } if (size == 0) { - //The block device will have all space form start address to the end of the flash + //The block device will have all space from start address to the end of the flash size = (flash_end_address - start_address); static FlashIAPBlockDevice bd(start_address, size); diff --git a/features/storage/kvstore/tdbstore/TDBStore.cpp b/features/storage/kvstore/tdbstore/TDBStore.cpp index eda5867e20..5b04d553bd 100644 --- a/features/storage/kvstore/tdbstore/TDBStore.cpp +++ b/features/storage/kvstore/tdbstore/TDBStore.cpp @@ -614,7 +614,7 @@ int TDBStore::set_finalize(set_handle_t handle) goto end; } - // Writes may fail without returning a failure (specially in flash components). Reread the record + // Writes may fail without returning a failure (especially in flash components). Reread the record // to ensure write success (this won't read the data anywhere - just use the CRC calculation). ret = read_record(_active_area, ih->bd_base_offset, 0, 0, (uint32_t) -1, actual_data_size, 0, false, false, false, false, @@ -1061,7 +1061,7 @@ int TDBStore::init() // (this will do nothing if already erased) if (ret == MBED_ERROR_INVALID_DATA_DETECTED) { if (check_erase_before_write(area, _master_record_offset, _master_record_size, true)) { - MBED_ERROR(MBED_ERROR_READ_FAILED, "TDBSTORE: Unable reset area at init"); + MBED_ERROR(MBED_ERROR_READ_FAILED, "TDBSTORE: Unable to reset area at init"); } area_state[area] = TDBSTORE_AREA_STATE_EMPTY; continue; diff --git a/platform/source/mbed_error.c b/platform/source/mbed_error.c index 3ffc22f5b1..8e9b81c6de 100644 --- a/platform/source/mbed_error.c +++ b/platform/source/mbed_error.c @@ -139,8 +139,8 @@ static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsign //Error status should always be < 0 if (error_status >= 0) { - //This is a weird situation, someone called mbed_error with invalid error code. - //We will still handle the situation but change the error code to ERROR_INVALID_ARGUMENT, atleast the context will have info on who called it + //This is a weird situation, someone called mbed_error with an invalid error code. + //We will still handle the situation but change the error code to ERROR_INVALID_ARGUMENT, at least the context will have info on who called it error_status = MBED_ERROR_INVALID_ARGUMENT; } From 83aa8b038b8a2c69799b799fec7cc0afd497fffd Mon Sep 17 00:00:00 2001 From: Tymoteusz Bloch Date: Mon, 26 Aug 2019 16:47:05 +0200 Subject: [PATCH 6/9] Supressed coverity warnings for intentional NULL passing to ip_reass_dequeue_datagram --- features/lwipstack/lwip/src/core/ipv4/lwip_ip4_frag.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/features/lwipstack/lwip/src/core/ipv4/lwip_ip4_frag.c b/features/lwipstack/lwip/src/core/ipv4/lwip_ip4_frag.c index b56ac23df1..47bbd2b723 100644 --- a/features/lwipstack/lwip/src/core/ipv4/lwip_ip4_frag.c +++ b/features/lwipstack/lwip/src/core/ipv4/lwip_ip4_frag.c @@ -206,9 +206,8 @@ ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *p pbuf_free(pcur); } /* Then, unchain the struct ip_reassdata from the list and free it. */ - if (prev != NULL) { - ip_reass_dequeue_datagram(ipr, prev); - } + /* coverity [FORWARD_NULL]*/ + ip_reass_dequeue_datagram(ipr, prev); LWIP_ASSERT("ip_reass_pbufcount >= pbufs_freed", ip_reass_pbufcount >= pbufs_freed); ip_reass_pbufcount = (u16_t)(ip_reass_pbufcount - pbufs_freed); @@ -662,9 +661,8 @@ ip4_reass(struct pbuf *p) } /* release the sources allocate for the fragment queue entry */ - if (ipr_prev != NULL) { - ip_reass_dequeue_datagram(ipr, ipr_prev); - } + /* coverity [FORWARD_NULL]*/ + ip_reass_dequeue_datagram(ipr, ipr_prev); /* and adjust the number of pbufs currently queued for reassembly. */ clen = pbuf_clen(p); LWIP_ASSERT("ip_reass_pbufcount >= clen", ip_reass_pbufcount >= clen); From 782734cae2aef839d084d5a15597d778804a0a2d Mon Sep 17 00:00:00 2001 From: Vairamuthu Ramasamy <11942020+VairaRamasamy@users.noreply.github.com> Date: Tue, 27 Aug 2019 11:25:12 +0530 Subject: [PATCH 7/9] Added MBED_CONF_ prefix to QSPI pins, GitHub issue# 10060 --- features/storage/kvstore/conf/kv_config.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/features/storage/kvstore/conf/kv_config.cpp b/features/storage/kvstore/conf/kv_config.cpp index e476f2de4a..303545db03 100644 --- a/features/storage/kvstore/conf/kv_config.cpp +++ b/features/storage/kvstore/conf/kv_config.cpp @@ -486,12 +486,12 @@ BlockDevice *_get_blockdevice_QSPIF(bd_addr_t start_address, bd_size_t size) bd_addr_t aligned_start_address; static QSPIFBlockDevice bd( - QSPI_FLASH1_IO0, - QSPI_FLASH1_IO1, - QSPI_FLASH1_IO2, - QSPI_FLASH1_IO3, - QSPI_FLASH1_SCK, - QSPI_FLASH1_CSN, + MBED_CONF_QSPIF_QSPI_IO0, + MBED_CONF_QSPIF_QSPI_IO1, + MBED_CONF_QSPIF_QSPI_IO2, + MBED_CONF_QSPIF_QSPI_IO3, + MBED_CONF_QSPIF_QSPI_SCK, + MBED_CONF_QSPIF_QSPI_CSN, QSPIF_POLARITY_MODE_0, MBED_CONF_QSPIF_QSPI_FREQ ); From 2aac56f79ac0f810cd9b2dbac4bf8a52b91edd6f Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Tue, 27 Aug 2019 09:21:24 +0300 Subject: [PATCH 8/9] NetworkInterface set_blocking() doxygen corrected --- features/netsocket/NetworkInterface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/netsocket/NetworkInterface.h b/features/netsocket/NetworkInterface.h index 117ea14cd2..40724a9d74 100644 --- a/features/netsocket/NetworkInterface.h +++ b/features/netsocket/NetworkInterface.h @@ -308,7 +308,7 @@ public: * By default, interfaces are in synchronous mode which means that * connect() or disconnect() blocks until it reach the target state or requested operation fails. * - * @param blocking Use true to set NetworkInterface in asynchronous mode. + * @param blocking Use false to set NetworkInterface in asynchronous mode. * @return NSAPI_ERROR_OK on success * @return NSAPI_ERROR_UNSUPPORTED if driver does not support asynchronous mode. * @return negative error code on failure. From 7063ccee9eddd852e89a7b14e72cde07f9ba66d9 Mon Sep 17 00:00:00 2001 From: Leon Lindenfelser Date: Tue, 27 Aug 2019 09:26:37 -0500 Subject: [PATCH 9/9] Add PA6 to ADC PeripheralPins for MTS_DRAGONFLY_L471QG --- .../TARGET_STM32L4/TARGET_MTS_DRAGONFLY_L471QG/PeripheralPins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_MTS_DRAGONFLY_L471QG/PeripheralPins.c b/targets/TARGET_STM/TARGET_STM32L4/TARGET_MTS_DRAGONFLY_L471QG/PeripheralPins.c index d27086691c..c7454b67b4 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_MTS_DRAGONFLY_L471QG/PeripheralPins.c +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_MTS_DRAGONFLY_L471QG/PeripheralPins.c @@ -44,6 +44,7 @@ MBED_WEAK const PinMap PinMap_ADC[] = { {PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 6, 0)}, // IN6 - ARDUINO D6 {PA_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 7, 0)}, // IN7 // PA_2 is used as SERIAL_TX {PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 8, 0)}, // IN8 // PA_3 is used as SERIAL_RX + {PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 11, 0)}, // IN11 {PA_7, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 12, 0)}, // IN12 {PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 15, 0)}, // IN15 - ARDUINO D8 {PC_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 1, 0)}, // IN1