Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion TESTS/configs/greentea_full.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"platform.all-stats-enabled": 1,

// Enable auto reboot on error, required for crash reporting test
"platform.fatal-error-auto-reboot-enabled": true
"platform.fatal-error-auto-reboot-enabled": true,

// Allow lots of reboots so that we don't get in a situation where the MCU refuses to boot
// after crashing and being reflashed (since some MCUs/flash tools don't reset the
// crash data RAM)
"platform.error-reboot-max": 99999
}
}
11 changes: 9 additions & 2 deletions connectivity/netsocket/tests/TESTS/netsocket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ Configure the firewall to allow this traffic to access the test server.

These services are available on many operating systems, and installing them is out of scope of this document. Below is an example of how to install these services into a Debian/Ubuntu based Linux distribution using standard Inet Daemon:

```.sh
```shell
$ sudo apt install inetutils-inetd
$ nano /etc/inetd.conf
$ sudo nano /etc/inetd.conf
```

Enable following services from /etc/inetd.conf:
Expand All @@ -79,6 +79,13 @@ daytime stream tcp6 nowait root internal
time stream tcp6 nowait root internal
```

Then run:

```shell
$ sudo systemctl enable inetutils-inetd.service
$ sudo systemctl start inetutils-inetd.service
```

Below is an example of how to install these services in TLS version into a Debian/Ubuntu based Linux distribution using Stunnel4 Daemon:

