Skip to content

Commit e20b269

Browse files
Merge branch 'master' into ubx_context_activation
2 parents 1ec6117 + 2f136b9 commit e20b269

File tree

957 files changed

+242514
-102446
lines changed

Some content is hidden

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

957 files changed

+242514
-102446
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.cpp text
33
*.h text
44
*.s text
5+
*.S text
56
*.sct text
67
*.ld text
78
*.txt text

TESTS/mbed-crypto/sanity/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18+
#include "psa/crypto.h"
19+
1820
#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
1921
#error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping.
2022
#endif
@@ -24,7 +26,6 @@
2426
#include "greentea-client/test_env.h"
2527
#include "unity.h"
2628
#include "utest.h"
27-
#include "psa/crypto.h"
2829
#include "entropy.h"
2930
#include "entropy_poll.h"
3031

TESTS/mbed_drivers/timeout/timeout_tests.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ void test_deepsleep(void)
313313
314314
* This should be replaced with a better function that checks if the
315315
* hardware buffers are empty. However, such an API does not exist now,
316-
* so we'll use the wait_ms() function for now.
316+
* so we'll use the ThisThread::sleep_for() function for now.
317317
*/
318-
wait_ms(20);
318+
ThisThread::sleep_for(20);
319319

320320
timer.start();
321321
timeout.attach_callback(mbed::callback(sem_callback, &sem), delay_us);

TESTS/mbed_drivers/watchdog/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ using utest::v1::Harness;
6868

6969
using namespace mbed;
7070

71-
Thread wdg_kicking_thread;
71+
Thread wdg_kicking_thread(osPriorityNormal, 768);
7272
Semaphore kick_wdg_during_test_teardown(0, 1);
7373

7474
void wdg_kicking_thread_fun()

TESTS/mbed_hal/pinmap/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
using namespace utest::v1;
2222

23+
#include "gpio_api.h"
2324
#include "analogin_api.h"
2425
#include "analogout_api.h"
2526
#include "can_api.h"
@@ -38,6 +39,7 @@ typedef struct {
3839
} pinmap_info_t;
3940

