I imported a project in STM32CubeIDE with the option "Makefile Project with Existing Code". I created this project without using any IDE, so I had to write my own makefile.
CC = arm-none-eabi-gcc -c
LD = arm-none-eabi-gcc
LIBNAME_OPENCM3 = opencm3_stm32f1
OPT = -Os
DEFS += -DSTM32F1
DIR_OPENCM3 = ./libopencm3
DIR_INC = ./inc
DIR_OBJ = ./obj
DEBUG = -ggdb3
LDSCRIPT = stm32f1.ld
DIR_FLAGS = -I$(DIR_INC)
ARCH_FLAGS = -mthumb -mcpu=cortex-m3
LDFLAGS += --static -nostartfiles
LDFLAGS += -T$(LDSCRIPT)
LDFLAGS += $(ARCH_FLAGS) $(DEBUG)
LDFLAGS += -Wl,-Map=$(*).map -Wl,--cref
LDFLAGS += -Wl,--gc-sections
ifeq ($(V),99)
LDFLAGS += -Wl,--print-gc-sections
endif
LDFLAGS += -u _printf_float
LDFLAGS += -L$(DIR_OPENCM3)/lib
LDLIBS += -l$(LIBNAME_OPENCM3)
LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
CFLAGS += $(OPT) $(DEBUG) $(ARCH_FLAGS)
CFLAGS += -Wextra -Wshadow -Wimplicit-function-declaration
CFLAGS += -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes
CFLAGS += -fno-common -ffunction-sections -fdata-sections
CFLAGS += -std=c11
DEFS += -I$(DIR_OPENCM3)/include
PREPFLAGS = -MD -Wall -Wundef $(DEFS)
OBJS = $(DIR_OBJ)/main.o \
$(DIR_OBJ)/bmp180.o
main.elf : $(OBJS) $(LDSCRIPT)
$(LD) $(LDFLAGS) $(OBJS) $(LDLIBS) -o main.elf
$(DIR_OBJ)/%.o : %.c
mkdir -p $(DIR_OBJ)
$(CC) $(CFLAGS) $(DIR_FLAGS) $(PREPFLAGS) $< -o $@
clean :
rm -rf $(DIR_OBJ) *.elf *.map *.d
all :
make
The project is compiled successfully and it's running, but when I started to debug, this IDE didn't show the SFR registers. That window is empty.
I created a different project, this time with the IDE, and it shows me the registers.

I suppose that it has something to do with my makefile. Is there an extra flag that I need to add or why is this happenning?