It is a 100 pin device and have it setup on PC10 and PC11, using alternate function 7.
I can send data out of USART3 ok using
chprintf((BaseSequentialStream*)&SD3, "Test String!! \r\n");
But i cant receive data, my recieve thread is this.
Code: Select all
static msg_t ThreadBacta(void *arg)
{
msg_t charbuf;
flagsmask_t flags;
BACTA_ST *ps = &pd;
EventListener elBactadata;
(void)arg;
chRegSetThreadName("bacd");
sdStart(&SD3, &bactaconfig);
chEvtRegisterMask((EventSource *)chnGetEventSource(&SD3),
&elBactadata, EVENT_MASK(1));
while(TRUE)
{
bactaCommsHandler(ps);
flags = chEvtGetAndClearFlags(&elBactadata);
if(flags & CHN_INPUT_AVAILABLE)
{
do
{
charbuf = chnGetTimeout(&SD3, TIME_IMMEDIATE);
if ( charbuf != Q_TIMEOUT )
{
// chprintf((BaseSequentialStream*)&SD3, "%c", charbuf);
decodeBactaStatemachine( ps, (char)charbuf );
}
}
while (charbuf != Q_TIMEOUT);
}
chEvtWaitOneTimeout(EVENT_MASK(1), MS2ST(10));
}
return( 0 );
}
decodeBactaStatemachine is never called, which i would except if there was data been recieved