Skip to content

Commit c966348

Browse files
authored
Merge pull request #9208 from ARMmbed/release-candidate
Release candidate for mbed-os-5.11.1
2 parents 6a0a865 + 3eab2b6 commit c966348

File tree

723 files changed

+55775
-12299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

723 files changed

+55775
-12299
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@
2424
[ ] Test update
2525
[ ] Breaking change
2626

27+
### Reviewers
28+
29+
<!--
30+
Optional
31+
Request additional reviewers with @username
32+
-->
33+

.travis.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright (c) 2013-2018 Arm Limited. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the License); you may
6+
# not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an AS IS BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
language: python
218
python: 2.7
319

@@ -30,8 +46,6 @@ before_install:
3046
# Setup ppa to make sure arm-none-eabi-gcc is correct version
3147
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
3248
- sudo add-apt-repository -y ppa:deadsnakes/ppa
33-
# import the new keys for rabbitmq (fix for https://github.com/ARMmbed/mbed-os/issues/8945)
34-
- curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.deb.sh | sudo bash
3549
# Loop until update succeeds (timeouts can occur)
3650
- travis_retry $(! sudo apt-get update 2>&1 |grep Failed)
3751

@@ -120,7 +134,7 @@ matrix:
120134
- env:
121135
- NAME=astyle
122136
install:
123-
- curl -L0 http://mbed-os.s3-eu-west-1.amazonaws.com/builds/deps/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
137+
- curl -L0 https://mbed-os.s3-eu-west-1.amazonaws.com/builds/deps/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
124138
mkdir -p BUILD && tar xf astyle.tar.gz -C BUILD;
125139
pushd BUILD/astyle/build/gcc;
126140
make;

TESTS/mbed_drivers/flashiap/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ void flashiap_program_test()
5959
// the one before the last sector in the system
6060
uint32_t address = (flash_device.get_flash_start() + flash_device.get_flash_size()) - (sector_size);
6161
TEST_ASSERT_TRUE(address != 0UL);
62-
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_ROM_END, address);
63-
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_ROM_END, "Test skipped. Test region overlaps code.");
62+
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, address);
63+
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
6464

6565
ret = flash_device.erase(address, sector_size);
6666
TEST_ASSERT_EQUAL_INT32(0, ret);
@@ -128,7 +128,7 @@ void flashiap_cross_sector_program_test()
128128
agg_size += sector_size;
129129
address -= sector_size;
130130
}
131-
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_ROM_END, "Test skipped. Test region overlaps code.");
131+
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
132132
ret = flash_device.erase(address, agg_size);
133133
TEST_ASSERT_EQUAL_INT32(0, ret);
134134

@@ -184,7 +184,7 @@ void flashiap_program_error_test()
184184
TEST_ASSERT_TRUE(address != 0UL);
185185

