cancel
Showing results for 
Search instead for 
Did you mean: 

Error after choosing USB communication with STM32CubeMX

electronicsbasickid
Associate II

Hi,

I'm using a STM32L100RC discovery board for a project. I'm trying to communicate with the USB port (Communication Device Class). After configuring the USB and USB_DEVICE part with STM32CubeMX, I have the following errors on Keil : 

.\Objects\Keil_TEST.axf: Error: L6218E: Undefined symbol hpcd_USB_FS (referred from stm32l1xx_it.o).

Not enough information to list image symbols.

Not enough information to list load addresses in the image map.

Finished: 2 information, 0 warning and 2 error messages."

I tried to add "extern PCD_HandleTypeDef hpcd_USB_FS;" in the file stm32l1xx_it.c. and the header "usbd_conf.h" but it still doesn't work.

Does anyone know how to solve this issue? 

Thank you in advance,

Jay.

1 ACCEPTED SOLUTION

Accepted Solutions
Houda GHABRI
ST Employee

Hi @electronicsbasickid​ 

If I well understand , you don't have anymore the issue when you start project from scratch?

Nice to hear this :) .

Houda

View solution in original post

5 REPLIES 5
Houda GHABRI
ST Employee

Hi @electronicsbasickid​ ,

Sorry for the delay.

I'm not able to reproduce this issue , can you please share your ioc?

Which CubeMX version are you using?

Houda

Hi,

Here is my ioc :

#MicroXplorer Configuration settings - do not modify

File.Version=6

GPIO.groupedBy=Group By Peripherals

KeepUserPlacement=false

Mcu.Family=STM32L1

Mcu.IP0=NVIC

Mcu.IP1=RCC

Mcu.IP2=SYS

Mcu.IP3=TIM2

Mcu.IP4=TIM3

Mcu.IP5=TIM4

Mcu.IP6=USB

Mcu.IP7=USB_DEVICE

Mcu.IPNb=8

Mcu.Name=STM32L100RCTx

Mcu.Package=LQFP64

Mcu.Pin0=PH0-OSC_IN

Mcu.Pin1=PH1-OSC_OUT

Mcu.Pin10=VP_SYS_VS_Systick

Mcu.Pin11=VP_TIM2_VS_ClockSourceINT

Mcu.Pin12=VP_TIM3_VS_ClockSourceINT

Mcu.Pin13=VP_TIM4_VS_ClockSourceINT

Mcu.Pin14=VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS

Mcu.Pin2=PA0-WKUP1

Mcu.Pin3=PA6

Mcu.Pin4=PA8

Mcu.Pin5=PA11

Mcu.Pin6=PA12

Mcu.Pin7=PA13

Mcu.Pin8=PA14

Mcu.Pin9=PB6

Mcu.PinsNb=15

Mcu.ThirdPartyNb=0

Mcu.UserConstants=

Mcu.UserName=STM32L100RCTx

MxCube.Version=6.2.1

MxDb.Version=DB.6.0.21

NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false

NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false

NVIC.ForceEnableDMAVector=true

NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false

NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false

NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false

NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false

NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4

NVIC.SVC_IRQn=true\:0\:0\:false\:false\:true\:false\:false

NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true

NVIC.USB_LP_IRQn=true\:0\:0\:false\:false\:true\:false\:true

NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false

PA0-WKUP1.Locked=true

PA0-WKUP1.Signal=S_TIM2_CH1_ETR

PA11.Mode=Device

PA11.Signal=USB_DM

PA12.Mode=Device

PA12.Signal=USB_DP

PA13.Mode=Serial_Wire

PA13.Signal=SYS_JTMS-SWDIO

PA14.Mode=Serial_Wire

PA14.Signal=SYS_JTCK-SWCLK

PA6.Locked=true

PA6.Signal=S_TIM3_CH1

PA8.Mode=Clock-out

PA8.Signal=RCC_MCO

PB6.Locked=true

PB6.Signal=S_TIM4_CH1

PH0-OSC_IN.Mode=HSE-External-Oscillator

PH0-OSC_IN.Signal=RCC_OSC_IN

PH1-OSC_OUT.Mode=HSE-External-Oscillator

PH1-OSC_OUT.Signal=RCC_OSC_OUT

PinOutPanel.RotationAngle=0

ProjectManager.AskForMigrate=true

ProjectManager.BackupPrevious=false

ProjectManager.CompilerOptimize=6

ProjectManager.ComputerToolchain=false

ProjectManager.CoupleFile=true

ProjectManager.CustomerFirmwarePackage=

ProjectManager.DefaultFWLocation=true

ProjectManager.DeletePrevious=true

ProjectManager.DeviceId=STM32L100RCTx

ProjectManager.FirmwarePackage=STM32Cube FW_L1 V1.10.2

