Differences Between PSoC 4 and PSoC 6 MCU Software Architecture - KBA220606

Version: **

 

Question:

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?

 

Answer:

The firmware created for other PSoC architectures is not compatible with PSoC 6. The biggest difference is that PSoC 6 is a dual-core 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 Peripheral Driver Library (PDL). 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.

 

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 Peripheral Driver Library (PDL). 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.

 

UART_Start();

 

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 instance-specific 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.

 

For more details on PDL, refer to the PDL User Guide, which is part of the PDL installation. Additionally, more details on developing firmware for PSoC 6 MCUs is available in the following documents:

 

1) AN215656 – PSoC 6 Dual-Core CPU System Design

2) AN210781 – Getting started with PSoC 6 BLE