Forum: ARM programming with GCC/GNU tools Serial_Non-conform-Baudrate 1,250,000 Bd

von Peter P. (peter-p)

Rate this post
0 useful
not useful
have anybody an idea? I want set the UART Baudrate to 1.25MB with ioctl. 
But the Flag "ASYNC_SPD_CUST", don't reach the kernel. On the other hand 
the return of the Kernel, reading the "struct serial" don’t reach the 
User space.

I have seen with printk()in  Module serial_core.c, that baud_base in 
struct is set from kernel to 2,500,000Bd. But don’t see it in user space 
in my application. Is there the possibility that "copy_to_user" doesn’t 
work in "static int uart_get_info" in "serial_core.c".

Here are the Application-Code snipped. Perhaps there is something wrong?


struct termios newtio;
struct serial_struct new_serdrvinfo;

// Set baudrate to 38400:
cfsetispeed(&newtio, B38400);
cfsetospeed(&newtio, B38400);
tcsetattr(fd, TCSANOW, &newtio );

// Change serial driver settings:
ioctl(fd, TIOCGSERIAL, &new_serdrvinfo);

// custom  Baudrate=9600
// set custom divisor (2,500,000Mhz/9600Bd = 260;
new_serdrvinfo.custom_divisor = 260;
new_serdrvinfo.flags |= ASYNC_SPD_CUST;
ioctl(fd, TIOCSSERIAL, &new_serdrvinfo);

printf("custom_divisor = %d \n", new_serdrvinfo.custom_divisor);
printf("baud_base = %d \n", new_serdrvinfo.baud_base);

I'm running Linux 2.6.23.atmel.4, Avr32AP7000, the Hardware is like 

Know some bode the problem und can help?
Many Thanks


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.