cube AI generated code error
When trying to use ai_network_ai_params, I get this error during the build process(my model name is sine_model). How do you fix this?
Build error message:
../Middlewares/ST/AI/Inc/ai_platform.h:323:4: error: 'union <anonymous>' has no member named 'format'
323 | { .format = (ai_buffer_format)(format_),\
| ^~~~~~
../X-CUBE-AI/App/sine_model_data.h:46:3: note: in expansion of macro 'AI_BUFFER_OBJ_INIT'
46 | AI_BUFFER_OBJ_INIT( \
| ^~~~~~~~~~~~~~~~~~
../Core/Src/main.c:121:5: note: in expansion of macro 'AI_SINE_MODEL_DATA_WEIGHTS'
121 | AI_SINE_MODEL_DATA_WEIGHTS(ai_sine_model_data_weights_get()),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../Middlewares/ST/AI/Inc/ai_platform.h:324:4: error: 'union <anonymous>' has no member named 'n_batches'
324 | .n_batches = (n_batches_), \
| ^~~~~~~~~
../X-CUBE-AI/App/sine_model_data.h:46:3: note: in expansion of macro 'AI_BUFFER_OBJ_INIT'
46 | AI_BUFFER_OBJ_INIT( \
| ^~~~~~~~~~~~~~~~~~
../Core/Src/main.c:121:5: note: in expansion of macro 'AI_SINE_MODEL_DATA_WEIGHTS'
121 | AI_SINE_MODEL_DATA_WEIGHTS(ai_sine_model_data_weights_get()),
code that calls it:
main.c:
// Set working memory and get weights/biases from model
ai_network_params ai_params = {
AI_SINE_MODEL_DATA_WEIGHTS(ai_sine_model_data_weights_get()),
AI_SINE_MODEL_DATA_ACTIVATIONS(activations)
};
sine_model_data.h:
#define AI_SINE_MODEL_DATA_ACTIVATIONS(ptr_) \
AI_BUFFER_OBJ_INIT( \
AI_BUFFER_FORMAT_U8, \
AI_SINE_MODEL_DATA_ACTIVATIONS_COUNT, 1, AI_SINE_MODEL_DATA_ACTIVATIONS_SIZE, 1, \
AI_HANDLE_PTR(ptr_) )
ai_platform.h:
#define AI_BUFFER_OBJ_INIT(format_, h_, w_, ch_, n_batches_, data_) \
{ .format = (ai_buffer_format)(format_),\
.n_batches = (n_batches_), \
.height = (h_), \
.width = (w_), \
.channels = (ch_), \
.data = (ai_handle)(data_), \
.meta_info = NULL \
}
X-Cube-AI version: 7.0.0
STM32CubeIDE version: 1.7.0
board: B-L475E-IOT01A2 (STM32L475VGT6 MCU)
