forked from M-Labs/artiq
firmware: increase post-boot UART speed to 921600.
This commit is contained in:
parent
13a544e13f
commit
971e4c3026
|
@ -11,6 +11,7 @@ include!(concat!(env!("BUILDINC_DIRECTORY"), "/generated/csr.rs"));
|
||||||
pub mod spr;
|
pub mod spr;
|
||||||
pub mod irq;
|
pub mod irq;
|
||||||
pub mod clock;
|
pub mod clock;
|
||||||
|
pub mod uart;
|
||||||
|
|
||||||
#[cfg(has_i2c)]
|
#[cfg(has_i2c)]
|
||||||
pub mod i2c;
|
pub mod i2c;
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
use csr;
|
||||||
|
|
||||||
|
pub fn set_speed(rate: u32) {
|
||||||
|
unsafe {
|
||||||
|
let tuning_word = (rate as u64) * (1 << 32) / (csr::CONFIG_CLOCK_FREQUENCY as u64);
|
||||||
|
csr::uart_phy::tuning_word_write(tuning_word as u32);
|
||||||
|
}
|
||||||
|
}
|
|
@ -103,6 +103,7 @@ pub unsafe extern fn rust_main() {
|
||||||
static mut LOG_BUFFER: [u8; 65536] = [0; 65536];
|
static mut LOG_BUFFER: [u8; 65536] = [0; 65536];
|
||||||
BufferLogger::new(&mut LOG_BUFFER[..])
|
BufferLogger::new(&mut LOG_BUFFER[..])
|
||||||
.register(move || {
|
.register(move || {
|
||||||
|
board::uart::set_speed(921600);
|
||||||
board::clock::init();
|
board::clock::init();
|
||||||
info!("ARTIQ runtime starting...");
|
info!("ARTIQ runtime starting...");
|
||||||
info!("software version {}", GIT_COMMIT);
|
info!("software version {}", GIT_COMMIT);
|
||||||
|
|
|
@ -66,11 +66,11 @@ def main():
|
||||||
tmp = "artiq" + "".join([rng.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ") for _ in range(6)])
|
tmp = "artiq" + "".join([rng.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ") for _ in range(6)])
|
||||||
env = "bash -c 'export PATH=$HOME/miniconda/bin:$PATH; exec $0 $*' "
|
env = "bash -c 'export PATH=$HOME/miniconda/bin:$PATH; exec $0 $*' "
|
||||||
|
|
||||||
def run_command(cmd):
|
def run_command(cmd, **kws):
|
||||||
logger.info("Executing {}".format(cmd))
|
logger.info("Executing {}".format(cmd))
|
||||||
chan = get_ssh().get_transport().open_session()
|
chan = get_ssh().get_transport().open_session()
|
||||||
chan.set_combine_stderr(True)
|
chan.set_combine_stderr(True)
|
||||||
chan.exec_command(cmd.format(tmp=tmp, env=env, serial=args.serial, ip=args.ip))
|
chan.exec_command(cmd.format(tmp=tmp, env=env, serial=args.serial, ip=args.ip, **kws))
|
||||||
return chan.makefile()
|
return chan.makefile()
|
||||||
|
|
||||||
def drain(chan):
|
def drain(chan):
|
||||||
|
@ -151,7 +151,7 @@ def main():
|
||||||
|
|
||||||
logger.info("Connecting to device")
|
logger.info("Connecting to device")
|
||||||
flterm = run_command(
|
flterm = run_command(
|
||||||
"{env} python3 flterm.py {serial} --output-only")
|
"{env} python3 flterm.py {serial} --speed 921600 --output-only")
|
||||||
drain(flterm)
|
drain(flterm)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue