The Texas Instruments CC1352P Launchpad is a development board equipped with the multiprotocol wireless CC1352P microcontroller. The Launchpad, when paired with the BOOSTXL-SENSORS is fully supported by Edge Impulse, and can sample sensor data, build models, and deploy directly to the device without any programming required.
This is a getting-started guide for the TI LAUNCHXL-CC1352P development board with the Edge Impulse. Here we will connect the board to the edge-impulse studio, collect sensor data directly from the board, Prepare a machine-learning model using the collected data, deploy the model back to the board and perform inference locally on the board. Let's get started!!
Edge Impulse Project Link - TI LAUNCHXL-CC1352P Getting StartedUnboxing
The launchpad kit comes with
- The LAUNCHXL-CC1352P development board
- Micro USB to USB A cable
- Documentation
The BOOSTXL sensor comes with
- The BOOSTXL sensor board
- Documentation
Each LAUNCHXL-CC1352P board comes preinstalled with a quick-start project called Project Zero. Let's run the quick-start project to verify our board is working properly.
- Connect the board to the computer using the provided micro USB cable.
- Download the SimpleLink Starter smartphone app on your smartphone. This app lets you control the LEDs, see the state of the buttons and send data to the UART.
- Open the app, select Project Zero from the list of available devices, and click on Sensor View to get the GUI.
- In the Project Zero GUI, tap on the lights to turn them On/Off on the board. Press the user buttons on the board to see their status on the app.
- To learn more about Project Zero or user guide please follow this link.
In this section, we will upgrade the firmware of the development board so we can connect it to the Edge-Impulse studio.
Please follow this official guide to update the firmware
Firmware Update Guide - https://docs.edgeimpulse.com/docs/development-platforms/officially-supported-mcu-targets/ti-launchxlEdge-Impulse Project
It's best to create an Edge-Impulse account and a project in the Edge-Impulse studio before proceeding to the next step. Please follow the below steps to do so.
- Navigate to the edge-impulse studio and create an account. If you already have an account then please login using your credentials.
- After login, please create a new project, give it a suitable name, and select an appropriate project type and click on Create new project.
After creating a new project in the Edge Impulse studio, let's connect the development board to the studio.
Connecting Ti Launchpad KitThe next step is connecting our TI LAUNCHXL development board to the Edge-Impulse studio so we can ingest sensor data for the machine-learning model. Please follow the below steps to do so.
- Open a terminal or command prompt and type edge-impulse-daemon. The edge-impulse-daemon will start and prompt for user credentials. If you have not installed Edge Impulse CLI in the Update the Firmware section then please install it now.
- After providing user credentials, it will prompt you to select an Edge-Impulse project. Please navigate and select the project created in the previous steps using the arrow keys.
- After selecting the project, it will ask you to give the connected board a name. It is useful when you want to connect multiple boards to the same project.
- Now the board should be connected to the selected project. The edge-impulse-daemon will tell you which project the board is connected to. We can also verify by checking the devices tab of that project.
Edge impulse provides multiple options for data acquisition. In this getting started guide, we will look at the direct data ingestion from the board using edge-impulse-daemon. Please follow the below steps for data acquisition.
- Navigate to the Data Acquisition tab in the edge-impulse studio.
- Here you will find the Device we connected in the previous step and the sensor list. Please select the suitable sensor from the drop-down menu. For this project, I selected the Accelerometer sensor and used default parameters.
- Add a Label name for the sample you are about to collect. I am collecting up-down, side-to-side and circular motion data therefore I will use up_down,side_to_side and circle as labels. As a default motion, I will also collect stationary data.
- Clicking Start Sampling will start the sample collection process. Once the sample is collected, it will be automatically uploaded to the edge-impulse studio.
After data collection, the next step is machine learning model preparation. To do so, please navigate to the Impulse designtab and add relevant preprocessing and learning blocks to the pipeline.
- Edge-Impulse studio will automatically add an input block and it will recommend a suitable preprocessing and a learning block based on the data type. I have used the recommended ones in this project with default arguments.
- After impulse design is complete, save the design and navigate to the preprocessing tab (Spectral features in this case) for the feature generation.
- Click on the save parameters button, then navigate to the Generate features tab and click Generate features button for data preprocessing.
- After feature generation, please navigate to the Learning Tab (Classifier in this case). Design the neural network architecture and use appropriate parameters. I have used the default architecture and parameters recommended by the edge-impulse studio. After selecting a suitable configuration, click on the Start Training button.
- Once the training is complete, please navigate to the Model testing tab, and click Classify All button.
After testing is finished, the edge-impulse studio will show the model accuracy and other parameters.
Even though it is a simple example, the edge-impulse studio prepared an excellent machine learning model just by using the default recommended parameters. That too in just couple of minutes.Deployment
In this step, we will deploy our prepared model to the TI LAUNCHXL-CC1352P development board, so we can perform the inference locally on the board.
- Please navigate to the Deployment tab, select the TI LAUNCHXL-CC1352P board using the search bar, and click on the Build button.
- After the build is finished, the new firmware will be downloaded automatically to your computer and the edge-impulse studio will provide next-step instructions.
- Please extract the folder and double-click the
flash_<operating-system>
file. This will flash the newly created firmware on the TI LAUNCHXL-CC1352P board. This firmware contains the machine learning model we prepared in the above steps.
The next step is testing!! Let's see how well our model performs when run locally on the TI LAUNCHXL-CC1352P board.
To start local inferencing, type edge-impulse-run-impulse
from your terminal or command prompt.
And, that's it. I hope this getting started guide will be useful for you when using TI LAUNCHXL-CC1352P with the edge impulse.
If you have any questions, please check out the edge impulse forum.
Comments