Machine Learning on PSoC6 via Edge-Impulse

Set up Environment

Install Infineon CyProgrammer, Nodejs, and Edge-impulse

  1. Infineon CyProgrammer : Use to flash firmware images into the target.

  2. Install Nodejs v14 or higher on your computer.

  1. Install the CLI tools via:

npm install -g edge-impulse-cli --force

Board Connecting

  • You can use Infineon CyProgrammer to flash your CY8CKIT-062S2 Pioneer Kit with our base firmware image. To do this, first select your board from the dropdown list on the top left corner. Make sure to select the item that starts with CY8CKIT-062S2-43012:

Then select the base firmware image file you downloaded in the first step above (i.e., the file named firmware-infineon-cy8ckit-062s2.hex). You can now press the Connect button to connect to the board, and finally the Program button to load the base firmware image onto the CY8CKIT-062S2 Pioneer Kit.

Let's start with Edge-Impulse

That's all! Your device is now connected to Edge Impulse. To verify this, go to your Edge Impulse project, and click Devices on the left sidebar. The device will be listed there:

Collecting your first data

  • Make sure your device is connected.

  • Go to the Data acquisition tab in the studio. This is where your raw data is stored.

  • Choose "Record new data."

  • Select your device and set the label to "updown."

  • Set the sample length to 10,000, which means recording for 10 seconds.

  • Choose the Built-in accelerometer as the sensor.

  • Set the frequency to 62.5Hz, which is how often data points are recorded per second.

Use Prebuild Dataset

Alternately, you can import this dataset to your Edge Impulse project using the Edge Impulse CLI Uploader. If you haven't done so, follow the Installation instructions.

  • Download the gestures dataset.

  • Unzip the file in a location of your choice.

  • Open a modus-shell and navigate to the place where you extracted the file.

$ edge-impulse-uploader --clean
  • Add training Dataset

$ edge-impulse-uploader --category training training/*.cbor
$ edge-impulse-uploader --category testing testing/*.cbor

Design an Impulse

In the studio go to Create impulse, set the window size to 2000 (you can click on the 2000 ms. text to enter an exact value), the window increase to 80, and add the 'Spectral Analysis', and 'Classification' blocks. Then click Save impulse.

  • Go to Spectral features => Save parameters => Generate features

Training model


Live Classification

Deploy the model

We can connect to the board's newly flashed firmware over serial. Open a terminal and run:

$ edge-impulse-run-impulse


Last updated

Assoc. Prof. Wiroon Sriborrirux, Founder of Advance Innovation Center (AIC) and Bangsaen Design House (BDH), Electrical Engineering Department, Faculty of Engineering, Burapha University