Hi,
I am doing a job with nRF52832 with keil in initial period. I have two peripherals and connect to nRF52832 via uart, and it runs well. Recently, I migrate the job to gcc environment. All runs well except for the ble. My phone can't connect to device anymore, but it works with keil hex well. When remove the two uart peripherals, I can connect to device via ble.... But the code is identical between keil and gcc.
My sdk version is S132, sdk is 15.0.0 and phone tool is nRF connect. The softdevice(6.0.0) is programmed and app download nextly. And before compiling, I checked the ROM and RAM in .ld file:
MEMORY
{
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
RAM (rwx) : ORIGIN = 0x20003000, LENGTH = 0xD000
}
So my question is : Is it different between keil and gcc when compiling ble (or uart)? or need to define macro i missed.
My part of makefile is below:
CFLAGS += $(OPT)
CFLAGS += -DBOARD_PCA10040
CFLAGS += -DDEBUG
CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS
CFLAGS += -DSOFTDEVICE_PRESENT
CFLAGS += -DNRF52
CFLAGS += -DS132
CFLAGS += -DSWI_DISABLE0
CFLAGS += -DNRF_SD_BLE_API_VERSION=5
CFLAGS += -DNRF52832_XXAA
CFLAGS += -DNRF52_PAN_74
CFLAGS += -mcpu=cortex-m4
CFLAGS += -mthumb -mabi=aapcs
CFLAGS += -Wall
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
# keep every function in a separate section, this allows linker to discard unused ones
CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
CFLAGS += -fno-builtin -fshort-enums
# C++ flags common to all targets
CXXFLAGS += $(OPT)
# Assembler flags common to all targets
ASMFLAGS += -g3
ASMFLAGS += -mcpu=cortex-m4
ASMFLAGS += -mthumb -mabi=aapcs
ASMFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
ASMFLAGS += -DBOARD_PCA10040
ASMFLAGS += -DBSP_DEFINES_ONLY
ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET
ASMFLAGS += -DFLOAT_ABI_HARD
ASMFLAGS += -DNRF52
ASMFLAGS += -DNRF52832_XXAA
ASMFLAGS += -DNRF52_PAN_74
ASMFLAGS += -DSOFTDEVICE_PRESENT
ASMFLAGS += -DS132
ASMFLAGS += -DNRF_SD_BLE_API_VERSION=5
# Linker flags
LDFLAGS += $(OPT)
LDFLAGS += -mthumb -mabi=aapcs -L$(SDK_ROOT)/modules/nrfx/mdk -T$(LINKER_SCRIPT)
LDFLAGS += -mcpu=cortex-m4
LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
# let linker dump unused sections
LDFLAGS += -Wl,--gc-sections
# use newlib in nano version
LDFLAGS += --specs=nano.specs