stdio baud

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

stdio baud

920 Views
Mike_d
Contributor IV

Hi,

How do I change the baud rate for stdio during run time?

Thanks,

-Mike

0 Kudos
3 Replies

774 Views
danielchen
NXP TechSupport
NXP TechSupport

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

0 Kudos

774 Views
Mike_d
Contributor IV

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

0 Kudos

774 Views
danielchen
NXP TechSupport
NXP TechSupport

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

0 Kudos