How to connect UART to kernel debug message?

17 views
Skip to first unread message

feplo...@gmail.com

unread,
Jan 20, 2021, 10:10:36 PM1/20/21
to Tock Embedded OS Development Discussion
Hi

I am trying to figure out how to get "debug!()" to work with our UART hardware. Currently I am simply implementing my "transfer_buffer()" just like "send_byte()" in my Uart object. So just polling without utilizing interrupt. However, for some reasons only the first debug!() message will work. Did anyone have similar problem before?

Thanks
Yu-Chieh

Brad Campbell

unread,
Jan 20, 2021, 10:26:49 PM1/20/21
to feplo...@gmail.com, Tock Embedded OS Development Discussion
When your uart code has finished transmitting the buffer, it needs to call the transmit complete callback. That signals to the various uart/debug layers that they can continue to send new buffers. Not calling that transmit complete callback would result in the behavior you're describing. The one catch is, however, that it is only valid to call the transmit complete callback in response to an interrupt. If you look at other uart implementations, the callback will occur once handle_interrupt() is called. So, in Tock you need to have an asynchronous uart implementation to correctly implement the driver.

-Brad

--
You received this message because you are subscribed to the Google Groups "Tock Embedded OS Development Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tock-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tock-dev/51c8f54f-4491-4272-acad-bdcf969e3fben%40googlegroups.com.

feplo...@gmail.com

unread,
Jan 21, 2021, 4:50:48 PM1/21/21
to Tock Embedded OS Development Discussion
Hi Brad

Thanks for the information. Tock kernel debug message seems to work properly(at least much better) after UART interrupt was setup.

Yu-Chieh

Reply all
Reply to author
Forward
0 new messages