186186
// unaligned address
187-
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_ROM_END, "Test skipped. Test region overlaps code.");
187+
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
188188
ret = flash_device.erase(address + 1, sector_size);
189189
TEST_ASSERT_EQUAL_INT32(-1, ret);
190190
if (flash_device.get_page_size() > 1) {
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2018-2018 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#ifndef MBED_QSPI_FLASH_MX25L51245G_H
17+
#define MBED_QSPI_FLASH_MX25L51245G_H
18+
19+
20+
#define QSPI_FLASH_CHIP_STRING "macronix MX25L51245G"
21+
22+
// Command for reading status register
23+
#define QSPI_CMD_RDSR 0x05
24+
// Command for reading configuration register
25+
#define QSPI_CMD_RDCR0 0x15
26+
// Command for writing status/configuration register
27+
#define QSPI_CMD_WRSR 0x01
28+
// Command for reading security register
29+
#define QSPI_CMD_RDSCUR 0x2B
30+
31+
// Command for setting Reset Enable
32+
#define QSPI_CMD_RSTEN 0x66
33+
// Command for setting Reset
34+
#define QSPI_CMD_RST 0x99
35+
36+
// Command for setting write enable
37+
#define QSPI_CMD_WREN 0x06
38+
// Command for setting write disable
39+
#define QSPI_CMD_WRDI 0x04
40+
41+
// WRSR operations max time [us] (datasheet max time + 15%)
42+
#define QSPI_WRSR_MAX_TIME 34500 // 30ms
43+
// general wait max time [us]
44+
#define QSPI_WAIT_MAX_TIME 100000 // 100ms
45+
46+
47+
// Commands for writing (page programming)
48+
#define QSPI_CMD_WRITE_1IO 0x02 // 1-1-1 mode
49+
#define QSPI_CMD_WRITE_4IO 0x38 // 1-4-4 mode
50+
51+
// write operations max time [us] (datasheet max time + 15%)
52+
#define QSPI_PAGE_PROG_MAX_TIME 11500 // 10ms
53+
54+
#define QSPI_PAGE_SIZE 256 // 256B
55+
#define QSPI_SECTOR_SIZE 4096 // 4kB
56+
#define QSPI_SECTOR_COUNT 2048 //
57+
58+
// Commands for reading
59+
#define QSPI_CMD_READ_1IO_FAST 0x0B // 1-1-1 mode
60+
#define QSPI_CMD_READ_1IO 0x03 // 1-1-1 mode
61+
#define QSPI_CMD_READ_2IO 0xBB // 1-2-2 mode
62+
#define QSPI_CMD_READ_1I2O 0x3B // 1-1-2 mode
63+
#define QSPI_CMD_READ_4IO 0xEB // 1-4-4 mode
64+
#define QSPI_CMD_READ_1I4O 0x6B // 1-1-4 mode
65+
66+
#define QSPI_READ_1IO_DUMMY_CYCLE 0
67+
#define QSPI_READ_FAST_DUMMY_CYCLE 8
68+
#define QSPI_READ_2IO_DUMMY_CYCLE 4
69+
#define QSPI_READ_1I2O_DUMMY_CYCLE 8
70+
#define QSPI_READ_4IO_DUMMY_CYCLE 6
71+
#define QSPI_READ_1I4O_DUMMY_CYCLE 8
72+
73+
// Commands for erasing
74+
#define QSPI_CMD_ERASE_SECTOR 0x20 // 4kB
75+
#define QSPI_CMD_ERASE_BLOCK_32 0x52 // 32kB
76+
#define QSPI_CMD_ERASE_BLOCK_64 0xD8 // 64kB
77+
#define QSPI_CMD_ERASE_CHIP 0x60 // or 0xC7
78+
79+
// erase operations max time [us] (datasheet max time + 15%)
80+
#define QSPI_ERASE_SECTOR_MAX_TIME 480000 // 400 ms
81+
#define QSPI_ERASE_BLOCK_32_MAX_TIME 1200000 // 1s
82+
#define QSPI_ERASE_BLOCK_64_MAX_TIME 2400000 // 2s
83+
84+
// max frequency for basic rw operation (for fast mode)
85+
#define QSPI_COMMON_MAX_FREQUENCY 32000000
86+
87+
#define QSPI_STATUS_REG_SIZE 1
88+
#define QSPI_CONFIG_REG_0_SIZE 2
89+
#define QSPI_SECURITY_REG_SIZE 1
90+
#define QSPI_MAX_REG_SIZE 2
91+
92+
// status register
93+
#define STATUS_BIT_WIP (1 << 0) // write in progress bit
94+
#define STATUS_BIT_WEL (1 << 1) // write enable latch
95+
#define STATUS_BIT_BP0 (1 << 2) //
96+
#define STATUS_BIT_BP1 (1 << 3) //
97+
#define STATUS_BIT_BP2 (1 << 4) //
98+
#define STATUS_BIT_BP3 (1 << 5) //
99+
#define STATUS_BIT_QE (1 << 6) // Quad Enable
100+
#define STATUS_BIT_SRWD (1 << 7) // status register write protect
101+
102+
// configuration register 0
103+
// bit 0, 1, 2, 4, 5, 7 reserved
104+
#define CONFIG0_BIT_TB (1 << 3) // Top/Bottom area protect
105+
106+
#endif // MBED_QSPI_FLASH_MX25L51245G_H

TESTS/mbed_hal/qspi/flash_configs/flash_configs.h

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,45 @@
1818
#define MBED_FLASH_CONFIGS_H
1919

2020
#if defined(TARGET_DISCO_L475VG_IOT01A)
21-
#include "STM/DISCO_L475VG_IOT01A/flash_config.h"
21+
#include "MX25RXX35F_config.h" // MX25R6435F
22+
23+
#elif defined(TARGET_DISCO_F413ZH)
24+
#include "N25Q128A_config.h" // N25Q128A13EF840F
25+
26+
#elif defined(TARGET_DISCO_F746NG)
27+
#include "N25Q128A_config.h" // N25Q128A13EF840E
28+
29+
#elif defined(TARGET_DISCO_F469NI)
30+
#include "N25Q128A_config.h" // N25Q128A13EF840E
31+
32+
#elif defined(TARGET_DISCO_F769NI)
33+
#include "MX25L51245G_config.h" // MX25L51245G
34+
35+
#elif defined(TARGET_DISCO_L476VG)
36+
#include "N25Q128A_config.h" // N25Q128A13EF840E
37+
/* See STM32L476 Errata Sheet, it is not possible to use Dual-/Quad-mode for the command phase */
38+
#undef QSPI_CMD_READ_DPI
39+
#undef QSPI_CMD_READ_QPI
40+
#undef QSPI_CMD_WRITE_DPI
41+
#undef QSPI_CMD_WRITE_QPI
42+
43+
#elif defined(TARGET_DISCO_L496AG)
44+
#include "MX25RXX35F_config.h" // MX25R6435F
45+
2246
#elif defined(TARGET_NRF52840)
2347
#include "NORDIC/NRF52840_DK/flash_config.h"
24-
#elif defined(TARGET_DISCO_F413ZH)
25-
#include "STM/DISCO_F413ZH/flash_config.h"
48+
2649
#elif defined(TARGET_EFM32GG11_STK3701)
2750
#include "SiliconLabs/EFM32GG11_STK3701/flash_config.h"
51+
2852
#elif defined(TARGET_K82F)
2953
#include "NXP/K82F/flash_config.h"
54+
3055
#elif defined(TARGET_KL82Z)
3156
#include "NXP/KL82Z/flash_config.h"
57+
3258
#elif defined(TARGET_LPC546XX)
3359
#include "NXP/LPC546XX/flash_config.h"
34-
#endif
3560

61+
#endif
3662
#endif // MBED_FLASH_CONFIGS_H

TESTS/mbed_hal/sleep/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void sleep_usticker_test()
9595
TEST_ASSERT_TRUE(sleep_manager_can_deep_sleep());
9696
}
9797

