Hi,
How do I change the baud rate for stdio during run time?
Thanks,
-Mike
Hi Mike:
Sorry I didn't get what you mean. Are you using MQX? If you include stdio.h, you will get errors because MQX provides its own libraries and a lot of functions like fopen and printf are declared in the MQX libraries.
Regards
Daniel
Hi Daniel,
In MQX 4.2, I would like to change the baud rate of the shell during run-time. I know which serial interface it is, "ttye:" Is there a get_handle() call? The handle is created in the BSP and not in my application.
Regards,
-Mike
Hi Mike_d
I would suggest you modify the BSPCFG_SCI4_BAUD_RATE in the following structure, and rebuild bsp .
In file source/bsp/[ your board] / init.sci.c
const KUART_INIT_STRUCT _bsp_sci4_init = {
/* queue size */ BSPCFG_SCI4_QUEUE_SIZE,
/* Channel */ 4,
/* Clock Speed */ BSP_BUS_CLOCK, /* SCI4 operates only on bus clock */
/* Baud rate */ BSPCFG_SCI4_BAUD_RATE,
/* RX/TX Int vect */ INT_UART4_RX_TX,
/* ERR Int vect */ INT_UART4_ERR,
/* RX/TX priority */ 3,
/* ERR priority */ 4
#if MQX_ENABLE_LOW_POWER
,
/* Clock source */ CM_CLOCK_SOURCE_BUS,
/* LPM operation info */ _bsp_sci4_operation_modes
#endif
,
1,
2
};
Does this work for you?
Regards
Daniel