see KSDK_1.0.0\usb\usb_core\device\sources\controller\usb_dev.c:
in usb_device_recv_data() and usb_device_send_data()
the call to get a transfer descriptor is intended to populate xd_ptr {which is dereferenced without check in usb_device_recv_data() and usb_device_send_data()}
example:
if (((usb_dev_interface_functions_struct_t*)\
usb_dev_ptr->usb_dev_interface)->dev_get_xd != NULL)
{
error = ((usb_dev_interface_functions_struct_t*)\
usb_dev_ptr->usb_dev_interface)->dev_get_xd(usb_dev_ptr->controller_handle, &xd_ptr);
}
else
{
#if _DEBUG
printf("usb_device_send_data: DEV_GET_XD is NULL\n");
#endif
return USBERR_ERROR;
}
OS_Mutex_lock(usb_dev_ptr->mutex);
/* Initialize the new transfer descriptor */
xd_ptr->ep_num = ep_num;
xd_ptr->bdirection = USB_SEND;
xd_ptr->wtotallength = size;
xd_ptr->wstartaddress = buff_ptr;
xd_ptr->wsofar = 0;
xd_ptr->bstatus = USB_STATUS_TRANSFER_ACCEPTED;
if (((usb_dev_interface_functions_struct_t*)\
usb_dev_ptr->usb_dev_interface)->dev_send != NULL)
{
error = ((usb_dev_interface_functions_struct_t*)\
usb_dev_ptr->usb_dev_interface)->dev_send(usb_dev_ptr->controller_handle, xd_ptr);
}
已解决! 转到解答。
Hello Chris:
This bug is already reported to our developers. It should be fixed in the next release of KSDK.
Thanks a lot for your feedback!
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Chris:
This bug is already reported to our developers. It should be fixed in the next release of KSDK.
Thanks a lot for your feedback!
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
is this information available anywhere?
it is not listed in the available latest published KSDK errata: http://cache.freescale.com/files/soft_dev_tools/doc/support_info/KSDK100ER.zip?fasp=1&WT_TYPE=Errata...