mirror of https://github.com/ARMmbed/mbed-os.git
Loads of general and MIMXRT-specific test fixes (#412)
* Update MIMXRT105x linker script to use memory banks * Disable SRAM for now :/ * Add split heap support * Loads of general and MIMXRT-specific test fixes * Style fix * Remove include guard from mbed_config.tmpl so that it can be re-included by the build system * Oops left that line therepull/15531/head
parent
d255e11152
commit
5887f9e97e
|
@ -4,6 +4,11 @@
|
||||||
"platform.all-stats-enabled": 1,
|
"platform.all-stats-enabled": 1,
|
||||||
|
|
||||||
// Enable auto reboot on error, required for crash reporting test
|
// 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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:
|
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
|
$ sudo apt install inetutils-inetd
|
||||||
$ nano /etc/inetd.conf
|
$ sudo nano /etc/inetd.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
Enable following services from /etc/inetd.conf:
|
Enable following services from /etc/inetd.conf:
|
||||||
|
@ -79,6 +79,13 @@ daytime stream tcp6 nowait root internal
|
||||||
time 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:
|
Below is an example of how to install these services in TLS version into a Debian/Ubuntu based Linux distribution using Stunnel4 Daemon:
|
||||||
|
|
||||||
```.sh
|
```.sh
|
||||||
|
|
|
@ -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")
|
set(TEST_SKIPPED "Reset Reason is not supported for this target")
|
||||||
endif()
|
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(
|
mbed_greentea_add_test(
|
||||||
TEST_NAME
|
TEST_NAME
|
||||||
mbed-drivers-reset-reason
|
mbed-drivers-reset-reason
|
||||||
|
|
|
@ -5,11 +5,6 @@ if(NOT "DEVICE_WATCHDOG=1" IN_LIST MBED_TARGET_DEFINITIONS)
|
||||||
set(TEST_SKIPPED "Watchdog is not supported for this target")
|
set(TEST_SKIPPED "Watchdog is not supported for this target")
|
||||||
endif()
|
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(
|
mbed_greentea_add_test(
|
||||||
TEST_NAME
|
TEST_NAME
|
||||||
mbed-drivers-watchdog-reset
|
mbed-drivers-watchdog-reset
|
||||||
|
|
|
@ -22,6 +22,7 @@ import threading
|
||||||
import uuid
|
import uuid
|
||||||
import sys
|
import sys
|
||||||
import mbed_host_tests
|
import mbed_host_tests
|
||||||
|
import hid
|
||||||
import usb.core
|
import usb.core
|
||||||
from usb.util import (
|
from usb.util import (
|
||||||
CTRL_IN,
|
CTRL_IN,
|
||||||
|
@ -42,13 +43,6 @@ else:
|
||||||
# Use a default backend on other platforms.
|
# Use a default backend on other platforms.
|
||||||
USB_BACKEND = None
|
USB_BACKEND = None
|
||||||
|
|
||||||
try:
|
|
||||||
import hid
|
|
||||||
except ImportError:
|
|
||||||
CYTHON_HIDAPI_PRESENT = False
|
|
||||||
else:
|
|
||||||
CYTHON_HIDAPI_PRESENT = True
|
|
||||||
|
|
||||||
# USB device -- device classes
|
# USB device -- device classes
|
||||||
USB_CLASS_HID = 0x03
|
USB_CLASS_HID = 0x03
|
||||||
|
|
||||||
|
@ -112,8 +106,6 @@ def build_get_desc_value(desc_type, desc_index):
|
||||||
|
|
||||||
def usb_hid_path(serial_number):
|
def usb_hid_path(serial_number):
|
||||||
"""Get a USB HID device system path based on the 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
|
for device_info in hid.enumerate(): # pylint: disable=no-member
|
||||||
if device_info.get('serial_number') == serial_number: # pylint: disable=not-callable
|
if device_info.get('serial_number') == serial_number: # pylint: disable=not-callable
|
||||||
return device_info['path']
|
return device_info['path']
|
||||||
|
@ -563,9 +555,6 @@ class USBHIDTest(mbed_host_tests.BaseHostTest):
|
||||||
|
|
||||||
def cb_test_raw_io(self, key, value, timestamp):
|
def cb_test_raw_io(self, key, value, timestamp):
|
||||||
"""Receive HID reports and send them back to the device."""
|
"""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:
|
try:
|
||||||
# The size of input and output reports used in test.
|
# The size of input and output reports used in test.
|
||||||
report_size = int(value)
|
report_size = int(value)
|
||||||
|
|
|
@ -165,9 +165,11 @@ bool Harness::run(const Specification& specification)
|
||||||
void Harness::raise_failure(const failure_reason_t reason)
|
void Harness::raise_failure(const failure_reason_t reason)
|
||||||
{
|
{
|
||||||
UTEST_LOG_FUNCTION();
|
UTEST_LOG_FUNCTION();
|
||||||
// ignore a failure, if the Harness has not been initialized.
|
|
||||||
// this allows using unity assertion macros without setting up utest.
|
// If not currently in a test case and code does a unity assertion that fails, it will end up
|
||||||
if (test_cases == NULL) return;
|
// 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;
|
utest::v1::status_t fail_status = STATUS_ABORT;
|
||||||
if (handlers->test_failure) handlers->test_failure(failure_t(reason, location));
|
if (handlers->test_failure) handlers->test_failure(failure_t(reason, location));
|
||||||
|
|
|
@ -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")
|
set(TEST_SKIPPED "Reset Reason is not supported for this target")
|
||||||
endif()
|
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(
|
mbed_greentea_add_test(
|
||||||
TEST_NAME
|
TEST_NAME
|
||||||
mbed-hal-reset-reason
|
mbed-hal-reset-reason
|
||||||
|
|
|
@ -5,11 +5,6 @@ if(NOT "DEVICE_RTC=1" IN_LIST MBED_TARGET_DEFINITIONS)
|
||||||
set(TEST_SKIPPED "RTC is not supported for this target")
|
set(TEST_SKIPPED "RTC is not supported for this target")
|
||||||
endif()
|
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(
|
mbed_greentea_add_test(
|
||||||
TEST_NAME
|
TEST_NAME
|
||||||
mbed-hal-rtc-reset
|
mbed-hal-rtc-reset
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if(NOT "MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED=1" IN_LIST MBED_CONFIG_DEFINITIONS)
|
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()
|
endif()
|
||||||
|
|
||||||
mbed_greentea_add_test(
|
mbed_greentea_add_test(
|
||||||
|
|
|
@ -35,8 +35,6 @@ static mbed_error_ctx saved_error_ctx = {0};
|
||||||
|
|
||||||
void mbed_error_reboot_callback(mbed_error_ctx *error_context)
|
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));
|
memcpy(&saved_error_ctx, error_context, sizeof(mbed_error_ctx));
|
||||||
mbed_reset_reboot_error_info();
|
mbed_reset_reboot_error_info();
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <cinttypes>
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
#include "cmsis.h"
|
#include "cmsis.h"
|
||||||
|
@ -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)
|
static bool valid_fill(uint8_t *data, uint32_t size, uint8_t fill)
|
||||||
{
|
{
|
||||||
|
bool valid = true;
|
||||||
for (uint32_t i = 0; i < size; i++) {
|
for (uint32_t i = 0; i < size; i++) {
|
||||||
if (data[i] != fill) {
|
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)
|
static void allocate_and_fill_heap(linked_list *&head)
|
||||||
|
@ -158,17 +163,20 @@ static void check_and_free_heap(linked_list *head, uint32_t &max_allocation_size
|
||||||
uint32_t total_size = 0;
|
uint32_t total_size = 0;
|
||||||
linked_list *current = head;
|
linked_list *current = head;
|
||||||
|
|
||||||
|
bool success = true;
|
||||||
|
|
||||||
while (current != NULL) {
|
while (current != NULL) {
|
||||||
total_size += sizeof(linked_list);
|
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;
|
linked_list *next = current->next;
|
||||||
free(current);
|
free(current);
|
||||||
current = next;
|
current = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_ASSERT_TRUE_MESSAGE(success, "Memory fill check failed");
|
||||||
|
|
||||||
max_allocation_size = total_size;
|
max_allocation_size = total_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,9 +206,8 @@ typedef enum {
|
||||||
NC = (int)0xFFFFFFFF
|
NC = (int)0xFFFFFFFF
|
||||||
} PinName;
|
} PinName;
|
||||||
|
|
||||||
// Standardized LED and button names
|
// MIMXRT EVKs do not have a usable LED, because the LED shares important pins with the
|
||||||
#define LED1 GPIO_AD_B0_09 // USER LED (green)
|
// debugging interface, so trying to use the LED can interrupt flashing and debugging code!
|
||||||
#define USER_LED LED1
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PullNone = 0,
|
PullNone = 0,
|
||||||
|
|
|
@ -38,28 +38,11 @@ const flexspi_nor_config_t qspiflash_config = {
|
||||||
.sflashA1Size = MBED_ROM_BANK_EXT_FLASH_SIZE,
|
.sflashA1Size = MBED_ROM_BANK_EXT_FLASH_SIZE,
|
||||||
.lookupTable =
|
.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),
|
[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),
|
[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),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.pageSize = 256u,
|
.pageSize = 256u,
|
||||||
|
|
|
@ -188,6 +188,9 @@ void mbed_sdk_init()
|
||||||
BOARD_ClockFullSpeed();
|
BOARD_ClockFullSpeed();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Enable non-HardFault exceptions
|
||||||
|
SCB->SHCSR |= SCB_SHCSR_USGFAULTENA_Msk | SCB_SHCSR_BUSFAULTENA_Msk | SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
|
|
||||||
// Switch to using an application-owned flexspi config instead of what the bootloader sets up
|
// Switch to using an application-owned flexspi config instead of what the bootloader sets up
|
||||||
#if DEVICE_FLASH
|
#if DEVICE_FLASH
|
||||||
mimxrt_flash_setup();
|
mimxrt_flash_setup();
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
# To change any of these parameters from their default values, set them in your build script between where you
|
# To change any of these parameters from their default values, set them in your build script between where you
|
||||||
# include app.cmake and where you add mbed os as a subdirectory.
|
# include app.cmake and where you add mbed os as a subdirectory.
|
||||||
|
|
||||||
|
# 1. Most debuggers cannot connect to this CPU after it does an NVIC system reset. See Mbed CE bug #83.
|
||||||
|
# However, a workaround has been implemented for PyOCD.
|
||||||
|
|
||||||
# General config parameters
|
# General config parameters
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
set(UPLOAD_METHOD_DEFAULT MBED)
|
set(UPLOAD_METHOD_DEFAULT MBED)
|
||||||
|
@ -16,6 +19,7 @@ set(MBED_RESET_BAUDRATE 115200)
|
||||||
set(PYOCD_UPLOAD_ENABLED TRUE)
|
set(PYOCD_UPLOAD_ENABLED TRUE)
|
||||||
set(PYOCD_TARGET_NAME mimxrt1050_hyperflash) # Note: change to "mimxrt1050_quadspi" if onboard QSPI flash is used
|
set(PYOCD_TARGET_NAME mimxrt1050_hyperflash) # Note: change to "mimxrt1050_quadspi" if onboard QSPI flash is used
|
||||||
set(PYOCD_CLOCK_SPEED 4000k)
|
set(PYOCD_CLOCK_SPEED 4000k)
|
||||||
|
set(PYOCD_EXTRA_OPTIONS -Oconnect_mode=pre-reset)
|
||||||
|
|
||||||
# Config options for LINKSERVER
|
# Config options for LINKSERVER
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
|
|
|
@ -7,8 +7,9 @@
|
||||||
# connecting an external J-Link probe. See here for conversion instructions: https://www.segger.com/products/debug-probes/j-link/models/other-j-links/lpc-link-2/
|
# connecting an external J-Link probe. See here for conversion instructions: https://www.segger.com/products/debug-probes/j-link/models/other-j-links/lpc-link-2/
|
||||||
# Also, a relatively new version of the J-Link software is needed (7.82 confirmed working), so try updating
|
# Also, a relatively new version of the J-Link software is needed (7.82 confirmed working), so try updating
|
||||||
# it if you get any errors.
|
# it if you get any errors.
|
||||||
# 2. pyocd seems glitchy for this device. Sometimes it works great, sometimes you get 'no ACK received.'
|
# 2. Most debuggers cannot connect to this CPU after it does an NVIC system reset. See Mbed CE bug #83.
|
||||||
# Might be related to pyOCD#861?
|
# However, a workaround has been implemented for PyOCD.
|
||||||
|
#
|
||||||
|
|
||||||
# General config parameters
|
# General config parameters
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
|
@ -26,6 +27,7 @@ set(JLINK_CLOCK_SPEED 4000)
|
||||||
set(PYOCD_UPLOAD_ENABLED TRUE)
|
set(PYOCD_UPLOAD_ENABLED TRUE)
|
||||||
set(PYOCD_TARGET_NAME mimxrt1060) # Note: This seems to use QSPI. There does not seem to be a pyocd equivalent for hyperflash.
|
set(PYOCD_TARGET_NAME mimxrt1060) # Note: This seems to use QSPI. There does not seem to be a pyocd equivalent for hyperflash.
|
||||||
set(PYOCD_CLOCK_SPEED 4000k)
|
set(PYOCD_CLOCK_SPEED 4000k)
|
||||||
|
set(PYOCD_EXTRA_OPTIONS -Oconnect_mode=pre-reset)
|
||||||
|
|
||||||
# Config options for LINKSERVER
|
# Config options for LINKSERVER
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
# This method needs the following parameters:
|
# This method needs the following parameters:
|
||||||
# PYOCD_TARGET_NAME - Name of your processor as passed to the -t option of pyOCD. This is usually the full or partial model number.
|
# PYOCD_TARGET_NAME - Name of your processor as passed to the -t option of pyOCD. This is usually the full or partial model number.
|
||||||
# PYOCD_CLOCK_SPEED - Clock speed of the JTAG or SWD connection. Default is in Hz, but can use k and M suffixes for MHz and GHz
|
# PYOCD_CLOCK_SPEED - Clock speed of the JTAG or SWD connection. Default is in Hz, but can use k and M suffixes for MHz and GHz
|
||||||
|
# PYOCD_EXTRA_OPTIONS - Extra options to pass to the pyocd 'flash' and 'gdbserver' commands.
|
||||||
|
|
||||||
set(UPLOAD_SUPPORTS_DEBUG TRUE)
|
set(UPLOAD_SUPPORTS_DEBUG TRUE)
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@ function(gen_upload_target TARGET_NAME BINARY_FILE)
|
||||||
-t ${PYOCD_TARGET_NAME}
|
-t ${PYOCD_TARGET_NAME}
|
||||||
${PYOCD_PROBE_ARGS}
|
${PYOCD_PROBE_ARGS}
|
||||||
--base-address ${MBED_UPLOAD_BASE_ADDR}
|
--base-address ${MBED_UPLOAD_BASE_ADDR}
|
||||||
|
${PYOCD_EXTRA_OPTIONS}
|
||||||
${BINARY_FILE})
|
${BINARY_FILE})
|
||||||
|
|
||||||
endfunction(gen_upload_target)
|
endfunction(gen_upload_target)
|
||||||
|
@ -45,7 +47,8 @@ set(UPLOAD_GDBSERVER_DEBUG_COMMAND
|
||||||
-t ${PYOCD_TARGET_NAME}
|
-t ${PYOCD_TARGET_NAME}
|
||||||
${PYOCD_PROBE_ARGS}
|
${PYOCD_PROBE_ARGS}
|
||||||
-f ${PYOCD_CLOCK_SPEED}
|
-f ${PYOCD_CLOCK_SPEED}
|
||||||
-p ${MBED_GDB_PORT})
|
-p ${MBED_GDB_PORT}
|
||||||
|
${PYOCD_EXTRA_OPTIONS})
|
||||||
|
|
||||||
# Reference: https://github.com/Marus/cortex-debug/blob/056c03f01e008828e6527c571ef5c9adaf64083f/src/pyocd.ts#L40
|
# Reference: https://github.com/Marus/cortex-debug/blob/056c03f01e008828e6527c571ef5c9adaf64083f/src/pyocd.ts#L40
|
||||||
set(UPLOAD_LAUNCH_COMMANDS
|
set(UPLOAD_LAUNCH_COMMANDS
|
||||||
|
|
|
@ -22,7 +22,7 @@ from functools import partial
|
||||||
class HtrunLogger(object):
|
class HtrunLogger(object):
|
||||||
"""! Yet another logger flavour """
|
"""! Yet another logger flavour """
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
logging.basicConfig(stream=sys.stdout,format='[%(created).2f][%(name)s]%(message)s', level=logging.DEBUG)
|
logging.basicConfig(stream=sys.stdout,format='[+%(relativeCreated)dms][%(name)s]%(message)s', level=logging.DEBUG)
|
||||||
self.logger = logging.getLogger(name)
|
self.logger = logging.getLogger(name)
|
||||||
self.format_str = '[%(logger_level)s] %(message)s'
|
self.format_str = '[%(logger_level)s] %(message)s'
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ def assemble_config(target_attributes: dict, program: MbedProgram) -> Config:
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return path
|
return path
|
||||||
|
|
||||||
config.json_sources = [make_relative_if_possible(program.root) for json_source in config.json_sources]
|
config.json_sources = [make_relative_if_possible(json_source) for json_source in config.json_sources]
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
# Automatically generated configuration file.
|
# Automatically generated configuration file.
|
||||||
# DO NOT EDIT. Content may be overwritten.
|
# DO NOT EDIT. Content may be overwritten.
|
||||||
|
|
||||||
include_guard(GLOBAL)
|
|
||||||
|
|
||||||
set(MBED_TOOLCHAIN "{{toolchain_name}}")
|
set(MBED_TOOLCHAIN "{{toolchain_name}}")
|
||||||
set(MBED_CPU_CORE "{{core}}")
|
set(MBED_CPU_CORE "{{core}}")
|
||||||
set(MBED_C_LIB "{{c_lib}}")
|
set(MBED_C_LIB "{{c_lib}}")
|
||||||
|
@ -69,7 +67,6 @@ set(MBED_TARGET_DEFINITIONS{% for component in components %}
|
||||||
|
|
||||||
# config
|
# config
|
||||||
set(MBED_CONFIG_DEFINITIONS
|
set(MBED_CONFIG_DEFINITIONS
|
||||||
|
|
||||||
# Config settings
|
# Config settings
|
||||||
{% for setting in config %}
|
{% for setting in config %}
|
||||||
{%- if setting.macro_name -%}
|
{%- if setting.macro_name -%}
|
||||||
|
|
Loading…
Reference in New Issue