KSDK V1.1.0 USB compile errors. usb_device_stack_interface.h

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KSDK V1.1.0 USB compile errors. usb_device_stack_interface.h

Jump to solution
1,619 Views
guitardenver
Contributor IV

Hello,

 

I have a project in KDS that I am trying to get CDC code running on. Bare metal project. I have compiled and included the linker library for the platform, hal, and usbd libraries. I am getting an "unknown type name" error for all the typedefs in usb_device_stack_interface.h. But all the typedefs are being referenced in usb_class_cdc.h, but the usb_device_stack_interface.h is not included in the file. The CDC demo for the frdmk22 board compiles fine for me.

 

The errors:

19978_19978.pngerrors.PNG.png

 

My USB include paths:

20000_20000.pngincludePaths.PNG.png

 

The only thing usb_class_cdc.h includes is usb_class.h which includes nothing. Where does it get these typedefs?

Labels (1)
0 Kudos
1 Solution
717 Views
guitardenver
Contributor IV

Since my last post I have figured out the problem with my compiling error. With KSDK V1.1.0

Many of the USB files use the "_CODE_PTR_" definition but this was not defined anywhere. So I defined it in my project settings.

#define "_CODE_PTR_"     *

View solution in original post

0 Kudos
9 Replies
717 Views
isaacavila
NXP Employee
NXP Employee

Hello Matt and Lang

I'd like to inform you that Adrian has been moved to another area so that's why he couldn't finish his reference design.

According to your questions, there is another KSDK available version (1.2.0) that runs along with KSD v3.0. It could be a good idea to take a look at this new version to explore for new example codes meanwhile i can contact Adrian and could finish his reference design.

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KINETIS-SDK

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KDS_IDE

Best Regards,

Isaac

0 Kudos
718 Views
guitardenver
Contributor IV

Since my last post I have figured out the problem with my compiling error. With KSDK V1.1.0

Many of the USB files use the "_CODE_PTR_" definition but this was not defined anywhere. So I defined it in my project settings.

#define "_CODE_PTR_"     *

0 Kudos
717 Views
guitardenver
Contributor IV

A more specific question.

In the KSDK V1.1.0, it has a usb_class.h file. Found in "usb_core\devices\sources\drivers\include". The compile error above "expected ")" before....." is yelling at the "_CODE_PTR" declaration. This is defined in types.h as "*" in the usb stack code as well. But.... usb_class.h does not include any file at all.  How can this code now what "_CODE_PTR" is if it does not include any other file? The example CDC code does not have this defined or undefined in the project settings or anything. Why is it yelling at me?

usb_class.h code:

/**HEADER********************************************************************

*

* Copyright (c) 2008, 2013 - 2014 Freescale Semiconductor;

* All Rights Reserved

*

* Copyright (c) 1989-2008 ARC International;

* All Rights Reserved

*

***************************************************************************

*

* THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR

* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES

* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 

* IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,

* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES

* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR

* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)

* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,

* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING

* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF

* THE POSSIBILITY OF SUCH DAMAGE.

*

**************************************************************************

*

* $FileName: usb_class.h$

* $Version :

* $Date    :

*

* Comments:

*

* @brief The file contains USB stack class layer api header function.

*

*****************************************************************************/

#ifndef _USB_CLASS_H

#define _USB_CLASS_H 1

/******************************************************************************

* Includes

*****************************************************************************/

/******************************************************************************

* Global Variables

*****************************************************************************/

/******************************************************************************

* Macro's

*****************************************************************************/

/*#define DELAYED_PROCESSING  1 This define is used to delay the control

                                processing and not have it executed as part

                                of the interrupt routine */

//#define UNINITIALISED_VAL        (0xffffffff) 

/* Events to the Application */

/*

#define USB_APP_BUS_RESET           (0)

#define USB_APP_CONFIG_CHANGED      (1)

#define USB_APP_ENUM_COMPLETE       (2)

#define USB_APP_SEND_COMPLETE       (3)

#define USB_APP_DATA_RECEIVED       (4)

#define USB_APP_ERROR               (5)

#define USB_APP_GET_DATA_BUFF       (6)

#define USB_APP_EP_STALLED          (7)

#define USB_APP_EP_UNSTALLED        (8)

#define USB_APP_GET_TRANSFER_SIZE   (9)

*/

/******************************************************************************

* Types

*****************************************************************************/

typedef uint32_t class_handle_t;

/*callback function pointer structure for application to provide class params*/

typedef uint8_t (_CODE_PTR_ usb_class_specific_handler_func)(

                           uint8_t,

                           uint16_t,

                           uint8_t **,

                           uint32_t*,

                           void* arg);

typedef struct usb_class_specific_handler_callback_struct

{

    usb_class_specific_handler_func  callback;

    void*                            arg;

}usb_class_specific_callback_struct_t;

#endif

/* EOF */

0 Kudos
717 Views
adriancano
NXP Employee
NXP Employee

Hi,

I apologize for the late response. Are you still having the same issues with your project?

Thank you for the information.

Best Regards,

Adrian

0 Kudos
717 Views
guitardenver
Contributor IV

Thank you for a reply. I am still having the problem. I attached a test project that is giving me those errors.




0 Kudos
717 Views
adriancano
NXP Employee
NXP Employee

Hi,

Unfortunately I am not able to find the source of the errors you are having in the project. If it is ok for you I can create a standalone copy of the dev_cdc_virtual_com_frdmk22f_bm project, then you can use it as the base for your project.

Please let me know if it will be useful for you.

Thanks,

Adrian

0 Kudos
717 Views
jeffmakes
Contributor II

Adrian I would like to see a standalone version of dev_msd_disk_frdmk64f_bm_frdmk64f . Been crawling through fire for two days.

In other news, a forum != documentation!

0 Kudos
717 Views
guitardenver
Contributor IV

Thanks for the try,

That actually would be useful. Thanks for doing that.

0 Kudos
717 Views
mjbcswitzerland
Specialist V

Hi Matt

I can't help with KSDK difficulty but in case you need USB-CDC that builds out of the box with KDS (it has a simple scheduler but can otherwise be considered as bare-metal) you can check out http://www.utasker.com/kinetis/FRDM-K22F.html

It is industrially proven and will allow multiple USB-CDC interfaces (also mixed with other devices like MSD, Mouse, keyboard etc.) and UART bridges with DMA and end-to-end flow control. The USB operation can be simulated with VisualStudio when adding new classes or applications that interface with it (free express version is adequate).

It is completely free for non-commerical use with fast-track support in this forum.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html

K22: µTasker Kinetis FRDM-K22F support / µTasker Kinetis TWR-K22F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos