The memory map file for LX2160ARDB_rev2 arm trusted firmware is not generated.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The memory map file for LX2160ARDB_rev2 arm trusted firmware is not generated.

Jump to solution
1,846 Views
m_kei
Contributor III

LX2160ardb_rev2 is being developed.

I have a problem that core 2 or later does not start when using the debugger when running on multiple cores. Core 0 and Core 1 start without problems.

We have determined that the cause is ATF, so we are trying to debug ATF, but the ATF generated by flex-installer does not output a map file or elf file.

I need at least a map file, how can I generate one?
Or, do you have any idea what is being done, looping permanently from address 0x1010 to 0x104C?

0 Kudos
Reply
1 Solution
1,830 Views
yipingwang
NXP TechSupport
NXP TechSupport

After running command "$ flex-builder -c atf -m lx2160ardb -b xspi", please go to folder components/firmware/atf/ and modify Makefile as the following.

$(eval $(call add_define,DEBUG))
DEBUG := 1
ifneq (${DEBUG}, 0)
BUILD_TYPE := debug
TF_CFLAGS += -g

ifneq ($(findstring clang,$(notdir $(CC))),)
ASFLAGS += -g
else
ASFLAGS += -g -Wa,--gdwarf-2
endif

# Use LOG_LEVEL_INFO by default for debug builds
LOG_LEVEL := 40
else

Then run command "$ flex-builder -c atf -m lx2160ardb -b xspi" again, you will get the debug atf elf image in build/lx2160ardb/debug/bl31/bl31.elf, memory map file in build/lx2160ardb/debug/bl31/bl31.map.

View solution in original post

0 Kudos
Reply
5 Replies
1,831 Views
yipingwang
NXP TechSupport
NXP TechSupport

After running command "$ flex-builder -c atf -m lx2160ardb -b xspi", please go to folder components/firmware/atf/ and modify Makefile as the following.

$(eval $(call add_define,DEBUG))
DEBUG := 1
ifneq (${DEBUG}, 0)
BUILD_TYPE := debug
TF_CFLAGS += -g

ifneq ($(findstring clang,$(notdir $(CC))),)
ASFLAGS += -g
else
ASFLAGS += -g -Wa,--gdwarf-2
endif

# Use LOG_LEVEL_INFO by default for debug builds
LOG_LEVEL := 40
else

Then run command "$ flex-builder -c atf -m lx2160ardb -b xspi" again, you will get the debug atf elf image in build/lx2160ardb/debug/bl31/bl31.elf, memory map file in build/lx2160ardb/debug/bl31/bl31.map.

0 Kudos
Reply
1,826 Views
m_kei
Contributor III

This procedure results in an error.

flex-builder outputs to "components/firmware/atf" instead of "build/firmware/atf" during DEBUG build. This is because flex-builder does not support changing the output destination of generated files at DEBUG build time. Therefore, flex-builder refers to "components/firmware/atf", but an error occurs because it does not exist.

I checked the map file as it succeeds in outputting it, but bl2 is placed at address 0x18000000 or later and bl31 at address 0xfbe00000 or later.

What I would like to see is a map file around address 0x1000, but maybe address 0x1000 is bl1, or BootROM?

0 Kudos
Reply
1,820 Views
yipingwang
NXP TechSupport
NXP TechSupport

Code in the internal BootROM starts running and configures low-level aspects of the SoC.
The BootROM must then load the first external software (TF-A binaries) to run from a boot device, such as NOR flash or
SD/eMMC.
a. The BootROM transfers control to BL2.
b. BL2 loads and starts bootloader from NOR flash or SD/eMMC.

Please refer to plat/nxp/soc-lx2160a/soc.def

# Area of OCRAM reserved by ROM code
NXP_ROM_RSVD := 0xa000

0 Kudos
Reply
1,817 Views
m_kei
Contributor III

Does this mean that BootROM uses addresses 0x0000 - 0xa000?

In that case, the area around address 0x1000 that I would like to debug and modify would be the BootROM.

Is it possible to change the BootROM code?

0 Kudos
Reply
1,780 Views
yipingwang
NXP TechSupport
NXP TechSupport

BootROM uses addresses 0x0000 - 0xa000.

BootROM code cannot be changed.

0 Kudos
Reply