98-
#ifdef DEVICE_LPTICKER
98+
#if DEVICE_LPTICKER
9999

100100
/* Test that wake-up time from sleep should be less than 10 ms and
101101
* low power ticker interrupt can wake-up target from sleep. */

TESTS/mbed_hal/sleep/sleep_test_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void us_ticker_isr(const ticker_data_t *const ticker_data)
105105
us_ticker_clear_interrupt();
106106
}
107107

108-
#ifdef DEVICE_LPTICKER
108+
#if DEVICE_LPTICKER
109109
void lp_ticker_isr(const ticker_data_t *const ticker_data)
110110
{
111111
lp_ticker_clear_interrupt();

TESTS/mbed_platform/FileHandle/main.cpp

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,15 @@ void test_fprintf_fscanf()
384384

385385
/** Test fseek and ftell
386386
*
387-
* Given already opened file is empty
388-
*
389-
* When set the file position indicator via fseek
390-
* Then underneath retargeting layer seek function is called
391-
* fseek return with succeed and ftell return already set position
387+
* ARM library is quite good at optimising out unnecessary calls to underlying
388+
* seek, so only test real non empty files.
392389
*
393390
* Given already opened file is not empty
394391
*
395392
* When set the file position indicator via fseek
396393
* Then underneath retargeting layer seek function is called
397394
* fseek return with succeed and ftell return already set position
395+
* Check actual character read or written.
398396
*
399397
*/
400398
void test_fseek_ftell()
@@ -413,19 +411,6 @@ void test_fseek_ftell()
413411
ftell_ret = std::ftell(file);
414412
TEST_ASSERT_EQUAL(0, ftell_ret);
415413

416-
TestFile<FS>::resetFunctionCallHistory();
417-
fssek_ret = std::fseek(file, 0, SEEK_CUR);
418-
TEST_ASSERT_EQUAL(0, fssek_ret);
419-
420-
TestFile<FS>::resetFunctionCallHistory();
421-
fssek_ret = std::fseek(file, 0, SEEK_SET);
422-
TEST_ASSERT_EQUAL(0, fssek_ret);
423-
424-
TestFile<FS>::resetFunctionCallHistory();
425-
fssek_ret = std::fseek(file, 0, SEEK_END);
426-
TEST_ASSERT_TRUE(TestFile<FS>::functionCalled(TestFile<FS>::fnSeek));
427-
TEST_ASSERT_EQUAL(0, fssek_ret);
428-
429414
const char *str = "Hello world";
430415
const std::size_t size = std::strlen(str);
431416

@@ -440,19 +425,28 @@ void test_fseek_ftell()
440425
TEST_ASSERT_EQUAL(0, fssek_ret);
441426
ftell_ret = std::ftell(file);
442427
TEST_ASSERT_EQUAL(5, ftell_ret);
428+
int c = std::fgetc(file);
429+
TEST_ASSERT_TRUE(TestFile<FS>::functionCalled(TestFile<FS>::fnRead));
430+
TEST_ASSERT_EQUAL(c, str[5]);
443431

444432
TestFile<FS>::resetFunctionCallHistory();
445-
fssek_ret = std::fseek(file, -5, SEEK_CUR);
433+
fssek_ret = std::fseek(file, -6, SEEK_CUR);
446434
TEST_ASSERT_EQUAL(0, fssek_ret);
447435
ftell_ret = std::ftell(file);
448436
TEST_ASSERT_EQUAL(0, ftell_ret);
437+
c = std::fgetc(file);
438+
TEST_ASSERT_TRUE(TestFile<FS>::functionCalled(TestFile<FS>::fnRead));
439+
TEST_ASSERT_EQUAL(c, str[0]);
449440

450441
TestFile<FS>::resetFunctionCallHistory();
451442
fssek_ret = std::fseek(file, 0, SEEK_END);
452-
TEST_ASSERT_TRUE(TestFile<FS>::functionCalled(TestFile<FS>::fnSeek));
453443
TEST_ASSERT_EQUAL(0, fssek_ret);
454444
ftell_ret = std::ftell(file);
455445
TEST_ASSERT_EQUAL(size, ftell_ret);
446+
c = std::fputc('!', file);
447+
TEST_ASSERT_TRUE(TestFile<FS>::functionCalled(TestFile<FS>::fnWrite));
448+
TEST_ASSERT_EQUAL(c, '!');
449+
TEST_ASSERT_EQUAL(fh.size(), size + 1);
456450

457451
std::fclose(file);
458452
}

0 commit comments

Comments
 (0)