Can not compile example for VCP with STM32F429ZIT6

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
bigbo
Posts: 5
Joined: 21 Jul 2016 23:16

Can not compile example for VCP with STM32F429ZIT6

#1 Post by bigbo » 11 Sep 2016 20:36

Dear all,

Please help me with the following problem:

My MCU is STM32F429ZIT6 (Actually it is STM32F429DISCO board)
I made small test project for USB HID and the example from USB library is working fine.
To do this I made small "shield" and connected wires from PA11 to USB_OTG_FS_DM and PA12 to USB_OTG_FS_DP, both om them are through 22 Ohm resistors.
Also, USB pin D+ is pulled up to 3.3V with 1.5 kOhm resistor.

So, my laptop see the HID device, I can send and receive strings, also I put received strings to LCD2x16 which I installed before I try to use USB.
So I sure 100% my HID is working right.

Then, I want to make VCP connection because I have to send a huge information to laptop.
I found an example in USB library.
I made new project with right adjustments for my MCU, as it was with USB HID project.
I use VPC_Descriptor.mpas from the example. The file is included to the project in Project Inspector.
USB_Device_CDClass_STM32 and USB_Device_STM32_M4 are selected in Library Manager. Only these, because LCD is already disconnected.

When I try to compile the project I get many faults, they are shown below:
0 360 Unresolved extern 'OTG_FS_GUSBCFG' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTSTS' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GRSTCTL' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GAHBCFG' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DCFG' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_PCGCCTL' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GCCFG' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTSTS' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GRXFSIZ' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_HNPTXFSIZ_DIEPTXF0' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DOEPTSIZ0' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GUSBCFG' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GRXSTSPR' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DCTL' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DCFG' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GRXFSIZ' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DOEPTSIZ0' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DAINT' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DAINTMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DIEPMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DIEPEMPMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DCTL' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTSTS' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTSTS' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DAINT' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DAINTMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DOEPMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTSTS' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DSTS' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTSTS' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GRSTCTL' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DCTL' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DCFG' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DAINT' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DAINTMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DOEPMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DIEPMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DOEPTSIZ0' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTSTS' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTSTS' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GINTMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DAINTMSK' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_HNPTXFSIZ_DIEPTXF0' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DIEPTXF1' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_HNPTXFSIZ_DIEPTXF0' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_GRXFSIZ' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DIEPTXF1' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DOEPTSIZ0' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DOEPTSIZ0' __Lib_USB_Device_STM_M4.c
0 360 Unresolved extern 'OTG_FS_DIEPEMPMSK' __Lib_USB_Device_STM_M4.c
0 453 Unsuccessful linking 'bigbo_lcd.mppar' Unsuccessful linking 'bigbo_lcd.mppar'
0 102 Finished (with errors): 11 Âåð 2016, 20:05:25 bigbo_lcd.mppar
My code is -

Code: Select all

program bigbo_lcd;


var buffer : array[64] of byte;

procedure USBDev_CDCParamsChanged();
begin
end;

// USB interrupt service routine
procedure USB0Interrupt(); iv IVT_INT_OTG_FS;
begin  // Call library interrupt handler routine
  USBDev_IntHandler();
end;

// Callback function which will be called on received packet
procedure USBDev_CDCDataReceived(size : word);
begin
  // Prepare receive buffer
  USBDev_CDCSetReceiveBuffer(@buffer);
  // Send back received packet
  USBDev_CDCSendData( @buffer, size);
end;


begin
  // Initialize CDC Class
  USBDev_CDCInit();

  // Initialize USB device module
  USBDev_Init();

  // Enable USB device interrupt
  NVIC_IntEnable(IVT_INT_OTG_FS);

  // Wait until device is configured (enumeration is successfully finished)
  while(USBDev_GetDeviceState() <> _USB_DEV_STATE_CONFIGURED) do    ;

  // Set receive buffer where received data is stored
  USBDev_CDCSetReceiveBuffer(@buffer);

  // Infinite loop
  while(1) do
   ;

end.
Please help my to solve the problem.
PS Version is mikroPascal PRO for ARM 4.9.0
Attachments
VCP_Descriptor.zip
(1.53 KiB) Downloaded 215 times

User avatar
uros.cvetinovic
mikroElektronika team
Posts: 803
Joined: 14 Dec 2015 09:24

Re: Can not compile example for VCP with STM32F429ZIT6

#2 Post by uros.cvetinovic » 12 Sep 2016 15:55

Hi,

Can you please submit a ticket on this matter on our helpdesk?
http://helpdesk.mikroe.com/

I believe I can find a solution for you.

Best regards,

Uros

bigbo
Posts: 5
Joined: 21 Jul 2016 23:16

Re: Can not compile example for VCP with STM32F429ZIT6

#3 Post by bigbo » 13 Sep 2016 08:19

uros.cvetinovic wrote:Hi,

Can you please submit a ticket on this matter on our helpdesk?
http://helpdesk.mikroe.com/

I believe I can find a solution for you.

Best regards,

Uros
I did.

User avatar
uros.cvetinovic
mikroElektronika team
Posts: 803
Joined: 14 Dec 2015 09:24

Re: Can not compile example for VCP with STM32F429ZIT6

#4 Post by uros.cvetinovic » 13 Sep 2016 10:24

Hi,

I believe I have answered you, we can continue our correspondence there.

Best regards,

Uros

bigbo
Posts: 5
Joined: 21 Jul 2016 23:16

Re: Can not compile example for VCP with STM32F429ZIT6

#5 Post by bigbo » 15 Sep 2016 22:14

uros.cvetinovic wrote:Hi,

I believe I have answered you, we can continue our correspondence there.

Best regards,

Uros
Thank you for the support once again )

If there any possibility to know if buffer already sent?
Now I use delays between every 64 bytes buffer packet but it seems there is possible to send faster.

I found and use this - USBDev_RegisterDataSentHandler(@USBDev_CDCDataSent);
As I understud the procedure must have a variable, but how to use the variable?

Procedure USBDev_CDCDataSent(aVariable : Byte);
Begin
Sent:=True; // I use global variable here and checking after I send a buffer - While not Sent do;
End;

Is it right?

User avatar
uros.cvetinovic
mikroElektronika team
Posts: 803
Joined: 14 Dec 2015 09:24

Re: Can not compile example for VCP with STM32F429ZIT6

#6 Post by uros.cvetinovic » 16 Sep 2016 15:45

Hi,

Can you please be more specified?

Please describe in details what you are trying to achieve.

Best regards,

Uros

Post Reply

Return to “mikroPascal PRO for ARM General”