Hi,
I have a working project for XC167 using RTX-166 Tiny.
However, when I remove the RTOS (see code change below), printf stops working. It now prints the first character and then stops. I have read that this could be an issue with user stack, would the RTOS have changed the configuration of this? Memory model is HLarge.
I.e. code before:
#include <rtx166t.h> #include "task.h" #include <string.h> #include <intrins.h> #include <absacc.h> #include <stdio.h> #include <XC167.h> #include "typedef.h" #include "iodef.h" #include "interrupts.h" void task_init (void) _task_ TASK_INIT { InitUART(); for(;;) { printf("Hello!\n"); _getkey(); } os_delete_task (os_running_task_id ()); }
code after (with no RTOS selected in options):
//#include <rtx166t.h> //#include "task.h" #include <string.h> #include <intrins.h> #include <absacc.h> #include <stdio.h> #include <XC167.h> #include "typedef.h" #include "iodef.h" #include "interrupts.h" void main (void) { InitUART(); for(;;) { printf("Hello!\n"); _getkey(); } // os_delete_task (os_running_task_id ()); }
This second project just prings "H"
Any ideas?
Thanks.
I have a redirect.c file with the putchar/_getkey functions defined. Also, InitUart does not depend on the RTOS. Interrupts should also be enabled.
I have seen some suggestions that if it prints only the first character, perhaps there is a problem with stack definition..?