ProjectManager.FreePins=false

ProjectManager.HalAssertFull=false

ProjectManager.HeapSize=0x200

ProjectManager.KeepUserCode=true

ProjectManager.LastFirmware=true

ProjectManager.LibraryCopy=1

ProjectManager.MainLocation=Src

ProjectManager.NoMain=false

ProjectManager.PreviousToolchain=STM32CubeIDE

ProjectManager.ProjectBuild=false

ProjectManager.ProjectFileName=STCubeGenerated.ioc

ProjectManager.ProjectName=STCubeGenerated

ProjectManager.RegisterCallBack=

ProjectManager.StackSize=0x400

ProjectManager.TargetToolchain=MDK-ARM V5

ProjectManager.ToolChainLocation=

ProjectManager.UnderRoot=false

ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_TIM2_Init-TIM2-false-HAL-true,4-MX_TIM3_Init-TIM3-false-HAL-true,5-MX_TIM4_Init-TIM4-false-HAL-true,6-MX_USB_DEVICE_Init-USB_DEVICE-false-HAL-false

RCC.48MHZClocksFreq_Value=48000000

RCC.AHBFreq_Value=16000000

RCC.APB1Freq_Value=16000000

RCC.APB1TimFreq_Value=16000000

RCC.APB2Freq_Value=16000000

RCC.APB2TimFreq_Value=16000000

RCC.FCLKCortexFreq_Value=16000000

RCC.FamilyName=M

RCC.HCLKFreq_Value=16000000

RCC.HSE_VALUE=24000000

RCC.HSI_VALUE=16000000

RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,LSE_VALUE,LSI_VALUE,MCOPinFreq_Value,MSI_VALUE,PLLCLKFreq_Value,PLLMUL,PWRFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,TIMFreq_Value,TimerFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value

RCC.LSE_VALUE=32768

RCC.LSI_VALUE=37000

RCC.MCOPinFreq_Value=16000000

RCC.MSI_VALUE=2097000

RCC.PLLCLKFreq_Value=48000000

RCC.PLLMUL=RCC_PLL_MUL4

RCC.PWRFreq_Value=16000000

RCC.RTCFreq_Value=37000

RCC.RTCHSEDivFreq_Value=12000000

RCC.SYSCLKFreq_VALUE=16000000

RCC.SYSCLKSource=RCC_SYSCLKSOURCE_HSI

RCC.TIMFreq_Value=16000000

RCC.TimerFreq_Value=16000000

RCC.VCOInputFreq_Value=24000000

RCC.VCOOutputFreq_Value=96000000

SH.S_TIM2_CH1_ETR.0=TIM2_CH1,PWM Generation1 CH1

SH.S_TIM2_CH1_ETR.ConfNb=1

SH.S_TIM3_CH1.0=TIM3_CH1,PWM Generation1 CH1

SH.S_TIM3_CH1.ConfNb=1

SH.S_TIM4_CH1.0=TIM4_CH1,PWM Generation1 CH1

SH.S_TIM4_CH1.ConfNb=1

TIM2.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1

TIM2.IPParameters=Channel-PWM Generation1 CH1,Prescaler,Period

TIM2.Period=15999

TIM2.Prescaler=999

TIM3.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1

TIM3.IPParameters=Channel-PWM Generation1 CH1,Prescaler,Period

TIM3.Period=15999

TIM3.Prescaler=999

TIM4.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1

TIM4.IPParameters=Channel-PWM Generation1 CH1,Prescaler,Period

TIM4.Period=15999

TIM4.Prescaler=999

USB_DEVICE.CLASS_NAME_FS=CDC

USB_DEVICE.IPParameters=VirtualMode,VirtualModeFS,CLASS_NAME_FS

USB_DEVICE.VirtualMode=Cdc

USB_DEVICE.VirtualModeFS=Cdc_FS

VP_SYS_VS_Systick.Mode=SysTick

VP_SYS_VS_Systick.Signal=SYS_VS_Systick

VP_TIM2_VS_ClockSourceINT.Mode=Internal

VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT

VP_TIM3_VS_ClockSourceINT.Mode=Internal

VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT

VP_TIM4_VS_ClockSourceINT.Mode=Internal

VP_TIM4_VS_ClockSourceINT.Signal=TIM4_VS_ClockSourceINT

VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS.Mode=CDC_FS

VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS.Signal=USB_DEVICE_VS_USB_DEVICE_CDC_FS

board=custom

I'm using the last version of CubeMX.

electronicsbasickid
Associate II

Recreating a new project from the beginning cleared the errors.

Houda GHABRI
ST Employee

Hi @electronicsbasickid​ 

If I well understand , you don't have anymore the issue when you start project from scratch?

Nice to hear this :) .

Houda

yes, exactly.