```.sh
Expand Down
5 changes: 0 additions & 5 deletions drivers/tests/TESTS/mbed_drivers/reset_reason/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ if(NOT "DEVICE_RESET_REASON=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "Reset Reason is not supported for this target")
endif()

if("TARGET_MIMXRT105X" IN_LIST MBED_TARGET_DEFINITIONS)
# This test causes this target to die. See https://github.com/mbed-ce/mbed-os/issues/83
set(TEST_SKIPPED "Temporarily disabled for this target, see #83")
endif()

mbed_greentea_add_test(
TEST_NAME
mbed-drivers-reset-reason
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ if(NOT "DEVICE_WATCHDOG=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "Watchdog is not supported for this target")
endif()

if("TARGET_MIMXRT105X" IN_LIST MBED_TARGET_DEFINITIONS)
# This test causes this target to die. See https://github.com/mbed-ce/mbed-os/issues/83
set(TEST_SKIPPED "Temporarily disabled for this target, see #83")
endif()

mbed_greentea_add_test(
TEST_NAME
mbed-drivers-watchdog-reset
Expand Down
13 changes: 1 addition & 12 deletions drivers/usb/tests/TESTS/host_tests/usb_device_hid.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import uuid
import sys
import mbed_host_tests
import hid
import usb.core
from usb.util import (
CTRL_IN,
Expand All @@ -42,13 +43,6 @@
# Use a default backend on other platforms.
USB_BACKEND = None

try:
import hid
except ImportError:
CYTHON_HIDAPI_PRESENT = False
else:
CYTHON_HIDAPI_PRESENT = True

# USB device -- device classes
USB_CLASS_HID = 0x03

Expand Down Expand Up @@ -112,8 +106,6 @@ def build_get_desc_value(desc_type, desc_index):

def usb_hid_path(serial_number):
"""Get a USB HID device system path based on the serial number."""
if not CYTHON_HIDAPI_PRESENT:
return None
for device_info in hid.enumerate(): # pylint: disable=no-member
if device_info.get('serial_number') == serial_number: # pylint: disable=not-callable
return device_info['path']
Expand Down Expand Up @@ -563,9 +555,6 @@ def start_bg_task(self, **thread_kwargs):

def cb_test_raw_io(self, key, value, timestamp):
"""Receive HID reports and send them back to the device."""
if not CYTHON_HIDAPI_PRESENT:
self.send_kv(MSG_KEY_HOST_READY, MSG_VALUE_NOT_SUPPORTED)
return
try:
# The size of input and output reports used in test.
report_size = int(value)
Expand Down
8 changes: 5 additions & 3 deletions features/frameworks/utest/source/utest_harness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ bool Harness::run(const Specification& specification)
void Harness::raise_failure(const failure_reason_t reason)
{
UTEST_LOG_FUNCTION();
// ignore a failure, if the Harness has not been initialized.
// this allows using unity assertion macros without setting up utest.
if (test_cases == NULL) return;

// If not currently in a test case and code does a unity assertion that fails, it will end up
// at this assert. This will stop execution of the program.
// This allows using unity assertion macros without setting up utest.
assert(test_cases != nullptr);

utest::v1::status_t fail_status = STATUS_ABORT;
if (handlers->test_failure) handlers->test_failure(failure_t(reason, location));
Expand Down
5 changes: 0 additions & 5 deletions hal/tests/TESTS/mbed_hal/reset_reason/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ if(NOT "DEVICE_RESET_REASON=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "Reset Reason is not supported for this target")
endif()

if("TARGET_MIMXRT105X" IN_LIST MBED_TARGET_DEFINITIONS)
# This test causes this target to die. See https://github.com/mbed-ce/mbed-os/issues/83
set(TEST_SKIPPED "Temporarily disabled for this target, see #83")
endif()

mbed_greentea_add_test(
TEST_NAME
mbed-hal-reset-reason
Expand Down
5 changes: 0 additions & 5 deletions hal/tests/TESTS/mbed_hal/rtc_reset/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ if(NOT "DEVICE_RTC=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "RTC is not supported for this target")
endif()

if("TARGET_MIMXRT105X" IN_LIST MBED_TARGET_DEFINITIONS)
# This test causes this target to die. See https://github.com/mbed-ce/mbed-os/issues/83
set(TEST_SKIPPED "Temporarily disabled for this target, see #83")
endif()

mbed_greentea_add_test(
TEST_NAME
mbed-hal-rtc-reset
Expand Down
3 changes: 3 additions & 0 deletions platform/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@
},
"MCU_STM32H7": {
"crash-capture-enabled": true
},
"MIMXRT105X": {
"crash-capture-enabled": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

if(NOT "MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED=1" IN_LIST MBED_CONFIG_DEFINITIONS)
set(TEST_SKIPPED "CRC is not supported for this target")
set(TEST_SKIPPED "MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED is not enabled for this target")
endif()

mbed_greentea_add_test(
Expand Down
2 changes: 0 additions & 2 deletions platform/tests/TESTS/mbed_platform/crash_reporting/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ static mbed_error_ctx saved_error_ctx = {0};

void mbed_error_reboot_callback(mbed_error_ctx *error_context)
{

TEST_ASSERT_EQUAL_PTR(error_context, &MBED_CRASH_DATA);
memcpy(&saved_error_ctx, error_context, sizeof(mbed_error_ctx));
mbed_reset_reboot_error_info();

Expand Down
16 changes: 12 additions & 4 deletions rtos/tests/TESTS/mbed_rtos/heap_and_stack/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cinttypes>

#include "mbed.h"
#include "cmsis.h"
Expand Down Expand Up @@ -107,12 +108,16 @@ static bool rangeinrange(uint32_t addr, uint32_t size, uint32_t start, uint32_t
*/
static bool valid_fill(uint8_t *data, uint32_t size, uint8_t fill)
{
bool valid = true;
for (uint32_t i = 0; i < size; i++) {
if (data[i] != fill) {
return false;
printf("Address 0x%" PRIx32 ": expected value 0x%" PRIx8 ", got 0x%" PRIx8,
reinterpret_cast<uint32_t>(&data[i]), fill, data[i]);
valid = false;
wait_us(1000);
}
}
return true;
return valid;
}

static void allocate_and_fill_heap(linked_list *&head)
Expand Down Expand Up @@ -158,17 +163,20 @@ static void check_and_free_heap(linked_list *head, uint32_t &max_allocation_size
uint32_t total_size = 0;
linked_list *current = head;

bool success = true;

while (current != NULL) {
total_size += sizeof(linked_list);
bool result = valid_fill(current->data, sizeof(current->data), MALLOC_FILL);

TEST_ASSERT_TRUE_MESSAGE(result, "Memory fill check failed");
success = success && valid_fill(current->data, sizeof(current->data), MALLOC_FILL);

linked_list *next = current->next;
free(current);
current = next;
}

TEST_ASSERT_TRUE_MESSAGE(success, "Memory fill check failed");

max_allocation_size = total_size;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ SECTIONS
. = ALIGN(8);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(8);
} > m_text AT> m_text :text
} > m_text :text

/* FCF to absolute address of 0x400, but only if bootloader is not present. */
#if !IS_BOOTLOADER_PRESENT
.flash_config FLASH_VTOR_TABLE_SIZE :
{
KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */
} > m_text AT> m_text :text
} > m_text :text
#else
/DISCARD/ : {
*(.FlashConfig)
Expand All @@ -140,19 +140,19 @@ SECTIONS
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(8);
} > m_text AT> m_text :text
} > m_text :text

.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > m_text AT> m_text :text
} > m_text :text

.ARM :
{
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} > m_text AT> m_text :text
} > m_text :text

.ctors :
{
Expand All @@ -176,7 +176,7 @@ SECTIONS
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
__CTOR_END__ = .;
} > m_text AT> m_text :text
} > m_text :text

.dtors :
{
Expand All @@ -187,30 +187,30 @@ SECTIONS
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
__DTOR_END__ = .;
} > m_text AT> m_text :text
} > m_text :text

.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} > m_text AT> m_text :text
} > m_text :text

.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} > m_text AT> m_text :text
} > m_text :text

.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
} > m_text AT> m_text :text
} > m_text :text

#if MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED
/* Stick the crash data ram at the start of sram_l */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@ typedef enum {
NC = (int)0xFFFFFFFF
} PinName;

// Standardized LED and button names
#define LED1 GPIO_AD_B0_09 // USER LED (green)
#define USER_LED LED1
// MIMXRT EVKs do not have a usable LED, because the LED shares important pins with the
// debugging interface, so trying to use the LED can interrupt flashing and debugging code!

typedef enum {
PullNone = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const flexspi_nor_config_t hyperflash_config = {
(1u << kFlexSpiMiscOffset_SafeConfigFreqEnable) | (1u << kFlexSpiMiscOffset_DiffClkEnable),
.sflashPadType = kSerialFlash_8Pads,
.serialClkFreq = kFlexSpiSerialClk_133MHz,
.sflashA1Size = BOARD_FLASH_SIZE,
.sflashA1Size = MBED_ROM_BANK_EXT_FLASH_SIZE,
.dataValidTime = {16u, 16u},
.lookupTable = {
// Read LUTs
Expand Down Expand Up @@ -68,7 +68,7 @@ const flexspi_nor_config_t qspiflash_config = {
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_133MHz,
.lutCustomSeqEnable = 0u,
.sflashA1Size = BOARD_FLASH_SIZE,
.sflashA1Size = MBED_ROM_BANK_EXT_FLASH_SIZE,
.lookupTable = {
// Fast read sequence
[0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,14 @@ const flexspi_nor_config_t qspiflash_config = {
.deviceType = kFlexSpiDeviceType_SerialNOR,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_120MHz,
.sflashA1Size = BOARD_FLASH_SIZE,
.sflashA1Size = MBED_ROM_BANK_EXT_FLASH_SIZE,
.lookupTable =
{
// Read LUTs
// Read LUT. Always index 0.
// All that the bootrom needs to know is how to read the flash. The rest of the
// flash configuration is stored in flash_defines.h.
[0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
[1] = FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),

// Read Status LUTs
[4 * 1 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05, READ_SDR, FLEXSPI_1PAD, 0x04),

// Write Enable LUTs
[4 * 3 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06, STOP, FLEXSPI_1PAD, 0x0),

// Erase Sector LUTs
[4 * 5 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20, RADDR_SDR, FLEXSPI_1PAD, 0x18),

// Erase Block LUTs
[4 * 8 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8, RADDR_SDR, FLEXSPI_1PAD, 0x18),

// Pape Program LUTs
[4 * 9 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02, RADDR_SDR, FLEXSPI_1PAD, 0x18),
[4 * 9 + 1] = FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0),

// Erase Chip LUTs
[4 * 11 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60, STOP, FLEXSPI_1PAD, 0x0),
[1] = FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04)
},
},
.pageSize = 256u,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ int32_t flash_free(flash_t *obj)
uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
{
uint32_t sectorsize = MBED_FLASH_INVALID_SIZE;
uint32_t devicesize = BOARD_FLASH_SIZE;
uint32_t startaddr = BOARD_FLASH_START_ADDR;
uint32_t devicesize = MBED_ROM_BANK_EXT_FLASH_SIZE;
uint32_t startaddr = MBED_ROM_BANK_EXT_FLASH_START;

if ((address >= startaddr) && (address < (startaddr + devicesize))) {
sectorsize = BOARD_FLASH_SECTOR_SIZE;
Expand All @@ -672,12 +672,12 @@ uint32_t flash_get_page_size(const flash_t *obj)

uint32_t flash_get_start_address(const flash_t *obj)
{
return BOARD_FLASH_START_ADDR;
return MBED_ROM_BANK_EXT_FLASH_START;
}

uint32_t flash_get_size(const flash_t *obj)
{
return BOARD_FLASH_SIZE;
return MBED_ROM_BANK_EXT_FLASH_SIZE;
}

uint8_t flash_get_erase_value(const flash_t *obj)
Expand Down
Loading
Loading