Other Parts Discussed in Thread: AM6424, SYSBIOS
Hi,
I want to get our FW running on our new PCBA which contains an AM6424. Since we will use AM6404 later, we have no DDR Memory on our PCB.
I checked some linker scripts and mpu configs for AM64xx in the PDK. So I took those and placed them in our project.I also modified the linker script to place FW into
internal RAM (0x70000000 - 0x701FFFFF). FW resides only from 0x70100000. The previous memory is reserved for "SYSFW Secure Proxy" or MSMC3_H. WHAT IS THAT? WHERE CAN I FIND DOCUMENTATION??
Does this really need 1MB ???? I modified this to 256kB.
APP_RAM is the memory for my FW. It is 1MB.
If I build the project with these linker scripts I get the following error:
/workspaceLocal/ti/firmware/build/BuildInfrastructure/CMake/Targets/binary/basic_mcu0/configuro/linker_mod.cmd", line 163: warning: specified address lies outside memory map error: DEFAULT memory range overlaps existing memory range SBL_RSVD error: DEFAULT memory range overlaps existing memory range RESET_VECTORS error: DEFAULT memory range overlaps existing memory range MSMC3 error: DEFAULT memory range overlaps existing memory range VECTORS error: DEFAULT memory range overlaps existing memory range MSMC3_H error: DEFAULT memory range overlaps existing memory range APP_RAM error: DEFAULT memory range overlaps existing memory range SYSFW_RSVD_1 error: DEFAULT memory range overlaps existing memory range SYSFW_RSVD_2 error: DEFAULT memory range overlaps existing memory range DDR0 error: errors encountered during linking; "../../../../../../output/binary_basic_mcu0_debug/binary_basic_mcu0_debug_V0 _0_0_0_alpha.elf" not built
What is DEFAULT memory?
The File "linker_mod.cmd" does not include those sections I defined.
Other questions:
- The Reference Manual of AM64x has differenct memory mapping than the Linker Scripts. I cannot find any information in TRM which tells me where and why this is different. Where can I find these Informations?
- Do I need to change Linker Scripts or can I use the linker script from AM65xx and set a new section where to put my FW??
- Is there any porting guide for this?
I've attached my linker script:
/* linker options */
--fill_value=0
--stack_size=0x2000
--heap_size=0x1000
-stack 0x2000 /* SOFTWARE STACK SIZE */
-heap 0x2000 /* HEAP AREA SIZE */
-e __VECS_ENTRY_POINT
--retain="*(.utilsCopyVecsToAtcm)"
MEMORY
{
/* Reserved for SBL code/data */
SBL_RSVD (X) : origin=0x70000000 length=0x80000
/* Reset Vectors base address(RESET_VECTORS) should be 64 bytes aligned */
RESET_VECTORS (X) : origin=0x70080000 length=0x100
/* am64x MCMS3 locations */
MSMC3 (RWIX) : origin=0x70080100 length=0x40000 - 0x1100
VECTORS (X) : origin=0x700BF000 length=0x1000
/* Reserved for SYSFW Secure Proxy */
MSMC3_H (RWIX) : origin=0x700C0000 length=0x40000
/* temporary ram for application */
APP_RAM (RWIX) : origin=0x70100000 length=0x100000 /* 1MB */
/* Reserved by ROM for SYSFW */
SYSFW_RSVD_1 (X) : origin=0x71C00000 length=0x20000
SYSFW_RSVD_2 (X) : origin=0x71E00000 length=0x20000
DDR0 (RWIX) : origin=0x80000000 length=0x80000000 /* 2GB */
}
SECTIONS
{
.vecs : {
__VECS_ENTRY_POINT = .;
} palign(8) > RESET_VECTORS
.text_boot {
*boot.aer5f*<*boot.o*>(.text)
} palign(8) > MSMC3
.text:xdc_runtime_Startup_reset__I : {} palign(8) > MSMC3
.text:ti_sysbios_family_arm_v7r_Cache* : {} palign(8) > MSMC3
.text:ti_sysbios_family_arm_MPU* : {} palign(8) > MSMC3
.utilsCopyVecsToAtcm : {} palign(8) > MSMC3
.text : {} palign(8) > APP_RAM
.cinit : {} palign(8) > APP_RAM
.init_array : {} palign(8) > APP_RAM
.bss : {} align(8) > APP_RAM
.far : {} align(8) > APP_RAM
.const : {} palign(8) > APP_RAM
.data : {} palign(128) > APP_RAM
.sysmem : {} align(8) > APP_RAM
.stack : {} align(4) > APP_RAM
.data_buffer: {} palign(128) > APP_RAM
.benchmark_buffer: (NOLOAD) {} align (8) > APP_RAM
}
/*
* Do not modify this file; it is automatically generated from the template
* linkcmd.xdt in the ti.platforms.cortexR package and will be overwritten.
*/
/*
* put '"'s around paths because, without this, the linker
* considers '-' as minus operator, not a file name character.
*/
-l"/home/zeilera/workspaceLocal/ti/firmware/build/BuildInfrastructure/CMake/Targets/binary/basic_mcu0/configuro/package/cfg/bni_master_ng_per5f.oer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/pdk_am64x_07_01_03_09/packages/ti/drv/udma/lib/am64x/mcu1_0/debug/udma.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/pdk_am64x_07_01_03_09/packages/ti/drv/spi/lib/am64x/r5f/debug/ti.drv.spi.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/pdk_am64x_07_01_03_09/packages/ti/drv/gpio/lib/am64x/r5f/debug/ti.drv.gpio.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/pdk_am64x_07_01_03_09/packages/ti/board/lib/am64x_evm/r5f/debug/ti.board.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/pdk_am64x_07_01_03_09/packages/ti/drv/i2c/lib/am64x/r5f/debug/ti.drv.i2c.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/pdk_am64x_07_01_03_09/packages/ti/drv/uart/lib/am64x/r5f/debug/ti.drv.uart.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/pdk_am64x_07_01_03_09/packages/ti/drv/sciclient/lib/am64x/mcu1_0/debug/sciclient.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/pdk_am64x_07_01_03_09/packages/ti/osal/lib/tirtos/am64x/r5f/release/ti.osal.aer5f"
-l"/home/zeilera/workspaceLocal/ti/firmware/build/BuildInfrastructure/CMake/Targets/binary/basic_mcu0/configuro/package/cfg/bni_master_ng_per5f.src/sysbios/sysbios.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/pdk_am64x_07_01_03_09/packages/ti/csl/lib/am64x/r5f/debug/ti.csl.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/bios_6_83_00_18/packages/ti/targets/arm/rtsarm/lib/ti.targets.arm.rtsarm.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/bios_6_83_00_18/packages/ti/targets/arm/rtsarm/lib/boot.aer5f"
-l"/home/zeilera/ti/processor_sdk_sitara_am64x_00_09_00_01/rtos/bios_6_83_00_18/packages/ti/targets/arm/rtsarm/lib/auto_init.aer5f"
--retain="*(xdc.meta)"
/* C6x Elf symbols */
--symbol_map __TI_STACK_SIZE=__STACK_SIZE
--symbol_map __TI_STACK_BASE=__stack
--symbol_map _stack=__stack
--args 0x0
-heap 0x0
-stack 0x4000
/*
* Linker command file contributions from all loaded packages:
*/
/* Content from xdc.services.global (null): */
/* Content from xdc (null): */
/* Content from xdc.corevers (null): */
/* Content from xdc.rov (null): */
/* Content from xdc.runtime (null): */
/* Content from xdc.rov.runtime (null): */
/* Content from xdc.shelf (null): */
/* Content from xdc.services.spec (null): */
/* Content from xdc.services.intern.xsr (null): */
/* Content from xdc.services.intern.gen (null): */
/* Content from xdc.services.intern.cmd (null): */
/* Content from xdc.bld (null): */
/* Content from ti.targets (null): */
/* Content from ti.targets.arm.elf (null): */
/* Content from ti.targets.arm.rtsarm (null): */
/* Content from ti.sysbios.interfaces (null): */
/* Content from ti.sysbios.family (null): */
/* Content from xdc.services.getset (null): */
/* Content from ti.csl (null): */
/* Content from ti.sysbios.rts (null): */
/* Content from xdc.runtime.knl (null): */
/* Content from ti.sysbios.family.arm.a15 (null): */
/* Content from ti.catalog.arm.cortexr5 (null): */
/* Content from ti.catalog (null): */
/* Content from xdc.platform (null): */
/* Content from xdc.cfg (null): */
/* Content from ti.platforms.cortexR (null): */
/* Content from ti.sysbios (null): */
/* Content from ti.osal (null): */
/* Content from ti.drv.sciclient (null): */
/* Content from ti.drv.uart (null): */
/* Content from ti.drv.i2c (null): */
/* Content from ti.board (null): */
/* Content from ti.drv.gpio (null): */
/* Content from ti.drv.spi (null): */
/* Content from ti.drv.udma (null): */
/* Content from ti.sysbios.hal (null): */
/* Content from ti.sysbios.knl (null): */
/* Content from ti.sysbios.timers.dmtimer (null): */
/* Content from ti.sysbios.family.arm (ti/sysbios/family/arm/linkcmd.xdt): */
--retain "*(.vecs)"
/* Content from ti.sysbios.gates (null): */
/* Content from ti.sysbios.family.arm.exc (null): */
/* Content from ti.sysbios.family.arm.v7r.keystone3 (ti/sysbios/family/arm/v7r/keystone3/linkcmd.xdt): */
--diag_suppress=10063
ti_sysbios_family_arm_v7r_keystone3_Hwi_vim =
805240832;
/* Content from ti.sysbios.family.arm.v7r (null): */
/* Content from ti.sysbios.heaps (null): */
/* Content from ti.sysbios.xdcruntime (null): */
/* Content from ti.sysbios.utils (null): */
/* Content from configuro (null): */
/* Content from xdc.services.io (null): */
/* Content from ti.sysbios.family.c28 (null): */
/*
* symbolic aliases for static instance objects
*/
xdc_runtime_Startup__EXECFXN__C = 1;
xdc_runtime_Startup__RESETFXN__C = 1;
xdc_rov_runtime_Mon__checksum = 1;
xdc_rov_runtime_Mon__write = 1;
SECTIONS
{
.vecs: load > 0x0
xdc.meta: type = COPY
}
/*
* Copyright (c) 2019, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* ======== event_MPU.xs ========
* MPU Settings for am64x device's Cortex-R5F
*/
/*
* -------------------------------------------------------------------------------------------------------------
* | Id | Base Address | Size | En | Cacheable | XN | AccPerm | Mask |
* |----|--------------|------|----|-------------------------------------------|----|---------------------|------|
* | 0 | 0x00000000 | 4GB | T | uncacheable, Shareable | F | RW at PL 1 & PL 2 | 0x0 |
* |----|--------------|------|----|-------------------------------------------|----|---------------------|------|
* | 1 | 0 (local TCM)| 32K | T | Write-Back, Write-Allocate, Non-Shareable | F | RW at PL 1 | 0x0 |
* |----|--------------|------|----|-------------------------------------------|----|---------------------|------|
* | 2 | 0x41000000 | 32K | T | Write-Back, Write-Allocate, Non-Shareable | F | RW at PL 1 | 0x0 |
* |----|--------------|------|----|-------------------------------------------|----|---------------------|------|
* | 3 | 0x41010000 | 32K | T | Write-Back, Write-Allocate, Non-Shareable | F | RW at PL 1 | 0x0 |
* |----|--------------|------|----|-------------------------------------------|----|---------------------|------|
* | 4 | 0x41C00000 | 1MB | T | Write-Back, Write-Allocate, Non-Shareable | F | RW at PL 1 | 0x0 |
* -------------------------------------------------------------------------------------------------------------
* | 5 | 0x70000000 | 8MB | T | MSMC Ram - Cachable | F | RW at PL 1 | 0x0 |
* -------------------------------------------------------------------------------------------------------------
* | 6 | 0x80000000 | 2GB | T | DDR - Strongly Ordered, Shareable | F | RW at PL 1 & PL 3 | 0x0 |
* -------------------------------------------------------------------------------------------------------------
* | 7 | 0xA5000000 | 8MB | T | DDR (VRing Buffer) - Uncacheble | F | RW at PL 1 & PL 3 | 0x0 |
* |-------------------------------------------------------------------------------------------------------------|
*/
/*
* Note: Marking a region as shareable will cause the region to behave as outer shareable with write through
* no write-allocate caching policy irrespective of the actual cache policy set. Therefore, only select
* regions that are actually shared outside the R5 CPUSS must be marked as shared.
*/
var MPU = xdc.useModule('ti.sysbios.family.arm.MPU');
MPU.enableMPU = true;
MPU.enableBackgroundRegion = true;
var attrs = new MPU.RegionAttrs();
MPU.initRegionAttrsMeta(attrs);
/* This entry covers the whole 32 bit memory range
Address: 0x00000000-0xffffffff */
attrs.enable = true;
attrs.bufferable = false;
attrs.cacheable = false;
attrs.shareable = true;
attrs.noExecute = true;
attrs.accPerm = 1; /* RW at PL1 */
attrs.tex = 0;
attrs.subregionDisableMask = 0;
MPU.setRegionMeta(0, 0x00000000, MPU.RegionSize_4G, attrs);
/* This entry covers the ATCM mapped to 0 */
attrs.enable = true;
attrs.bufferable = true;
attrs.cacheable = true;
attrs.shareable = true;
attrs.noExecute = false;
attrs.accPerm = 1; /* RW at PL1 */
attrs.tex = 1;
attrs.subregionDisableMask = 0;
MPU.setRegionMeta(1, 0x00000000, MPU.RegionSize_32K, attrs);
/* This entry covers ATCM if mapped to 0x41000000 */
attrs.enable = true;
attrs.bufferable = true;
attrs.cacheable = true;
attrs.shareable = false;
attrs.noExecute = false;
attrs.accPerm = 1; /* RW at PL1 */
attrs.tex = 1;
attrs.subregionDisableMask = 0;
MPU.setRegionMeta(2, 0x41000000, MPU.RegionSize_32K, attrs);
/* This entry covers BTCM if mapped to 0x41010000 */
attrs.enable = true;
attrs.bufferable = true;
attrs.cacheable = true;
attrs.shareable = false;
attrs.noExecute = false;
attrs.accPerm = 1; /* RW at PL1 */
attrs.tex = 1;
attrs.subregionDisableMask = 0x0;
MPU.setRegionMeta(3, 0x41010000, MPU.RegionSize_32K, attrs);
/* This entry covers RAM0 */
attrs.enable = true;
attrs.bufferable = true;
attrs.cacheable = true;
attrs.shareable = false;
attrs.noExecute = false;
attrs.accPerm = 1; /* RW at PL1 */
attrs.tex = 1;
attrs.subregionDisableMask = 0;
MPU.setRegionMeta(4, 0x41C00000, MPU.RegionSize_1M, attrs);
/* This entry covers MSMC SRAM */
attrs.enable = true;
attrs.bufferable = true;
attrs.cacheable = true;
attrs.shareable = false;
attrs.noExecute = false;
attrs.accPerm = 1; /* RW at PL1 */
attrs.tex = 1;
attrs.subregionDisableMask = 0;
MPU.setRegionMeta(5, 0x70000000, MPU.RegionSize_8M, attrs);
/* This entry covers DDR memory */
attrs.enable = true;
attrs.bufferable = true;
attrs.cacheable = true;
attrs.shareable = false;
attrs.noExecute = false;
attrs.accPerm = 0x3; /* RW at PL1 & PL2 */
attrs.tex = 1;
attrs.subregionDisableMask = 0;
MPU.setRegionMeta(6, 0x80000000, MPU.RegionSize_2G, attrs);
/* Ring Buffer uncached.... */
attrs.enable = true;
attrs.bufferable = false;
attrs.cacheable = false;
attrs.shareable = true;
attrs.noExecute = true;
attrs.accPerm = 3; /* RW at PL1 */
attrs.tex = 0;
attrs.subregionDisableMask = 0;
MPU.setRegionMeta(7, 0xA5000000, MPU.RegionSize_8M, attrs);
0574.binary_basic_mcu0_debug_V0_0_0_0_alpha.elf.map.txt
Please answer every question.
Kind regards
Andreas