Skip to content

Commit

Permalink
Platform change for STM32 only: add support for STM32U5 on STM32Cube.…
Browse files Browse the repository at this point in the history
… (#1196)

The STM32U5 MCU, which is already supported via Zephyr, is now also supported on the STM32Cube platform. Two configurations are supported: the default STM32U5 integration from ST, which now uses ThreadX as the underlying OS [but see important note below], and a configuration which continues to use FreeRTOS as the underlying OS (i.e. as STM32F4 does). In order to make this possible all OS operations for STM32U5 builds go through CMSIS (V2). See the README.md files under the stm32cube platform directory for details of how the two differ and what limitations you may find.

**VERY IMPORTANT**: there is a bug in the ST-provided CMSIS layer for ThreadX in that it does not free memory when a dynamic task is terminated, hence you will very quickly run out of memory; ST are aware of this, see  STMicroelectronics/STM32CubeU5#48 and we await a fix. Until the fix is available PLEASE USE THE FREERTOS version for STM32U5, by defining U_PORT_STM32_CMSIS_ON_FREERTOS (as well as U_PORT_STM32_PURE_CMSIS) when building ubxlib, DO NOT USE the THREADX version.

Existing STM32Cube users should note that the guts of stm32f4.mk are moved up a directory-level and renamed to stm32.mk; this file is included in stm32f4.mk so you should notice no difference.
  • Loading branch information
RobMeades authored Jul 10, 2024
1 parent 98f0c5b commit 37447ae
Show file tree
Hide file tree
Showing 66 changed files with 7,966 additions and 644 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ The software in this repository is Apache 2.0 licensed and copyright u-blox with

- The heap management code (`heap_useNewlib.c`), required because the [STM32Cube](/port/platform/stm32cube) platform doesn't provide the necessary memory management for [newlib](https://sourceware.org/newlib/libc.html) and [FreeRTOS](https://www.freertos.org) to play together, is copyright Dave Nadler.
- The AT client code in [common/at_client](/common/at_client) is derived from the Apache 2.0 licensed AT parser of [mbed-os](https://github.com/ARMmbed/mbed-os).
- The [stm32cube platform directory](/port/platform/stm32cube/src) necessarily includes porting files from the STM32F4 SDK that are copyright ST Microelectronics.
- The [stm32cube platform directory](/port/platform/stm32cube/src) necessarily includes porting files from the STM32F4 and STM32U5 SDKs that are copyright ST Microelectronics.
- The `go` echo servers in [common/sock/test/echo_server](/common/sock/test/echo_server) are based on those used in testing of [AWS FreeRTOS](https://github.com/aws/amazon-freertos).
- The `setjmp()/longjmp()` implementation in [port/clib/u_port_setjmp.S](/port/clib/u_port_setjmp.S), used when testing the Zephyr platform, is copyright Nick Clifton, Cygnus Solutions and part of [newlib](https://sourceware.org/newlib/libc.html).
- The `base64` implementation in [common/utils/src/base64.h](/common/utils/src/base64.h) is copyright [William Sherif](https://github.com/superwills/NibbleAndAHalf).
Expand Down
26 changes: 19 additions & 7 deletions port/api/u_port_event_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,21 @@ extern "C" {
# define U_PORT_EVENT_QUEUE_MAX_NUM 20
#endif

#ifndef U_PORT_EVENT_QUEUE_MAX_PARAM_LENGTH_BYTES
/** The maximum length of parameter block that can be sent on an
* event queue.
*/
# define U_PORT_EVENT_QUEUE_MAX_PARAM_LENGTH_BYTES 128
#endif

/** The length of uEventQueueControlOrSize_t (see implementation).
*/
#define U_PORT_EVENT_QUEUE_CONTROL_OR_SIZE_LENGTH_BYTES 4

#ifndef U_PORT_EVENT_QUEUE_MAX_PARAM_LENGTH_BYTES
# if defined(U_PORT_STM32_PURE_CMSIS) && !defined(U_PORT_STM32_CMSIS_ON_FREERTOS)
/** When using ThreadX under CMSIS the maximum length of a queue item is just
* 64 bytes, hence the event queue maximum item length is similarly limited.
*/
# define U_PORT_EVENT_QUEUE_MAX_PARAM_LENGTH_BYTES ((16 * sizeof(uint32_t)) - U_PORT_EVENT_QUEUE_CONTROL_OR_SIZE_LENGTH_BYTES)
# else
# define U_PORT_EVENT_QUEUE_MAX_PARAM_LENGTH_BYTES 128
# endif
#endif

#ifndef U_PORT_EVENT_QUEUE_MIN_TASK_STACK_SIZE_BYTES
/** The minimum stack size for an event queue task; the governing
* factor here is ESP32S3, which requires ~256 bytes more stack
Expand All @@ -133,6 +137,14 @@ extern "C" {
* -------------------------------------------------------------- */

/** Open an event queue.
*
* Note: some platforms place further restrictions on the maximum
* size of message that can be sent by the underlying uPortQueue API,
* and that has an impact here. For instance, ThreadX, used on
* the later STM32Cube platforms, has a limit of 64 bytes, meaning
* that paramMaxLengthBytes here, by the time
* #U_PORT_EVENT_QUEUE_CONTROL_OR_SIZE_LENGTH_BYTES is accounted
* for, is just 60 bytes.
*
* Note: in some operating systems (e.g. Zephyr) we use a
* conditional compilation flag, U_CFG_OS_MAX_THREADS, to
Expand Down
10 changes: 5 additions & 5 deletions port/api/u_port_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ int32_t uPortI2cGetTimeout(int32_t handle);
* directions; this should be used only on chipsets where the HW
* interface is limited (e.g. nRF52832, which has a maximum DMA
* size of 256 for I2C, STM32 on Zephyr which has a similar (though
* not DMA related) limitation): any transfers above this size will be
* segmented into N transfers of no more than this size. If this is
* not called no segmentation will be applied. Where this is not
* supported a weakly-linked function will return
* #U_ERROR_COMMON_NOT_SUPPORTED.
* not DMA related) limitation and STM32U5 on STM32Cube): any
* transfers above this size will be segmented into N transfers of
* no more than this size. If this is not called no segmentation will
* be applied. Where this is not supported a weakly-linked function
* will return #U_ERROR_COMMON_NOT_SUPPORTED.
*
* Note to GNSS users: the receive length of each segment of
* data from the GNSS device is already limited by
Expand Down
7 changes: 6 additions & 1 deletion port/api/u_port_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ int32_t uPortTaskGetHandle(uPortTaskHandle_t *pTaskHandle);
* -------------------------------------------------------------- */

/** Create a queue.
*
* Note: some platforms place restrictions on itemSizeBytes; for
* instance, ThreadX, used on the later STM32Cube platforms, has a
* limit of 64 bytes.
*
* @param queueLength the maximum length of the queue in units
* of itemSizeBytes.
Expand Down Expand Up @@ -516,7 +520,8 @@ int32_t uPortSemaphoreGive(const uPortSemaphoreHandle_t semaphoreHandle);

/** Give a semaphore from interrupt, unless the semaphore is already at its
* maximum permitted count. Note that not all platforms support this
* function (e.g. Windows doesn't).
* function (e.g. Windows, Linux and later STM32Cube platforms where ThreadX
* is the default RTOS do not).
*
* @param semaphoreHandle the handle of the semaphore.
* @return zero on success else negative error code.
Expand Down
4 changes: 4 additions & 0 deletions port/api/u_port_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ int32_t uPortUartPrefix(const char *pPrefix);
* the README.md for that platform to find out how the pins
* are chosen.
*
* SPECIAL CASE FOR STM32U5: you may employ the single LPUART
* on STM32U5 platform by specifying uart 0 (the "normal" UARTs on
* STM32U5 platform start at HW block 1).
*
* @param uart the UART HW block to use.
* @param baudRate the baud rate to use.
* @param[in] pReceiveBuffer a receive buffer to use,
Expand Down
2 changes: 1 addition & 1 deletion port/platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Also provided is a [static_size](static_size) "platform", which includes stubs f
The MCUs supported by the platforms are as follows:

- Espressif [ESP-IDF](esp-idf): ESP32.
- ST Microelectronics' [STM32Cube IDE](stm32cube): STM32F4.
- ST Microelectronics' [STM32Cube IDE](stm32cube): STM32F4 and STM32U5.
- [zephyr](zephyr): we test NRF52/NRF53, STM32, and also Linux/Posix for development purposes, but any MCU that is supported by Zephyr may work transparently.
- not really an MCU but [windows](windows) is supported for development/test purposes.
- [Linux](linux): not an MCU but native Linux is supported.
Expand Down
5 changes: 4 additions & 1 deletion port/platform/common/automation/DATABASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The table below defines the instances of test hardware available on the `ubxlib`
| 6.1.1 | CodeChecker (Zephyr), short-range gen 2 | NRF52833 | ubx_evkninab4_nrf52833 | CodeChecker:Zephyr | | SARA_R5 NORA_W36 | | short_range short_range_gen2 | U_CFG_BLE_MODULE_INTERNAL U_CFG_PPP_ENABLE U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_BLE_TEST_CFG_REMOTE_SPS_PERIPHERAL=2462ABB6EAC6p U_CFG_APP_SHORT_RANGE_ROLE=1 U_CFG_TEST_NET_STATUS_SHORT_RANGE U_DEBUG_UTILS_DUMP_THREADS U_CFG_HEAP_MONITOR |
| 6.2.0 | CodeChecker (STM32Cube) | STM32F4 | | CodeChecker:STM32Cube || SARA_R5 NINA_W15 M8 | | | U_CFG_APP_PIN_SHORT_RANGE_RESET_TO_DEFAULTS=0x42 U_CFG_SARA_R5_M8_WORKAROUND U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_CFG_TEST_NET_STATUS_CELL U_CFG_TEST_NET_STATUS_SHORT_RANGE U_DEBUG_UTILS_DUMP_THREADS U_CFG_HEAP_MONITOR |
| 6.2.1 | CodeChecker (STM32Cube) with geofence | STM32F4 | | CodeChecker:STM32Cube || SARA_R5 NINA_W15 M8 | | | U_CFG_GEOFENCE U_CFG_APP_PIN_SHORT_RANGE_RESET_TO_DEFAULTS=0x42 U_CFG_SARA_R5_M8_WORKAROUND U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_CFG_TEST_NET_STATUS_CELL U_CFG_TEST_NET_STATUS_SHORT_RANGE U_DEBUG_UTILS_DUMP_THREADS U_CFG_HEAP_MONITOR |
| 6.2.2 | CodeChecker (STM32Cube) | STM32U5 | | CodeChecker:STM32Cube || SARA_R5 NINA_W15 M8 | | | U_CFG_APP_PIN_SHORT_RANGE_RESET_TO_DEFAULTS=0x42 U_CFG_SARA_R5_M8_WORKAROUND U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_CFG_TEST_NET_STATUS_CELL U_CFG_TEST_NET_STATUS_SHORT_RANGE U_DEBUG_UTILS_DUMP_THREADS U_CFG_HEAP_MONITOR |
| 7 | Build PIO examples | | | | | | | | |
| 8 | Build as a Zephyr module | NRF5340 | nrf5340dk_nrf5340_cpuapp | | | | | |
| 10.0 | ESP32-DevKitC | ESP32 | | ESP-IDF | | M10 | port ubx_protocol gnss spartn geofence | gnss geodesic | U_CFG_GEOFENCE U_CFG_GNSS_FENCE_USE_GEODESIC U_CFG_APP_GNSS_I2C=0 U_CFG_TEST_PIN_GNSS_RESET_N=23 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_CFG_MUTEX_DEBUG U_DEBUG_UTILS_DUMP_THREADS |
Expand Down Expand Up @@ -71,7 +72,9 @@ The table below defines the instances of test hardware available on the `ubxlib`
| 29 | HPG C214 board (NINA-W1), live network | ESP32 | | ESP-IDF | | LENA_R8 M9 | port device network sock cell security mqtt_client gnss location || U_CFG_PPP_ENABLE U_HTTP_CLIENT_DISABLE_TEST U_CELL_GPIO_DISABLE_TEST U_MQTT_CLIENT_TEST_NO_NULL_SEND U_CFG_TEST_GNSS_POWER_SAVING_NOT_SUPPORTED U_GNSS_MGA_TEST_ASSIST_NOW_AUTONOMOUS_NOT_SUPPORTED U_CELL_CFG_TEST_USE_FIXED_TIME_SECONDS U_CFG_MONITOR_DTR_RTS_OFF U_CELL_TEST_NO_INVALID_APN U_CELL_TEST_CFG_BANDMASK1=0x0000000000080084ULL U_CELL_NET_TEST_RAT=U_CELL_NET_RAT_LTE U_CFG_APP_PIN_CELL_ENABLE_POWER=-1 U_CFG_APP_PIN_CELL_PWR_ON=0x801a U_CFG_APP_PIN_CELL_RESET=33 U_CELL_RESET_PIN_DRIVE_MODE=U_PORT_GPIO_DRIVE_MODE_NORMAL U_CFG_APP_PIN_CELL_VINT=0x8025 U_CFG_APP_PIN_CELL_DTR=15 U_CFG_APP_PIN_CELL_TXD=25 U_CFG_APP_PIN_CELL_RXD=34 U_CFG_APP_PIN_CELL_RTS=27 U_CFG_APP_PIN_CELL_CTS=36 U_CFG_APP_GNSS_I2C=0 U_GNSS_TEST_I2C_ADDRESS_EXTRA=0x43 U_CFG_APP_CELL_PIN_GNSS_POWER=-1 U_CFG_APP_CELL_PIN_GNSS_DATA_READY=-1 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_DEBUG_UTILS_DUMP_THREADS |
| 30 | STM32F407 Discovery, NORA-W3, SARA-R520 EVK| STM32F4 | | STM32Cube | | LEXI_R52 NORA_W36 | port device network sock cell ble wifi short_range security mqtt_client http_client location | cell gnss short_range short_range_gen2 | CMSIS_V2 HSE_VALUE=8000000U U_CFG_LOC_TEST_CHANGE_SYSTEM_TYPES_DISABLE U_CFG_APP_PIN_C030_ENABLE_3V3=-1 U_CFG_APP_PIN_CELL_RESET=-1 U_CFG_APP_CELL_UART=2 U_CFG_APP_PIN_CELL_TXD=0x03 U_CFG_APP_PIN_CELL_RXD=0x02 U_CFG_APP_PIN_CELL_RTS=-1 U_CFG_APP_PIN_CELL_CTS=-1 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_BLE_TEST_CFG_REMOTE_SPS_PERIPHERAL=2462ABB6EAC6p U_CFG_APP_SHORT_RANGE_ROLE=3 U_CFG_APP_SHORT_RANGE_UART2=6 U_CFG_APP_PIN_SHORT_RANGE_TXD2=0x26 U_CFG_APP_PIN_SHORT_RANGE_RXD2=0x27 U_DEBUG_UTILS_DUMP_THREADS |
| 31 | STM32F7, Nucleo-F767ZI, LARA-R6, live net | STM32 | nucleo_f767zi | Zephyr | | LARA_R6 | port device network sock cell security mqtt_client http_client location || U_ZEPHYR_PORT_UART_ASYNC U_CFG_TEST_DISABLE_MUX U_CFG_TEST_CELL_PWR_DISABLE U_CELL_TEST_CFG_APN=iot.1nce.net U_CELL_CFG_TEST_USE_FIXED_TIME_SECONDS U_CELL_TEST_NO_INVALID_APN U_CELL_TEST_CFG_BANDMASK1=0x0000000000080084ULL U_CELL_NET_TEST_RAT=U_CELL_NET_RAT_LTE U_CELL_TEST_CFG_MNO_PROFILE=90 U_DEBUG_UTILS_DUMP_THREADS |
| 32 | STM32U5, Nucleo-U575ZI-q | STM32 | nucleo_u575zi_q | Zephyr | | SARA_U201 M9 ODIN_W2 | port device network sock cell ble wifi short_range gnss security http_client location ubx_protocol spartn || U_CFG_CELL_DISABLE_UART_POWER_SAVING U_CELL_NET_TEST_RAT=U_CELL_NET_RAT_GSM_GPRS_EGPRS U_CELL_TEST_CFG_APN=iot.1nce.net U_CELL_CFG_APN_DEFAULT=iot.1nce.net U_CFG_TEST_TRANSPORT_SECURITY_DISABLE U_CELL_CFG_TEST_USE_FIXED_TIME_SECONDS U_CELL_TEST_NO_INVALID_APN U_CFG_CELL_DISABLE_UART_POWER_SAVING U_CFG_APP_GNSS_I2C=1 U_CFG_APP_I2C_MAX_SEGMENT_SIZE=255 U_GNSS_MGA_TEST_HAS_FLASH U_CFG_TEST_GNSS_POWER_SAVING_NOT_SUPPORTED U_GNSS_MGA_TEST_ASSIST_NOW_AUTONOMOUS_NOT_SUPPORTED U_CFG_TEST_PIN_GNSS_RESET_N=0x5D U_CFG_APP_SHORT_RANGE_UART=3 U_CFG_TEST_BLE_DISABLE_SPS U_CFG_TEST_UART_A=-1 U_DEBUG_UTILS_DUMP_THREADS |
| 32.0 | STM32U5, Nucleo-U575ZI, Zephyr | STM32 | nucleo_u575zi_q | Zephyr | | SARA_U201 M9 ODIN_W2 | port device network sock cell ble wifi short_range gnss security http_client location ubx_protocol spartn || U_CFG_CELL_DISABLE_UART_POWER_SAVING U_CELL_NET_TEST_RAT=U_CELL_NET_RAT_GSM_GPRS_EGPRS U_CELL_TEST_CFG_APN=iot.1nce.net U_CELL_CFG_APN_DEFAULT=iot.1nce.net U_CFG_TEST_TRANSPORT_SECURITY_DISABLE U_CELL_CFG_TEST_USE_FIXED_TIME_SECONDS U_CELL_TEST_NO_INVALID_APN U_CFG_CELL_DISABLE_UART_POWER_SAVING U_CFG_APP_GNSS_I2C=1 U_CFG_APP_I2C_MAX_SEGMENT_SIZE=255 U_GNSS_MGA_TEST_HAS_FLASH U_CFG_TEST_GNSS_POWER_SAVING_NOT_SUPPORTED U_GNSS_MGA_TEST_ASSIST_NOW_AUTONOMOUS_NOT_SUPPORTED U_CFG_TEST_PIN_GNSS_RESET_N=0x5D U_CFG_APP_SHORT_RANGE_UART=3 U_CFG_TEST_BLE_DISABLE_SPS U_CFG_TEST_UART_A=-1 U_DEBUG_UTILS_DUMP_THREADS |
| 32.1 | STM32U5, STM32Cube default, Nucleo-U575ZI | STM32U5 | | STM32Cube | | SARA_U201 | port || U_CFG_APP_FILTER=portInit.portRentrancy.portOs.portEventQueue.portTimers.portUart.portI2c.portSpi.portGpio. U_CELL_NET_TEST_RAT=U_CELL_NET_RAT_GSM_GPRS_EGPRS U_CELL_TEST_CFG_APN=iot.1nce.net U_CELL_CFG_APN_DEFAULT=iot.1nce.net U_CFG_TEST_TRANSPORT_SECURITY_DISABLE U_CELL_CFG_TEST_USE_FIXED_TIME_SECONDS U_CELL_TEST_NO_INVALID_APN U_CFG_CELL_DISABLE_UART_POWER_SAVING U_CFG_APP_GNSS_I2C=-1 U_CFG_APP_GNSS_SPI=-1 U_CFG_HW_EXTI_12_AVAILABLE=1 U_CFG_HW_EXTI_15_AVAILABLE=1 |
| 32.2 | STM32U5, STM32Cube FreeRTOS, Nucleo-U575ZI | STM32U5 | | STM32Cube | FreeRTOS | SARA_U201 | port || U_CFG_APP_FILTER=port.example. U_CELL_NET_TEST_RAT=U_CELL_NET_RAT_GSM_GPRS_EGPRS U_CELL_TEST_CFG_APN=iot.1nce.net U_CELL_CFG_APN_DEFAULT=iot.1nce.net U_CFG_TEST_TRANSPORT_SECURITY_DISABLE U_CELL_CFG_TEST_USE_FIXED_TIME_SECONDS U_CELL_TEST_NO_INVALID_APN U_CFG_CELL_DISABLE_UART_POWER_SAVING U_CFG_APP_GNSS_I2C=-1 U_CFG_APP_GNSS_SPI=-1 |
| 33 | ESP32-DevKitC + EVK, live network | ESP32 | | ESP-IDF | | LEXI_R10 | port device network sock cell security mqtt_client http_client || U_CFG_TEST_UART_A=-1 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_APP_PIN_CELL_VINT=-1 U_CFG_APP_PIN_CELL_ENABLE_POWER=-1 U_CFG_APP_CELL_PIN_GNSS_POWER=-1 U_CFG_APP_CELL_PIN_GNSS_DATA_READY=-1 U_CELL_TEST_CFG_BANDMASK1=0x80800d5ULL U_CELL_TEST_CFG_ALT_BANDMASK1=0x10ULL U_CELL_PWR_GNSS_PROFILE_BITS_EXTRA=-1 U_CFG_LOC_TEST_CHANGE_SYSTEM_TYPES_DISABLE U_CELL_MUX_ENABLE_DEBUG U_CELL_MUX_ENABLE_USER_TX_DEBUG U_CELL_MUX_ENABLE_USER_RX_DEBUG U_CELL_MUX_HEX_DEBUG U_DEBUG_UTILS_DUMP_THREADS U_CELL_TEST_CFG_MNO_PROFILE=90 U_CELL_TEST_NO_INVALID_APN U_HTTP_CLIENT_TEST_MAX_NUM=1 U_HTTP_SHORT_RANGE_CLIENT_TEST_MAX_NUM=2 |

Notes:
Expand Down
5 changes: 4 additions & 1 deletion port/platform/common/automation/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,12 @@ def buildAndTestPipeline(instance_str, json_entry, filter) {
sh(script: "echo 0 > sudo tee /sys/bus/usb/devices/1-1.3/authorized")
sh(script: "echo 0 > sudo tee /sys/bus/usb/devices/1-1.4/authorized")
// Set return status to true so that it doesn't cause an exception if this instance doesn't
// happen to have a C030 board or an STM32F407 Discovery board or a Segger J-Link attached
// happen to have a C030 board or an STM32F407 Discovery board, or any number of other ST
// boards, or a Segger J-Link attached
sh(script: "sudo udisksctl power-off --block-device /dev/disk/by-label/UBLOX-R412M", returnStatus : true)
sh(script: "sudo udisksctl power-off --block-device /dev/disk/by-label/DIS_F407VG", returnStatus : true)
sh(script: "sudo udisksctl power-off --block-device /dev/disk/by-label/NOD_U575ZI", returnStatus : true)
sh(script: "sudo udisksctl power-off --block-device /dev/disk/by-label/NOD_F767ZI", returnStatus : true)
sh(script: "sudo udisksctl power-off --block-device /dev/disk/by-label/JLINK", returnStatus : true)
sh(script: "uhubctl -a 0 -l 1-1 -r 100")
}
Expand Down
14 changes: 14 additions & 0 deletions port/platform/common/automation/cfg/stm32u5.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OpenOCD config for STM32U5x
source [find interface/stlink.cfg]
transport select hla_swd
source [find target/stm32u5x.cfg]

# Reset configuration
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only srst_nogate connect_assert_srst

# Target specific frequencies
set _TARGET_SYSTEM_FREQUENCY 160000000
set _TARGET_SWO_FREQUENCY 2000000

1 change: 1 addition & 0 deletions port/platform/common/automation/malloc_excludes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ port/u_port_heap.c

# Platform files that map malloc()/free(), left this way so that customer code can use malloc()/free()
port/platform/cell_ucpu/r5/src/u_port_clib.c
port/platform/stm32cube/src/u_port_clib.c
port/platform/stm32cube/src/heap_useNewlib.c
port/platform/zephyr/src/u_port_clib.c

Expand Down
4 changes: 2 additions & 2 deletions port/platform/common/automation/scripts/u_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@
"debugger": "066DFF313937424757082031"}
__DEFAULT_SETTINGS["CONNECTION_INSTANCE_32" + __SETTINGS_POSTFIX_AGENT_SPECIFIC] = \
{"serial_port": ("/dev/serial/by-id/"
"usb-STMicroelectronics_STLINK-V3_004800273532510F31333430-if02"),
"debugger": "004800273532510F31333430"}
"usb-STMicroelectronics_STLINK-V3_003E004C3532510F31333430-if02"),
"debugger": "003E004C3532510F31333430"}
__DEFAULT_SETTINGS["CONNECTION_INSTANCE_33" + __SETTINGS_POSTFIX_AGENT_SPECIFIC] = \
{"serial_port": "/dev/silabs_cp210x_uart"}
# u_data.py
Expand Down
4 changes: 2 additions & 2 deletions port/platform/common/automation/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from invoke import Collection, Config
from scripts import u_utils
from . import nrfconnect, stm32cubef4, esp_idf, automation, linux
from . import nrfconnect, stm32cube, esp_idf, automation, linux

ns = Collection()

Expand All @@ -11,7 +11,7 @@

ns.configure(cfg)
ns.add_collection(nrfconnect)
ns.add_collection(stm32cubef4)
ns.add_collection(stm32cube)
ns.add_collection(esp_idf)
ns.add_collection(automation)
ns.add_collection(linux)
Loading

0 comments on commit 37447ae

Please sign in to comment.