I have my firmware (array) for PIC stored in a header file (pic_firmware.h)..
This array is used by two USB Linux drivers for my customized board.
#ifndef PIC_FIRMWARE_H
#define PIC_FIRMWARE_H
const unsigned char ucPICAppsectorFirmware[] =
{
0xa5,0xef,0x2b,0xf0, 0x12,0x00,0x12,0x00, // Address 0x3000
0x81,0xef,0x29,0xf0, 0x12,0x00,0x12,0x00, // Address 0x3008
0x00,0x00,0xff,0xff, 0xff,0xff,0xff,0xff, // Address 0x3010
0xab,0xef,0x29,0xf0, 0x12,0x00,0xff,0xff, // Address 0x3018
....
}
#endif
When I add the both drivers as builtin and include the header file (#include "pic_firmware.h") in both driver code, I am getting multiple definition error
| drivers/usb/misc/pic_dfu.o:(.rodata+0x80): multiple definition of `ucPICAppsectorFirmware'
| drivers/usb/misc/usb_mib.o:(.rodata+0xcc0): first defined here
How can I resolve this error. Thanks for your time..