Using External Sensors with Syntiant TinyML

I was wondering if anyone has experience using the Syntiant TinyML with external sensor data. I’m currently looking at the firmware libraries for the board here and I found a function in syntiant_ndp10x_micro.c (which is linked here)called syntiant_ndp10x_micro_send_data. I noticed that this function wasn’t implemented in the NDP.cpp wrapper file and I am trying to use it to send external sensor data to the NDP101.

For right now, I am simply trying to write fake data (an array of integers) to the NDP101 and then read it again using the extractData function from NDP.cpp. I’m not getting my expected results and my suspicion is that extractData is not reading from the same memory address that I write the data to. Alternatively, the data might be overwritten by the time I try to read it, but I’m not sure how to check that. Here is how I am currently trying to use the send_data function in NDP.cpp:

int NDPClass::sendData(uint8_t *data, unsigned int len) 
{
    return syntiant_ndp10x_micro_send_data
        (&ndp, data, len, SYNTIANT_NDP10X_MICRO_SEND_DATA_TYPE_FEATURE_STATIC, 0x00);
}

As of right now, I’ve made no other modifications to any of the other files.

I was considering using SYNTIANT_NDP10X_MICRO_SEND_DATA_TYPE_STREAMING for the type variable instead, but I wasn’t certain on how to access the SPI interface of the NDP and properly read and write from it.

Any help or advice would be appreciated. Thank you!

Hi @neetsy

To be honest I’m not sure how to use an external sensor with the TinyML board, because both microphone and IMU are connected directly with the NDP101.

But you can have a look what we did for the Arduino Nicla Voice, because for this target we feed the IMU data to the NDP, see here
As you see, we feed data using NDP.sendData the same way yo do, see details here, it’s a different library from the one used with the TinyML board, it’s for the NDP120.

If you have a look at the libraries for the NDP120, when feeding data they send it at address 0x20 (and using TYPE_STREAMING).

regards,
fv

Thank you for your reply! Since then, I have moved my work to the Avnet RasynBoard and Arduino Nicla Voice in order to leverage the NDP120 and the libraries seem much more well defined.