Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ list(APPEND CMAKE_MODULE_PATH
add_subdirectory(extern)

if(MBED_IS_STANDALONE)

# Always print output on test failure
list(APPEND CMAKE_CTEST_ARGUMENTS --output-on-failure)

include(CTest)

if((NOT MBED_BUILD_GREENTEA_TESTS) AND MBED_ENABLE_TESTING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ target_sources(mbed-wifi
src/bus_protocols/whd_bus_spi_protocol.c
)

if("TARGET_CY_EXTERNAL_WIFI_FW" IN_LIST MBED_TARGET_DEFINITIONS)
# For Cypress targets, add additional resource driver for external wifi firmware
target_sources(mbed-wifi PRIVATE
resources/resource_imp/cy_ext_wifi_fw_resources.c)
target_link_libraries(mbed-wifi PUBLIC mbed-cy-external-wifi-fw)
endif()

target_compile_definitions(mbed-wifi
PUBLIC
MBED_CONF_CY_PSOC6_WHD_PRESENT=1
Expand Down
7 changes: 6 additions & 1 deletion storage/kvstore/kv_config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ target_link_libraries(mbed-storage-kv-config

if("DEVICE_FLASH=1" IN_LIST MBED_TARGET_DEFINITIONS)
target_link_libraries(mbed-storage-kv-config PUBLIC mbed-storage-flashiap)
endif()
endif()

if("TARGET_CY_EXTERNAL_WIFI_FW" IN_LIST MBED_TARGET_DEFINITIONS)
# On some Cypress PSOC6 targets, the external wifi fw library provides the definition of get_other_blockdevice()
target_link_libraries(mbed-storage-kv-config PUBLIC mbed-cy-external-wifi-fw)
endif()
5 changes: 5 additions & 0 deletions storage/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ list(APPEND mbed-storage-libs
mbed-storage-littlefs-v2
)

if("TARGET_CY_EXTERNAL_WIFI_FW" IN_LIST MBED_TARGET_DEFINITIONS)
# On some Cypress PSOC6 targets, the external wifi fw library provides the definition of BlockDevice::get_default_instance()
target_link_libraries(mbed-storage PUBLIC mbed-cy-external-wifi-fw)
endif()

if("COMPONENT_DATAFLASH=1" IN_LIST MBED_TARGET_DEFINITIONS)
list(APPEND mbed-storage-libs mbed-storage-dataflash)
endif()
Expand Down
8 changes: 0 additions & 8 deletions targets/TARGET_Cypress/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,4 @@

add_subdirectory(TARGET_PSOC6 EXCLUDE_FROM_ALL)

add_library(mbed-cy-external-wifi-fw INTERFACE)
target_compile_definitions(mbed-cy-external-wifi-fw
INTERFACE
"CY_ENABLE_XIP_PROGRAM"
"CY_STORAGE_WIFI_DATA=\".cy_xip\""
"CY_STORAGE_WIFI_DATA_OUTPUT=cy_xip"
"CY_EXT_WIFI_FW_STORAGE=QSPIF"
)

1 change: 1 addition & 0 deletions targets/TARGET_Cypress/TARGET_PSOC6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(COMPONENT_SCL EXCLUDE_FROM_ALL)
add_subdirectory(ext-wifi-fw EXCLUDE_FROM_ALL)

add_library(mbed-cat1a INTERFACE)

Expand Down
23 changes: 23 additions & 0 deletions targets/TARGET_Cypress/TARGET_PSOC6/ext-wifi-fw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
add_library(mbed-cy-external-wifi-fw STATIC
cy_ext_wifi_fw_reserved_region_bd.cpp
CyReservedRegionBlockDevice.cpp)

target_include_directories(mbed-cy-external-wifi-fw PUBLIC .)

target_link_libraries(mbed-cy-external-wifi-fw PUBLIC
mbed-core-flags
mbed-storage-qspif)

target_compile_definitions(mbed-cy-external-wifi-fw
PUBLIC
"CY_ENABLE_XIP_PROGRAM"
"CY_STORAGE_WIFI_DATA=\".cy_xip\""
"CY_STORAGE_WIFI_DATA_OUTPUT=cy_xip"
"CY_EXT_WIFI_FW_STORAGE=QSPIF"
)

# Force linking of the cy_ext_wifi_fw_reserved_region_bd.o object file to correctly resolve weak symbols
target_link_options(mbed-cy-external-wifi-fw
INTERFACE
LINKER:--undefined=force_link_cy_ext_wifi_fw_reserved_region_bd_o
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define CY_RESERVED_REGION_BLOCK_DEVICE_H

#include "mbed.h"
#include "BlockDevice.h"

/**
* Block device for working via an underlying block device without altering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,15 @@ BlockDevice *BlockDevice::get_default_instance()
}

#endif /* defined(CY_EXT_WIFI_FW_STORAGE) && !MBED_CONF_TARGET_XIP_ENABLE */

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C" void force_link_cy_ext_wifi_fw_reserved_region_bd_o()
{}
File renamed without changes.
33 changes: 22 additions & 11 deletions targets/targets.json5
Original file line number Diff line number Diff line change
Expand Up @@ -9087,8 +9087,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
"forced_reset_timeout": 5,
"overrides": {
"deep-sleep-latency": "CY_CFG_PWR_DEEPSLEEP_LATENCY"
},
"is_mcu_family_target": true
}
},
"MCU_PSOC6_M4": {
"inherits": [
Expand All @@ -9113,6 +9112,18 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
"full", "bare-metal"
]
},
"MCU_PSOC62_CM4": {
"inherits": [
"MCU_PSOC6_M4"
],
"is_mcu_family_target": true
},
"MCU_PSOC64_CM4": {
"inherits": [
"MCU_PSOC6_M4"
],
"is_mcu_family_target": true
},
"CY_EXTERNAL_WIFI_FW": {
"public": false,
"macros_add": [
Expand All @@ -9124,7 +9135,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
},
"CY8CPROTO_062_4343W": {
"inherits": [
"MCU_PSOC6_M4"
"MCU_PSOC62_CM4"
],
"features": [
"BLE"
Expand Down Expand Up @@ -9173,7 +9184,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
},
"CY8CKIT_062S2_43012": {
"inherits": [
"MCU_PSOC6_M4"
"MCU_PSOC62_CM4"
],
"features": [
"BLE"
Expand Down Expand Up @@ -9218,7 +9229,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
},
"CY8CPROTO_062S3_4343W": {
"inherits": [
"MCU_PSOC6_M4",
"MCU_PSOC62_CM4",
"CY_EXTERNAL_WIFI_FW"
],
"features": [
Expand Down Expand Up @@ -9261,7 +9272,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
},
"CY8CKIT_062_WIFI_BT": { // AKA PSoC 6 WiFi-BT Pioneer Kit
"inherits": [
"MCU_PSOC6_M4"
"MCU_PSOC62_CM4"
],
"features": [
"BLE"
Expand Down Expand Up @@ -9313,7 +9324,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
},
"CY8CKIT_062_BLE": { // AKA PSoC 6 BLE Pioneer Kit
"inherits": [
"MCU_PSOC6_M4"
"MCU_PSOC62_CM4"
],
"device_has_remove": [
"USBDEVICE"
Expand Down Expand Up @@ -9352,7 +9363,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
},
"CYW9P62S1_43438EVB_01": { // AKA CYW9P62S1-43438EVB-01 PSoC 62S1 Wi-Fi BT Pioneer Kit
"inherits": [
"MCU_PSOC6_M4"
"MCU_PSOC62_CM4"
],
"features": [
"BLE"
Expand Down Expand Up @@ -9406,7 +9417,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
},
"CYW9P62S1_43012EVB_01": { // AKA CYW9P62S1-43012EVB-01 PSoC 62S1 Wi-Fi BT Pioneer Kit
"inherits": [
"MCU_PSOC6_M4"
"MCU_PSOC62_CM4"
],
"features": [
"BLE"
Expand Down Expand Up @@ -9453,7 +9464,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
},
"CY8CKIT064B0S2_4343W": { // AKA CY8CKIT-064B0S2-4343W PSoC 64 Secure Boot Wi-Fi BT Pioneer Kit
"inherits": [
"MCU_PSOC6_M4"
"MCU_PSOC64_CM4"
],
"supported_form_factors": [
"ARDUINO_UNO"
Expand Down Expand Up @@ -9507,7 +9518,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
},
"CYTFM_064B0S2_4343W": { // Same as
"inherits": [
"MCU_PSOC6_M4"
"MCU_PSOC64_CM4"
],
"supported_form_factors": [
"ARDUINO_UNO"
Expand Down
2 changes: 1 addition & 1 deletion targets/upload_method_cfg/ARDUINO_GIGA_CM7.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mbed OS upload method configuration file for target ARDUINO_GIGA_CM7.
# 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 mbed_toolchain_setup and where you add mbed os as a subdirectory.

# Notes:
# 1. To use this target with PyOCD, you need to install a pack: `pyocd pack install STM32H747XIHx`.
Expand Down
2 changes: 1 addition & 1 deletion targets/upload_method_cfg/ARDUINO_NANO33BLE.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mbed OS upload method configuration file for target ARDUINO_NANO33BLE.
# 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 mbed_toolchain_setup and where you add mbed os as a subdirectory.

# General config parameters
# -------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions targets/upload_method_cfg/ARDUINO_NANO33BLE_SWD.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mbed OS upload method configuration file for target ARDUINO_NANO33BLE_SWD.
# 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 mbed_toolchain_setup and where you add mbed os as a subdirectory.

# Notes:
# 1. Using pyocd with this device requires installing a pack: `pyocd pack install nrf52`.
Expand All @@ -22,6 +22,6 @@ set(PYOCD_CLOCK_SPEED 4000k)

set(OPENOCD_UPLOAD_ENABLED TRUE)
set(OPENOCD_CHIP_CONFIG_COMMANDS
-f ${OpenOCD_SCRIPT_DIR}/interface/cmsis-dap.cfg
-f interface/cmsis-dap.cfg
-c "transport select swd"
-f ${OpenOCD_SCRIPT_DIR}/target/nrf52.cfg)
-f target/nrf52.cfg)
6 changes: 3 additions & 3 deletions targets/upload_method_cfg/ARDUINO_NICLA_SENSE_ME.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mbed OS upload method configuration file for target ARDUINO_NANO33BLE_SWD.
# 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 mbed_toolchain_setup and where you add mbed os as a subdirectory.

# Notes:
# 1. Using pyocd with this device requires installing a pack: `pyocd pack install nrf52`.
Expand All @@ -22,6 +22,6 @@ set(PYOCD_CLOCK_SPEED 4000k)

set(OPENOCD_UPLOAD_ENABLED TRUE)
set(OPENOCD_CHIP_CONFIG_COMMANDS
-f ${OpenOCD_SCRIPT_DIR}/interface/cmsis-dap.cfg
-f interface/cmsis-dap.cfg
-c "transport select swd"
-f ${OpenOCD_SCRIPT_DIR}/target/nrf52.cfg)
-f target/nrf52.cfg)
2 changes: 1 addition & 1 deletion targets/upload_method_cfg/ARDUINO_PORTENTA_H7_M7.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mbed OS upload method configuration file for target ARDUINO_PORTENTA_H7_M7.
# 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 mbed_toolchain_setup and where you add mbed os as a subdirectory.

# Notes:
# 1. To use this target with PyOCD, you need to install a pack: `pyocd pack install STM32H747XIHx`.
Expand Down
4 changes: 2 additions & 2 deletions targets/upload_method_cfg/BLACKPILL_F411CE.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mbed OS upload method configuration file for target BLACKPILL_F411CE.
# 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 mbed_toolchain_setup and where you add mbed os as a subdirectory.

# Notes:
# 1. Keep in mind the Blackpill does not contain any on-board debugger, so all upload methods counts with external debugger, usually ST-Link.
Expand Down Expand Up @@ -39,7 +39,7 @@ set(PYOCD_CLOCK_SPEED 4000k)

set(OPENOCD_UPLOAD_ENABLED TRUE)
set(OPENOCD_CHIP_CONFIG_COMMANDS
-f ${OpenOCD_SCRIPT_DIR}/board/st_nucleo_f4.cfg)
-f board/st_nucleo_f4.cfg)

# Config options for STM32Cube
# -------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion targets/upload_method_cfg/B_U585I_IOT02A.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mbed OS upload method configuration file for target B_U585_IOT02A.
# 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 mbed_toolchain_setup and where you add mbed os as a subdirectory.

# Notes:
# 1. To use this target with PyOCD, you need to install a pack: `pyocd pack install STM32U585AIIxQ`.
Expand Down
51 changes: 51 additions & 0 deletions targets/upload_method_cfg/CY8CPROTO_062S3_4343W.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Mbed OS upload method configuration file for target CY8CPROTO_062S3_4343W.
# To change any of these parameters from their default values, set them in your build script between where you
# include mbed_toolchain_setup and where you add mbed os as a subdirectory.

# Notes:
# 1. The KitProg3 programmer on this board boots up in KitProg mode. To enable mass storage device mode, press the
# button labeled "MODE" near the USB port to switch to DAPLink mode. The MBED and PYOCD upload methods need
# the board to be in DAPLink mode (which is deprecated by Infineon).
# 2. Mbed upload method seems VERY slow on this board (takes like 1 minute to flash!).
# 3. PyOCD is tested working correctly in DAPLink mode. In KitProg mode it can flash but debugging does
# not appear to work correctly.
# 4. Infineon's fork of OpenOCD must be used to program this device as they have not yet upstreamed their
# changes. This can be downloaded from here: https://github.com/Infineon/openocd/releases
# Then configure CMake to use it with `-DOpenOCD=/path/to/infineon/openocd`
# 5. If using the wi-fi module on this board, you need to flash the wi-fi module firmware to the QSPI flash.
# This is done automatically via Infineon's OpenOCD scripts when flashing any project that uses wifi with OpenOCD.
# Flashing via other methods will likely not work for wifi projects.

# General config parameters
# -------------------------------------------------------------
set(UPLOAD_METHOD_DEFAULT MBED)

# Generally we are only interested in the CM4 core which is index 1
set(MBED_DEBUG_CORE_INDEX 1)

# Config options for MBED
# -------------------------------------------------------------

set(MBED_UPLOAD_ENABLED TRUE)
set(MBED_RESET_BAUDRATE 115200)

# Config options for PYOCD
# -------------------------------------------------------------

set(PYOCD_UPLOAD_ENABLED TRUE)
set(PYOCD_TARGET_NAME cy8c6xx5)
set(PYOCD_CLOCK_SPEED 4000k)

# Config options for OpenOCD
# -------------------------------------------------------------

set(OPENOCD_UPLOAD_ENABLED TRUE)
set(OPENOCD_CHIP_CONFIG_COMMANDS
-s ${CMAKE_CURRENT_LIST_DIR}/openocd_cfgs/CY8CPROTO_062S3_4343W
-f ${CMAKE_CURRENT_LIST_DIR}/openocd_cfgs/infineon_psoc62_c8cxx5.cfg)

# Seems like a regular 'monitor reset' does not work correctly for this chip. This is the command sequence
# used by ModusToolbox IDE.
set(OPENOCD_GDB_RESET_SEQUENCE
"monitor reset run"
"monitor psoc6 reset_halt sysresetreq")
4 changes: 2 additions & 2 deletions targets/upload_method_cfg/DISCO_F469NI.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mbed OS upload method configuration file for target DISCO_F469NI.
# 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 mbed_toolchain_setup and where you add mbed os as a subdirectory.

# Notes:
# 1. Using the JLINK upload method with your dev board requires converting its ST-LINK into a J-Link. See here for details: https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/
Expand Down Expand Up @@ -36,7 +36,7 @@ set(PYOCD_CLOCK_SPEED 4000k)

set(OPENOCD_UPLOAD_ENABLED TRUE)
set(OPENOCD_CHIP_CONFIG_COMMANDS
-f ${OpenOCD_SCRIPT_DIR}/board/stm32f4discovery.cfg)
-f board/stm32f4discovery.cfg)

# Config options for STM32Cube
# -------------------------------------------------------------
Expand Down
Loading