Skip to content

Commit d306ecb

Browse files
GHORTESSTMGitHub Enterprise
authored andcommitted
Update to v2.0.0
- Add support of the NUCLEO-N657X0-Q board - Update miscellaneous drivers - Update Camera Middleware to v1.4.2 - Miscellaneous refactoring
1 parent bf726c2 commit d306ecb

File tree

2,007 files changed

+810038
-25543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,007 files changed

+810038
-25543
lines changed
File renamed without changes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
******************************************************************************
3+
* @file app_camerapipeline.h
4+
* @author GPM Application Team
5+
*
6+
******************************************************************************
7+
* @attention
8+
*
9+
* Copyright (c) 2023 STMicroelectronics.
10+
* All rights reserved.
11+
*
12+
* This software is licensed under terms that can be found in the LICENSE file
13+
* in the root directory of this software component.
14+
* If no LICENSE file comes with this software, it is provided AS-IS.
15+
*
16+
******************************************************************************
17+
*/
18+
#ifndef APP_CAMERAPIPELINE
19+
#define APP_CAMERAPIPELINE
20+
21+
#define CAMERA_FPS 30
22+
#define SCREEN_HEIGHT (240)
23+
#define SCREEN_WIDTH (320)
24+
25+
void CameraPipeline_Init(uint32_t *layers_width[2], uint32_t *layers_height[2], uint32_t *pitch_nn);
26+
void CameraPipeline_DeInit(void);
27+
void CameraPipeline_Start(void);
28+
void CameraPipeline_DisplayPipe_Start(uint8_t *display_pipe_dst, uint32_t cam_mode);
29+
void CameraPipeline_DisplayPipe_Stop(void);
30+
void CameraPipeline_NNPipe_Start(uint8_t *nn_pipe_dst, uint32_t cam_mode);
31+
void CameraPipeline_IspUpdate(void);
32+
33+
#endif

Inc/app_config.h renamed to Application/NUCLEO-N657X0-Q/Inc/app_config.h

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,10 @@
2626
/*Defines: CMW_MIRRORFLIP_NONE; CMW_MIRRORFLIP_FLIP; CMW_MIRRORFLIP_MIRROR; CMW_MIRRORFLIP_FLIP_MIRROR;*/
2727
#define CAMERA_FLIP CMW_MIRRORFLIP_NONE
2828

29-
#define ASPECT_RATIO_CROP (1) /* Crop both pipes to nn input aspect ratio; Original aspect ratio kept */
30-
#define ASPECT_RATIO_FIT (2) /* Resize both pipe to NN input aspect ratio; Original aspect ratio not kept */
31-
#define ASPECT_RATIO_FULLSCREEN (3) /* Resize camera image to NN input size and display a fullscreen image */
32-
#define ASPECT_RATIO_MODE ASPECT_RATIO_CROP
33-
34-
#define CAPTURE_FORMAT DCMIPP_PIXEL_PACKER_FORMAT_RGB565_1
35-
#define CAPTURE_BPP 2
36-
/* Leave the driver use the default resolution */
37-
#define CAMERA_WIDTH 0
38-
#define CAMERA_HEIGHT 0
39-
40-
#define LCD_FG_WIDTH 800
41-
#define LCD_FG_HEIGHT 480
42-
#define LCD_FG_FRAMEBUFFER_SIZE (LCD_FG_WIDTH * LCD_FG_HEIGHT * 2)
29+
#define ASPECT_RATIO_CROP (1) /* Crop both pipes to nn input aspect ratio; Original aspect ratio kept */
30+
#define ASPECT_RATIO_FIT (2) /* Resize both pipe to NN input aspect ratio; Original aspect ratio not kept */
31+
#define ASPECT_RATIO_FULLSCREEN (3) /* Resize camera image to NN input size and display a maximized image. See Doc/Build-Options.md#aspect-ratio-mode */
32+
#define ASPECT_RATIO_MODE ASPECT_RATIO_FULLSCREEN
4333

4434
/* Model Related Info */
4535
#define POSTPROCESS_TYPE POSTPROCESS_OD_YOLO_V2_UF
@@ -57,14 +47,14 @@
5747
"person", "not_person"}
5848

