cancel
Showing results for 
Search instead for 
Did you mean: 

MX_I2C2_Init used but never define H7A3

StanCosgrove
Associate II

I encountered this error when configuring I2C2 on H7A3 board, fast mode, i2c enabled, and code auto generated from ioc.  anyone can kindly advise?

 MX_I2C2_Init used but never define

9 REPLIES 9
StanCosgrove
Associate II

full error msg: ../Core/Src/main.c:211:13: error: invalid storage class for function 'MX_I2C2_Init' at line that say :   static void MX_I2C2_Init(void);

whats happening ?? 

Pavel A.
Evangelist III

Missing forward declaration for MX_I2C2_Init?

StanCosgrove
Associate II

the I2C2 was generate from the ioc GUI, how could it be missing? Any idea ?

TDK
Guru

Include the relevant files (main.c and *.ioc).

If you feel a post has answered your question, please click "Accept as Solution".
Foued_KH
ST Employee

Hello @StanCosgrove ,

I couldn't reproduce this issue .
Could you please share the .ioc file ?

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Foued_KH, Sure, there u go...

#MicroXplorer Configuration settings - do not modify File.Version=6 I2C2.I2C_Speed_Mode=I2C_Fast I2C2.IPParameters=Timing,I2C_Speed_Mode I2C2.Timing=0x009032AE KeepUserPlacement=false Mcu.CPN=STM32H7A3ZIT6Q Mcu.Family=STM32H7 Mcu.IP0=CORTEX_M7 Mcu.IP1=DEBUG Mcu.IP2=I2C2 Mcu.IP3=NVIC Mcu.IP4=RCC Mcu.IP5=SYS Mcu.IPNb=6 Mcu.Name=STM32H7A3Z(G-I)TxQ Mcu.Package=LQFP144 Mcu.Pin0=PC13 Mcu.Pin1=PC14-OSC32_IN Mcu.Pin2=PC15-OSC32_OUT Mcu.Pin3=PH0-OSC_IN Mcu.Pin4=PB10 Mcu.Pin5=PB11 Mcu.Pin6=PA13 Mcu.Pin7=PA14 Mcu.Pin8=PB3 Mcu.Pin9=VP_SYS_VS_Systick Mcu.PinsNb=10 Mcu.ThirdPartyNb=0 Mcu.UserConstants= Mcu.UserName=STM32H7A3ZITxQ MxCube.Version=6.5.0 MxDb.Version=DB.6.0.50 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true NVIC.ForceEnableDMAVector=true NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true PA13.Mode=Trace_Asynchronous_SW PA13.Signal=DEBUG_JTMS-SWDIO PA14.Mode=Trace_Asynchronous_SW PA14.Signal=DEBUG_JTCK-SWCLK PB10.Locked=true PB10.Mode=I2C PB10.Signal=I2C2_SCL PB11.Locked=true PB11.Mode=I2C PB11.Signal=I2C2_SDA PB3.Mode=Trace_Asynchronous_SW PB3.Signal=DEBUG_JTDO-SWO PC13.GPIOParameters=GPIO_Label PC13.GPIO_Label=BTN PC13.Locked=true PC13.Signal=GPIO_Input PC14-OSC32_IN.Mode=LSE-External-Oscillator PC14-OSC32_IN.Signal=RCC_OSC32_IN PC15-OSC32_OUT.Mode=LSE-External-Oscillator PC15-OSC32_OUT.Signal=RCC_OSC32_OUT PH0-OSC_IN.Mode=HSE-External-Clock-Source PH0-OSC_IN.Signal=RCC_OSC_IN PinOutPanel.RotationAngle=0 ProjectManager.AskForMigrate=true ProjectManager.BackupPrevious=false ProjectManager.CompilerOptimize=6 ProjectManager.ComputerToolchain=false ProjectManager.CoupleFile=false ProjectManager.CustomerFirmwarePackage= ProjectManager.DefaultFWLocation=true ProjectManager.DeletePrevious=true ProjectManager.DeviceId=STM32H7A3ZITxQ ProjectManager.FirmwarePackage=STM32Cube FW_H7 V1.10.0 ProjectManager.FreePins=false ProjectManager.HalAssertFull=false ProjectManager.HeapSize=0x200 ProjectManager.KeepUserCode=true ProjectManager.LastFirmware=true ProjectManager.LibraryCopy=1 ProjectManager.MainLocation=Core/Src ProjectManager.NoMain=false ProjectManager.PreviousToolchain= ProjectManager.ProjectBuild=false ProjectManager.ProjectFileName=My_OLED_SSD1306_I2C.ioc ProjectManager.ProjectName=My_OLED_SSD1306_I2C ProjectManager.RegisterCallBack= ProjectManager.StackSize=0x400 ProjectManager.TargetToolchain=STM32CubeIDE ProjectManager.ToolChainLocation= ProjectManager.UnderRoot=true ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_I2C2_Init-I2C2-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true RCC.ADCFreq_Value=16125000 RCC.AHB12Freq_Value=96000000 RCC.AHB4Freq_Value=96000000 RCC.APB1Freq_Value=96000000 RCC.APB2Freq_Value=96000000 RCC.APB3Freq_Value=96000000 RCC.APB4Freq_Value=96000000 RCC.AXIClockFreq_Value=96000000 RCC.CDCPREFreq_Value=96000000 RCC.CECFreq_Value=32000 RCC.CKPERFreq_Value=64000000 RCC.CortexFreq_Value=96000000 RCC.CpuClockFreq_Value=96000000 RCC.DAC1Freq_Value=32000 RCC.DFSDM2ACLkFreq_Value=96000000 RCC.DFSDM2Freq_Value=96000000 RCC.DFSDMACLkFreq_Value=48000000 RCC.DFSDMFreq_Value=96000000 RCC.DIVM1=1 RCC.DIVM3=1 RCC.DIVN1=24 RCC.DIVN3=24 RCC.DIVP1Freq_Value=96000000 RCC.DIVP2Freq_Value=16125000 RCC.DIVP3Freq_Value=96000000 RCC.DIVQ1=4 RCC.DIVQ1Freq_Value=48000000 RCC.DIVQ2Freq_Value=16125000 RCC.DIVQ3Freq_Value=96000000 RCC.DIVR1Freq_Value=96000000 RCC.DIVR2Freq_Value=16125000 RCC.DIVR3Freq_Value=96000000 RCC.FDCANFreq_Value=48000000 RCC.FMCFreq_Value=96000000 RCC.FamilyName=M RCC.HCLK3ClockFreq_Value=96000000 RCC.HCLKFreq_Value=96000000 RCC.HSE_VALUE=8000000 RCC.I2C123Freq_Value=96000000 RCC.I2C4Freq_Value=96000000 RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CDCPREFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,DAC1Freq_Value,DFSDM2ACLkFreq_Value,DFSDM2Freq_Value,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVM3,DIVN1,DIVN3,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,HSE_VALUE,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLLFRACN,PLLSourceVirtual,PWR_Regulator_Voltage_Scale,QSPIFreq_Value,RNGFreq_Value,RTCFreq_Value,SAI1Freq_Value,SAI2AFreq_Value,SAI2BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,SupplySource,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBCLockSelection,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value RCC.LPTIM1Freq_Value=96000000 RCC.LPTIM2Freq_Value=96000000 RCC.LPTIM345Freq_Value=96000000 RCC.LPUART1Freq_Value=96000000 RCC.LTDCFreq_Value=96000000 RCC.MCO1PinFreq_Value=64000000 RCC.MCO2PinFreq_Value=96000000 RCC.PLLFRACN=0 RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE RCC.PWR_Regulator_Voltage_Scale=PWR_REGULATOR_VOLTAGE_SCALE0 RCC.QSPIFreq_Value=96000000 RCC.RNGFreq_Value=48000000 RCC.RTCFreq_Value=32000 RCC.SAI1Freq_Value=48000000 RCC.SAI2AFreq_Value=48000000 RCC.SAI2BFreq_Value=48000000 RCC.SDMMCFreq_Value=48000000 RCC.SPDIFRXFreq_Value=48000000 RCC.SPI123Freq_Value=48000000 RCC.SPI45Freq_Value=96000000 RCC.SPI6Freq_Value=96000000 RCC.SWPMI1Freq_Value=96000000 RCC.SYSCLKFreq_VALUE=96000000 RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK RCC.SupplySource=PWR_DIRECT_SMPS_SUPPLY RCC.Tim1OutputFreq_Value=96000000 RCC.Tim2OutputFreq_Value=96000000 RCC.TraceFreq_Value=96000000 RCC.USART16Freq_Value=96000000 RCC.USART234578Freq_Value=96000000 RCC.USBCLockSelection=RCC_USBCLKSOURCE_HSI48 RCC.USBFreq_Value=48000000 RCC.VCO1OutputFreq_Value=192000000 RCC.VCO2OutputFreq_Value=32250000 RCC.VCO3OutputFreq_Value=192000000 RCC.VCOInput1Freq_Value=8000000 RCC.VCOInput2Freq_Value=250000 RCC.VCOInput3Freq_Value=8000000 VP_SYS_VS_Systick.Mode=SysTick VP_SYS_VS_Systick.Signal=SYS_VS_Systick board=NUCLEO-H7A3ZI-Q boardIOC=true isbadioc=false
View more
TDK
Guru

The project builds with no errors for me.

If you feel a post has answered your question, please click "Accept as Solution".
Foued_KH
ST Employee

Hi @StanCosgrove , 

Could you please use the latest version .

Foued

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I had been using this version since 2020 and no problem arise, I had also try to update the STM32CubeIDE but cant with error msg again!