This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I tried to use GCC toolchain to create application binary generated by HAL Code Generator. I can't generate BE32 format binary. It seems that all built-in libraries are compiled for LE. Are there any examples of Makefiles using GCC to create binary for this processor. This is my Makefile in root directory of project created by HAL Code Generator.
PREFIX = arm-none-eabi- CC = $(PREFIX)gcc LD = $(PREFIX)gcc OBJCOPY = $(PREFIX)objcopy CFLAGS = -Wall -Werror -I include -mfpu=vfpv3-d16 -march=armv7-r -mcpu=cortex-r4f CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -mbig-endian LDFLAGS = --specs=nosys.specs -Wl,--gc-sections -mbig-endian BINFLAGS = -O binary SRCS = $(wildcard source/*.c) ASRCS = $(wildcard source/*.s) OBJS = $(patsubst %.c, %.o, $(SRCS)) AOBJS = $(patsubst %.s, %.o, $(ASRCS)) .SECONDARY: all: app.bin %.bin: %.elf $(OBJCOPY) $< $(BINFLAGS) $@ %.elf: $(OBJS) $(AOBJS) $(LD) $^ $(LDFLAGS) -o $@ -Xlinker -Map=output.map -T source/HL_sys_link.ld %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ %.o: %.s $(CC) $(CFLAGS) -c $< -o $@ clean: rm -f $(OBJS) $(AOBJS) app.elf app.bin
This fails with errors such as:
/usr/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o: compiled for a little endian system and target is big endian
Should one compile libraries for big endian? Is that even possible for GCC?