Multiple definition of _bsp_usb_host_init

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

Multiple definition of _bsp_usb_host_init

1,530 Views
ttahut
Contributor III

Hello,

I am trying to get the USB host stack running on the FRDM KL25Z.  I'm using KDS and PE.  The project is failing to build because _bsp_usb_host_init is defined multiple time.  The problem is, it is PE generated code and there is no enable/disable available for this function in any of the requisite components that I can see. I have the components from version 4.1.1 of the USB Stack imported into the project and I have usb_host:USB_HOST_STACK included in the project as well as the FAT1:FAT_FilesySystem component which references FsMSD1:FatFsMem_USB_MSD.

The linker tell me that _bsp_usb_host_init is defined in Generated_Code/khci.c and Generated_Code/FsMSD1.c

How do I get rid of this multiple definition?

Thanks in advance for any help.

Tom

Tags (2)
0 Kudos
Reply
5 Replies

1,235 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

I am sorry I cannot say what is wrong according to you description. Could you provide me the application for analysis, please?

You can also see an example (with description) of similar application on the web page USB MSD Host for the Freedom Board | MCU on Eclipse There are also used the same components in one project.

Best Regards,

Marek Neuzil

0 Kudos
Reply

1,235 Views
ttahut
Contributor III

Marek,

I've attached a project that exhibits the problem. 

Tom

0 Kudos
Reply

1,235 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

I have analyzed you application and I have found the issue of used components. You have used Freescale USB Stack v4.1.1 and PEx components that are provided on MCU On Eclipse pages by Erich Styger. These packages have been developed independently and you cannot use mixture of these components in one project.

I have replaced the USB_HOST_STACK component by FSL_USB_Stack component and I have been able to build the application (I have only replaced "Other Linker flags" seetings value "-nanolibc" by new value "-specs=nano.specs -specs=nosys.specs" because I am using newer GNU C compiler) .

Please, see the web page USB MSD Host for the Freedom Board | MCU on Eclipse where is described the design of very similar application.

I have attached the updated application.

0 Kudos
Reply

1,235 Views
ttahut
Contributor III

Marek,

I'm finally back at this.... I was able to get a project built with the components you outlined above.  Now my problem is that when PE_low_level_init() calls the USB init routines, I am stuck in USB_ISR (I guess its not actually stuck in the ISR because I can trace through the exit of the routine but the interrupts keep coming back such that no other code is executed)  The USB_ISTAT register always contains 0x05 which indicates a USB Reset (which makes some sense I guess) and a SOF Token has been received- which does not make a lot of sense to me.  I do not have anything plugged into the USB port.  I've attached the project- thanks again for your help

Tom

0 Kudos
Reply

1,235 Views
ttahut
Contributor III

After some investigation/trial/error, I found that unchecking 'Asynchronous Resume Interrupt' in the Interrupts tab on the Init_USB_OTG component the continuous interrupt was cured.  Next came the 'delay_count' variable that must be implemented in a 1ms timer.  I woul dhave found this earlier had I not been working on this with various versions as the compiler would have at least told me it was not there.  I had an old instantiation around so the project built but it was not being updated properly.  Finally, I have 'Long File Names' enabled but the FILINFO structure does not seem to be created/declared  correctly no matter how I choose  to use the buffer on the LFN tab in the FAT_FileSystem component.  If I declare a static buffer and assign to a FILINFO variable before its use, that seems to cure the crash for accessing an invalid pointer in (among other routines perhaps) get_fileinfo() in ff.c.  After all that I have been able to some USB/MSD activity to work on a USB stick.  Some things still crash but at least now some things are working.

0 Kudos
Reply