Looks like I got it working and the problem was with the ZLT's. My predecessor had turned them off by default to get the read portion working (all referenced routines are found in usb_dci_kinetis.c ):
routine: usbd_send_data_ep0 in()
- originally:
(*(volatile unsigned int *)(dqh_address)) &= ~0x20000000; // Enabled
- changed to:
(*(volatile unsigned int *)(dqh_address)) |= 0x20000000; // Disabled
Indeed, the Setup reads didn't work when it was in its original, Enabled state.
But apparently they're needed for uploading. so in usdb_prime_ep() I changed:
if (direction == IN)
{
(*(volatile unsigned int *)(dqh_address)) &= ~0x20000000;
}
To:
if (direction == IN)
{
(*(volatile unsigned int *)(dqh_address)) |= 0x20000000;
}
I'm not sure that was really necessary because this next change is what really fixed it. In USB_DCI_Init_EndPoint(), I changed the parameter passed to usbd_ep_qh_init() from "flag" to "1":
From:
usbd_ep_qh_init(controller_ID, ep_ptr->ep_num, ep_ptr->direction, ep_ptr->size, flag, mult, 0xDEAD0001);
To:
usbd_ep_qh_init(controller_ID, ep_ptr->ep_num, ep_ptr->direction, ep_ptr->size, 1, mult, 0xDEAD0001);
Things started uploading then! I've got some cleanup to do, and more testing, just wanted to share my findings in case anyone else is having similar problems.
Lee