I am using TWR-K60D100M with TWR-SER to connect the evauliation kit with my pc with RS232 cable. But I couldn't send data. Below is what I did.
1. connect everything: TWR-K60D100M with TWR-SER through TWR-ELEV. RS232 cable connect the com port on my pc with the com port on TWR-SER, and no problem with the RS232 cable.
2. change environment: in the user's config of BSP, I enabled the TTYD. in the TWRK60D100M.h, I change the default IO/debug port from ttyf to ttyd. (ttyf is still enabled). Recompile BSP in release mode.
3. open the hyperterminal on pc: set baud rate:115200, parity:none. databits:8, stopbits:1, flow control: none.
4. try to send data in several ways:
a. printf("hello"); nothing shows on the hyperterminal
b. char data = 'S';
fd = fopen(DEFAULT IO DEBUG PORT, 0);
printf("hello"); write(fd,&data,1);
fail.
c. fd = fopen("ttyd:",0);
same with method b.
fail
d. fd = fopen("ttyd:",DEFAULT_SERIAL_PORT_CONFIG);
printf and wirte both fail
all the above methods I've tried are ok if I use ttyf which is the OSJTAG com usb port and data are successfully sent and showed on PE termianl. But as long as I change "ttyf" to "ttyd", it never works.
I even use ioctl to read out the "baud rate", "parity", "databits","stopbits", and they are all the same with what I set on hyperterminal.
all the jumpers on the board are default. I didn't change any hardware.
Please tell me what is the problem with the serial port communication.I've been testing it for two whole days, helplessly.
Thank you very much.
I did a forum search using the string "ttyd" and uncovered this forum https://community.freescale.com/message/114540#114540. If this thread isn't relevant, the search request displayed a number of other hits that might offer an answer.
---Tom