Skip to content

Release candidate for mbed-os-5.2-rc4 #3080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Oct 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7f74678
Fixed the emac_interface_t struct so that the struct constructor is n…
Oct 17, 2016
d078e94
Removed k64f defines from templates
sarahmarshy Oct 17, 2016
5c610e2
Increase serial init timeout value
jeromecoutant Oct 10, 2016
12db6be
Waiting before call to deepsleep to allow buffers to flush
bridadan Oct 13, 2016
e0e1803
add ncs36510 exporter support
Oct 14, 2016
3ab3236
add macros for NCS36510 IAR IDE building
Oct 14, 2016
9368766
CFSTORE - Fix crashed due to uninit data
c1728p9 Oct 16, 2016
5a5dbc2
CFSTORE - fix handling of realloc fail on delete
c1728p9 Oct 16, 2016
a37ccd1
CFSTORE - Delete handle even if key ref non zero
c1728p9 Oct 17, 2016
87e1b37
CFSTORE - Fix test failures due to fragmentation
c1728p9 Oct 17, 2016
97265af
Update feature/mbedtls to version 2.4.0
Oct 17, 2016
2794b48
Corrected lwip TCP socket accept ipv6 address conversion
Oct 17, 2016
6d05f1d
Exporters - Name the eclipse exporters
theotherjimmy Oct 17, 2016
5c35230
Remove unneeded relpath calculations
theotherjimmy Oct 17, 2016
6871321
Add cmsis.h inclusion
toyowata Oct 18, 2016
92ccc05
Fix pull over write to all families
LMESTM Oct 14, 2016
9534fae
Fix pull overwrite
LMESTM Oct 17, 2016
a4e763d
Add quick print to the makefile when srec_cat is required
theotherjimmy Oct 18, 2016
550c170
NUCLEO_F429 - Increase IAR heap size
c1728p9 Oct 18, 2016
7d56590
Fix traceback from incorrect use of core
theotherjimmy Oct 18, 2016
cd1d9cc
Update the IAR debug template"
theotherjimmy Oct 18, 2016
c23146b
ONME-2822 Binary build script mod
Oct 14, 2016
bb55470
check in a copy of the arm-pack-manager index and use it
theotherjimmy Oct 18, 2016
aef71ce
Add update command to project.py
theotherjimmy Oct 18, 2016
457aef7
Remove dependency on XDG home spec
theotherjimmy Oct 19, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions TESTS/mbed_drivers/lp_timeout/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,18 @@ void lp_timeout_1s_deepsleep(void)
{
complete = false;

/*
* We use here lp_ticker_read() instead of us_ticker_read() for start and
/*
* Since deepsleep() may shut down the UART peripheral, we wait for 10ms
* to allow for hardware serial buffers to completely flush.
* This should be replaced with a better function that checks if the
* hardware buffers are empty. However, such an API does not exist now,
* so we'll use the wait_ms() function for now.
*/
wait_ms(10);

/*
* We use here lp_ticker_read() instead of us_ticker_read() for start and
* end because the microseconds timer might be disable during deepsleep.
*/
timestamp_t start = lp_ticker_read();
Expand Down
14 changes: 12 additions & 2 deletions TESTS/mbed_hal/lp_ticker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,22 @@ void lp_ticker_1s_deepsleep()
complete = false;
uint32_t delay_ts;

/*
* Since deepsleep() may shut down the UART peripheral, we wait for 10ms
* to allow for hardware serial buffers to completely flush.
* This should be replaced with a better function that checks if the
* hardware buffers are empty. However, such an API does not exist now,
* so we'll use the wait_ms() function for now.
*/
wait_ms(10);

ticker_set_handler(lp_ticker_data, cb_done);
ticker_remove_event(lp_ticker_data, &delay_event);
delay_ts = lp_ticker_read() + 1000000;

/*
* We use here lp_ticker_read() instead of us_ticker_read() for start and
/*
* We use here lp_ticker_read() instead of us_ticker_read() for start and
* end because the microseconds timer might be disable during deepsleep.
*/
timestamp_t start = lp_ticker_read();
Expand Down
5 changes: 3 additions & 2 deletions features/FEATURE_LWIP/lwip-interface/lwip_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,9 @@ static int mbed_lwip_socket_accept(nsapi_stack_t *stack, nsapi_socket_t server,
netconn_set_recvtimeout(ns->conn, 1);
*(struct lwip_socket **)handle = ns;

(void) netconn_peer(ns->conn, (ip_addr_t *)addr->bytes, port);
addr->version = NSAPI_IPv4;
ip_addr_t peer_addr;
(void) netconn_peer(ns->conn, &peer_addr, port);
convert_lwip_addr_to_mbed(addr, &peer_addr);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion features/mbedtls/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8e004104020dd4328434e8a207245b0327bbb9b1
mbedtls-2.4.0
4 changes: 2 additions & 2 deletions features/mbedtls/importer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
#

# Set the mbed TLS release to import (this can/should be edited before import)
MBED_TLS_RELEASE ?= a592dcc1c6277bb191269e709cdd3d5593e593ed
MBED_TLS_RELEASE ?= mbedtls-2.4.0

# Translate between mbed TLS namespace and mbed namespace
TARGET_PREFIX:=../
TARGET_SRC:=$(TARGET_PREFIX)src
TARGET_INC:=$(TARGET_PREFIX)inc

# mbed TLS source directory - hidden from mbed via TARGET_IGNORE
MBED_TLS_URL:=https://github.com/ARMmbed/mbedtls.git
MBED_TLS_URL:=https://github.com/ARMmbed/mbedtls-restricted.git
MBED_TLS_DIR:=TARGET_IGNORE/mbedtls
MBED_TLS_API:=$(MBED_TLS_DIR)/include/mbedtls
MBED_TLS_GIT_CFG=$(MBED_TLS_DIR)/.git/config
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 @@ -38,17 +38,17 @@
* Major, Minor, Patchlevel
*/
#define MBEDTLS_VERSION_MAJOR 2
#define MBEDTLS_VERSION_MINOR 3
#define MBEDTLS_VERSION_MINOR 4
#define MBEDTLS_VERSION_PATCH 0

/**
* The single version number has the following structure:
* MMNNPP00
* Major version | Minor version | Patch version
*/
#define MBEDTLS_VERSION_NUMBER 0x02030000
#define MBEDTLS_VERSION_STRING "2.3.0"
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.3.0"
#define MBEDTLS_VERSION_NUMBER 0x02040000
#define MBEDTLS_VERSION_STRING "2.4.0"
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.4.0"

#if defined(MBEDTLS_VERSION_C)

Expand Down
19 changes: 16 additions & 3 deletions features/nanostack/FEATURE_NANOSTACK/clone_nanostack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ clean() {
rm -rf $dir
done
clean_nanostack_binaries
clean_nanostack_licenses
}

clone() {
Expand All @@ -80,12 +81,23 @@ export_repos() {
}

copy_nanostack_binaries() {
mkdir -p ../nanostack-binaries
mv sal-stack-nanostack/FEATURE_* ../nanostack-binaries/
mv sal-stack-nanostack/FEATURE_* ../
}

clean_nanostack_binaries() {
rm -rf ../nanostack-binaries
for binaries in ../FEATURE_*; do
if [ "$binaries" != "../FEATURE_NANOSTACK" ]; then
rm -rf $binaries
fi
done
}

copy_nanostack_licenses() {
mv sal-stack-nanostack/LICENSE* ../
}

clean_nanostack_licenses() {
rm -rf ../LICENSE*
}

case "${1-}" in
Expand All @@ -99,6 +111,7 @@ case "${1-}" in
export)
export_repos
copy_nanostack_binaries
copy_nanostack_licenses
;;
*)
print_usage
Expand Down
29 changes: 14 additions & 15 deletions features/storage/FEATURE_STORAGE/TESTS/cfstore/create/create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#include "mbed.h"
#include "mbed_stats.h"
#include "cfstore_config.h"
#include "cfstore_debug.h"
#include "cfstore_test.h"
Expand Down Expand Up @@ -507,11 +508,10 @@ control_t cfstore_create_test_04_end(const size_t call_count)
*
* Create enough KV's to consume the whole of available memory
*/
int32_t cfstore_create_test_05_core(const size_t call_count, uint32_t* bytes_stored_ex)
int32_t cfstore_create_test_05_core(const size_t call_count)
{
int32_t ret = ARM_DRIVER_ERROR;
uint32_t i = 0;
uint32_t bytes_stored = 0;
const uint32_t max_num_kvs_create = 200;
const size_t kv_name_tag_len = 3;
const size_t kv_name_min_len = 10;
Expand All @@ -535,9 +535,6 @@ int32_t cfstore_create_test_05_core(const size_t call_count, uint32_t* bytes_sto
memset(value_buf, 0, max_value_buf_size);
snprintf(kv_name_tag_buf, kv_name_tag_len+1, "%0d", (int) i);
ret = cfstore_create_kv_create(kv_name_min_len, kv_name_tag_buf, value_buf, kv_value_min_len/64 * (i+1));
bytes_stored += kv_name_min_len + i + strlen(kv_name_tag_buf); /* kv_name */
bytes_stored += kv_value_min_len/64 * (i+1); /* kv value blob */
bytes_stored += 8; /* kv overhead */
if(ret == ARM_CFSTORE_DRIVER_ERROR_OUT_OF_MEMORY){
CFSTORE_ERRLOG("Out of memory on %d-th KV, trying to allocate memory totalling %d.\n", (int) i, (int) bytes_stored);
break;
Expand All @@ -551,9 +548,6 @@ int32_t cfstore_create_test_05_core(const size_t call_count, uint32_t* bytes_sto
free(value_buf);
CFSTORE_TEST_UTEST_MESSAGE(cfstore_create_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: Uninitialize() call failed.\n", __func__);
TEST_ASSERT_MESSAGE(drv->Uninitialize() >= ARM_DRIVER_OK, cfstore_create_utest_msg_g);
if(bytes_stored_ex){
*bytes_stored_ex = bytes_stored;
}
return ret;
}

Expand All @@ -576,22 +570,25 @@ control_t cfstore_create_test_05(const size_t call_count)
{
uint32_t i = 0;
int32_t ret = ARM_DRIVER_ERROR;
uint32_t bytes_stored = 0;
uint32_t bytes_stored_prev = 0;
const uint32_t max_loops = 50;
mbed_stats_heap_t stats_before;
mbed_stats_heap_t stats_after;

mbed_stats_heap_get(&stats_before);

CFSTORE_FENTRYLOG("%s:entered\n", __func__);
for(i = 0; i < max_loops; i++) {
ret = cfstore_create_test_05_core(call_count, &bytes_stored);
ret = cfstore_create_test_05_core(call_count);
CFSTORE_TEST_UTEST_MESSAGE(cfstore_create_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: cfstore_create_test_05_core() failed (ret = %d.\n", __func__, (int) ret);
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_create_utest_msg_g);

mbed_stats_heap_get(&stats_after);
if(i > 1) {
CFSTORE_TEST_UTEST_MESSAGE(cfstore_create_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: memory leak: stored %d bytes on loop %d, but %d bytes on loop %d .\n", __func__, (int) bytes_stored, (int) i, (int) bytes_stored_prev, (int) i-1);
TEST_ASSERT_MESSAGE(bytes_stored == bytes_stored_prev, cfstore_create_utest_msg_g);

CFSTORE_TEST_UTEST_MESSAGE(cfstore_create_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: memory leak: stored %d bytes on loop %d, but %d bytes on loop %d .\n", __func__, (int) stats_after.current_size, (int) i, (int) stats_before.current_size, (int) i-1);
TEST_ASSERT_MESSAGE(stats_after.current_size == stats_before.current_size, cfstore_create_utest_msg_g);
TEST_ASSERT(stats_after.alloc_fail_cnt > stats_before.alloc_fail_cnt);
}
bytes_stored_prev = bytes_stored;
stats_before = stats_after;
}
return CaseNext;
}
Expand Down Expand Up @@ -828,7 +825,9 @@ Case cases[] = {
Case("CREATE_test_03_end", cfstore_create_test_03_end),
Case("CREATE_test_04_start", cfstore_utest_default_start),
Case("CREATE_test_04_end", cfstore_create_test_04_end),
#if defined(MBED_HEAP_STATS_ENABLED) && MBED_HEAP_STATS_ENABLED && !defined(__ICCARM__)
Case("CREATE_test_05", cfstore_create_test_05),
#endif
Case("CREATE_test_06_start", cfstore_utest_default_start),
Case("CREATE_test_06_end", cfstore_create_test_06_end),
Case("CREATE_test_07_start", cfstore_utest_default_start),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,7 @@ static int32_t cfstore_get_next_hkvt(cfstore_area_hkvt_t* prev, cfstore_area_hkv

CFSTORE_ASSERT(prev != NULL);
CFSTORE_ASSERT(next != NULL);
CFSTORE_ASSERT(prev->tail <= ctx->area_0_tail);

if(prev->tail == ctx->area_0_tail){
CFSTORE_TP(CFSTORE_TP_VERBOSE1, "%s:reached the end of the list. return NULL entry\n", __func__);
Expand Down Expand Up @@ -1433,6 +1434,14 @@ static int32_t cfstore_realloc_ex(ARM_CFSTORE_SIZE size, uint64_t *allocated_siz
}

ptr = (uint8_t*) CFSTORE_REALLOC((void*) ctx->area_0_head, size);
if (ptr == NULL) {
if (total_kv_size <= ctx->area_0_len) {
/* Size is shrinking so a realloc failure is recoverable.
* Update ptr so it matches the previous head.
*/
ptr = ctx->area_0_head;
}
}
if(ptr == NULL){
CFSTORE_ERRLOG("%s:Error: unable to allocate memory (size=%d)\n", __func__, (int) size);
/* realloc() has failed to allocate the required memory object. If previously
Expand Down Expand Up @@ -2449,11 +2458,11 @@ static int32_t cfstore_file_destroy(cfstore_file_t* file)
if(cfstore_hkvt_get_flags_delete(&hkvt)){
ret = cfstore_delete_ex(&hkvt);
}
/* reset client buffer to empty ready for reuse */
/* delete the file even if not deleting the KV*/
cfstore_listDel(&file->node);
memset(file, 0, sizeof(cfstore_file_t));
}
/* reset client buffer to empty ready for reuse */
/* delete the file even if not deleting the KV*/
cfstore_listDel(&file->node);
memset(file, 0, sizeof(cfstore_file_t));
}
return ret;
}
Expand Down Expand Up @@ -4045,6 +4054,7 @@ static int32_t cfstore_uninitialise(void)
CFSTORE_FREE(ctx->area_0_head);
ctx->area_0_head = NULL;
ctx->area_0_tail = NULL;
ctx->area_0_len = 0;
}
}
out:
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ requests
mbed-ls>=0.2.13
mbed-host-tests>=1.1.2
mbed-greentea>=0.2.24
pyxdg>=0.25
pycurl>=4
beautifulsoup4>=4
fuzzywuzzy>=0.11
6 changes: 3 additions & 3 deletions targets/TARGET_ONSEMI/TARGET_NCS36510/swversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
* $Rev: 2199 $
* $Date: 2013-08-07 12:17:27 +0200 (Wed, 07 Aug 2013) $
******************************************************************************
* Copyright 2016 Semiconductor Components Industries LLC (d/b/a ON Semiconductor).
* Copyright 2016 Semiconductor Components Industries LLC (d/b/a "ON Semiconductor").
* All rights reserved. This software and/or documentation is licensed by ON Semiconductor
* under limited terms and conditions. The terms and conditions pertaining to the software
* and/or documentation are available at http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf
* (ON Semiconductor Standard Terms and Conditions of Sale, Section 8 Software) and
* ("ON Semiconductor Standard Terms and Conditions of Sale, Section 8 Software") and
* if applicable the software license agreement. Do not use this software and/or
* documentation unless you have carefully read and you agree to the limited terms and
* conditions. By using this software and/or documentation, you agree to the limited
Expand All @@ -37,7 +37,7 @@
* *
*************************************************************************************************/

#ifdef IAR
#ifdef __ICCARM__
/** Define a fib table constant region, to be located at fixed offset in the binary
* such that flash loader knows where to find it and gets the build dependent data
* it needs for programming the new fib.
Expand Down
2 changes: 2 additions & 0 deletions targets/TARGET_RENESAS/TARGET_RZ_A1H/device/cmsis_nvic.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef MBED_CMSIS_NVIC_H
#define MBED_CMSIS_NVIC_H

#include "cmsis.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
2 changes: 2 additions & 0 deletions targets/TARGET_RENESAS/TARGET_VK_RZ_A1H/device/cmsis_nvic.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef MBED_CMSIS_NVIC_H
#define MBED_CMSIS_NVIC_H

#include "cmsis.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
7 changes: 4 additions & 3 deletions targets/TARGET_STM/TARGET_STM32F0/gpio_irq_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ static void gpio_irq2(void) {
}

extern uint32_t Set_GPIO_Clock(uint32_t port_idx);
extern void pin_function_gpiomode(PinName pin, uint32_t gpiomode);

int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id) {
IRQn_Type irq_n = (IRQn_Type)0;
Expand Down Expand Up @@ -196,8 +197,8 @@ void gpio_irq_free(gpio_irq_t *obj) {
gpio_channel->channel_gpio[gpio_idx] = 0;
gpio_channel->channel_pin[gpio_idx] = 0;

// Disable EXTI line
pin_function(obj->pin, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0));
// Disable EXTI line, but don't change pull-up config
pin_function_gpiomode(obj->pin, STM_MODE_INPUT);
obj->event = EDGE_NONE;
}

Expand Down Expand Up @@ -245,7 +246,7 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable) {
}
}

pin_function(obj->pin, STM_PIN_DATA(mode, pull, 0));
pin_function_gpiomode(obj->pin, mode);
}

void gpio_irq_enable(gpio_irq_t *obj) {
Expand Down
15 changes: 15 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F0/pinmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,20 @@ void pin_mode(PinName pin, PinMode mode) {
if (pupd > 2) pupd = 0; // Open-drain = No pull-up/No pull-down
gpio->PUPDR &= (uint32_t)(~(GPIO_PUPDR_PUPDR0 << (pin_index * 2)));
gpio->PUPDR |= (uint32_t)(pupd << (pin_index * 2));
}

/* Internal function for setting the gpiomode/function
* without changing Pull mode
*/
void pin_function_gpiomode(PinName pin, uint32_t gpiomode) {

/* Read current pull state from HW to avoid over-write*/
uint32_t port_index = STM_PORT(pin);
uint32_t pin_index = STM_PIN(pin);
GPIO_TypeDef *gpio = (GPIO_TypeDef *) Set_GPIO_Clock(port_index);
uint32_t temp = gpio->PUPDR;
uint32_t pull = (temp >> (pin_index * 2U)) & GPIO_PUPDR_PUPDR0;

/* Then re-use global function for updating the mode part*/
pin_function(pin, STM_PIN_DATA(gpiomode, pull, 0));
}
Loading