Code: Select all
if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) {Is not true and it goes to false, but this happens all the time.
The default of the switch statement is never reached. Do you know what error this would indicate?
Moderator: RoccoMarco
Code: Select all
if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) {Code: Select all
void obqReleaseEmptyBufferI(output_buffers_queue_t *obqp) {
osalDbgCheckClassI();
//osalDbgAssert(!obqIsEmptyI(obqp), "buffers queue empty");
/* Freeing a buffer slot in the queue.*/
obqp->bcounter++;
obqp->brdptr += obqp->bsize;
if (obqp->brdptr >= obqp->btop) {
obqp->brdptr = obqp->buffers;
}
/* Waking up one waiting thread, if any.*/
osalThreadDequeueNextI(&obqp->waiting, MSG_OK);
}
Korken wrote:Just a thing I found through testing:
If I disable that check, everything works as it should. Is it possible that I have found some corner-case bug?Code: Select all
void obqReleaseEmptyBufferI(output_buffers_queue_t *obqp) {
osalDbgCheckClassI();
//osalDbgAssert(!obqIsEmptyI(obqp), "buffers queue empty");
/* Freeing a buffer slot in the queue.*/
obqp->bcounter++;
obqp->brdptr += obqp->bsize;
if (obqp->brdptr >= obqp->btop) {
obqp->brdptr = obqp->buffers;
}
/* Waking up one waiting thread, if any.*/
osalThreadDequeueNextI(&obqp->waiting, MSG_OK);
}
Giovanni wrote:The USB specification is thousands of pages, you can't expect me to remember all of it on demand. That if controls that the message is of the right type ("class").
I recommend you to read this: https://www.google.com/#q=usb%20in%20a% ... 20download
What you need it the format of the setup packets, it is a small free booklet and a good start.
Giovanni
Giovanni wrote:It is the same as sweeping the dust under the carpet and pretend that the room is clean. There could be a bug but that is not the solution.
What I need is a way to replicate the problem.
Giovanni
Code: Select all
USBD1.epc[1].in_state->txsize = 6Code: Select all
SDU1.obqueue = {
waiting = {
p_next = 0x20001414 <SDU1+64>,
p_prev = 0x20001414 <SDU1+64>
},
bcounter = 2,
bwrptr = 0x20001650 <SDU1+636> "\006",
brdptr = 0x20001650 <SDU1+636> "\006",
btop = 0x20001858 <SDU1+1156> "XY",
bsize = 260,
bn = 2,
buffers = 0x20001650 <SDU1+636> "\006",
ptr = 0x0,
top = 0x0,
notify = 0x202441 <obnotify>,
link = 0x200013d4 <SDU1>
}