Before making anything with PSoC 62S2 Pioneer Kit first I need to set up the software environment. I am going to use ModusToolbox 3.0 with Eclipse IDE for firmware development. You can download and install ModusToolbox 3.0 using this link. You can take help from ModusToolbox tools package installation guide. I prefer Infineon Developer Center Launcher for installing ModusToolbox and you can manage all the installation from the Developer Center Launcher.
For using ModusToolbox 3.0 Eclipse IDE is not required but I feel comfortable with Eclipse IDE and I will use it here for my development.
After setting up any development environment it is a good practice to build and run the "hello wordl!" program or blinking LED program. It confirms the perfect setup of the development environment. I always do this before writing any code by myself. All MCU development comes with hello world/blinking led program and PSoC is not an exception.
ModusToolbox Getting Started Guide is an excellent reference for building and running you first example. Following the guide I was able to create and build hello_world program without any difficulties.
After programing the PSOC 62S4 board with the hello_world program it was working as expected. To be frank the provided hello_world program is a bit complex. So, I modified the code and keep only the minimum instructions. I was trying to make it as simple as possible like the blink program of the Arduino IDE. Here is my minimum code for blinking an LED connected to the D7 pin of the Arduino header.
#include "cyhal.h"
#include "cybsp.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);
}
result = cyhal_gpio_init(CYBSP_D7, CYHAL_GPIO_DIR_OUTPUT,
CYHAL_GPIO_DRIVE_STRONG, CYBSP_LED_STATE_OFF);
/* GPIO init failed. Stop program execution */
if (result != CY_RSLT_SUCCESS)
{
CY_ASSERT(0);
}
for (;;)
{
cyhal_gpio_write(CYBSP_D7, true);
cyhal_system_delay_ms(1000);
cyhal_gpio_write(CYBSP_D7, false);
cyhal_system_delay_ms(1000);
}
}
I was happy enough to see that it is working and it increased my confidence level because I was new in this platform.
The program was built at first attempt without any error.
Then I programed the board and connect a LED with the D7 pin of the Arduino header. This is my test circuit.
Now I am prepared and confident for the next step.