Hi,
I am using eval version of CodeWarrior IDE 7.1.1 with M52259DEMO board. MQX build 3.1
Could anyone tell me how to change baud rate and other UART parameters under MQX? Documentation is kind off vague on details.
For the starter, could you show me how to change baud rate for ttya UART for printf output in MQX "hello world" example? Default speed in example is 115200.
Solved! Go to Solution.
You are correct.
printf uses stdout, so use ioctl(stdout,...
You will need to open the BSP library.
Then search in all files (ctrl + shift +m) ttya (which is the name for the uart).
Then you will see the parameters you need to change.
After you change them, dont forget to rebuild the library.
Thanks for suggestion. So I assume something like following will set baud rate to 9600?
uint_32 baud=9600;
FILE_PTR serial_fd = fopen("ttya:",0);
Fine with me.
One more quetion "Hello World" example using prinf for output. I assume above example must use fprintf instead. Is any way to change baud rate for printf?
I correct one before, IMHO right way would be a
ioctl(serial_fd,IO_IOCTL_SERIAL_SET_BAUD, &baud);
Correct me if wrong.
You are correct.
printf uses stdout, so use ioctl(stdout,...
and how to send byte not a character ?? eg. 0xfffe12
So all the changes for UART must be hardcoded on BSP level!? It's very inconvenient.
I need to change UART parameters on the fly during MCU runtime.
I can't find any complete UART application example in my MQX distribution. I am new to this OS platform, so good set of examples would be really nice to have.