FreeRTOS serial.print

Working libraries, libraries being ported and related hardware
Post Reply
User avatar
jfitter
Posts: 10
Joined: Tue Feb 13, 2018 2:41 pm
Location: Sunshine Coast, Australia

FreeRTOS serial.print

Post by jfitter » Sat Aug 18, 2018 1:40 pm

I am developing a small instrument and prototyping it with a BluePill and FreeRTOS, using Rogers bootloader, his version of the Core, and the bundled FreeRTOS v9.

For development I have a macro that prints information to Serial (usb port).

In setup() there are many calls to setup procedures. Each of these uses the info macro, so it prints stuff out. At the end of setup() the taskscheduler is started. All vanilla stuff, but it doesn't work....

Currently every task is a timer with the exception of the main task. As setup runs info messages are sent showing what is happening during setup of various timers, tasks, and other stuff. At a certain point it all stops and the program hangs. By much trial and error it appears that this happens after a certain number of characters are sent.

So I put some of the info macro calls into the first task, before its main loop, and then I can print more messages from setup().

So what it looks like to me is that before the scheduler is started I can fill the serial output buffer but no characters are transmitted until the scheduler starts. Am I right about this??? If not then what is going on???

It is awkward. I want to send output during setup() but I don't want to create a task just for this. Is there a way for force the serial buffer to be transmitted?

Or is this issue some peculiarity of the Arduino setup() procedure?

Any ideas would be appreciated. Thanks.

Post Reply