Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Examples): Updated CAM02 examples #963

Merged
merged 30 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dbc204a
Replacing 2.4" TFT fonts with Liberation fonts
vicloginov Nov 6, 2023
7f06a76
Added copyright to fonts
vicloginov Nov 7, 2023
fd29398
Linter cleanup
vicloginov Nov 7, 2023
c91d245
Clang cleanup
vicloginov Nov 7, 2023
5ef5e7f
Add consolidated fonts
Jake-Carter Nov 7, 2023
f10e844
Include new fonts.mk from AI85, AI87 BSPs
Jake-Carter Nov 7, 2023
f13e07e
Update AI85, AI87 projects to use new fonts
Jake-Carter Nov 7, 2023
18020ec
Add copyrights
Jake-Carter Nov 7, 2023
ee1f89f
Restore faceid_evkit-riscv project, use new font
Jake-Carter Nov 8, 2023
40e8cc9
Restore kws20_demo-riscv project, use new fonts
Jake-Carter Nov 8, 2023
504c39f
Restore mnist-riscv project
Jake-Carter Nov 8, 2023
8c0c8d1
clang-format
Jake-Carter Nov 8, 2023
6223f68
cpplint
Jake-Carter Nov 8, 2023
34afbc4
clang-format
Jake-Carter Nov 8, 2023
cf2fe07
Update header guard
Jake-Carter Nov 8, 2023
c9cf568
clang-format
Jake-Carter Nov 8, 2023
6a04800
Update MAX32662, MAX32672, MAX32690 projects and BSPs to use new fonts
Jake-Carter Nov 8, 2023
8938634
clang-format
Jake-Carter Nov 8, 2023
4c7454d
Revert unintentional change to faceid_evkit default settings
Jake-Carter Nov 15, 2023
cc3598f
Merge branch 'main' of https://github.com/vicloginov/msdk
vicloginov Nov 18, 2023
969631b
Fixed bug in faceId RISC-V example
vicloginov Nov 22, 2023
db09e52
Merge branch 'main' of https://github.com/vicloginov/msdk
vicloginov Nov 22, 2023
45cab6f
Use TFT_ENABLE setting for all CNN examples
vicloginov Nov 22, 2023
6cc992b
Merge branch 'main' of https://github.com/vicloginov/msdk
vicloginov Jan 9, 2024
525f318
Updated documentation of CSI2 example
vicloginov Jan 9, 2024
35ea615
Added more details to README
vicloginov Jan 10, 2024
cde8856
Merge branch 'main' of https://github.com/vicloginov/msdk
vicloginov Mar 24, 2024
d2e5dea
Updated CAM02 examples
vicloginov Mar 25, 2024
0522236
clang fix
vicloginov Mar 25, 2024
25ef5d8
Update project.mk
Jake-Carter Apr 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Examples/MAX78000/CNN/cats-dogs_demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Description
-----------

The model trained in this demo is used to classify images of cats and dogs. 25000 images dataset is used to train the model. The dataset can be downloaded using�[https://www.kaggle.com/c/dogs-vs-cats/data](https://www.kaggle.com/c/dogs-vs-cats/data)�link. The input size is 64x64 pixels RGB which is 3x64x64 in CHW format.
The model trained in this demo is used to classify images of cats and dogs. 25000 images dataset is used to train the model. The dataset can be downloaded using�[https://www.kaggle.com/c/dogs-vs-cats/data](https://www.kaggle.com/c/dogs-vs-cats/data)�link. The input size is 128x128 pixels RGB which is 3x128x128 in CHW format.

The code uses a sampledata header (sampledata.h) file to test a pre-defined input sample. The example also supports live capture from camera module and displays the image on the TFT LCD.

Expand Down Expand Up @@ -75,13 +75,13 @@ The PB1 (SW1) button is located as shown in picture bellow:

### Camera Mode

This mode uses OVM7692 camera module to capture an image in RGB888 format. Since the model is trained using 64x64 pixel image, the PCIF peripheral captures 64x64 pixel image and displays it on LCD.
This mode uses OVM7692 camera module to capture an image in RGB888 format. Since the model is trained using 128x128 pixel image, the PCIF peripheral captures 128x128 pixel image and displays it on LCD.

### Offline Mode

To operate in this mode, uncomment "#define USE\_SAMPLEDATA", defined in main.c.�

This mode uses a header file "sampledata.h" containing RGB image data and it should be included in the project to use it as an input to the cnn network.�
This mode uses a header file "sampledata.h" containing RGB image data and it should be included in the project to use it as an input to the CNN network.�

To create your own header file follow these steps:

Expand Down
22 changes: 13 additions & 9 deletions Examples/MAX78000/CNN/cats-dogs_demo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ static uint8_t *rx_data = NULL;
void setup_dma_tft(uint32_t *src_ptr, uint16_t byte_cnt)
{
// TFT DMA
while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) {
;
}
while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) {}

MXC_DMA->ch[g_dma_channel_tft].status = MXC_F_DMA_STATUS_CTZ_IF; // Clear CTZ status flag
MXC_DMA->ch[g_dma_channel_tft].dst = (uint32_t)rx_data; // Cast Pointer
Expand Down Expand Up @@ -186,9 +184,7 @@ void setup_dma_tft(uint32_t *src_ptr, uint16_t byte_cnt)
/* **************************************************************************** */
void start_tft_dma(uint32_t *src_ptr, uint16_t byte_cnt)
{
while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) {
;
}
while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) {}

