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.