Make Separate Bin file

Sysprogs forums Forums VisualGDB Make Separate Bin file

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11874
    Taisen
    Participant

    Hi VisualGDB, I am working on STM32 TouchGFX project, the graphic project output file will be divided into .elf file, which is major C/C++ code, which will be saved on onchip Flash, and there also generate a .bin file, which contain picture and other font file, then will be flashed into qspi.

    Here is their Makefile.
    <div>
    <div>    @mkdir -p $(@D)</div>
    <div>    @$(linker) \</div>
    <div>        $(linker_options) -T $(makefile_path_relative)/application.ld -Wl,-Map=$(@D)/application.map $(linker_options_local) \</div>
    <div>        $(patsubst %,-L%,$(library_include_paths)) \</div>
    <div>        @$(build_root_path)/objects.tmp -o $@ \</div>
    <div>        -Wl,–start-group $(patsubst %,-l%,$(libraries)) -Wl,–end-group</div>
    <div>    @rm -f $(build_root_path)/objects.tmp</div>
    <div>    @echo “Producing additional output formats…”</div>
    <div>    @echo ” target.hex – Combined internal+external hex”</div>
    <div>    @$(objcopy) -O ihex $@ $(@D)/target.hex</div>
    <div>    @echo ” intflash.elf – Internal flash, elf debug”</div>
    <div>    @$(objcopy) –remove-section=ExtFlashSection $@ $(@D)/intflash.elf 2>/dev/null</div>
    <div>    @echo ” intflash.hex – Internal flash, hex”</div>
    <div>    @$(objcopy) -O ihex –remove-section=ExtFlashSection $@ $(@D)/intflash.hex</div>
    <div>    @echo ” extflash.bin – External flash, binary”</div>
    <div>    @$(objcopy) -O binary –only-section=ExtFlashSection $@ $(@D)/extflash.bin</div>
    </div>
    <div></div>
    <div>How to set this under VisualGDB?</div>
    <div></div>
    <div>The visual GDB only contain</div>
    <div>PRIMARY_OUTPUTS :=

    ifeq ($(GENERATE_BIN_FILE),1)
    PRIMARY_OUTPUTS += $(BINARYDIR)/$(basename $(TARGETNAME)).bin
    endif

    ifeq ($(GENERATE_IHEX_FILE),1)
    PRIMARY_OUTPUTS += $(BINARYDIR)/$(basename $(TARGETNAME)).ihex
    endif

    ifeq ($(PRIMARY_OUTPUTS),)
    PRIMARY_OUTPUTS := $(BINARYDIR)/$(TARGETNAME)
    endif</div>
    <div></div>
    <div>This all the same but different format, who could set set something like @$(objcopy) -O binary –only-section=ExtFlashSection $@ $(@D)/extflash.bin ??</div>

    #11909
    support
    Keymaster

    Hi,

    Yes, this Makefile saves the contents of the ExtFlashSection to extflash.bin. If you want to convert the project into a MSBuild-based VisualGDB project, you would need to add the objcopy command to the custom post-build actions to achieve the same result.

    #11911
    Taisen
    Participant

    Thanks for the answer, could you give some detail hint or sample to add those command?

     

    #11936
    support
    Keymaster

    Hi,

    Yes, please refer to the instructions in this post: https://sysprogs.com/w/forums/topic/using-the-quadspi-on-stm32f7-discovery/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.