diff --git a/libs/cramium-hal/src/board/baosec.rs b/libs/cramium-hal/src/board/baosec.rs index c45f1431a..0b5c4d6de 100644 --- a/libs/cramium-hal/src/board/baosec.rs +++ b/libs/cramium-hal/src/board/baosec.rs @@ -26,20 +26,21 @@ pub const SPIM_FLASH_IFRAM_ADDR: usize = utralib::HW_IFRAM0_MEM + utralib::HW_IF // one page for the I2C driver pub const I2C_IFRAM_ADDR: usize = utralib::HW_IFRAM0_MEM + utralib::HW_IFRAM0_MEM_LEN - 8 * 4096; -// memory for camera driver -pub const CAM_IFRAM_LEN_PAGES: usize = 10; +// memory for camera driver - note this is mutually exclusive with USB, can't use both at the same time +pub const CAM_IFRAM_LEN_PAGES: usize = 30; pub const CAM_IFRAM_ADDR: usize = - utralib::HW_IFRAM0_MEM + utralib::HW_IFRAM0_MEM_LEN - (9 + CAM_IFRAM_LEN_PAGES) * 4096; + utralib::HW_IFRAM1_MEM + utralib::HW_IFRAM1_MEM_LEN - CAM_IFRAM_LEN_PAGES * 4096; -// USB pages - USB subsystem is a hog, needs a lot of pages -pub const CRG_IFRAM_PAGES: usize = 22; +// USB pages - USB subsystem is a hog, needs a lot of pages, note this is mutually exclusive with camera, +// can't use both at once +pub const CRG_IFRAM_PAGES: usize = 23; // +1 for extended application buffer by 4k pub const CRG_UDC_MEMBASE: usize = utralib::HW_IFRAM1_MEM + utralib::HW_IFRAM1_MEM_LEN - CRG_IFRAM_PAGES * 0x1000; // MANUALLY SYNCED TO ALLOCATIONS ABOVE // inclusive numbering - we allocate pages from the top-down, so the last number should generally be 31 -pub const IFRAM0_RESERVED_PAGE_RANGE: [usize; 2] = [31 - (9 + CAM_IFRAM_LEN_PAGES), 31]; -pub const IFRAM1_RESERVED_PAGE_RANGE: [usize; 2] = [31 - CRG_IFRAM_PAGES, 31]; +pub const IFRAM0_RESERVED_PAGE_RANGE: [usize; 2] = [31 - 9, 31]; +pub const IFRAM1_RESERVED_PAGE_RANGE: [usize; 2] = [31 - CAM_IFRAM_LEN_PAGES, 31]; /// Setup pins for the baosec display /// Returns a spi channel object and descriptor for the C/D + CS pins as a (port, c/d pin, cs pin) tuple