diff --git a/.gitignore b/.gitignore index 4b2bfc3..a053ead 100644 --- a/.gitignore +++ b/.gitignore @@ -7,12 +7,12 @@ # which files to ignore in whatever form your VCS requires. If you do not check your # code into a VCS, you can ignore the .gitignore file. -# ModusToolbox libraries are cloned into this directory, by default -libs/* +# ModusToolbox library repos or information about library dependencies +libs/ # Eclipse IDE for ModusToolbox files .metadata/ -.cyignore +# .cyignore # .settings/ # .cproject # .project @@ -28,7 +28,8 @@ Release/ *_build/ # Visual Studio Code -.vscode/* +openocd.tcl +.vscode/ !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json diff --git a/README.md b/README.md index 5ce68f9..86d5ad2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PSoC 6 MCU: Dual-CPU IPC Semaphores +# PSoC 6 MCU: Dual-CPU IPC Semaphore This example demonstrates how to use the inter-processor communication (IPC) driver to implement a semaphore in PSoC 6 MCU. The semaphore is used as a lock to control access to a resource shared by the CPUs and synchronize the initialization instructions. @@ -10,13 +10,22 @@ In this example, both CPUs in PSoC 6 MCU share the UART hardware block to send m ## Requirements -- [ModusToolbox™ software](https://www.cypress.com/products/modustoolbox-software-environment) v2.1 +- [ModusToolbox® software](https://www.cypress.com/products/modustoolbox-software-environment) v2.2 + + **Note:** This code example version requires ModusToolbox software version 2.2 or later and is not backward compatible with v2.1 or older versions. If you can't move to ModusToolbox v2.2, please use the latest compatible version of this example: [latest-v1.X](https://github.com/cypresssemiconductorco/mtb-example-psoc6-dual-cpu-pic-sema/tree/latest-v1.X). +- Board Support Package (BSP) minimum required version: 2.0.0 - Programming Language: C - Associated Parts: All [PSoC 6 MCU](http://www.cypress.com/PSoC6) parts with dual CPUs -## Supported Kits +## Supported Toolchains (make variable 'TOOLCHAIN') -- [PSoC 6 Wi-Fi BT Prototyping Kit](https://www.cypress.com/CY8CPROTO-062-4343W) (CY8CPROTO-062-4343W) - Default target +- GNU Arm® Embedded Compiler v9.3.1 (GCC_ARM) - Default value of `TOOLCHAIN` +- Arm compiler v6.11 (ARM) +- IAR C/C++ compiler v8.42.2 (IAR) + +## Supported Kits (make variable 'TARGET') + +- [PSoC 6 Wi-Fi BT Prototyping Kit](https://www.cypress.com/CY8CPROTO-062-4343W) (CY8CPROTO-062-4343W) - Default value of `TARGET` - [PSoC 6 WiFi-BT Pioneer Kit](https://www.cypress.com/CY8CKIT-062-WiFi-BT) (CY8CKIT-062-WIFI-BT) - [PSoC 6 BLE Pioneer Kit](https://www.cypress.com/CY8CKIT-062-BLE) (CY8CKIT-062-BLE) - [PSoC 6 BLE Prototyping Kit](https://www.cypress.com/CY8CPROTO-063-BLE) (CY8CPROTO-063-BLE) @@ -29,9 +38,9 @@ In this example, both CPUs in PSoC 6 MCU share the UART hardware block to send m This example uses the board's default configuration. See the kit user guide to ensure that the board is configured correctly. -**Note**: The PSoC 6 BLE Pioneer Kit and the PSoC 6 WiFi-BT Pioneer Kit ship with KitProg2 installed. ModusToolbox software requires KitProg3. Before using this code example, make sure that the board is upgraded to KitProg3. The tool and instructions are available in the [Firmware Loader](https://github.com/cypresssemiconductorco/Firmware-loader) GitHub repository. If you do not upgrade, you will see an error like "unable to find CMSIS-DAP device" or "KitProg firmware is out of date". +**Note:** The PSoC 6 BLE Pioneer Kit (CY8CKIT-062-BLE) and the PSoC 6 WiFi-BT Pioneer Kit (CY8CKIT-062-WIFI-BT) ship with KitProg2 installed. The ModusToolbox software requires KitProg3. Before using this code example, make sure that the board is upgraded to KitProg3. The tool and instructions are available in the [Firmware Loader](https://github.com/cypresssemiconductorco/Firmware-loader) GitHub repository. If you do not upgrade, you will see an error like "unable to find CMSIS-DAP device" or "KitProg firmware is out of date". -# Software Setup +## Software Setup Install a terminal emulator if you don't have one. Instructions in this document use [Tera Term](https://ttssh2.osdn.jp/index.html.en). @@ -39,25 +48,27 @@ Install a terminal emulator if you don't have one. Instructions in this document ### In Eclipse IDE for ModusToolbox: -1. Click the **New Application** link in the Quick Panel (or, use **File** > **New** > **ModusToolbox Application**). +1. Click the **New Application** link in the **Quick Panel** (or, use **File** > **New** > **ModusToolbox Application**). 2. Pick a kit supported by the code example from the list shown in the **Project Creator - Choose Board Support Package (BSP)** dialog. - When you select a supported kit, the example is reconfigured automatically to work with the kit. To work with a different supported kit later, use the **Library Manager** to choose the BSP for the supported kit. You can use the Library Manager to select or update the BSP and firmware libraries used in this application. - - To access the Library Manager, right-click the application name from the Project Workspace window in the IDE, and select **ModusToolbox** > **Library Manager** (or access it from the **Quick Panel**). + When you select a supported kit, the example is reconfigured automatically to work with the kit. To work with a different supported kit later, use the [Library Manager](https://www.cypress.com/ModusToolboxLibraryManager) to choose the BSP for the supported kit. You can use the Library Manager to select or update the BSP and firmware libraries used in this application. To access the Library Manager, click on the link from the Quick Panel. You can also just start the application creation process again and select a different kit. If you want to use the application for a kit not listed here, you may need to update the source files. If the kit does not have the required resources, the application may not work. -3. In the **Project Creator - Select Application** dialog, choose the example. +3. In the **Project Creator - Select Application** dialog, choose the example by enabling the checkbox. + +4. Optionally, change the suggested **New Application Name**. -4. Optionally, update the **Application Name** and **Location** fields with the application name and local path where the application is created. +5. Enter the local path in the **Application(s) Root Path** field to indicate where the application needs to be created. -5. Click **Create** to complete the application creation process. + Applications that can share libraries can be placed in the same root path. -For more details, see the Eclipse IDE for ModusToolbox User Guide: *{ModusToolbox install directory}/ide_{version}/docs/mt_ide_user_guide.pdf*. +6. Click **Create** to complete the application creation process. + +For more details, see the [Eclipse IDE for ModusToolbox User Guide](https://www.cypress.com/MTBEclipseIDEUserGuide) (locally available at *{ModusToolbox install directory}/ide_{version}/docs/mt_ide_user_guide.pdf*). ### In Command-line Interface (CLI): @@ -65,7 +76,9 @@ For more details, see the Eclipse IDE for ModusToolbox User Guide: *{ModusToolbo 2. Open a CLI terminal and navigate to the application folder. - On Linux and macOS, you can use any terminal application. On Windows, navigate to the modus-shell directory (*{ModusToolbox install directory}/tools_\/modus-shell*) and run *Cygwin.bat*. + On Linux and macOS, you can use any terminal application. On Windows, open the **modus-shell** app from the Start menu. + + **Note:** Ensure that the *deps* folder contains the required BSP file (*TARGET_xxx.mtb*) corresponding to the TARGET. Use the Library Manager (`make modlibs` command) to select and download the BSP file. If the selected kit does not have the required resources or is not [supported](#supported-kits-make-variable-target), the application may not work. 3. Import the required libraries by executing the `make getlibs` command in the *cm4_app* folder. @@ -77,7 +90,7 @@ For more details, see the Eclipse IDE for ModusToolbox User Guide: *{ModusToolbo 3. Follow the instructions displayed in the terminal to create or import the application as an IDE project. -For more details, see the "Exporting to IDEs" section of the ModusToolbox User Guide: *{ModusToolbox install directory}/ide_{version}/docs/mtb_user_guide.pdf*. +For more details, see the "Exporting to IDEs" section of the [ModusToolbox User Guide](https://www.cypress.com/ModusToolboxUserGuide) (locally available at *{ModusToolbox install directory}/ide_{version}/docs/mtb_user_guide.pdf*. ## Operation @@ -91,66 +104,69 @@ For more details, see the "Exporting to IDEs" section of the ModusToolbox User G 1. Select the application project in the Project Explorer. - 2. In the **Quick Panel**, scroll down, and click **\ Program (KitProg3)**. + 2. In the **Quick Panel**, scroll down, and click **\ Program (KitProg3_MiniProg4)**. - **Using CLI:** From the terminal, execute the `make program` command in the *cm4_app* folder to build and program the application using the default toolchain to the default target. You can specify a target and toolchain manually: - ``` - make program TARGET= TOOLCHAIN= - ``` - Example: + ``` + make program TARGET= TOOLCHAIN= + ``` - ``` - make program TARGET=CY8CPROTO-062-4343W TOOLCHAIN=GCC_ARM - ``` - **Note**: Before building the application, ensure that the *cm4_app/deps* folder contains the BSP file (*TARGET_xxx.lib*) corresponding to the TARGET. Execute the `make getlibs` command in the *cm4_app* folder to fetch the BSP contents before building the application. + Example: + ``` + make program TARGET=CY8CPROTO-062-4343W TOOLCHAIN=GCC_ARM + ``` - After programming, the application starts automatically. Confirm that "IPC Semaphore Example" and other text is displayed on the UART terminal. +4. After programming, the application starts automatically. Confirm that "IPC Semaphore Example" and other text is displayed on the UART terminal. -4. Press the user button on the kit. The terminal prints messages from both cores without any conflicts. Messages are printed every time you press the button. +5. Press the user button on the kit. The terminal prints messages from both cores without any conflicts. Messages are printed every time you press the button. **Figure 1. Terminal Prints Using Semaphore** + ![Terminal-with-Prints](images/terminal-with-sema.png) -5. Set the `#define ENABLE_SEMA` to *0u* in the *shared/include/ipc_def.h* file at line 41. Recompile the project and program it into the PSoC 6 MCU device. The red LED in the board should turn on, indicating that the semaphore is not used in the application. +6. Set the `#define ENABLE_SEMA` to *0u* in the *shared/include/ipc_def.h* file at line 41. Recompile the project and program it into the PSoC 6 MCU device. The red LED in the board should turn on, indicating that the semaphore is not used in the application. -6. Press the user button on the kit. The terminal will print messages from both CPUs, but with conflicts. +7. Press the user button on the kit. The terminal will print messages from both CPUs, but with conflicts. **Figure 2. Terminal Prints Without Semaphore** + ![Terminal-without-Prints](images/terminal-without-sema.png) ## Debugging -You can debug the example to step through the code. In the IDE, use the **\ Debug (KitProg3)** configuration in the **Quick Panel**. For more details, see the "Program and Debug" section in the Eclipse IDE for ModusToolbox User Guide: *{ModusToolbox install directory}/ide_{version}/docs/mt_ide_user_guide.pdf*. +You can debug the example to step through the code. In the IDE, use the **\ Debug (KitProg3_MiniProg4)** configuration in the **Quick Panel**. For more details, see the "Program and Debug" section in the [Eclipse IDE for ModusToolbox User Guide](https://www.cypress.com/MTBEclipseIDEUserGuide). + +**Note:** **(Only while debugging)** On the CM4 CPU, some code in `main()` may execute before the debugger halts at the beginning of `main()`. This means that some code executes twice - before the debugger stops execution, and again after the debugger resets the program counter to the beginning of `main()`. See [KBA231071](https://community.cypress.com/docs/DOC-21143) to learn about this and for the workaround. + ## Design and Implementation -In this code example, the CM4 CPU is the primary CPU, which is responsible for initializing the system. To avoid any access to uninitialized hardware, the CM0+ CPU waits for the CM4 to complete the system initialization by using a semaphore. Before CM4 executes code, CM0+ locks a semaphore, releases CM4 to execute, and then go to sleep until CM4 unlocks the semaphore. +In this code example, the CM4 CPU is the primary CPU, which is responsible for initializing the system. To avoid any access to uninitialized hardware, the CM0+ CPU waits for CM4 to complete the system initialization by using a semaphore. Before CM4 executes code, CM0+ locks a semaphore, releases CM4 to execute, and then go to sleep until CM4 unlocks the semaphore. The same semaphore is also used as a method to synchronize the access to a shared resource by the two CPUs. In this case, a UART block is the resource. Both CPUs print a message to the computer terminal through UART every time the user button is pressed. Before printing a message, both CPUs attempt to lock the semaphore. If it succeeds, it prints the message, and then unlocks the semaphore afterwards. If the semaphore is already locked, it keeps trying to lock it until it succeeds. The firmware has an option to disable the semaphore in the code. By simply changing `#define ENABLE_SEMA` to *0u* in the *ipc_def.h* file, the semaphore is no longer locked by the CPUs; in addition, the kit LED turns on. Without the semaphore to synchronize access to the UART block, messages from both CPUs might overlap. -[Figure 3](#figure-3-firmware-flowchart) shows the flowchart of this application. + **Figure 3. Firmware Flowchart** - **Figure 3. Firmware flowchart** ![firmware-flowchart](images/flowchart.png) -### Folder structure +### Folder Structure -This application has a different folder structure because it contains the firmware for CM4 and CM0+ applications. The list below explains the details of each folder: +This application has a different folder structure because it contains the firmware for CM4 and CM0+ applications as follows: |-- cm0p_app/ # CM0+ Application Folder |-- main.c |-- Makefile + |-- deps/ # All dependencies Folder for CM0+ |-- cm4_app/ # CM4 Application Folder |-- main.c |-- Makefile - |-- deps/ # All dependencies folder (including libraries for CM0+) + |-- deps/ # All dependencies Folder for CM4 |-- shared/ # Shared Folder for CM0+ and CM4 |-- include/ # Shared header files - |-- libs/ # All downloaded libraries for CM0+ and CM4 ### Resources and Settings @@ -181,15 +197,15 @@ This application has a different folder structure because it contains the firmwa | [CY8CKIT-062S2-43012](https://www.cypress.com/CY8CKIT-062S2-43012) PSoC 62S2 Wi-Fi BT Pioneer Kit | [CY8CPROTO-062S3-4343W](https://www.cypress.com/CY8CPROTO-062S3-4343W) PSoC 62S3 Wi-Fi BT Prototyping Kit | | [CYW9P62S1-43438EVB-01](https://www.cypress.com/CYW9P62S1-43438EVB-01) PSoC 62S1 Wi-Fi BT Pioneer Kit | [CYW9P62S1-43012EVB-01](https://www.cypress.com/CYW9P62S1-43012EVB-01) PSoC 62S1 Wi-Fi BT Pioneer Kit | | | **Libraries** | | -| PSoC 6 Peripheral Driver Library (PDL) and docs | [psoc6pdl](https://github.com/cypresssemiconductorco/psoc6pdl) on GitHub | -| Cypress Hardware Abstraction Layer (HAL) Library and docs | [psoc6hal](https://github.com/cypresssemiconductorco/psoc6hal) on GitHub | -| RetargetIO - A utility library to retarget the standard input/output (STDIO) messages to a UART port | [retarget-io](https://github.com/cypresssemiconductorco/retarget-io) on GitHub | +| PSoC 6 Peripheral Driver Library (PDL) and docs | [psoc6pdl](https://github.com/cypresssemiconductorco/psoc6pdl) on GitHub | +| Cypress Hardware Abstraction Layer (HAL) Library and docs | [psoc6hal](https://github.com/cypresssemiconductorco/psoc6hal) on GitHub | +| Retarget IO - A utility library to retarget the standard input/output (STDIO) messages to a UART port | [retarget-io](https://github.com/cypresssemiconductorco/retarget-io) on GitHub | | **Middleware** | | -| CapSense library and docs | [capsense](https://github.com/cypresssemiconductorco/capsense) on GitHub | +| CapSense® library and docs | [capsense](https://github.com/cypresssemiconductorco/capsense) on GitHub | | Links to all PSoC 6 MCU Middleware | [psoc6-middleware](https://github.com/cypresssemiconductorco/psoc6-middleware) on GitHub | | **Tools** | | -| [Eclipse IDE for ModusToolbox](https://www.cypress.com/modustoolbox) | The multi-platform, Eclipse-based Integrated Development Environment (IDE) that supports application configuration and development for PSoC 6 MCU and IoT designers. | -| [PSoC Creator](https://www.cypress.com/products/psoc-creator-integrated-design-environment-ide) | The Cypress IDE for PSoC and FM0+ MCU development. | +| [Eclipse IDE for ModusToolbox](https://www.cypress.com/modustoolbox) | The cross-platform, Eclipse-based IDE for IoT designers that supports application configuration and development targeting converged MCU and wireless systems. | +| [PSoC Creator™](https://www.cypress.com/products/psoc-creator-integrated-design-environment-ide) | The Cypress IDE for PSoC and FM0+ MCU development. | ## Other Resources @@ -204,6 +220,7 @@ Document Title: *CE230806 - PSoC 6 MCU: Dual-CPU IPC Semaphore* | Version | Description of Change | | ------- | --------------------- | | 1.0.0 | New code example | +| 2.0.0 | Major update to support ModusToolbox software v2.2.
This version is not backward compatible with ModusToolbox software v2.1 | ------ diff --git a/cm0p_app/Makefile b/cm0p_app/Makefile index 85f9b33..a2950c9 100644 --- a/cm0p_app/Makefile +++ b/cm0p_app/Makefile @@ -29,17 +29,22 @@ ################################################################################ # Target board/hardware (BSP). -# To change the target, use the Library manager ('make modlibs' from command line). -# If TARGET is manually edited, ensure TARGET_.lib with a valid URL exists -# in the application, and run 'make getlibs' to fetch BSP contents. +# To change the target, it is recommended to use the Library manager +# ('make modlibs' from command line), which will also update Eclipse IDE launch +# configurations. If TARGET is manually edited, ensure TARGET_.mtb with a +# valid URL exists in the application, run 'make getlibs' to fetch BSP contents +# and update or regenerate launch configurations for your IDE. TARGET=CY8CPROTO-062-4343W # Name of application (used to derive name of final linked file). +# +# If APPNAME is edited, ensure to update or regenerate launch +# configurations for your IDE. APPNAME=cy_m0p_image # Name of toolchain to use. Options include: # -# GCC_ARM -- GCC 7.2.1, provided with ModusToolbox IDE +# GCC_ARM -- GCC provided with ModusToolbox IDE # ARM -- ARM Compiler (must be installed separately) # IAR -- IAR Compiler (must be installed separately) # @@ -51,7 +56,9 @@ TOOLCHAIN=GCC_ARM # Debug -- build with minimal optimizations, focus on debugging. # Release -- build with full optimizations # Custom -- build with custom configuration, set the optimization flag in CFLAGS - +# +# If CONFIG is manually edited, ensure to update or regenerate launch configurations +# for your IDE. CONFIG=Debug # If set to "true" or "1", display full command-lines when building. @@ -134,26 +141,23 @@ POSTBUILD= # Paths ################################################################################ -# Link to the library folder -CY_EXTAPP_PATH=../shared/libs/ - -# Link to the devicesupport.xml file -CY_DEVICESUPPORT_PATH=$(CY_EXTAPP_PATH)/psoc6pdl - -# Build CY_IGNORE list, allowing only the CM0P_LIBRARIES -ALL_LIBRARIES=$(wildcard $(CY_EXTAPP_PATH)/*) -CM0P_LIBRARIES=$(CY_EXTAPP_PATH)/TARGET_$(TARGET) $(CY_EXTAPP_PATH)/psoc6pdl $(CY_EXTAPP_PATH)/core-lib -CY_IGNORE=$(filter-out $(CM0P_LIBRARIES), $(ALL_LIBRARIES)) - # Relative path to the project directory (default is the Makefile's directory). # # This controls where automatic source code discovery looks for code. CY_APP_PATH= -# Relative path to the "base" library. It provides the core makefile build -# infrastructure. -CY_BASELIB_PATH=$(CY_EXTAPP_PATH)/psoc6make +# Relative path to the shared repo location. +# +# All .mtb files have the format, ##. If the field +# begins with $$ASSET_REPO$$, then the repo is deposited in the path specified by +# the CY_GETLIBS_SHARED_PATH variable. The default location is one directory level +# above the current app directory. +# This is used with CY_GETLIBS_SHARED_NAME variable, which specifies the directory name. +CY_GETLIBS_SHARED_PATH=../../ +# Directory name of the shared repo location. +# +CY_GETLIBS_SHARED_NAME=mtb_shared # Absolute path to the compiler's "bin" directory. # diff --git a/cm0p_app/deps/TARGET_CY8CKIT-062-BLE.mtb b/cm0p_app/deps/TARGET_CY8CKIT-062-BLE.mtb new file mode 100644 index 0000000..49a8e50 --- /dev/null +++ b/cm0p_app/deps/TARGET_CY8CKIT-062-BLE.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/TARGET_CY8CKIT-062-BLE#latest-v2.X#$$ASSET_REPO$$/TARGET_CY8CKIT-062-BLE/latest-v2.X diff --git a/cm0p_app/deps/TARGET_CY8CKIT-062-WIFI-BT.mtb b/cm0p_app/deps/TARGET_CY8CKIT-062-WIFI-BT.mtb new file mode 100644 index 0000000..88fd727 --- /dev/null +++ b/cm0p_app/deps/TARGET_CY8CKIT-062-WIFI-BT.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/TARGET_CY8CKIT-062-WIFI-BT#latest-v2.X#$$ASSET_REPO$$/TARGET_CY8CKIT-062-WIFI-BT/latest-v2.X diff --git a/cm0p_app/deps/TARGET_CY8CKIT-062S2-43012.mtb b/cm0p_app/deps/TARGET_CY8CKIT-062S2-43012.mtb new file mode 100644 index 0000000..895ded9 --- /dev/null +++ b/cm0p_app/deps/TARGET_CY8CKIT-062S2-43012.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/TARGET_CY8CKIT-062S2-43012#latest-v2.X#$$ASSET_REPO$$/TARGET_CY8CKIT-062S2-43012/latest-v2.X diff --git a/cm0p_app/deps/TARGET_CY8CPROTO-062-4343W.mtb b/cm0p_app/deps/TARGET_CY8CPROTO-062-4343W.mtb new file mode 100644 index 0000000..4e94fc0 --- /dev/null +++ b/cm0p_app/deps/TARGET_CY8CPROTO-062-4343W.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/TARGET_CY8CPROTO-062-4343W#latest-v2.X#$$ASSET_REPO$$/TARGET_CY8CPROTO-062-4343W/latest-v2.X diff --git a/cm0p_app/deps/TARGET_CY8CPROTO-062S3-4343W.mtb b/cm0p_app/deps/TARGET_CY8CPROTO-062S3-4343W.mtb new file mode 100644 index 0000000..a59cc17 --- /dev/null +++ b/cm0p_app/deps/TARGET_CY8CPROTO-062S3-4343W.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/TARGET_CY8CPROTO-062S3-4343W#latest-v2.X#$$ASSET_REPO$$/TARGET_CY8CPROTO-062S3-4343W/latest-v2.X diff --git a/cm0p_app/deps/TARGET_CY8CPROTO-063-BLE.mtb b/cm0p_app/deps/TARGET_CY8CPROTO-063-BLE.mtb new file mode 100644 index 0000000..5488315 --- /dev/null +++ b/cm0p_app/deps/TARGET_CY8CPROTO-063-BLE.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/TARGET_CY8CPROTO-063-BLE#latest-v2.X#$$ASSET_REPO$$/TARGET_CY8CPROTO-063-BLE/latest-v2.X diff --git a/cm0p_app/deps/TARGET_CYW9P62S1-43012EVB-01.mtb b/cm0p_app/deps/TARGET_CYW9P62S1-43012EVB-01.mtb new file mode 100644 index 0000000..d7ae74d --- /dev/null +++ b/cm0p_app/deps/TARGET_CYW9P62S1-43012EVB-01.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/TARGET_CYW9P62S1-43012EVB-01#latest-v2.X#$$ASSET_REPO$$/TARGET_CYW9P62S1-43012EVB-01/latest-v2.X diff --git a/cm0p_app/deps/TARGET_CYW9P62S1-43438EVB-01.mtb b/cm0p_app/deps/TARGET_CYW9P62S1-43438EVB-01.mtb new file mode 100644 index 0000000..6fa8ed4 --- /dev/null +++ b/cm0p_app/deps/TARGET_CYW9P62S1-43438EVB-01.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/TARGET_CYW9P62S1-43438EVB-01#latest-v2.X#$$ASSET_REPO$$/TARGET_CYW9P62S1-43438EVB-01/latest-v2.X diff --git a/cm0p_app/main.c b/cm0p_app/main.c index c2528d0..b353adc 100644 --- a/cm0p_app/main.c +++ b/cm0p_app/main.c @@ -79,7 +79,7 @@ int main(void) #endif { /* Print a message to the console */ - Cy_SCB_UART_PutString(UART_RES, "Message sent from CM0+\n\r"); + Cy_SCB_UART_PutString(UART_RES, "Message sent from CM0+\r\n"); #if ENABLE_SEMA while (CY_IPC_SEMA_SUCCESS != Cy_IPC_Sema_Clear(SEMA_NUM, false)); diff --git a/cm4_app/Makefile b/cm4_app/Makefile index 2428baf..da8d933 100644 --- a/cm4_app/Makefile +++ b/cm4_app/Makefile @@ -29,17 +29,22 @@ ################################################################################ # Target board/hardware (BSP). -# To change the target, use the Library manager ('make modlibs' from command line). -# If TARGET is manually edited, ensure TARGET_.lib with a valid URL exists -# in the application, and run 'make getlibs' to fetch BSP contents. +# To change the target, it is recommended to use the Library manager +# ('make modlibs' from command line), which will also update Eclipse IDE launch +# configurations. If TARGET is manually edited, ensure TARGET_.mtb with a +# valid URL exists in the application, run 'make getlibs' to fetch BSP contents +# and update or regenerate launch configurations for your IDE. TARGET=CY8CPROTO-062-4343W # Name of application (used to derive name of final linked file). +# +# If APPNAME is edited, ensure to update or regenerate launch +# configurations for your IDE. APPNAME=mtb-example-psoc6-dual-cpu-ipc-sema # Name of toolchain to use. Options include: # -# GCC_ARM -- GCC 7.2.1, provided with ModusToolbox IDE +# GCC_ARM -- GCC provided with ModusToolbox IDE # ARM -- ARM Compiler (must be installed separately) # IAR -- IAR Compiler (must be installed separately) # @@ -51,7 +56,9 @@ TOOLCHAIN=GCC_ARM # Debug -- build with minimal optimizations, focus on debugging. # Release -- build with full optimizations # Custom -- build with custom configuration, set the optimization flag in CFLAGS - +# +# If CONFIG is manually edited, ensure to update or regenerate launch configurations +# for your IDE. CONFIG=Debug # If set to "true" or "1", display full command-lines when building. @@ -134,28 +141,23 @@ POSTBUILD= # Paths ################################################################################ -# Link to the library folder -CY_EXTAPP_PATH=../shared/libs/ - -# Link to the devicesupport.xml file -CY_DEVICESUPPORT_PATH=$(CY_EXTAPP_PATH)/psoc6pdl - -# Get the absolute address where the Makefile is located -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -mkfile_dir := $(dir $(mkfile_path)) - -# Set path to the shared folders -CY_GETLIBS_PATH=$(mkfile_dir)/$(CY_EXTAPP_PATH) - # Relative path to the project directory (default is the Makefile's directory). # # This controls where automatic source code discovery looks for code. CY_APP_PATH= -# Relative path to the "base" library. It provides the core makefile build -# infrastructure. -CY_BASELIB_PATH=$(CY_EXTAPP_PATH)/psoc6make +# Relative path to the shared repo location. +# +# All .mtb files have the format, ##. If the field +# begins with $$ASSET_REPO$$, then the repo is deposited in the path specified by +# the CY_GETLIBS_SHARED_PATH variable. The default location is one directory level +# above the current app directory. +# This is used with CY_GETLIBS_SHARED_NAME variable, which specifies the directory name. +CY_GETLIBS_SHARED_PATH=../../ +# Directory name of the shared repo location. +# +CY_GETLIBS_SHARED_NAME=mtb_shared # Absolute path to the compiler's "bin" directory. # @@ -188,3 +190,7 @@ endif $(info Tools Directory: $(CY_TOOLS_DIR)) include $(CY_TOOLS_DIR)/make/start.mk + +getlibs : getlibs_cm0p +getlibs_cm0p: + $(MAKE) -C ../cm0p_app/ $(MAKECMDGOALS) diff --git a/cm4_app/deps/TARGET_CY8CPROTO-062-4343W.lib b/cm4_app/deps/TARGET_CY8CPROTO-062-4343W.lib deleted file mode 100644 index 72d7312..0000000 --- a/cm4_app/deps/TARGET_CY8CPROTO-062-4343W.lib +++ /dev/null @@ -1 +0,0 @@ -https://github.com/cypresssemiconductorco/TARGET_CY8CPROTO-062-4343W/#latest-v1.X diff --git a/cm4_app/deps/TARGET_CY8CPROTO-062-4343W.mtb b/cm4_app/deps/TARGET_CY8CPROTO-062-4343W.mtb new file mode 100644 index 0000000..4e94fc0 --- /dev/null +++ b/cm4_app/deps/TARGET_CY8CPROTO-062-4343W.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/TARGET_CY8CPROTO-062-4343W#latest-v2.X#$$ASSET_REPO$$/TARGET_CY8CPROTO-062-4343W/latest-v2.X diff --git a/cm4_app/deps/retarget-io.lib b/cm4_app/deps/retarget-io.lib deleted file mode 100644 index 024802a..0000000 --- a/cm4_app/deps/retarget-io.lib +++ /dev/null @@ -1 +0,0 @@ -https://github.com/cypresssemiconductorco/retarget-io/#latest-v1.X diff --git a/cm4_app/deps/retarget-io.mtb b/cm4_app/deps/retarget-io.mtb new file mode 100644 index 0000000..5f86d6c --- /dev/null +++ b/cm4_app/deps/retarget-io.mtb @@ -0,0 +1 @@ +https://github.com/cypresssemiconductorco/retarget-io#latest-v1.X#$$ASSET_REPO$$/retarget-io/latest-v1.X diff --git a/cm4_app/main.c b/cm4_app/main.c index 2da555c..2255dd6 100644 --- a/cm4_app/main.c +++ b/cm4_app/main.c @@ -100,7 +100,7 @@ int main(void) #endif { /* Print a message to the console */ - printf("Message sent from CM4\n\r"); + printf("Message sent from CM4\r\n"); #if ENABLE_SEMA while (CY_IPC_SEMA_SUCCESS != Cy_IPC_Sema_Clear(SEMA_NUM, false));