You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use configuration options in config.txt to enable high speed UART.
(as listed here: http://elinux.org/RPi_config.txt)
My /boot/config.txt
init_uart_baud=1000000
init_uart_clock=16000000
With these settings I am hoping to achieve 1Mbps Uart? but I cant seem to get this working?
Note I have disabled the serial console in boot.txt and /etc/inittab
Testing with stty, yields the following (is there a better way?)
root@raspberrypi:~# stty -F /dev/ttyAMA0 115200
root@raspberrypi:~# stty -F /dev/ttyAMA0 1000000
stty: /dev/ttyAMA0: unable to perform all requested operations
Am I missing something? Do I need to recompile the kernel?
System spec:
Base image is the current Raspbian (2012-08-16-wheezy-raspbian)
# uname -a
Linux raspberrypi 3.2.27+ #102 PREEMPT Sat Sep 1 01:00:50 BST 2012 armv6l GNU/Linux
root@raspberrypi:~# /opt/vc/bin/vcgencmd version
Aug 25 2012 01:12:00
Copyright (c) 2012 Broadcom
version 333349 (release)
System fully upgraded today using apt-get update and dist-upgrade.
Hi, I would really appreciate some advice... I am using a serial touch screen and 115200K is too slow... I don't really want end users to have to recompile the kernel for higher UART speeds...
Please advise on what is the best course of action. (happy to do the work and provide a patch if that is what is needed?)
init_uart_baud just sets the baud rate through GPU before ARM code starts running. This is useful for bare metal/debug from very early on in linux. Once linux has booted then the UART will have been reconfigured and init_uart_baud will have been overwritten.
Currently you have to change
#define UART0_CLOCK 3000000
(to match init_uart_clock=) in arch/arm/mach-bcm2708/include/mach/platform.h
and rebuild kernel if you want a higher UART clock.
As a hack you can just increase init_uart_clock without telling linux. That means if init_uart_clock=6000000, and linux thinks it is 3000000, and you ask linux for 115200, you will actually get 230400 baud.
I did try reading the value from GPU (using mailbox interface), but the uart clock is given to kernel before the mailbox driver is initialised so it didn't prove simple.
I had spotted the value in platform.h but was hoping I had missed something, alas no.
I should be able to get away with fudging it for now, but clearly this is not a good long term solution?
How do you plan on implementing "init_uart_baud" from config?
init_uart_baud is implemented from config.txt. if you have bare metal OS, or use Linux before it has initialised the uart itself, you can write to the UART and it will output at the expected baud rate.
OK it is clear to me now that config.txt belongs to the GPU boot sequence...
You mention above that "uart clock is given to kernel" if that’s the case why is it not "given" the value specified in config.txt? or is it? and then consequently overwritten by the value in platform.h?
bcm2708_init tells the kernel what the UART clock rate is. This is before mailbox driver is initialised so I can't ask the GPU what the actual UART frequency is at this point.
I need someone who knows the kernel init code better than me to say where this should be done.
"Dead" --> pardon? If it's not fixed it's not fixed. So why on earth would you close it without a resolution?
** I spent days digging this one out **
I suspect that the stalling on the fix exists perhaps because GPU code is closed? and therefore not well understood?, Maybe It needs to wait till someone with the knowledge comes along... or Broardcom, actually embraces Open Source for the RPI and opens the GPU code... Or I could be completely wrong, either way its still an "Issue" until its fixed.
So please don't sweep this one under the carpet just yet.
Activity
Stonie commentedon Sep 6, 2012
I just noticed this closed issue: #78
Given the above issue is "closed" what is the "init_uart_baud" setting for? ... "bug" or "feature"? ;)
Stonie commentedon Sep 6, 2012
Hi, I would really appreciate some advice... I am using a serial touch screen and 115200K is too slow... I don't really want end users to have to recompile the kernel for higher UART speeds...
Please advise on what is the best course of action. (happy to do the work and provide a patch if that is what is needed?)
Regards,
Stonie.
popcornmix commentedon Sep 7, 2012
init_uart_baud just sets the baud rate through GPU before ARM code starts running. This is useful for bare metal/debug from very early on in linux. Once linux has booted then the UART will have been reconfigured and init_uart_baud will have been overwritten.
Currently you have to change
#define UART0_CLOCK 3000000
(to match init_uart_clock=) in arch/arm/mach-bcm2708/include/mach/platform.h
and rebuild kernel if you want a higher UART clock.
As a hack you can just increase init_uart_clock without telling linux. That means if init_uart_clock=6000000, and linux thinks it is 3000000, and you ask linux for 115200, you will actually get 230400 baud.
I did try reading the value from GPU (using mailbox interface), but the uart clock is given to kernel before the mailbox driver is initialised so it didn't prove simple.
Stonie commentedon Sep 9, 2012
Thanks for the update.
I had spotted the value in platform.h but was hoping I had missed something, alas no.
I should be able to get away with fudging it for now, but clearly this is not a good long term solution?
How do you plan on implementing "init_uart_baud" from config?
Cheers,
Stonie.
popcornmix commentedon Sep 9, 2012
init_uart_baud is implemented from config.txt. if you have bare metal OS, or use Linux before it has initialised the uart itself, you can write to the UART and it will output at the expected baud rate.
Stonie commentedon Sep 9, 2012
Yeah I greped the entire source tree looking for the use of config.txt... this where I am confused...
What code consumes/owns config.txt?
Can config.txt's values be set in arch_decomp_setup(void) in arch/arm/mach-bcm2708/include/mach/uncompress.h ?
popcornmix commentedon Sep 9, 2012
http://elinux.org/RPi_config.txt
Stonie commentedon Sep 9, 2012
OK it is clear to me now that config.txt belongs to the GPU boot sequence...
You mention above that "uart clock is given to kernel" if that’s the case why is it not "given" the value specified in config.txt? or is it? and then consequently overwritten by the value in platform.h?
popcornmix commentedon Sep 9, 2012
bcm2708_init tells the kernel what the UART clock rate is. This is before mailbox driver is initialised so I can't ask the GPU what the actual UART frequency is at this point.
I need someone who knows the kernel init code better than me to say where this should be done.
Stonie commentedon Sep 9, 2012
Ok, thanks for the update.
Stonie commentedon Aug 22, 2013
@ghollingworth why is this marked as closed? I don't see a resolution? commit? or otherwise?
ghollingworth commentedon Aug 22, 2013
No problem if you're still working on it, just going through tidying up issues that are dead
Stonie commentedon Aug 22, 2013
"Dead" --> pardon? If it's not fixed it's not fixed. So why on earth would you close it without a resolution?
** I spent days digging this one out **
I suspect that the stalling on the fix exists perhaps because GPU code is closed? and therefore not well understood?, Maybe It needs to wait till someone with the knowledge comes along... or Broardcom, actually embraces Open Source for the RPI and opens the GPU code... Or I could be completely wrong, either way its still an "Issue" until its fixed.
So please don't sweep this one under the carpet just yet.
2 remaining items
ghollingworth commentedon Aug 22, 2013
Sorry pressed wrong button!!!
mrshifo commentedon Feb 24, 2014
Please,
i am a beginner with linux and rpi, can you help me step by step for set high speed baud rate ?
mrshifo at libero.it
uname -a
Linux raspberry 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux
mm: numa: recheck for transhuge pages under lock during protection ch…
Ruffio commentedon Jul 28, 2016
@Stonie has this issue been resolved? If yes, then please close this issue.
Ruffio commentedon Aug 29, 2016
@popcornmix please consider closing this issue, as there haven't been any real activity since 2014 and I pinged for response a month ago...
popcornmix commentedon Aug 29, 2016
We have increased the UART clock source which allows higher baud rates. See:
#1601
raspberrypi/firmware#643
arm64: smp: fix crash_smp_send_stop() behaviour
arm64: smp: fix crash_smp_send_stop() behaviour
arm64: smp: fix crash_smp_send_stop() behaviour
arm64: smp: fix crash_smp_send_stop() behaviour
irq_work: use kasan_record_aux_stack_noalloc() record callstack
irq_work: use kasan_record_aux_stack_noalloc() record callstack
Merge pull request raspberrypi#105 from sched-ext/fix_fallback