Printf UART usage issues

Chris Coppens Chris.Coppens at TopicProducts.com
Tue Apr 25 07:34:27 UTC 2017


Hello,

I am developing an RTEMS 4.11 driver. The environment we are using is a LEON2 CPU with GRMON debug tool connected to UART debug link.
We load the driver, by defining it in a “system.h” file that includes “confdefs.h”. System configuration looks like this:

…
// our driver:
#define CONFIGURE_APPLICATION_EXTRA_DRIVERS DYPLO_DRIVER_TABLE_ENTRY
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER

#define CONFIGURE_EXECUTIVE_RAM_SIZE    (64*1024*1024)
#define CONFIGURE_STACK_SPACE_SIZE      (1024*1024)
#define CONFIGURE_MAXIMUM_TASKS             5
#define CONFIGURE_MAXIMUM_SEMAPHORES    64
#define CONFIGURE_MINIMUM_TASK_STACK_SIZE 512
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_MICROSECONDS_PER_TICK 1000
#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
#define CONFIGURE_INTERRUPT_STACK_SIZE 8192*4
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 64
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM

#include <rtems/confdefs.h>
…

We do many printf’s, both in Driver initialize context(thread), but also in Application tasks. We did not change the console driver configuration, so I’m guessing the console driver in “Polled mode” (correct me if I'm wrong).  The printf’s we are doing during driver initialization we are not seeing. Probably because I read that the /dev/console file is created after loading all drivers (post_bsp hook).

The problem we are encountering is that sometimes during printf the UART (debug) communication link seems to fail and the application does not respond anymore. Has someone else had issues using printf from different contexts? Are there any guidelines for the point in time when we can actually start using printf? Any idea what may be the issue with the UART stability using printfs?

Thanks for any help.

Kind regards,
Chris






Kind regards,

Chris Coppens
Software Designer

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: Chris.Coppens at TopicProducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail







More information about the users mailing list