5949
/* I/O configuration */
60-
#define AI_OBJDETECT_YOLOV2_PP_NB_CLASSES (1)
61-
#define AI_OBJDETECT_YOLOV2_PP_NB_ANCHORS (5)
62-
#define AI_OBJDETECT_YOLOV2_PP_GRID_WIDTH (7)
63-
#define AI_OBJDETECT_YOLOV2_PP_GRID_HEIGHT (7)
64-
#define AI_OBJDETECT_YOLOV2_PP_NB_INPUT_BOXES (AI_OBJDETECT_YOLOV2_PP_GRID_WIDTH * AI_OBJDETECT_YOLOV2_PP_GRID_HEIGHT)
50+
#define AI_OD_YOLOV2_PP_NB_CLASSES (1)
51+
#define AI_OD_YOLOV2_PP_NB_ANCHORS (5)
52+
#define AI_OD_YOLOV2_PP_GRID_WIDTH (7)
53+
#define AI_OD_YOLOV2_PP_GRID_HEIGHT (7)
54+
#define AI_OD_YOLOV2_PP_NB_INPUT_BOXES (AI_OD_YOLOV2_PP_GRID_WIDTH * AI_OD_YOLOV2_PP_GRID_HEIGHT)
6555

6656
/* Anchor boxes */
67-
static const float32_t AI_OBJDETECT_YOLOV2_PP_ANCHORS[2*AI_OBJDETECT_YOLOV2_PP_NB_ANCHORS] = {
57+
static const float32_t AI_OD_YOLOV2_PP_ANCHORS[2*AI_OD_YOLOV2_PP_NB_ANCHORS] = {
6858
0.9883000000f, 3.3606000000f,
6959
2.1194000000f, 5.3759000000f,
7060
3.0520000000f, 9.1336000000f,
@@ -73,12 +63,12 @@ static const float32_t AI_OBJDETECT_YOLOV2_PP_ANCHORS[2*AI_OBJDETECT_YOLOV2_PP_N
7363
};
7464

7565
/* -------- Tuning below can be modified by the application --------- */
76-
#define AI_OBJDETECT_YOLOV2_PP_CONF_THRESHOLD (0.6f)
77-
#define AI_OBJDETECT_YOLOV2_PP_IOU_THRESHOLD (0.3f)
78-
#define AI_OBJDETECT_YOLOV2_PP_MAX_BOXES_LIMIT (10)
66+
#define AI_OD_YOLOV2_PP_CONF_THRESHOLD (0.6f)
67+
#define AI_OD_YOLOV2_PP_IOU_THRESHOLD (0.3f)
68+
#define AI_OD_YOLOV2_PP_MAX_BOXES_LIMIT (10)
7969

8070
/* Display */
8171
#define WELCOME_MSG_1 "quantized_tiny_yolo_v2_224_.tflite"
82-
#define WELCOME_MSG_2 "Model Running in STM32 MCU internal memory"
72+
#define WELCOME_MSG_2 ((char *[2]) {"Model Running in STM32 MCU", "internal memory"})
8373

8474
#endif
File renamed without changes.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
******************************************************************************
3+
* @file cmw_camera_conf.h
4+
* @author GPM Application Team
5+
*
6+
******************************************************************************
7+
* @attention
8+
*
9+
* Copyright (c) 2024 STMicroelectronics.
10+
* All rights reserved.
11+
*
12+
* This software is licensed under terms that can be found in the LICENSE file
13+
* in the root directory of this software component.
14+
* If no LICENSE file comes with this software, it is provided AS-IS.
15+
*
16+
******************************************************************************
17+
*/
18+
19+
/* Define to prevent recursive inclusion -------------------------------------*/
20+
#ifndef CMW_CAMERA_CONF_H
21+
#define CMW_CAMERA_CONF_H
22+
23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif
26+
27+
/* Includes ------------------------------------------------------------------*/
28+
#include "stm32n6xx_hal.h"
29+
#include "stm32n6xx_nucleo_bus.h"
30+
31+
32+
/* ########################## Module Selection ############################## */
33+
/**
34+
* @brief This is the list of modules to be used in the HAL driver
35+
*/
36+
#define USE_IMX335_SENSOR
37+
#define USE_VD66GY_SENSOR
38+
#define USE_VD55G1_SENSOR
39+
40+
#ifdef __cplusplus
41+
}
42+
#endif
43+
44+
#endif /* CMW_CAMERA_CONF_H */
File renamed without changes.
File renamed without changes.

Inc/isp_param_conf.h renamed to Application/NUCLEO-N657X0-Q/Inc/isp_param_conf.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ static const ISP_IQParamTypeDef ISP_IQParamCacheInit_IMX335 = {
3333
},
3434
.AECAlgo = {
3535
.enable = 1,
36-
.exposureCompensation = 0,
36+
.exposureCompensation = EXPOSURE_TARGET_0_0_EV,
37+
.antiFlickerFreq = 0,
3738
},
3839
.statRemoval = {
3940
.enable = 0,
@@ -56,7 +57,7 @@ static const ISP_IQParamTypeDef ISP_IQParamCacheInit_IMX335 = {
5657
},
5758
.demosaicing = {
5859
.enable = 1,
59-
.type = 0,
60+
.type = ISP_DEMOS_TYPE_RGGB,
6061
.peak = 2,
6162
.lineV = 4,
6263
.lineH = 4,
@@ -111,13 +112,13 @@ static const ISP_IQParamTypeDef ISP_IQParamCacheInit_IMX335 = {
111112
},
112113
};
113114
#if CAMERA_FLIP == CMW_MIRRORFLIP_NONE
114-
#define BAYER_TYPE 1
115+
#define BAYER_TYPE ISP_DEMOS_TYPE_GRBG
115116
#elif CAMERA_FLIP == CMW_MIRRORFLIP_FLIP
116-
#define BAYER_TYPE 3
117+
#define BAYER_TYPE ISP_DEMOS_TYPE_BGGR
117118
#elif CAMERA_FLIP == CMW_MIRRORFLIP_MIRROR
118-
#define BAYER_TYPE 0
119+
#define BAYER_TYPE ISP_DEMOS_TYPE_RGGB
119120
#elif CAMERA_FLIP == CMW_MIRRORFLIP_FLIP_MIRROR
120-
#define BAYER_TYPE 2
121+
#define BAYER_TYPE ISP_DEMOS_TYPE_GBRG
121122
#endif
122123
/* DCMIPP ISP configuration for VD66GY sensor */
123124
static const ISP_IQParamTypeDef ISP_IQParamCacheInit_VD66GY = {
@@ -129,7 +130,8 @@ static const ISP_IQParamTypeDef ISP_IQParamCacheInit_VD66GY = {
129130
},
130131
.AECAlgo = {
131132
.enable = 1,
132-
.exposureCompensation = 0,
133+
.exposureCompensation = EXPOSURE_TARGET_0_0_EV,
134+
.antiFlickerFreq = 0,
133135
},
134136
.statRemoval = {
135137
.enable = 0,
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
******************************************************************************
3+
* @file main.h
4+
* @author GPM Application Team
5+
*
6+
******************************************************************************
7+
* @attention
8+
*
9+
* Copyright (c) 2023 STMicroelectronics.
10+
* All rights reserved.
11+
*
12+
* This software is licensed under terms that can be found in the LICENSE file
13+
* in the root directory of this software component.
14+
* If no LICENSE file comes with this software, it is provided AS-IS.
15+
*
16+
******************************************************************************
17+
*/
18+
19+
/* Define to prevent recursive inclusion -------------------------------------*/
20+
#ifndef MAIN_H
21+
#define MAIN_H
22+
23+
/* Includes ------------------------------------------------------------------*/
24+
#include "stm32n6xx_hal.h"
25+
26+
/* Exported types ------------------------------------------------------------*/
27+
/* Exported constants --------------------------------------------------------*/
28+
/* Exported macro ------------------------------------------------------------*/
29+
30+
/* Exported functions ------------------------------------------------------- */
31+
32+
#endif /* MAIN_H */
33+

0 commit comments

Comments
 (0)