4041
const pinmap_info_t pinmap_functions[] = {
42+
PINMAP_TEST_ENTRY(gpio_pinmap),
4143
#if DEVICE_ANALOGIN
4244
PINMAP_TEST_ENTRY(analogin_pinmap),
4345
#endif

TESTS/mbed_hal/rtc/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void rtc_persist_test()
125125
rtc_write(start);
126126
rtc_free();
127127

128-
wait(WAIT_TIME);
128+
ThisThread::sleep_for(WAIT_TIME * 1000);
129129

130130
rtc_init();
131131
const uint32_t stop = rtc_read();
@@ -167,7 +167,7 @@ void rtc_range_test()
167167
for (uint32_t i = 0; i < sizeof(starts) / sizeof(starts[0]); i++) {
168168
const uint32_t start = starts[i];
169169
rtc_write(start);
170-
wait(WAIT_TIME);
170+
ThisThread::sleep_for(WAIT_TIME * 1000);
171171
const uint32_t stop = rtc_read();
172172
TEST_ASSERT_UINT32_WITHIN(WAIT_TOLERANCE, WAIT_TIME, stop - start);
173173
}

TESTS/mbed_hal/watchdog/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ using utest::v1::Harness;
6969

7070
const watchdog_config_t WDG_CONFIG_DEFAULT = { .timeout_ms = WDG_TIMEOUT_MS };
7171

72-
Thread wdg_kicking_thread;
72+
Thread wdg_kicking_thread(osPriorityNormal, 768);
7373
Semaphore kick_wdg_during_test_teardown(0, 1);
7474

7575
void wdg_kicking_thread_fun()

TESTS/mbed_hal_fpga_ci_test_shield/analogin/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ using namespace utest::v1;
3636

3737
#define analogin_debug_printf(...)
3838

39-
#define DELTA_FLOAT 0.03f // 3%
40-
#define DELTA_U16 1965 // 3%
39+
#define DELTA_FLOAT 0.05f // 5%
40+
#define DELTA_U16 3277 // 5%
4141

4242
const PinList *form_factor = pinmap_ff_default_pins();
4343
const PinList *restricted = pinmap_restricted_pins();

TESTS/mbed_hal_fpga_ci_test_shield/analogout/main.cpp

Lines changed: 0 additions & 133 deletions
This file was deleted.

TESTS/mbed_hal_fpga_ci_test_shield/i2c/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ void i2c_test_byte_read(PinName sda, PinName scl)
366366
// Reset tester stats and select I2C
367367
tester.peripherals_reset();
368368
tester.select_peripheral(MbedTester::PeripheralI2C);
369+
tester.set_next_from_slave(0);
369370
for (int i = 0; i < TRANSFER_COUNT; i++) {
370371
data_in[i] = 0;
371372
}
@@ -413,7 +414,7 @@ void i2c_test_byte_read(PinName sda, PinName scl)
413414
TEST_ASSERT_EQUAL(num_nacks, tester.num_nacks());
414415
TEST_ASSERT_EQUAL(checksum, tester.get_send_checksum());
415416
TEST_ASSERT_EQUAL(0, tester.state_num());
416-
TEST_ASSERT_EQUAL(((TRANSFER_COUNT + 2) & 0xFF), tester.get_next_from_slave());
417+
TEST_ASSERT_EQUAL(((TRANSFER_COUNT) & 0xFF), tester.get_next_from_slave());
417418
TEST_ASSERT_EQUAL(num_writes, tester.num_writes());
418419
TEST_ASSERT_EQUAL(num_reads, tester.num_reads());
419420

TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ void pwm_period_fill_test(PinName pin, uint32_t period_ms, uint32_t fill_prc, pw
122122
break;
123123
}
124124

125+
wait(PERIOD_FLOAT(period_ms));
126+
125127
tester.io_metrics_start();
126128

127129
wait(NUM_OF_PERIODS * PERIOD_FLOAT(period_ms));

TESTS/mbed_hal_fpga_ci_test_shield/spi/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void spi_async_handler()
5555
{
5656
int event = spi_irq_handler_asynch(&spi);
5757

58-
if (event == SPI_EVENT_COMPLETE) {
58+
if (event & SPI_EVENT_COMPLETE) {
5959
async_trasfer_done = true;
6060
}
6161
}
@@ -136,7 +136,7 @@ void spi_test_common(PinName mosi, PinName miso, PinName sclk, PinName ssel, SPI
136136

137137
async_trasfer_done = false;
138138

139-
spi_master_transfer(&spi, tx_buf, TRANSFER_COUNT, rx_buf, TRANSFER_COUNT, 8, (uint32_t)spi_async_handler, 0, DMA_USAGE_NEVER);
139+
spi_master_transfer(&spi, tx_buf, TRANSFER_COUNT, rx_buf, TRANSFER_COUNT, 8, (uint32_t)spi_async_handler, SPI_EVENT_COMPLETE, DMA_USAGE_NEVER);
140140
while (!async_trasfer_done);
141141

142142
for (int i = 0; i < TRANSFER_COUNT; i++) {

TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,13 @@ static void uart_test_common(int baudrate, int data_bits, SerialParity parity, i
118118
serial_init(&serial, tx, rx);
119119
serial_baud(&serial, baudrate);
120120
serial_format(&serial, data_bits, parity, stop_bits);
121+
#if DEVICE_SERIAL_FC
121122
if (use_flow_control) {
122123
serial_set_flow_control(&serial, FlowControlRTSCTS, rts, cts);
123124
} else {
124125
serial_set_flow_control(&serial, FlowControlNone, NC, NC);
125126
}
127+
#endif
126128

127129
// Reset tester stats and select UART
128130
tester.peripherals_reset();
@@ -277,9 +279,11 @@ void test_init_free(PinName tx, PinName rx, PinName cts = NC, PinName rts = NC)
277279
serial_init(&serial, tx, rx);
278280
serial_baud(&serial, 9600);
279281
serial_format(&serial, 8, ParityNone, 1);
282+
#if DEVICE_SERIAL_FC
280283
if (use_flow_control) {
281284
serial_set_flow_control(&serial, FlowControlRTSCTS, rts, cts);
282285
}
286+
#endif
283287
serial_free(&serial);
284288
}
285289

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

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

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

312314
// One set of pins from one peripheral.
313315
// baudrate
314-
Case("19200, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<19200, 8, ParityNone, 1> >),
315316
Case("19200, 8N1, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<19200, 8, ParityNone, 1> >),
316-
Case("38400, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<38400, 8, ParityNone, 1> >),
317317
Case("38400, 8N1, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<38400, 8, ParityNone, 1> >),
318-
Case("115200, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<115200, 8, ParityNone, 1> >),
319318
Case("115200, 8N1, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<115200, 8, ParityNone, 1> >),
319+
// stop bits
320+
Case("9600, 8N2, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<9600, 8, ParityNone, 2> >),
321+
322+
#if DEVICE_SERIAL_FC
323+
// Every set of pins from every peripheral.
324+
Case("init/free, FC on", all_ports<UARTPort, DefaultFormFactor, test_init_free>),
325+
326+
// One set of pins from every peripheral.
327+
Case("basic, 9600, 8N1, FC on", all_peripherals<UARTPort, DefaultFormFactor, test_common<9600, 8, ParityNone, 1> >),
328+
329+
// One set of pins from one peripheral.
330+
// baudrate
331+
Case("19200, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<19200, 8, ParityNone, 1> >),
332+
Case("38400, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<38400, 8, ParityNone, 1> >),
333+
Case("115200, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<115200, 8, ParityNone, 1> >),
320334
// data bits: not tested (some platforms support 8 bits only)
321335
// parity
322336
Case("9600, 8O1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<9600, 8, ParityOdd, 1> >),
323337
Case("9600, 8E1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<9600, 8, ParityEven, 1> >),
324338
// stop bits
325339
Case("9600, 8N2, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<9600, 8, ParityNone, 2> >),
326-
Case("9600, 8N2, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<9600, 8, ParityNone, 2> >),
340+
#endif
327341
};
328342

329343
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)

0 commit comments

Comments
 (0)