From bf17ef10cbd1472bd828e826ae54a814831501ab Mon Sep 17 00:00:00 2001 From: chunyexixiaoyu <834670833@qq.com> Date: Wed, 19 Jan 2022 14:42:16 +0800 Subject: [PATCH] APP_Framework/Applications/: make mnist application running on the stm32f407 board,model data is saved in the flash,note the following points 1. the thread which run the mnist needs 10kb 2. Lwip and useless driver must be not loaded. 3. The entire bin file is close to 1024KB. --- APP_Framework/Applications/knowing_app/mnist/model.h | 2 +- .../NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c | 3 ++- .../NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s8.c | 3 ++- .../Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_svdf_s8.c | 3 ++- .../source/tensorflow/lite/kernels/internal/compatibility.h | 2 ++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/APP_Framework/Applications/knowing_app/mnist/model.h b/APP_Framework/Applications/knowing_app/mnist/model.h index ad7b2c594..98f1b1b1e 100644 --- a/APP_Framework/Applications/knowing_app/mnist/model.h +++ b/APP_Framework/Applications/knowing_app/mnist/model.h @@ -1,4 +1,4 @@ -unsigned char mnist_model[] = { +const unsigned char mnist_model[] = { 0x1c, 0x00, 0x00, 0x00, 0x54, 0x46, 0x4c, 0x33, 0x14, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x18, 0x00, 0x1c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, diff --git a/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c b/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c index d0420c239..38fabc951 100644 --- a/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c +++ b/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c @@ -27,7 +27,8 @@ * Target Processor: Cortex-M * * -------------------------------------------------------------------- */ - +#include +#include "../../../Core/Include/cmsis_gcc.h" #include "arm_nnsupportfunctions.h" /** diff --git a/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s8.c b/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s8.c index 9ee217935..72dc50a23 100644 --- a/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s8.c +++ b/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s8.c @@ -27,7 +27,8 @@ * Target Processor: Cortex-M * * -------------------------------------------------------------------- */ - +#include +#include "../../../Core/Include/cmsis_gcc.h" #include "arm_nnsupportfunctions.h" /** diff --git a/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_svdf_s8.c b/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_svdf_s8.c index 1e799ac39..994ba78a9 100644 --- a/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_svdf_s8.c +++ b/APP_Framework/Framework/knowing/cmsis_5/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_svdf_s8.c @@ -28,7 +28,8 @@ * Target Processor: Cortex-M * * -------------------------------------------------------------------- */ - +#include +#include "../../../Core/Include/cmsis_gcc.h" #include "arm_nnsupportfunctions.h" /** diff --git a/APP_Framework/Framework/knowing/tensorflow-lite/tensorflow-lite-for-mcu/source/tensorflow/lite/kernels/internal/compatibility.h b/APP_Framework/Framework/knowing/tensorflow-lite/tensorflow-lite-for-mcu/source/tensorflow/lite/kernels/internal/compatibility.h index 61becad30..835203a85 100644 --- a/APP_Framework/Framework/knowing/tensorflow-lite/tensorflow-lite-for-mcu/source/tensorflow/lite/kernels/internal/compatibility.h +++ b/APP_Framework/Framework/knowing/tensorflow-lite/tensorflow-lite-for-mcu/source/tensorflow/lite/kernels/internal/compatibility.h @@ -76,6 +76,7 @@ limitations under the License. #define TFLITE_CHECK_LT(x, y) ((x) < (y)) ? (void)0 : TFLITE_ABORT #endif +/* #ifndef TF_LITE_STATIC_MEMORY // TODO(b/162019032): Consider removing these type-aliases. using int8 = std::int8_t; @@ -85,6 +86,7 @@ using uint16 = std::uint16_t; using int32 = std::int32_t; using uint32 = std::uint32_t; #endif // !defined(TF_LITE_STATIC_MEMORY) +*/ // TFLITE_DEPRECATED() //