Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


undefined reference to "DCMI_SingleRandomRead"



Hi

I am working the project with STM32F407 discovery board and ran into an issue of undefined reference to “DCMI_SingleRandomRead”.

Using the same function “DCMI_SingleRandomRead” cause this issue in the the function “DCMI_OV7670_ReadID” shown below, but it does not in function “OV7670_config_window” shown below.

uint8_t DCMI_OV7670_ReadID(OV7670_IDTypeDef* OV7670ID)
{

uint8_t temp;
if(DCMI_SingleRandomRead(OV7670_MIDH,&temp)!=0)
return 0xff;
OV7670ID->Manufacturer_ID1 = temp;
if(DCMI_SingleRandomRead(OV7670_MIDL,&temp)!=0)
return 0xff;
OV7670ID->Manufacturer_ID2 = temp;
if(DCMI_SingleRandomRead(OV7670_VER,&temp)!=0)
return 0xff;
OV7670ID->Version = temp;
if(DCMI_SingleRandomRead(OV7670_PID,&temp)!=0)
return 0xff;
OV7670ID->PID = temp;

return 0;
}
/**
* @brief config_OV7660_window
* @param //(140,16,640,480) is good for VGA
* //(272,16,320,240) is good for QVGA
* @retval None
*/
void OV7670_config_window(uint16_t startx, uint16_t starty, uint16_t width, uint16_t height)
{
uint16_t endx=(startx+width);
uint16_t endy=(starty+height*2);// must be “height*2”
uint8_t temp_reg1, temp_reg2;
uint8_t state,temp;

//state = state; //Prevent report warning

state = DCMI_SingleRandomRead(0x03, &temp_reg1 );
temp_reg1 &= 0xC0;
state = DCMI_SingleRandomRead(0x32, &temp_reg2 );
temp_reg2 &= 0xC0;

// Horizontal
temp = temp_reg2|((endx&0x7)3;
state = DCMI_SingleRandomWrite(0x17, temp );
temp = (endx&0x7F8)>>3;
state = DCMI_SingleRandomWrite(0x18, temp );

// Vertical
temp = temp_reg1|((endy&0x7)3;
state = DCMI_SingleRandomWrite(0x19, temp );
temp = (endy&0x7F8)>>3;
state = DCMI_SingleRandomWrite(0x1A, temp );
}


please see the errors below:

Description Resource Path Location Type
undefined reference to `SCCB_GPIO_Config’ dcmi_OV7670.c /smartlock/src line 229 C/C++ Problem
undefined reference to `DCMI_SingleRandomWrite’ dcmi_OV7670.c /smartlock/src line 235 C/C++ Problem
undefined reference to `DCMI_SingleRandomWrite’ dcmi_OV7670.c /smartlock/src line 241 C/C++ Problem
undefined reference to `DCMI_SingleRandomWrite’ main.c /smartlock/src line 117 C/C++ Problem
undefined reference to `DCMI_SingleRandomWrite’ main.c /smartlock/src line 124 C/C++ Problem
undefined reference to `DCMI_SingleRandomRead’ dcmi_OV7670.c /smartlock/src line 260 C/C++ Problem
undefined reference to `DCMI_SingleRandomRead’ dcmi_OV7670.c /smartlock/src line 263 C/C++ Problem
undefined reference to `DCMI_SingleRandomRead’ dcmi_OV7670.c /smartlock/src line 266 C/C++ Problem
undefined reference to `DCMI_SingleRandomRead’ dcmi_OV7670.c /smartlock/src line 269 C/C++ Problem
undefined reference to `DCMI_SingleRandomRead’ dcmi_OV7670.c /smartlock/src line 274 C/C++ Problem
recipe for target ‘smartlock.elf’ failed makefile /smartlock/Debug line 35 C/C++ Problem
make: *** smartlock.elf Error 1 smartlock C/C++ Problem
variable ‘state’ set but not used -Wunused-but-set-variable dcmi_OV7670.c /smartlock/src line 259 C/C++ Problem
variable ‘state’ set but not used -Wunused-but-set-variable dcmi_OV7670.c /smartlock/src line 290 C/C++ Problem
Unused declaration of variable ‘disfps’ stm32f4xx_it.c /smartlock/src line 138 Code Analysis Problem
“STM32F40_41xxx” redefined stm32f4xx.h /smartlock/CMSIS/device line 108 C/C++ Problem
this is the location of the previous definition smartlock line 0 C/C++ Problem