fix app_uart default memory mapping

was pointing to the wrong uart initially >_<
This commit is contained in:
bunnie 2024-05-21 16:33:11 +08:00
parent 71d7a2a3ae
commit bae408b466

View file

@ -6,7 +6,7 @@ use cramium_hal::iox::*;
use cramium_hal::sce;
use cramium_hal::udma::*;
use loader::swap::SPIM_RAM_IFRAM_ADDR;
use loader::{APP_UART_IFRAM_ADDR, UART_IFRAM_ADDR};
use loader::APP_UART_IFRAM_ADDR;
use rand_chacha::rand_core::RngCore;
use rand_chacha::rand_core::SeedableRng;
use rand_chacha::ChaCha8Rng;
@ -490,8 +490,8 @@ pub fn userspace_maps(cfg: &mut BootConfig) {
// the address of the UART buffer is "hard-allocated" at an offset one page from the top of
// IFRAM0. This is a convention that must be respected by the UDMA UART library implementation
// for things to work.
let uart_buf_addr = UART_IFRAM_ADDR;
let udma_uart = unsafe {
let uart_buf_addr = APP_UART_IFRAM_ADDR;
let mut udma_uart = unsafe {
// safety: this is safe to call, because we set up clock and events prior to calling new.
cramium_hal::udma::Uart::get_handle(
utralib::utra::udma_uart_0::HW_UDMA_UART_0_BASE,
@ -502,6 +502,8 @@ pub fn userspace_maps(cfg: &mut BootConfig) {
crate::println!("Baud freq is {} Hz, baudrate is {}", freq, baudrate);
udma_uart.set_baud(baudrate, freq);
udma_uart.write(b"APP UART INIT OK\n\r");
// map the debug UART HW page
cfg.map_page_32(
root,