What are the main differences between the software architecture of PSoC® 4 and PSoC 6 MCU? Can I port PSoC 4 firmware directly to a PSoC 6 MCU?
The firmware created for other PSoC architectures is not compatible with PSoC 6. The major difference is that PSoC 6 is a dualcore architecture, with both Arm® Cortex®-M0+ and Cortex-M4 cores. Firmware must provide code for each core (such as the main.c file) when creating a PSoC 6 design.
Additionally, both PSoC 4 and PSoC 6 MCU devices use Component-based APIs. However, for PSoC 6 MCU, APIs are built on top of the Cypress Peripheral Driver Library (PDL) v3.0.x. Each Component has been re-engineered to support the dual-core architecture transparently. What this means from the firmware perspective is that the code and APIs generated for PSoC 4 are incompatible with PSoC 6 and the PDL.
For example, consider the case of an SCB UART Component. You can use a Component-based function call to enable the peripheral:
where UART is the name of the instance of SCB UART Component. The actual generated code behind that call is completely different for PSoC 4 and PSoC 6 MCU. Other UART API calls are also different, with different parameters. For PSoC 6 MCU, the Component-based API is a wrapper over PDL functions. The UART_Start() function calls the PDL function Cy_SCB_UART_Init().
For PSoC 6 MCU, you can call the PDL functions directly, without using the PSoC Creator Component API. In this case, you write:
Cy_SCB_UART_Init(UART_HW, &UART_config, &UART_context);
where UART_HW, UART_config and UART_context are the pointer to the base address of the hardware, the pointer to the instancespecific configuration structure, and the pointer to the context structure respectively. PDL enables developers to create firmware for the PSoC 6 MCU architecture without using PSoC Creator™, should they choose to do so.
However, when you place an instance of the Component on TopDesign, PSoC Creator generates the structures with all the Component settings that you configured. Firmware can use these generated structures in PDL function calls, which eases firmware development.
Similarly, the BLE API has been re-engineered to support the dual-core architecture. The BLE source code for PSoC 6 MCU with BLE Connectivity is delivered as middleware with the PDL. The API for BLE in PSoC 6 MCU is different from the PSoC 4 BLE/ PRoC™ BLE, so firmware that uses one cannot be directly ported to the other.
Furthermore, Bootloader architecture and design process are different in PSoC 4 and PSoC 6. PSoC 6 uses Cypress Bootloader SDK shipped as a part of the Cypress Peripheral Driver Library (PDL) 3.0.x. It is an API consisting of a set of callable functions and other elements that enable rapid bootloader development. For more details, refer to AN213924 - PSoC 6 MCU Bootloader Software Development Kit (SDK) Guide.
For more details on PDL, refer to the PDL User Guide, which is available at <PDL Installation directory>\doc. Additionally, more details on developing firmware for PSoC 6 MCUs is available in the following documents: