RoadTest: Enroll to Review ModusToolbox™ Software with the Infineon PSoC™ 62S2 Evaluation Kit
Author: taifur
Creation date:
Evaluation Type: Development Boards & Tools
Did you receive all parts the manufacturer stated would be included in the package?: True
What other parts do you consider comparable to this product?: CY8CPROTO-062-4343W, CY8CKIT-062-BLE, CY8CKIT-062S2-43012, CY8CPROTO-062S4-4343W
What were the biggest problems encountered?: I did not face any big problems throughout my experiment. I tried to configure the Segment LCD Configurator for a Seven Segment Dsiplay but I failed to do it. Even I did not understand the configuration process by reading the documentation of the configurator. I did not find any related video. So, I believe that working with BSP Configurators of ModusToolbox requires experience and study. These may be hard for the newbies.
Detailed Review:
I am very happy to be a part of the RoadTest "Review ModusToolbox Software with the Infineon PSoC 62S2 Evaluation Kit". I would like to thank Element14 and Infineon Teams for choosing me as a Road Tester for this RoadTest. In this Roadtest I am going to share my hands-on getting-started experience with the PSoC 62S2 Evaluation Kit and ModusToolbox.
After getting it out from the UPS courier packaging I was surprised to see the pleasant big box of PSoC 62S2 Evaluation Kit. I already have some Infineon kits and all of them came with the elegant magnetic lid box but this box is the biggest among all of them. To be honest this is the biggest box I ever received for an embedded development kit. I believe this magnetic box will give you a premium unboxing experience like me.
So, let's unbox it now. The first look inside the box was this:
The box includes all of the following:
I observed Infineon Development Kits always come with this type of jumper wire but I am not sure yet what is the specific use of this jumper wire. Anyway, I like those.
The board also comes with a 4-page quick start guide. The first page contains kit contents with an image. The second page includes instructions on how to run the pre-programmed code. The instructions were very clear and I was able to run the code without any hassle. The LED started blinking immediately after plugging into the PC using the USB cable. I used Arduino serial monitor to observe the message output from the pre-programed firmware. I got the following response on the Arduino serial monitor. I was able to pause and resume the LED blinking by pressing the Enter key from the keyboard as stated in the quick start guide.
The following screenshot shows the response I received from the serial monitor.
The next step is to download the necessary software for the board so that we can make our own code for the kit. When I receive any new hardware or development kit, I usually visit the kit page first before doing anything.
As usual, I pinged the kit page and I got the following response back.
I downloaded the User Manual by clicking the Download User Manual button from the right and it was a 59 pages document. The document includes getting started guide, kit features, block diagrams, pin description, and a detailed schematic of the board. The document also illustrates how to program and debug your first application using ModusToolbox. The organization of the schematic is very user friendly and each functional unit is explained separately in an individual section. I recommend every user to read this user guide first at least up to page 33 before going to start working with the kit. The schematic will be required if you like to interface the kit with external hardware or if you design your own hardware using this microcontroller.
Modus Toolbox is the main software tool for developing firmware for the Infineon microcontrollers. The cross-platform ModusToolbox is actually a collection of development tools, libraries, and embedded runtime assets. I downloaded the ModusToolbox from the link (https://www.infineon.com/cms/en/design-support/tools/sdk/modustoolbox-software/). You can just search in Google for the ModusToolbox and you will get this link as the first suggestion. Installing ModusToolbox on my Windows PC was very straightforward. Though an official installation guide is available I was able to install it without any assistance from the installation guide. The installation may ask you several times for permission to install different drivers, just click yes. ModusToolbox can be used with Eclipse, VS Code, IAR, and Arm uVision. Eclipse IDE by default installed with ModusToolbox. As I already said ModusToolbox is a collection of tools, every tool can be used independently without using any IDE.
You will find the installed tools from the list of your installed apps like the image shown below and you can run any tool by clicking on that.
But for a new user, I prefer to use any IDE instead of using the tools individually. As Eclipse is already installed why not Eclipse? So, Let's make the Hello World project in Eclipse.
The user guide includes step-by-step instructions with necessary images about how to create the first application in Eclipse IDE. Following the instructions provided in the user guide, anyone can easily create and run an application. Creating an application takes some time as it downloads lots of resources from GitHub I believe. One feature of ModusToolbox I like very much is when you create a new project using an example application it automatically opens the GitHub README.md file of that project in the text editor window which contains all the necessary information and documentation about that project and I found it very helpful for the understanding of the project.
This is a screenshot of Eclipse IDE after creating and building the Hello World application.
I was able to build and run the application in the PSoC 62S2 Evaluation Kit without any issues.
Many developers like Microsoft Visual Studio Code as their developing environment. The good news is that ModusToolbox supports VS Code for application development. I was curious about that and I searched on Google about using ModusToolbox in Visual Studio Code. I found this Visual Studio Code for ModusToolbox user guide (https://www.infineon.com/dgdl/Infineon-ModusToolbox_3.1_Visual_Studio_Code_User_Guide-UserManual-v01_00 EN.pdf?fileId=8ac78c8c88704c7a0188a18b83824e58). This document provides all the necessary information for creating, building, running, and debugging an application in VS Code for ModusToolbox. I was able to successfully build the Hello World Application and run it in PSoC 62S2 Evaluation Kit. But I think it may be a bit harder to follow the guide for a person who has no previous experience with Visual Studio Code. In that case, he/she may follow the video tutorials on this topic provided by Infineon.
I explained how I installed ModusToolbox on my Windows PC and used it with Eclipse and VS Code. I illustrated how easy it was to create, build, and run an application in both environments. Now, I want to install and use ModusToolbox on my Ubuntu PC. One thing I want to mention here is that I am not an expert user of Ubuntu. I rarely use Ubuntu/Linux if required for any project. So, let's check how easy it is to install and use ModusToolbox in Ubuntu for a basic user like me.
As I am a nerd in Ubuntu, I searched on Google for how to install ModusToolbox in Ubuntu. The first document I found was the ModusToolBox Installation Guide Version 1.1. This document includes the installation process of ModusToolbox on Windows, Ubuntu, and MacOS. However, as a basic Ubuntu user, I found the instructions for Ubuntu a bit ambiguous.
The document mentioned some Unix packages required installation before installing ModusToolbox in Ubuntu but did not include the command for installing all those packages. Maybe it is not a big deal for an experienced Linux user. Anyway, I was able to install all these packages by searching on Google. On the next page, I found that I needed to download and extract the .tar.gz file to a location on my Ubuntu PC. I downloaded the tar file from the Infineon site but the document did not include any command for extracting the .tar.gz file. Again I was able to manage it by searching on the internet.
The last three instructions mentioned in the document for completing the installation process after extracting the tar file (shown in the above screenshot) were totally unclear to me. So, I was looking for a video tutorial. Luckily I found one on Youtube uploaded by Infineon and I was able to follow the instructions. Watching the video, I realized that the instructions provided in the document are very old and need some corrections. So, I was looking for a newer guide and found the latest one for version 3.1.
This guide is much clearer than previous documents but still has a missing command for extracting the tar.gz file. I think this is a very basic thing for experienced Ubuntu users but including the command in this guide would be helpful for new users like me. Another important thing the guide missed is it does not include how to run the ModusToolbox after extracting and installing post-install scripts.
Anyway, with the help of the latest user guide and the Internet, I successfully installed and ran ModusToolbox on my Ubuntu PC. I installed all the pre-install scripts after extracting the tar file as shown in the screenshot below.
ModusToolbox was installed in the Home directory of my Ubuntu PC under the sub-directory ModusToolbox.
I run the ModusToolbox from the ide_3.1 directory. I created the Hello World application, built the application, and ran it to the PSoC 62S2 Evaluation Kit successfully without any issues. While programming the device I received a warning related to the KitProg firmware version but it worked without updating the firmware.
The goal of this step is to create a customized application for controlling D3 RGB LED with the Capsense buttons and slider. For implementing this project we need to use the Capsense Middleware. Before making the customized application I want to run a Capsense example project that came with ModusToolbox to make sure that Capsense functionality is working perfectly. For this purpose, I opened the CAPSENSE_Buttons_and_Slider example. From the opened README.md I found the code example uses two Capsense buttons for turning on and off the D1 user LED and the slider is used to control the brightness of the LED.
I built the application and uploaded the program to the PSoC 62S2 Evaluation Kit. The application is working as expected. See the video below.
After that, I created a new empty application named RGB_CAPSENSE. After that, I added Capsense Middleware and retarget-io library to my project from the Library Manager.
The next step was to find the pinout for the D3 RGB LED. So, I opened the PSoC 62S2 Evaluation Kit user guide and went to the schematic section. I found the schematic and pinout for D3 LED from page 47 of the user guide as shown in the screenshot below.
Then with the help of the example code I successfully finished my goal easily without any difficulties. From the video you see the Green & Red LED is working with the Caspense buttons and slider.
In this section I will use a dual relay Click board from mikroe with the mikro BUS. I intended to use two user buttons of the PSoC 62S2 Evaluation kit to control two relays of the relay board. For developing the program, we need to find the pinout of the relay board as well as two user buttons of the PSoC board. First I looked at the official page of the relay board and found the following pinout table.
From the above table, it is clear that relay one (RL1) is connected to pin 16 of the mikro bus, and relay 2 (RL2) is connected to pin 3 of the mikro bus. Now, let's find the corresponding pins of the PSoC 62S2 Kit. I opened the user manual of the kit again and looked for the schematic section for mikro bus. Unfortunately, I did not find the schematic for mikro BUS in the schematic section of the user guide. Maybe they did not include it by mistake. But I was able to find the pinout from the silkscreen print of the PCB. Mikro BUS 16 pin is actually P6.3 pin of the PSoC microcontroller and mikro BUS 3 pin is P1.3 pin of the microcontroller. Then I identified the pinout of two user buttons from the kit user guide.
As we already identified all the involved pins the next step is to write the code. I created an application using ModusToolbox and Eclipse IDE. From the bottom left side of IDE, I clicked on the Hardware Abstraction Layer option to open the HAL API documentation page. A good thing about ModusToolbox for Eclipse is that it organizes all the required tools and documents under Quick Panel so that you can easily access all the materials from one place without searching from different locations and sources.
After opening the HAL API page I went to the GPIO section as shown below. The API is very well-defined and organized. Every API function is explained with sample code which makes it understandable to the developer of any skill level. I really like the API documentation.
With the help of the API, I wrote the following code to achieve my expected output.
#include "cyhal.h" #include "cybsp.h" #include "cy_retarget_io.h" int main(void) { cy_rslt_t result; /* Initialize the device and board peripherals */ result = cybsp_init(); /* Board init failed. Stop program execution */ if (result != CY_RSLT_SUCCESS) { CY_ASSERT(0); } /* Enable global interrupts */ __enable_irq(); /* Initialize the button and relay */ result = cyhal_gpio_init(P0_4, CYHAL_GPIO_DIR_INPUT, CYHAL_GPIO_DRIVE_NONE, false); //button 1 if (result != CY_RSLT_SUCCESS) { CY_ASSERT(0); } result = cyhal_gpio_init(P1_4, CYHAL_GPIO_DIR_INPUT, CYHAL_GPIO_DRIVE_NONE, false); //button 2 if (result != CY_RSLT_SUCCESS) { CY_ASSERT(0); } result = cyhal_gpio_init(P1_3, CYHAL_GPIO_DIR_OUTPUT, CYHAL_GPIO_DRIVE_STRONG, true); //relay 1 if (result != CY_RSLT_SUCCESS) { CY_ASSERT(0); } result = cyhal_gpio_init(P6_3, CYHAL_GPIO_DIR_OUTPUT, CYHAL_GPIO_DRIVE_STRONG, true); //relay 2 if (result != CY_RSLT_SUCCESS) { CY_ASSERT(0); } for (;;) { bool button1_state = cyhal_gpio_read(P0_4); cyhal_system_delay_ms(100); if(button1_state == 0) cyhal_gpio_toggle(P1_3); bool button2_state = cyhal_gpio_read(P1_4); cyhal_system_delay_ms(100); if(button2_state == 0) cyhal_gpio_toggle(P6_3); } }
I plugged the mikroe relay click to the PSoC kit and uploaded the code. After uploading the code the kit is working as expected as shown in the short video below.
The PSoC 62S2 evaluation kit provides the option to connect AIROC Wi-Fi & Bluetooth® combo radio modules to the M.2 interface connector on the board. The combination of PSoC 6 host MCU and radio module enables users to evaluate Wi-Fi/Bluetooth® IoT applications. The M.2 radio module is not required if the application does not require Wi-Fi/Bluetooth® connectivity. The Sterling-LWB5+ M.2 module from Laird Connectivity provided with this kit requires an external antenna and the module came with a FlexPIFA antenna from Laird Connectivity. The FlexPIFA antenna from Laird Connectivity comes with a 3M adhesive. You can stick the antenna to the baseboard as shown in the figure below.
The PSoC 62S2 evaluation kit comes with two board support packages (BSP). This is the first time I saw an Infineon board with two BSPs. Section 2.3 of the kit user guide mentioned the two BSPs for the kit as shown in the screenshot below. For making an application that needs WiFi or Bluetooth support required to choose the second BSP.
For testing WiFi functionality I chose the right BSP for project creation.
I chose the Tester Wi-Fi Bluetooth Console example application for my project.
As per the instruction provided on the Operation section of the README.md file I modified WIFI_SSID and WIFI_KEY macros with my wifi network credentials.
After successfully compiling I ran the project on my PSoC 62S2 Kit and got a response from the serial monitor that the Wi-Fi is successfully connected. The output from the PuTTY serial terminal is shown in the image below. The board was connected to the wifi even without the antenna connected.
Possibly you will get a library for any of the sensors and actuators compatible with Arduino but you may not get it readily available for other platforms like ModusToolbox or nRF Connect SDK. But you may use it on another platform if you can easily modify it for that platform. In this section, I will show you how easy it is to modify any Arduino-compatible library for ModusToolbox. For a use case, I am using a SeeedStudo Grove 1.12-inch OLED Display. This Grove - OLED Display 1.12'' uses I2C interface. For connecting it with the PSoC 62S2 Evaluation Kit I used Grove Base Shield. As PSoC Kit is Arduino Header compatible we can easily place the Base Shield on top of the PSoC kit through the Arduino Header Connector. I downloaded the SeeedStudio provided library for the display from this GitHub link. Then I modified only two functions which is directly related to I2C communication. The updated two functions are provided below:
void sendCommand(unsigned char command) { uint8_t tx_buff[2] = {0, 0}; tx_buff[0] = SeeedGrayOLED_Command_Mode; tx_buff[1] = command; cy_rslt_t rslt = cyhal_i2c_master_write(&i2c_master_obj, SeeedGrayOLED_Address, tx_buff, 2, 0, true); } void sendData(unsigned char Data) { uint8_t tx_buff[2] = {0, 0}; tx_buff[0] = SeeedGrayOLED_Data_Mode; tx_buff[1] = Data; cy_rslt_t rslt = cyhal_i2c_master_write(&i2c_master_obj, SeeedGrayOLED_Address, tx_buff, 2, 0, true); }
I kept all other functions as it was without changing the name. For modifying the above two functions I got help from the HAL API and found the HAL API documentation very user-friendly. You can access the HAL API from here. For finding the Pin Mappings you can browse Pin Mappings on BSP API. From BSP API I found the pin mapping for SDA and SCL pins available in Arduino header as shown in the following screenshot.
Using this naming I initialized the I2C module and the initialization function is as follows.
void init_i2c(){ /* Define frequency */ uint32_t I2C_MASTER_FREQUENCY = 100000u; /* Define the I2C master configuration structure */ cyhal_i2c_cfg_t i2c_master_config = {CYHAL_I2C_MODE_MASTER, 0 /* address is not used for master mode */, I2C_MASTER_FREQUENCY}; /* Initialize I2C master, set the SDA and SCL pins and assign a new clock */ rslt = cyhal_i2c_init(&i2c_master_obj, CYBSP_I2C_SDA, CYBSP_I2C_SCL , NULL); /* Configure the I2C resource to be master */ rslt = cyhal_i2c_configure(&i2c_master_obj, &i2c_master_config); }
After uploading the test program in the PSoC Kit the OLED display was working perfectly.
So, from this hands-on experience in importing the Arduino library on ModusToolbox, I would say it is not a big deal to import an Arduino library to ModusToolbox. You can easily do it if you have some experience in embedded programming and a basic understanding of the Arduino library.
I will summarize my review here under the following three-point:
How was my getting started experience with ModusToolbox: ModusToolbox is one of the most user-friendly and powerful embedded development tools I have seen ever. The installation of the tool on the Windows environment is very straightforward. Installing the tool on Ubuntu requires some experience with Linux commands. The user guide for the installation is very detailed and easy to follow. The tool is installed with Eclipse IDE which is the most known IDE to embedded developer and my favorite. Getting started with the example project does not need any previous experience. If you have any confusion with any example you have a great collection of resources such as GitHub, User Guides, training videos, and great community support. Another good thing about ModusToolbox is it comes with lots of example applications for all the development kits and middleware. Every example is well-organized and rich with useful comments. Besides, a well-explained API documentation is also available.
How flexible the ModusToolbox is: To check the flexibility of the tool I tried three options. First, I created an empty application and then tried to include Capsense middleware and retarget-io to my application. I achieved the goal very easily without any difficulties. Then I tried to merge the functionality of two applications into one by making the required modification and I was successful. Finally, I imported one Arduino library to the ModusToolbox and I was able to make it work with very few modifications. So, I would say you can easily use any Arduino library with ModusToolbox if you have a basic understanding of Arduino and ModusToolbox.
How was my experience with the PSoC 62S2 Evaluation Kit: In a single sentence I love this big development kit. It has a Arduino Shield Compatible header and mikro BUS two most common and useful expansion interfaces. I tested both of these interfaces and I was very satisfied with how easy it was to work with. Pin Mapping BSP was very helpful in finding the name of the pins. Retarget-io makes the print-style debugging very easy. Programming of the board was hassle-free and I did not face any driver issues.