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
2 changes: 1 addition & 1 deletion TESTS/configs/greentea_full.json5
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// 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": 2147483648,
"platform.error-reboot-max": 2147483647,

// Emit a KV pair when an assert fail or hardfault occurs
"platform.mbed-error-emit-greentea-kv": true,
Expand Down
14 changes: 14 additions & 0 deletions drivers/include/drivers/SerialBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,22 @@ class SerialBase : private NonCopyable<SerialBase> {

enum Flow {
Disabled = 0,

/// RS-232-E RTS flow control. This is used to prevent the other end of the connection from sending more
/// bytes than the Mbed MCU can process.
/// When this flow control is active, the RTS signal will normally be asserted (low),
/// but will go deasserted (high) if the Mbed MCU might not have Rx buffer space to store another byte.
/// Note that in this configuration the RTS signal actually operates as a "ready to receive" (RTR) output,
/// not a true RTS.
RTS,

/// RS-232 CTS flow control. This is used to prevent the Mbed MCU from sending more bytes than the
/// other end of the connection can process.
/// When this flow control is active, the CTS pin will be sampled after transmitting each byte, and if
/// if is deasserted (high), transmission will pause until it becomes asserted (low) again.
CTS,

/// Combination of RTS and CTS flow control as previously defined.
RTSCTS
};

Expand Down
17 changes: 0 additions & 17 deletions hal/include/hal/pinmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ uint32_t pinmap_find_function(PinName pin, const PinMap *map);
* {
* int per = spi_master_cs_pinmap()->peripheral;
* const PinList *pins_ff = pinmap_ff_default_pins();
* const PinList *pins_avoid = pinmap_restricted_pins();
* PinName mosi = NC;
* PinName miso = NC;
* PinName sclk = NC;
Expand Down Expand Up @@ -138,22 +137,6 @@ bool pinmap_list_has_pin(const PinList *list, PinName pin);
*/
bool pinmap_list_has_peripheral(const PeripheralList *list, int peripheral);

/**
* Get the pin list of pins to avoid during testing
*
* The restricted pin list is used to indicate to testing
* that a pin should be skipped due to some caveat about it.
* For example, using CONSOLE_RX and CONSOLE_TX during tests will interfere
* with the test runner and should be avoided.
*
* Targets should override the weak implementation of this
* function if they have additional pins which should be
* skipped during testing.
*
* @return Pointer to a pin list of pins to avoid
*/
const PinList *pinmap_restricted_pins(void);

/**
* Get the pin list of peripherals per interface to avoid during testing
*
Expand Down
13 changes: 0 additions & 13 deletions hal/source/mbed_pinmap_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,6 @@ const char *pinmap_ff_arduino_uno_pin_to_string(PinName pin)

#endif // defined (TARGET_FF_ARDUINO) || (TARGET_FF_ARDUINO_UNO)

//*** Default restricted pins ***
MBED_WEAK const PinList *pinmap_restricted_pins()
{
static const PinName pins[] = {
CONSOLE_TX, CONSOLE_RX
};
static const PinList pin_list = {
sizeof(pins) / sizeof(pins[0]),
pins
};
return &pin_list;
}

//*** Default restricted gpio pins ***
// GPIO pins are special case because there are no pin-maps for GPIO
MBED_WEAK const PinList *pinmap_gpio_restricted_pins()
Expand Down
2 changes: 1 addition & 1 deletion hal/source/mpu/mbed_mpu_v7m.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void mbed_mpu_init()
MBED_ASSERT(regions >= 4);
#endif

// Disable the MCU
// Disable the MPU
MPU->CTRL = 0;

// Reset all mapping
Expand Down
3 changes: 3 additions & 0 deletions platform/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@
},
"MIMXRT105X": {
"crash-capture-enabled": true
},
"MCU_LPC546XX": {
"crash-capture-enabled": true
}
}
}
6 changes: 5 additions & 1 deletion platform/tests/TESTS/host_tests/crash_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def __init__(self):
def setup(self):
self.register_callback(MSG_KEY_DEVICE_READY, self.cb_device_ready)

# Disable the default behavior of ending the test when the target experiences a fatal error.
# In this test, we intentionally generate a fatal error!
self.register_callback("mbed_error", lambda key, value, timestamp: None)

def cb_device_ready(self, key, value, timestamp):
"""Acknowledge device rebooted correctly and feed the test execution
"""
Expand Down Expand Up @@ -68,7 +72,7 @@ def test_steps(self):

system_reset = yield
if self.reset == False:
raise RuntimeError('Platform did not auto-reboot as expected.')
raise RuntimeError('Platform did not auto-reboot as expected. This is likely due to failing to auto-reboot after a reset, or failing to preserve the contents of crash data RAM across resets.')

# The sequence is correct -- test passed.
yield True
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ using namespace mbed;
#define DATAFLASH_READ_SIZE 1
#define DATAFLASH_PROG_SIZE 1
#define DATAFLASH_TIMEOUT 10000
#define DATAFLASH_ID_MATCH 0x1F20
#define DATAFLASH_ID_MASK 0xFFE0 // Matches Manufacturer ID and Family Code
#define DATAFLASH_ID_MATCH 0x1F20 // Matches Adesto/Renesas AT45Dxxx family
#define DATAFLASH_ID_DENSITY_MASK 0x001F
#define DATAFLASH_PAGE_SIZE_256 0x0100
#define DATAFLASH_PAGE_SIZE_264 0x0108
Expand Down Expand Up @@ -186,13 +187,13 @@ int DataFlashBlockDevice::init()
/* read ID register to validate model and set dimensions */
uint16_t id = _get_register(DATAFLASH_OP_ID);

DEBUG_PRINTF("id: %04X\r\n", id & DATAFLASH_ID_MATCH);
DEBUG_PRINTF("id: %04X\r\n", id);

/* get status register to verify the page size mode */
uint16_t status = _get_register(DATAFLASH_OP_STATUS);

/* manufacture ID match */
if ((id & DATAFLASH_ID_MATCH) == DATAFLASH_ID_MATCH) {
if ((id & DATAFLASH_ID_MASK) == DATAFLASH_ID_MATCH) {

/* calculate density */
_device_size = 0x8000 << (id & DATAFLASH_ID_DENSITY_MASK);
Expand Down Expand Up @@ -656,7 +657,7 @@ int DataFlashBlockDevice::_sync(void)
/* wait the typical write period before trying again */
} else {
DEBUG_PRINTF("sleep_for: %d\r\n", DATAFLASH_TIMING_ERASE_PROGRAM_PAGE);
rtos::ThisThread::sleep_for(DATAFLASH_TIMING_ERASE_PROGRAM_PAGE);
rtos::ThisThread::sleep_for(std::chrono::milliseconds(DATAFLASH_TIMING_ERASE_PROGRAM_PAGE));
}
}

Expand Down
6 changes: 3 additions & 3 deletions storage/blockdevice/COMPONENT_SPIF/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"SPI_CS": "PB_12",
"SPI_FREQ": "20000000"
},
"UHURU_RAVEN": {
"UHURU_RAVEN": {
"SPI_MOSI": "PE_14",
"SPI_MISO": "PE_13",
"SPI_CLK": "PE_12",
Expand All @@ -68,8 +68,8 @@
"SPI_CLK": "SPI3_SCK",
"SPI_CS": "SPI_CS1"
},
"ARDUINO_NICLA_SENSE_ME": {
"ARDUINO_NICLA_SENSE_ME": {
"SPI_CS": "CS_FLASH"
}
}
}
}
21 changes: 0 additions & 21 deletions targets/TARGET_NUVOTON/TARGET_M460/pinmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,6 @@ void pin_mode(PinName pin, PinMode mode)
*/
}

