Hi Guys, I had no choice but to get this working... I made a huge mistake and used FreeRToS as the UART so you cant use getchar/putchar (which is EVERYTHING like scanf and printf) until AFTER the scheduler is started (you'll get a lock up condition)
If someone can be bothered to write and post a version that does not use FreeRToS this will allow PRINTF to work BEFORE running the scheduler i.e. to use my code you have to create a new task, and start the scheduler, the new task can call the PRINTF function
Here is what you do (i didnt double check or read this so use at your own risk, and fault find at your own risk, dont have time to make it right.
Attached is the consol code i quickly made to get me out of trouble. if you fix it or do it better, please sure, I was nice enough to share :smileyhappy:
This is using UART2, so if you need another you'll have to hand code it, i dont have time to do this properly, i just needed a result. Not here for support, just sharing because
this 100% should be standard code, waiting in a while loop in a multithreaded RToS is nothing short of pathetic
I did it using the RToS functions, you could have dont it with standard UART which would no doubt be less overheads
Add this to fsl_common.h
#define DEBUG_CONSOLE_DEVICE_TYPE_FREERTOS_UART 6U
//Change the call to configure consol to this
DbgConsole_Init(BOARD_DEBUG_UART_BASEADDR, BOARD_DEBUG_UART_BAUDRATE, DEBUG_CONSOLE_DEVICE_TYPE_FREERTOS_UART, uartClkSrcFreq);
DO NOT CALL ANYTHING CONSOLE FUNCTIONS UNTIL AFTER FreeRToS is running!
example:
xTaskCreate(ModemTask, "ModemTask", ModemTask_STACKSIZE, NULL, ModemTask_PRIORITY, NULL);
vTaskStartScheduler();
then inside ModemTask you can use printf, if you do it before, you're dead in the water.