USB example code porting error

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

USB example code porting error

Jump to solution
1,078 Views
shkim9
Contributor II

i have got error on USB example code porting.

the error is belows..

Fatal Error[Pe035]: #error directive: Not define RTOS in file "usb_osa.h". D:\<directory>\FRDM-K22F\SDK_2.5.0_FRDM-K22F(RTOS)\middleware\usb\osa\usb_osa.h 96

error cased by there is no macro definition. (usb_osa.h)

/* Include required header file based on RTOS selection */
#if defined(USB_STACK_BM)

   #include "usb_osa_bm.h"

#elif defined(USB_STACK_FREERTOS)

   #include "usb_osa_freertos.h"

#elif defined(USB_STACK_UCOSII)

   #include "usb_osa_ucosii.h"

#elif defined(USB_STACK_UCOSIII)

   #include "usb_osa_ucosiii.h"

#else
   #if defined(SDK_OS_BAREMETAL)

      #define USB_STACK_BM
      #include "usb_osa_bm.h"

   #elif defined(SDK_OS_FREE_RTOS)

      #define USB_STACK_FREERTOS
      #include "usb_osa_freertos.h"

   #elif defined(SDK_OS_UCOSII)

      #define USB_STACK_UCOSII
      #include "usb_osa_ucosii.h"

   #elif defined(SDK_OS_UCOSIII)

      #define USB_STACK_UCOSIII
      #include "usb_osa_ucosiii.h"

   #else

      #error Not define RTOS in file "usb_osa.h".
   #endif
#endif

So, i try find out one of macro in sample project(freeRTOS, NON OS), it can be compiled.

USB_STACK_BM, USB_STACK_FREERTOS, SDK_OS_BAREMETAL, SDK_OS_FREE_RTOS, ...

But, I couldn't find it anywhere. I can't understand how a sample project can be built successfully.
where can I find this macro definition ? .
0 Kudos
1 Solution
806 Views
shkim9
Contributor II

I found it !.

the macro defined preprocessor options.

definition.PNG

View solution in original post

0 Kudos
3 Replies
807 Views
shkim9
Contributor II

I found it !.

the macro defined preprocessor options.

definition.PNG

0 Kudos
806 Views
neilporven
Senior Contributor I

Hi Kim,

I ran a sample project for the FRDM-K64 board and now I am ready to port to my custom board.  

My question to you is, did you follow a documentation on how to port the code over?  If so, can 

you tell me where can I find it (the document)?

Thanks,

Neil

0 Kudos
806 Views
shkim9
Contributor II

Hi.

I referenced document "MCUXpresso SDK USB Stack User's Guide" chapter 3 "porting to a new platform".

This document generated by "MCUXpresso SDK builder" web app.(https://mcuxpresso.nxp.com/en/welcome)

sdk.PNG

I did not know where the definition of the "USB_STACK_FREERTOS"(because my project use freeRTOS) macro was when I ported it.
Except for this problem, it works by just copying the sample code. ( Of course, you should remove the main function in sample code, and have some porting works.)
0 Kudos