SW7
to position one on the MCU board side, ensuring that the sensor board is powered from kitprog2 stable VDD supply. Also, ensure the board is in daplink mode for easy debugging in the software section.
libiio
and other application-specific wrapper libraries, the hardware can talk to any client-side number-crunching applications such as Python or Matlab. Since the firmware for CN0549 is based on the iio stack, we will use the pyadi-iio
package to collect data in Python from the firmware.
Before starting to build the dataset, you should install these first, or else the Python code might fail to run:
user_config.c
and pin mappings in app_config_mbeb.c/.h
files. If you want to use different pins or configurations; you can change them in these files..mbedignore
file in the root of the directory.EI_C_LINKAGE=1
flags to build the code properly. Some other flags and configurations can be found in the mbed_app.json
file..lib
files with specific Commit IDs. Click the “Exclamation mark” shown in the picture below, and that should check out the libraries properly.
app_config.h
file depending upon the intended use. You can either use it for data logging or inferencing. In inference mode, the firmware returns the client two extra bytes of classification results and the accelerometer data.
py_supplement
folder of the firmware repository or visit the following link.
This Jupyter notebook has all the initialization and data logging code. Run all the cells in the notebook one by one, except the last two cells. One is used for inference, and the other is for pushing data into Edge Impulse.
Here is a snapshot of the code. Add your HMAC
and API_KEY
into the code, and you can also set the sampling frequency (which needs to be in sync with the sampling frequency specified in the firmware) and then run the code.
Changing the block_size
will determine the sample length, which also depends on the sampling frequency. Here is a snapshot:
label
in the script, and data will be arranged accordingly in the Edge Impulse Studio. You should be able to see your incoming data in the Data acquisition tab.
app_config.h
file. This will build the code to transport inference results as part of the data stream on the host; on the client side, it should be able to separate it.