Hello,
i have some problem about double! Through terminal there is some query, that i should give some number. for example how much delay in per hour. if i give through terminal a number 1.1 h then it printed about -1173000! It shall print only 1.1. And i think, maybe there is some problem about makefile from FreeRTOS. ( because it doesn't compiler through FreeRTOS to STM32F407 Processor! )
And I believe something throug this line shall be solved!
-- CPU = -mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16
Please I need help, thanks
here is the fully Code of Makefile:
#
OPT = 0
# OBJDIR = obj
TARGET = $(OBJDIR)/STM32F4_Test
# SOURCES += src/uart.c SOURCES += src/ustime.c SOURCES += src/main.c SOURCES += src/startupstm32f4xx.S SOURCES += src/systemstm32f4xx.c SOURCES += src/syscalls.c SOURCES += src/modbus.c SOURCES += src/test.c SOURCES += src/get.c SOURCES += src/heap_2.c
SOURCES += FreeRTOS/Source/tasks.c SOURCES += FreeRTOS/Source/queue.c SOURCES += FreeRTOS/Source/list.c SOURCES += FreeRTOS/Source/croutine.c SOURCES += FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
SOURCES += libs/STM32F4xxStdPeriphDriver/src/misc.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxadc.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxcan.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxcrc.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxcryp.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxcrypaes.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxcrypdes.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxcryptdes.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxdac.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxdbgmcu.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxdcmi.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxdma.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxexti.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxflash.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxfsmc.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxgpio.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxhash.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxhashmd5.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxhashsha1.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxi2c.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxiwdg.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxpwr.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxrcc.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxrng.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxrtc.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxsdio.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxspi.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxsyscfg.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxtim.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xxusart.c SOURCES += libs/STM32F4xxStdPeriphDriver/src/stm32f4xx_wwdg.c
OBJECTS = $(addprefix $(OBJDIR)/,$(addsuffix .o,$(basename $(SOURCES))))
CPPFLAGS += -Isrc CPPFLAGS += -IFreeRTOS/Source/include CPPFLAGS += -Ilibs/CMSIS/Include CPPFLAGS += -Ilibs/Device/STM32F4xx/Include CPPFLAGS += -Ilibs/STM32F4xxStdPeriphDriver/inc
CFLAGS = -O$(OPT) CFLAGS += -std=gnu99 CFLAGS += -gdwarf-2 CFLAGS += -ffunction-sections CFLAGS += -fdata-sections CFLAGS += -Wall
CFLAGS += -Wa,-adhlns=$(OBJDIR)/$(*F).lst
#
#
# CXXFLAGS = $(CFLAGS)
# ASFLAGS = -Wa,-adhlns=$(OBJDIR)/$(*F).lst
LDFLAGS += -lm LDFLAGS += -Wl,-Map=$(TARGET).map,--cref LDFLAGS += -Wl,--gc-sections LDFLAGS += -Tsrc/stm32_flash.ld
TOOLCHAIN = d:/Programme/CodeSourcery/Sourcery201109ARMEABI/bin/arm-none-eabi CC = $(TOOLCHAIN)-gcc OBJCOPY = $(TOOLCHAIN)-objcopy OBJDUMP = $(TOOLCHAIN)-objdump SIZE = $(TOOLCHAIN)-size NM = $(TOOLCHAIN)-nm OPENOCD = D:Toolsopenocd-0.7.0binopenocd-0.7.0.exe DOXYGEN = doxygen STLINK = tools/ST-LINK_CLI.exe MKDIR = d:toolsunxutilsbinmkdir.exe
ifeq (AMD64, $(PROCESSOR_ARCHITEW6432)) SUBWCREV = tools/SubWCRev64.exe else SUBWCREV = tools/SubWCRev.exe endif
GENDEPFLAGS = -MMD -MP -MF $(OBJDIR)/$(*F).d
#
#
// kannst du mal nach dem problem suchen? Und dich ueber floating point probleme informieren? // auf der ARM cpu oder spezielle dieser F407 cpu
CPU = -mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16
CFLAGS += $(CPU) CXXFLAGS += $(CPU) ASFLAGS += $(CPU) LDFLAGS += $(CPU)
all: setup gccversion build showsize
setup: $(MKDIR) -p $(OBJDIR) $(MKDIR) -p $(OBJDIR)src $(MKDIR) -p $(OBJDIR)FreeRTOSSource $(MKDIR) -p $(OBJDIR)FreeRTOSSourceportableGCCARMCM4F $(MKDIR) -p $(OBJDIR)libsSTM32F4xxStdPeriph_Driversrc
build: elf hex lss sym bin
elf: $(TARGET).elf hex: $(TARGET).hex bin: $(TARGET).bin lss: $(TARGET).lss sym: $(TARGET).sym
doxygen: @echo @echo Creating Doxygen documentation @$(DOXYGEN)
gccversion: @$(CC) --version
showsize: elf @echo @$(SIZE) $(TARGET).elf
OOCD_CL=-d2
OOCDCL+=-f interface/signalyzer.cfg -f openocd/stm32f4x.cfg OOCDCL+=-f openocd/config.cfg OOCD_CL+=-c init -c targets
OOCD_CL+=-c "halt"
OOCDCL+=-c "flash writeimage erase $(TARGET).elf" -c "verify_image $(TARGET).elf"
OOCD_CL+=-c "reset run"
flash: hex
$(OPENOCD) $(OOCD_CL)
clean: @echo Cleaning project: rm -rf $(OBJDIR) rm -rf docs/html
%.lss: %.elf @echo @echo Creating Extended Listing: $@ $(OBJDUMP) -h -S -z $< > $@
%.sym: %.elf @echo @echo Creating Symbol Table: $@ $(NM) -n $< > $@
.SECONDARY: $(TARGET).elf .PRECIOUS: $(OBJECTS) $(TARGET).elf: $(OBJECTS) @echo @echo Linking: $@ $(CC) $^ $(LDFLAGS) --output $@
%.hex: %.elf @echo @echo Creating hex file: $@ $(OBJCOPY) -O ihex $< $@
%.bin: %.elf @echo @echo Creating bin file: $@ $(OBJCOPY) -O binary $< $@
$(OBJDIR)/%.o : %.c @echo @echo Compiling C: $< $(CC) -c $(CPPFLAGS) $(CFLAGS) $(GENDEPFLAGS) $< -o $@
$(OBJDIR)/%.o : %.cpp @echo @echo Compiling CPP: $< $(CC) -c $(CPPFLAGS) $(CXXFLAGS) $(GENDEPFLAGS) $< -o $@
$(OBJDIR)/%.o : %.s @echo @echo Assembling: $< $(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
-include $(wildcard $(OBJDIR)/*.d)
.PHONY: all build flash clean doxygen elf lss sym showsize gccversion build elf hex bin lss sym clean clean_list setup program
There are few things that can effect printing of floating point numbers, only one of which is FreeRTOS related.
In the past we have found that stacks must be 8 byte aligned to use optimised floating point printf() functions - this is inline with the official ABI from ARM but we had been reliably informed 4 was enough but evidentially not! All FreeRTOS Cortex-M ports have had the correct 8 byte alignment for a long time now, so it should not be an issue, but just to double check try using printf() on a double before starting the scheduler, so the stack is exactly the stack setup by the tools for use by main() and not the task stack.
If it fails from main() too then you need to look at your compiler options and the support for floating point in your library build. Many libraries come in multiple versions, with full, partial or no floating point support to save code space. The easiest thing to do with regards to compiler options is look in the ARM GCC FAQs, and other example projects.
Regards.
It is the true, that it even failed from main() too. I am using CodeSourcery! I have looked in ARM GCC FAQs, but there is not some solution to my problem. I am using STM32F407ZGT6.
please show me the linking to website!
Please contact CodeSourcery about this issue. They should be able to tell you the command line options or the libraries needed, or at least have some documentation they can point you to.
Regards.