VPATH += $(ROOTDIR)/examples\r
VPATH += $(ROOTDIR)/examples/$(PROJECTNAME)\r
\r
-ifneq ($(CFG_BOOT),)\r
-\r
-# "downloader" need an srecord file \r
-build-srec-image-y = $(PROJECTNAME)_srec_image.srec\r
-build-srec-y = $(PROJECTNAME).srec\r
-build-bin-image-y = $(PROJECTNAME)_bin_image.bin\r
-\r
-# To add a header with mkimage we need a binary file\r
-build-bin-y = $(PROJECTNAME).bin\r
-\r
-all-mod += $(build-srec-image-y)\r
-all-mod += $(build-srec-y)\r
-all-mod += $(build-bin-image-y)\r
-\r
-# Tools Path\r
-mkimage = /c/Users/mahi/git/bootloader/bin/mkimage\r
-SRECORD_PATH=/c/devtools/srecord\r
-SREC_CAT=$(Q)$(SRECORD_PATH)/srec_cat.exe\r
-SREC_INFO=$(Q)$(SRECORD_PATH)/srec_info.exe\r
-\r
-LOAD_ADDR=0x1c000\r
-\r
-# To srecord again to load in tool\r
-$(build-srec-image-y): $(build-bin-image-y)\r
- @echo ">> Binary to SREC to load with tool"\r
- $(SREC_CAT) $< -binary -offset ${LOAD_ADDR} -o $@\r
- $(SREC_INFO) $@\r
-\r
-$(build-srec-y) : $(build-exe-y)\r
- @echo\r
- @echo " >> OBJCOPY $@" \r
- $(Q)$(CROSS_COMPILE)objcopy -O srec $< $@\r
- $(SREC_INFO) $@\r
-\r
-# Binary image down to 0\r
-$(build-bin-y) : $(build-srec-y)\r
- @echo ">> srec to binary with offset 0"\r
- $(SREC_INFO) $< \r
- $(SREC_CAT) $< -offset - -minimum-addr $< -o $@ -binary\r
-\r
-# Add image header \r
-# Should extract the start address with "objdump -f"\r
-$(build-bin-image-y): $(build-bin-y)\r
- @echo ">> Adding header" \r
- $(mkimage) -o $@ -l 0x1c100 -s 0x1c100 -m "APP" -v $<\r
-\r
endif\r
\r
\r
-endif\r
\r
\r
\r