if (MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_CTZ_IF) {
MXC_DMA->ch[g_dma_channel_tft].status = MXC_F_DMA_STATUS_CTZ_IF;
Expand Down Expand Up @@ -400,8 +396,10 @@ int main(void)
Camera_Power(POWER_ON);
//MXC_Delay(300000);
printf("\n\nCats-vs-Dogs Feather Demo\n");
#else
#elif defined(BOARD_EVKIT_V1)
printf("\n\nCats-vs-Dogs Evkit Demo\n");
#else
printf("\n\nCats-vs-Dogs CAM02 Demo\n");
#endif

/* Enable cache */
Expand Down Expand Up @@ -463,7 +461,8 @@ int main(void)

#ifdef BOARD_EVKIT_V1
camera_write_reg(0x11, 0x1); // set camera clock prescaller to prevent streaming overflow
#else
#endif
#ifdef BOARD_FTHR_REVA
camera_write_reg(0x11, 0x0); // set camera clock prescaller to prevent streaming overflow
#endif

Expand All @@ -477,8 +476,10 @@ int main(void)
TFT_Print(buff, 20, 130, font_2, snprintf(buff, sizeof(buff), "PRESS PB1(SW1) TO START!"));
#endif

#if defined(BOARD_EVKIT_V1) || defined(BOARD_FTHR_REVA)
printf("********** Press PB1(SW1) to capture an image **********\r\n");
while (!PB_Get(0)) {}
#endif

#ifdef TFT_ENABLE
MXC_TFT_ClearScreen();
Expand Down Expand Up @@ -566,9 +567,12 @@ int main(void)

#ifdef ASCII_ART
asciiart((uint8_t *)input_0);
printf("********** Press PB1(SW1) to capture an image **********\r\n");
#endif

#if defined(BOARD_EVKIT_V1) || defined(BOARD_FTHR_REVA)
printf("********** Press PB1(SW1) to capture an image **********\r\n");
while (!PB_Get(0)) {}
#endif
}

return 0;
Expand Down
21 changes: 13 additions & 8 deletions Examples/MAX78000/CNN/cats-dogs_demo/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,20 @@
# Add your config here!
# Uncomment the line below to build for the MAX78000FTHR
#BOARD=FTHR_RevA
# Uncomment the line below to build for the MAX78000CAM02
#BOARD = CAM02_RevA

$(info Note: This project is designed and tested for the OV7692 only.)
override CAMERA=OV7692
ifeq ($(BOARD),EvKit_V1)
CAMERA = OV7692
endif

ifeq ($(BOARD),FTHR_RevA)
CAMERA = OV7692
endif

ifeq ($(BOARD),CAM02_RevA)
CAMERA = GC0308
endif

# Set a higher optimization level. The increased performance
# is required for the CameraIF DMA code to work within the
Expand Down Expand Up @@ -46,9 +57,3 @@ endif
ifeq ($(BOARD),CAM01_RevA)
$(error ERR_NOTSUPPORTED: This project is not supported for the CAM01 board)
endif

ifeq ($(BOARD),CAM02_RevA)
$(error ERR_NOTSUPPORTED: This project is not supported for the CAM02 board)
endif


10 changes: 10 additions & 0 deletions Examples/MAX78000/ImgCapture/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

# **********************************************************

# Add your config here!
# Uncomment the line below to build for the MAX78000FTHR
#BOARD=FTHR_RevA
# Uncomment the line below to build for the MAX78000CAM02
#BOARD = CAM02_RevA
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding the place-holder lines, the preferred suggestion now is to link to the BSP sections of the MSDK User Guide: https://analogdevicesinc.github.io/msdk//USERGUIDE/#board-support-packages

This covers how to set the BSP for all supported development environments


# Project options:
# Set to 1 to enable, 0 to disable
CONSOLE = 1
Expand All @@ -28,6 +34,10 @@ ifeq ($(BOARD),CAM01_RevA)
CAMERA = HM0360_COLOR
endif

ifeq ($(BOARD),CAM02_RevA)
CAMERA = GC0308
endif

ifeq ($(BOARD),FTHR_RevA)
CAMERA = OV7692
endif
Expand Down
Loading