Skip to content

Compiler error when compiling camera app with Mbed 1.10 #42

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

Closed
dtch1997 opened this issue Jun 15, 2020 · 1 comment
Closed

Compiler error when compiling camera app with Mbed 1.10 #42

dtch1997 opened this issue Jun 15, 2020 · 1 comment

Comments

@dtch1997
Copy link

dtch1997 commented Jun 15, 2020

Would appreciate advice on this within the next 2-3 days. I am a complete novice so any bit of information would be useful.

To build a basic camera app for STM32F746-DISCO, I am following the tutorial here: https://developer.arm.com/solutions/machine-learning-on-arm/developer-material/how-to-guides/image-recognition-on-arm-cortex-m-with-cmsis-nn/single-page.

Due to a missing header in Mbed 2.0 (ARMmbed/mbed-cli#805), I am using Mbed 1.10 instead. (Instead of mbed new cmsisnn_demo --mbedlib, I omitted the --mbedlib so it will use Mbed 1.10).

After installing requirements, I try to compile it with:

mbed compile -m DISCO_F746NG -t GCC_ARM --source . --source ../ML-examples/cmsisnn-cifar10/camera_demo/camera_app/

This produces the following error:

BUILD/DISCO_F746NG/GCC_ARM/ML-examples/cmsisnn-cifar10/camera_demo/camera_a
pp/camera_app.o: In function `DCMI_IRQHandler':
/home/dtch009/CMSISNN_Webinar/cmsisnn_demo/../ML-examples/cmsisnn-cifar10/c
amera_demo/camera_app/camera_app.cpp:10: multiple definition of `DCMI_IRQHa
ndler'
BUILD/DISCO_F746NG/GCC_ARM/BSP_DISCO_F746NG/Drivers/BSP/STM32746G-Discovery
/stm32746g_discovery_camera.o:/home/dtch009/CMSISNN_Webinar/cmsisnn_demo/./
BSP_DISCO_F746NG/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_camera
.c:404: first defined here
BUILD/DISCO_F746NG/GCC_ARM/ML-examples/cmsisnn-cifar10/camera_demo/camera_a
pp/camera_app.o: In function `DMA2_Stream1_IRQHandler':
/home/dtch009/CMSISNN_Webinar/cmsisnn_demo/../ML-examples/cmsisnn-cifar10/c
amera_demo/camera_app/camera_app.cpp:13: multiple definition of `DMA2_Strea
m1_IRQHandler'
BUILD/DISCO_F746NG/GCC_ARM/BSP_DISCO_F746NG/Drivers/BSP/STM32746G-Discovery
/stm32746g_discovery_camera.o:/home/dtch009/CMSISNN_Webinar/cmsisnn_demo/./
BSP_DISCO_F746NG/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_camera
.c:413: first defined here
collect2: error: ld returned 1 exit status
[ERROR] BUILD/DISCO_F746NG/GCC_ARM/ML-examples/cmsisnn-cifar10/camera_demo/
camera_app/camera_app.o: In function `DCMI_IRQHandler':
/home/dtch009/CMSISNN_Webinar/cmsisnn_demo/../ML-examples/cmsisnn-cifar10/c
amera_demo/camera_app/camera_app.cpp:10: multiple definition of `DCMI_IRQHandler'
BUILD/DISCO_F746NG/GCC_ARM/BSP_DISCO_F746NG/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_camera.o:/home/dtch009/CMSISNN_Webinar/cmsisnn_demo/./BSP_DISCO_F746NG/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_camera.c:404: first defined here
BUILD/DISCO_F746NG/GCC_ARM/ML-examples/cmsisnn-cifar10/camera_demo/camera_app/camera_app.o: In function `DMA2_Stream1_IRQHandler':
/home/dtch009/CMSISNN_Webinar/cmsisnn_demo/../ML-examples/cmsisnn-cifar10/camera_demo/camera_app/camera_app.cpp:13: multiple definition of `DMA2_Stream1_IRQHandler'
BUILD/DISCO_F746NG/GCC_ARM/BSP_DISCO_F746NG/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_camera.o:/home/dtch009/CMSISNN_Webinar/cmsisnn_demo/./BSP_DISCO_F746NG/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_camera
@dtch1997
Copy link
Author

I resolved this as follows:

Comment out the following code. The camera_app.cpp file then compiles without issue.

/*
extern "C" {
  //defined in stm32746g_discovery_camera.c
  extern DCMI_HandleTypeDef hDcmiHandler;
  void DCMI_IRQHandler(void) {
      HAL_DCMI_IRQHandler(&hDcmiHandler);
  }
  void DMA2_Stream1_IRQHandler(void) {
      HAL_DMA_IRQHandler(hDcmiHandler.DMA_Handle);
  }
}*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant