Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PicoVoice on PSoC6 - Part 1, Installing ModusToolbox on Ubuntu

lking
Moderator
Moderator First like received First solution authored 5 replies posted
Moderator

PicoVoice on PSoC6 - Part 1, Installing ModusToolbox on Ubuntu

1. Introduction

This stared out as a really easy project, with just a few simple steps.

  • Install ModusToolbox
  • Use Project Creator to generate the code for the PicoVoice demo
  • Compile the code and load to the board
  • Try it out

The instructions are on github here: https://github.com/Picovoice/picovoice-demo-psoc6 It sounds easy, every step should go smoothly, after all I am just following the instructions for a proven demo that has been posted for months.

Unfortunately, it did not go smoothly. I’ll detail the roadblocks and workarounds as I walk you through the process. In the end I did get the demo to work.

Before you run out and buy the recommended hardware kit CY8CKIT-062S2-43012, please read this post and the following two parts of the Blog series.

2. Install Modus Toolbox

This should be easy I am running a Linux system with Ubuntu 20.04, a well tested system, and it is supported by ModusToolbox. Lets Go…

First I went to the Infineon site and downloaded the Quick Start Guide . Section 1.1 I checked the dependencies:

  • 25GB free space on the disk - check
  • Ubuntu 20.04 (recommended) – check
  • 8GB of RAM – check

Everything looks good. Section 1.2 remove Beta versions. Nothing to do here I never installed a Beta version.

Section 2 Download the from (www.infineon.com/modustoolbox) this redirects you to an Infineon.com page with a large friendly “Download” button at the top. The Download button redirects you to a page where you can select your OS, I selected “Linux (x64)(tar.gz)” and  appropriate version was selected for me. Hitting the Download button brought in a 1.1GB file.

Section 2.2 pre-requisites. I checked the versions of various tools installed on my system against the required versions

  • cmp (v2.8.1) -> cmp (GNU diffutils) 3.7
  • git (2.17.0) -> git version 2.25.1
  • make (v3.81) -> GNU Make 4.2.1
  • mktemp (v8.25) -> mktemp (GNU coreutils) 8.30
  • perl (v5.18.2) -> This is perl 5, version 30, subversion 0 (v5.30.0)
  • python (v3.7) -> Python 2.7.18

Oh,oh, I have the wrong version of python. I need to install python3 and make it the default version of python. Run the following commands to make python3 the default:

sudo apt install python3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
sudo update-alternatives --config python

At the last command, select python3 as the default. And recheck the python version:

  • python (v3.7) -> Python 3.8.10

 

Section 2.3 SEGGER J-Link, I do not have a J-Link debugger so I will ignore this section.

Section 3.4 Linux. Extract the files into your home directory

cd ~
gunzip Downloads/ModusToolbox_2.4.0.5972-linux-install.tar.gz
tar -vxf Downloads/ModusToolbox_2.4.0.5972-linux-install.tar

Now we need to install a bunch of dependencies

~/ModusToolbox/tools_2.4/openocd/udev_rules/install_rules.sh
~/ModusToolbox/tools_2.4/driver_media/install_rules.sh
~/ModusToolbox/tools_2.4/fw-loader/udev_rules/install_rules.sh
~/ModusToolbox/tools_2.4/modus-shell/postinstall
~/ModusToolbox/tools_2.4/idc_registration-2.4.0.bash
sudo apt install libncurses5 libusb-1.0-0 libxcb-xinerama0

Why do I have to do all of these steps? I thought most Ubuntu packages installed with a simple command like:

          sudo apt install ModusToolbox

apt would then install all of the dependencies and run the required setup scripts. At the very least a single script that checks all of the required versions, and runs all of the other scripts would make installation easier.

So far ModusToolbox is installed, but not tested, more on this later. So far we have installed the tool necessary to build an application, in the next parts we will build the Picovoice application, and figure out why it didn’t work.