Blog #2 Install & Setup Template Application
I will be showing you how I setup the Linux IDE from the official website. I will be using ModusToolbox on Ubuntu 20.04 LTS.
As of writing, it is ModusToolbox version 2.3
It is a tar.gz file. I extracted it into a folder ModusToolbox into my home folder ~/
According to the readme file, I need to run the following installation commands as follows:
~/ModusToolbox/tools_2.3/openocd/udev_rules/install_rules.sh
~/ModusToolbox/tools_2.3/driver_media/install_rules.sh
~/ModusToolbox/tools_2.3/fw-loader/udev_rules/install_rules.sh
~/ModusToolbox/tools_2.3/modus-shell/postinstall
sudo apt-get install libusb-0.1-4
Go into the directory and start ModusToolbox by double clicking on this file
- ~/ModusToolbox/ide_2.3/eclipse/ModusToolbox
The app will launch and I am greeted by this screen. From Quick Panel, choose New Application.
I got the PSoC 6 WiFi-BT Pioneer Kit so I chose CY8CKIT-062-WiFi-BT.
Based on my proposal, I decided to choose the AnyCloud BLE CapSense Buttons and Slider template as it covers the main code of what I need (BLE and CapSense). I will add on relevant libraries along the way.
After creating the project, you will see it in the Project Explorer. Right click it to rename it to our own name
Program the board. At the bottom left, you will see options in the Quick Panel. Choose Build and then Debug using KitProg3.
If the programming is successful, you will see build details in the console
After programming the template, launch your favorite UART serial console and details will be printed on it. It indicates the board and the bluetooth events are functional
Double click on design.cybt. This will open up the BLE configuration.
If you go to GATT settings, you will see a service called CapSense and it has Button and Slider characteristics under it.
So from reading all the settings, we get the following IDs are programmed into the board, let us verify it.
CapSense (Service) | 0003CAB5-0000-1000-8000-00805F9B0131 |
---|---|
Button (Char) | 0003CAA3-0000-1000-8000-00805F9B0131 |
Slider (Char) | 0003CAA2-0000-1000-8000-00805F9B0131 |
On an Android phone, I installed this app to debug the BLE communication
With this, we can connect to the device.
Upon connecting, notice that the ID codes are the same as what we have observed.
To do a simple test, I renamed the device. Go to GAP Settings and change the Device name
Download the code to the board, and I see the new name on my phone!
This is a test of the bluetooth communication for the slider characteristic
Never thought that ModusToolbox has become so simple and seamless since I last used it one year ago! We shall revisit BLE again in a future blog.
In the next blog I will add the CY8CKIT-028-TFT display shield. The features on the shield I will use are the LCD display and the motion sensor (accelerometer)
I will be posting my progress on my Github repo, feel free to follow it!
https://github.com/zst123/Element14_Low-Power-IoT