Serial_Non-conform-Baudrate 1,250,000 Bd

OP #1329205
Hi,
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?

fd=open_port();

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);
close(fd);

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 
STK1000.

Know some bode the problem und can help?
Many Thanks

Reply

A question of your own? This thread is over 17 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.