Appear to be missing something using simpleterm_close and -open.
DaemonInformaticus
Posts: 9
So in my main cog, I start
and start_serial_output looks like
start_serial_output_cog looks like:
Question:
The text "Picked up terminal control in the serial output cog." is not displayed on the serial terminal. The text "We still have control here...." however, is. So for some reason it would appear that transferring control of the serial port went wrong? Anybody any idea what it could be?
Edit:
I did try the example 'Print from other core', and this worked.. As far as I can tell, I'm doing essentially the same...
void initSerialOut() { printMessage("Starting serial out on cog..."); simpleterm_close(); start_serial_output(queuevga, 1); printMessage("We still have control here...."); }
and start_serial_output looks like
void start_serial_output(struct queue_str *queueptr, uint8_t isDebug) { // initialize serial output structure. struct serial_out_structure *pSerialOut = malloc(sizeof(serial_out_structure)); pSerialOut->pQueue = queueptr; pSerialOut->isDebug = isDebug; // start the cog and store its id in the structure. unsigned int serial_out_stack[SERIAL_OUT_STACK_SIZE]; int cogId = cogstart(start_serial_output_cog, (void *)pSerialOut, &serial_out_stack, sizeof(&serial_out_stack)); pSerialOut->cogID = cogId; }
start_serial_output_cog looks like:
/** * Called as a function pointer starting the cog. */ void start_serial_output_cog(void *pSerialOut) { // open serial port stream for this cog. simpleterm_open(); print("Picked up terminal control in the serial output cog."); struct serial_out_structure *pSerialOutStruct = (struct serial_out_structure *)pSerialOut; // start the fetch - execute loop. serialOutputLoop(pSerialOutStruct); }
Question:
The text "Picked up terminal control in the serial output cog." is not displayed on the serial terminal. The text "We still have control here...." however, is. So for some reason it would appear that transferring control of the serial port went wrong? Anybody any idea what it could be?
Edit:
I did try the example 'Print from other core', and this worked.. As far as I can tell, I'm doing essentially the same...
Comments
Unfortunatly it didn't solve the problem at hand.
Aside from that, I don't have any other suggestions without seeing the remainder of your code.
The simpleterm calls themselves, I've got from the example 'Print from other core' in the Learn directory of the SimpleIDE:
Testing this, it appears to work as expected.
The rest of my code is... involved.. 18 .c and .h files compiling to nearly 31KB of binary..
Guess I'll have to just figure it out then..
Thanks for the help so far.