Hi everyone,
I'm trying to manage a printer with a tm4c. I succeed to write host class printer and I can now communicate with the printer as long as the data length to not exceed 64 bytes.
I'v already read that it was a known issue : e2e.ti.com/.../296947
I actually encounter the same problem.
While using USBHCDPipeWrite(), I'm stuck in a while statement (line 1685) as my g_sUSBHCD.psUSBOUTPIpes[0].iState is stuck in ePipeWriteDMAWait state...
Trying to solve that, I think it may come from the USBHostIntHandlerInternal():
Line 4123, u132Status get a value but never the value that will allow the program to enter in the if statement (line 4317) that check the status of transmit(OUT) pipes and would change the state ePipeWriteDMAWait to another one. Alas, I can't figure out why...
My revision of TivaWare is 2.1.2.111
My function to send data to the printer
int32_t
USBHPRNBlockWrite(tUSBHPRNInstance *psPRNInstance, uint8_t *pui8Data, uint32_t ui32Size)
{
//
// If there is no device present then return an error.
//
if(psPRNInstance->psDevice == 0)
{
return(-1);
}
//
// Perform the write command.
//
return(USBHCDPipeWrite(psPRNInstance->ui32BulkOutPipe, pui8Data,ui32Size));
}
The part of main where I send my commands :
USBHPRNBlockWrite(g_psPRNInstance, g_init, 2); USBHPRNBlockWrite(g_psPRNInstance, g_status, 3); USBHPRNBlockRead(g_psPRNInstance, g_ans, 64); USBHPRNBlockWrite(g_psPRNInstance, g_control, 13); USBHPRNBlockWrite(g_psPRNInstance, g_cut, 4); USBHPRNBlockWrite(g_psPRNInstance, g_margin, 5); USBHPRNBlockWrite(g_psPRNInstance, g_status, 3); USBHPRNBlockWrite(g_psPRNInstance, g_msg, 93); //<-- All work fine until here
Thank you to anyone who will read that.
Regards,
Quentin
