Skip to content

Commit

Permalink
Changed the default UART baud rate
Browse files Browse the repository at this point in the history
The default baud rate is now 921,600. This is the largest standard baud
rate below the maximum of 937,500 when running with a clock of 30MHz.
  • Loading branch information
HU90m committed Aug 1, 2024
1 parent 3beb56e commit 52c1af9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions doc/guide/building-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ You can drag and drop this UF2 file into the `SONATA` drive to program the firmw

On Linux use the following command to check you can receive serial output:
```sh
screen /dev/ttyUSB2 115200
screen /dev/ttyUSB2 921600
```

On Mac this is similar
```sh
screen /dev/tty.usbserial-LN100302 115200
screen /dev/tty.usbserial-LN100302 921600
```

On Windows, connecting to serial ports directly from within WSL2 (default) is not possible.
Connecting from WSL1 is possible, but we recommend to use [PuTTY](https://www.putty.org/) to connect to serial ports.
Alternatively you can use [Termite](https://www.compuphase.com/software_termite.htm).

Select "Serial" as "Connection type", put the COM port in the "Serial line" text field, and set "Speed" to 115200.
Select "Serial" as "Connection type", put the COM port in the "Serial line" text field, and set "Speed" to 921600.
To find out what serial ports are available, you can open Device Manager and all connected serial ports are listed under "Ports (COM & LPT)" section.

## Baremetal examples
Expand Down
2 changes: 1 addition & 1 deletion dv/verilator/top_verilator.sv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module top_verilator (input logic clk_i, rst_ni);

localparam ClockFrequency = 30_000_000;
localparam BaudRate = 115_200;
localparam BaudRate = 921_600;
localparam EnableCHERI = 1'b1;

logic uart_sys_rx, uart_sys_tx;
Expand Down
2 changes: 1 addition & 1 deletion sw/cheri/boot/boot_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ extern "C" void rom_loader_entry(void *rwRoot)
sram.bounds() = 0x00040000 - 0x1000;

spi->init(false, false, true, 0);
uart->init();
uart->init(BAUD_RATE);

SpiFlash spi_flash(spi, gpio, FLASH_CSN_GPIO_BIT);
read_elf(spi_flash, uart, sram);
Expand Down
2 changes: 1 addition & 1 deletion sw/cheri/tests/spi_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ using namespace CHERI;
SpiFlash spi_flash(spi, gpio, FLASH_CSN_GPIO_BIT);

spi->init(false, false, true, 0);
uart->init();
uart->init(BAUD_RATE);
write_str(uart, "Hello World!\r\n");

uint8_t jedec_id[3];
Expand Down
2 changes: 1 addition & 1 deletion sw/common/defs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#define CPU_TIMER_HZ (30'000'000)
#define BAUD_RATE ( 115'200)
#define BAUD_RATE ( 921'600)

#define RGBLED_CTRL_ADDRESS (0x8000'9000)
#define RGBLED_CTRL_BOUNDS (0x0000'0010)
Expand Down
2 changes: 1 addition & 1 deletion sw/legacy/common/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "sonata_system.h"
#include "dev_access.h"

#define BAUD_RATE (115200)
#define BAUD_RATE (921600)

void uart_enable_rx_int(void) {
enable_interrupts(UART_IRQ);
Expand Down

0 comments on commit 52c1af9

Please sign in to comment.