3.6 Mapping Memory and Peripheral Addresses
(Ask a Question)In the Libero design flow, the Mi-V processor execution memory address is mapped to 0x80000000, and its size is set to 64 KB. This information must be checked in the linker script before building the application.
To map the memory address, perform the following steps:
- Open the linker script (
miv-rv32-ram.ld
) available in the MIV_RV32_HAL folder. - Ensure that the ram ORIGIN address is mapped to 0x80000000.
- Ensure that the LENGTH of the ram is 64 KB.
- Ensure that the HEAP_SIZE is 1 KB.
- Save the file.
miv-rv32-ram.ld
file.The following figure shows the linker script.
In the Libero design flow, the UART, GPIO, and SPI peripheral addresses are mapped to 0x61000000, 0x65000000, and 0x66000000 respectively. This information needs to be provided in the hw_platform.h
file.
To map the peripheral address, perform the following steps:
- Open the hardware platform header file (
hw_platform.h
). - Ensure that the SYS_CLK_FREQ macro is defined as 83333000UL.
- Ensure that the COREUARTAPB0_BASE_ADDR macro is defined as 0x61000000.
- Ensure that the COREGPIO_OUT_BASE_ADDR macro is defined as 0x65000000.
- Ensure that the FLASH_CORE_SPI_BASE macro is defined as 0x66000000.
- Save the file.
The following figure shows thehw_platform.h
after these updates.
The memory and peripheral addresses are successfully mapped.