/* List of pins excluded from testing */
const PinList *pinmap_restricted_pins()
{
static const PinName pins[] = {
CONSOLE_TX, CONSOLE_RX, // Dedicated to USB VCOM
#if MBED_CONF_TARGET_EXCLUDE_UNO_SPI_FROM_FPGA_CI_TEST_SHIELD_TEST
ARDUINO_UNO_D8, // Dedicated to on-board SPI flash
ARDUINO_UNO_D9,
ARDUINO_UNO_D10,
ARDUINO_UNO_D11,
ARDUINO_UNO_D12,
ARDUINO_UNO_D13,
#endif
};
static const PinList pin_list = {
sizeof(pins) / sizeof(pins[0]),
pins
};
return &pin_list;
}

/* List of UART peripherals excluded from testing */
#if DEVICE_SERIAL
const PeripheralList *pinmap_uart_restricted_peripherals()
Expand Down
16 changes: 0 additions & 16 deletions targets/TARGET_NUVOTON/TARGET_M480/pinmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,6 @@ void pin_mode(PinName pin, PinMode mode)
*/
}

/* List of pins excluded from testing */
const PinList *pinmap_restricted_pins()
{
static const PinName pins[] = {
CONSOLE_TX, CONSOLE_RX, // Dedicated to USB VCOM
#if defined(TARGET_NUMAKER_IOT_M487)
A2, A3, // Dedicated to on-board ESP8266 WiFi module RTS/CTS
#endif
};
static const PinList pin_list = {
sizeof(pins) / sizeof(pins[0]),
pins
};
return &pin_list;
}

