Fellow forumers, trying to adopt usb_dev_bulk example code , I figured out, that usblib from 2.1.4.178 kit may have potential issue caused by improper usage of void pointers. As I figured out, calling USBDBulkInit usblib API function cause FAult interrupt code snapshot below:
pvsDevice=USBDBulkInit(0, &g_sBulkDevice);
if(pvsDevice==0)UARTprintf(....")
CallUSBDBulkInit() cause HARD Fault interrupt with following register values:
{FAULT_ADDR;NVIC_NVIC_FAULT_STAT;NVIC_HFAULT_STAT}={0x4;0x8200;0x0}
Looking on file usbdbulk.c in usblib, I noticed that, probably, following code cause fault interrupt:
psDevDesc = (tDeviceDescriptor *)g_pui8BulkDeviceDescriptor;
psDevDesc->idVendor = psBulkDevice->ui16VID;
psDevDesc->idProduct = psBulkDevice->ui16PID;
Shouldn't it be something like next:
psDevDesc = (tDeviceDescriptor *)pvBulkDevice->g_pui8BulkDeviceDescriptor;
psDevDesc->idVendor = psDevDesc->ui16VID;
psDevDesc->idProduct = psDevDesc->ui16PID;
??? appreciate any help, advice, comments
Sincerely,
Alex.