The latest deployed model doesn´t compile on firmware-nrf52840-5340-dk

Hi,

When I try to compile the latest firmware-nrf52840-5340-dk with a new model I deployed yesterday, I get compile errors. Compiling with the sample model works fine, but the error shows up when I swap the model with a newly compiled model, so I guess there are some updates in the generated Edge Impulse models that the firmware is not up to date with.

I´m using NRF Connect SDK 16.0 with nrf52840dk.

First when I only copy tflite-model and model-parameters to firmware-nrf52840-5340-dk and compile, I get following errors:

    -MF CMakeFiles\app.dir\edge-impulse-sdk\CMSIS\NN\Source\PoolingFunctions\arm_max_pool_s8_opt.c.obj.d -o CMakeFiles/app.dir/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8_opt.c.obj   -c ../edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8_opt.c
    ../edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8_opt.c: In function 'compare_and_replace_if_larger_q7':
    ../edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8_opt.c:76:22: error: storage size of 'ref_max' isn't known
       76 |     union arm_nnword ref_max;
          |                      ^~~~~~~
    ../edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8_opt.c:77:22: error: storage size of 'comp_max' isn't known
       77 |     union arm_nnword comp_max;

When I also copy edge-impulse-sdk (and overwrite) folder from the deployed model to firmware-nrf52840-5340-dk, I get these errors instead:

    -MF CMakeFiles\app.dir\tflite-model\trained_model_compiled.cpp.obj.d -o CMakeFiles/app.dir/tflite-model/trained_model_compiled.cpp.obj -c ../tflite-model/trained_model_compiled.cpp
../tflite-model/trained_model_compiled.cpp:96:1: error: 'TfLiteEvalTensor' does not name a type; did you mean 'TfLiteTensor'?
   96 | TfLiteEvalTensor tflEvalTensors[23];
      | ^~~~~~~~~~~~~~~~
      | TfLiteTensor
../tflite-model/trained_model_compiled.cpp:347:8: error: 'TfLiteEvalTensor' does not name a type; did you mean 'TfLiteTensor'?
  347 | static TfLiteEvalTensor* GetEvalTensor(const struct TfLiteContext* context,
      |        ^~~~~~~~~~~~~~~~
      |        TfLiteTensor
../tflite-model/trained_model_compiled.cpp: In function 'TfLiteStatus trained_model_init(void* (*)(size_t, size_t))':
../tflite-model/trained_model_compiled.cpp:366:34: error: invalid conversion from 'void* (*)(TfLiteContext*, size_t)' {aka 'void* (*)(TfLiteContext*, unsigned int)'} to 'TfLiteStatus (*)(TfLiteContext*, size_t, void**)' {aka 'TfLiteStatus (*)(TfLiteContext*, unsigned int, void**)'} [-fpermissive]
  366 |   ctx.AllocatePersistentBuffer = &AllocatePersistentBuffer;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                  |
      |                                  void* (*)(TfLiteContext*, size_t) {aka void* (*)(TfLiteContext*, unsigned int)}
../tflite-model/trained_model_compiled.cpp:369:7: error: 'TfLiteContext' {aka 'struct TfLiteContext'} has no member named 'GetTensor'
  369 |   ctx.GetTensor = &GetTensor;

Hello @M435,

Few days ago, we updated TensorFlow lite, CMSIS-NN and other things.
See here for more info: Updated TensorFlow Lite, CMSIS-NN, ARC DSP kernels

Did the compilation worked before or is it the first time you tried to deploy the model on your board?

I’m forwarding your issue to our core engineering team.

Regards,

Hello again @M435,

Could you try to completely remove the edge-impulse-sdk/ and add the new one again as well as the deleting the build/ repository before re-compiling please?

Regards,

Louis

Hi louis,

Yes, the compilation worked before with a model I deployed in June, and I used NRF Connect SDK 16.0-rc2 at that point.

Hi again,

I now tried again by first completely removing the edge-impulse-sdk, and it worked!
Thanks!

3 Likes