/* List of UART peripherals excluded from testing */
#if DEVICE_SERIAL
const PeripheralList *pinmap_uart_restricted_peripherals()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ int i2c_slave_receive(i2c_t *obj)
uint32_t status_flags = I2C_GetStatusFlags(i2c_addrs[obj->instance]);

if (status_flags & kI2C_SlaveSelected) {
if (((status_flags >> I2C_STAT_SLVSTATE_SHIFT) & I2C_STAT_SLVSTATE_MASK) == 0x1) {
if (((status_flags & I2C_STAT_SLVSTATE_MASK) >> I2C_STAT_SLVSTATE_SHIFT) == 0x1) {
// read addressed
return 1;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ include(mbed_set_post_build_nxp)
add_subdirectory(TARGET_FF_LPC546XX EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_LPCXpresso EXCLUDE_FROM_ALL)

if(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_LPC54628.S)
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/LPC54628J512.sct)
set(LIB_POWER device/TOOLCHAIN_ARM_STD/lib_power.ar)
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_LPC54628.S)
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/LPC54628J512.ld)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_LPC546xx.S)
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/LPC546xx.ld)
set(LIB_POWER device/TOOLCHAIN_GCC_ARM/libpower.a)
endif()

Expand All @@ -35,6 +31,8 @@ target_sources(mbed-mcu-lpc546xx
INTERFACE
flash_api.c
trng_api.c
mbed_overrides.cpp
mbed_mpu_lpc546xx.c

device/system_LPC54628.c

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_sources(mbed-ff-lpc546xx
INTERFACE
PeripheralPins.c
clock_config.c
mbed_overrides.c
)

target_link_libraries(mbed-ff-lpc546xx INTERFACE mbed-mcu-lpc546xx)
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,12 @@ const PinMap PinMap_SPI_SCLK[] = {
const PinMap PinMap_SPI_MOSI[] = {
{P1_5, SPI_0, 1},
{P1_24, SPI_2, 1},
{P0_8, SPI_3, 1},
{NC , NC , 0}
};

const PinMap PinMap_SPI_MISO[] = {
{P1_6, SPI_0, 1},
{P1_25, SPI_2, 1},
{P0_9, SPI_3, 1},
{NC , NC , 0}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,6 @@ typedef enum {
P4_15 = (4 << PORT_SHIFT | 15),
P4_16 = (4 << PORT_SHIFT | 16),



// mbed original LED naming
LED1 = P1_3,
LED2 = P1_27,
LED3 = P1_26,
LED4 = P1_28,


// USB Pins
CONSOLE_TX = P0_30,
CONSOLE_RX = P0_29,
Expand Down Expand Up @@ -233,19 +224,20 @@ typedef enum {
p29 = P0_0,
p30 = P0_1,


I2C_SCL2 = P0_27,
I2C_SDA2 = P0_26,
I2C_SCL7 = P1_30,
I2C_SDA7 = P1_29,
I2C_SCL = I2C_SCL2,
I2C_SDA = I2C_SDA2,


// Not connected
NC = (int)0xFFFFFFFF
} PinName;

#define LED1 P1_3
#define LED2 P1_27
#define LED3 P1_22
#define LED4 P1_28

#define I2C_SCL0 P0_27
#define I2C_SDA0 P0_26

#define I2C_SCL1 P1_30
#define I2C_SDA1 P1_29

typedef enum {
PullNone = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ target_sources(mbed-lpc546xx-xpresso
PeripheralPins.c
clock_config.c
crc.c
mbed_overrides.c
overrides.c
)
Loading