cancel
Showing results for 
Search instead for 
Did you mean: 

Recipe for target 'flash' failed

DMeis.1
Associate III

I am getting the following code error. The program build successfully in the simulator but when I try 'Run Target' it fails.

I use the following Build settings. And the detail log is below.0690X00000D8EBQQA3.png

Run Target
    Generate
        Done
    Generate Assets
        make -f simulator/gcc/Makefile assets -j8
        Generating generated/texts/src/Texts.cpp
        Generating generated/texts/src/LanguageGb.cpp
        Done
    Post Generate
        touchgfx update_project --project-file=simulator/msvs/Application.vcxproj
        Done
    Post Generate Target
        touchgfx update_project --project-file=../STM32H750B-DK.ioc --platform=m7
        Done
    Compile
        make -f ../gcc/Makefile -j8
        Generating TouchGFX/generated/texts/src/Texts.cpp
        Generating TouchGFX/generated/texts/src/LanguageGb.cpp
        Compiling TouchGFX/generated/fonts/src/Font_verdana_40_4bpp_0.cpp
        Compiling TouchGFX/generated/fonts/src/Table_verdana_80_4bpp.cpp
        Compiling TouchGFX/generated/fonts/src/Font_verdana_80_4bpp_0.cpp
        Compiling TouchGFX/generated/fonts/src/Kerning_verdana_40_4bpp.cpp
        Compiling TouchGFX/generated/fonts/src/Table_verdana_10_4bpp.cpp
        Compiling TouchGFX/generated/fonts/src/Kerning_verdana_10_4bpp.cpp
        Compiling TouchGFX/generated/fonts/src/Kerning_verdana_80_4bpp.cpp
        Compiling TouchGFX/generated/fonts/src/Font_verdana_10_4bpp_0.cpp
        Compiling TouchGFX/generated/fonts/src/Table_verdana_40_4bpp.cpp
        Compiling TouchGFX/generated/texts/src/LanguageGb.cpp
        Compiling TouchGFX/generated/texts/src/Texts.cpp
        Linking TouchGFX/build/bin/target.elf
        Producing additional output formats...
          target.hex   - Combined internal+external hex
          intflash.elf - Internal flash, elf debug
          intflash.hex - Internal flash, hex
          extflash.bin - External flash, binary
        Done
    Flash
        make -f  ../gcc/Makefile -j8 flash
        Linking TouchGFX/build/bin/target.elf
        Producing additional output formats...
          target.hex   - Combined internal+external hex
          intflash.elf - Internal flash, elf debug
          intflash.hex - Internal flash, hex
          extflash.bin - External flash, binary
              -------------------------------------------------------------------
                               STM32CubeProgrammer v2.2.0                  
              -------------------------------------------------------------------
        
        ST-LINK SN  : 0668FF363931594E43111416
        ST-LINK FW  : V2J35M26
        Voltage     : 3.23V
        SWD freq    : 4000 KHz
        Connect mode: Normal
        Reset mode  : Software reset
        Device ID   : 0x449
        Device name : STM32F74x/STM32F75x
        Flash size  : 64 KBytes
        Device type : MCU
        Device CPU  : Cortex-M7
        
        
        
        Memory Programming ...
        Opening and parsing file: target.hex
          File          : target.hex
          Size          : 2141868 Bytes
          Address       : 0x08000000 
        
        
        Erasing memory corresponding to segment 0:
        Erasing internal memory sector 0
        Erasing memory corresponding to segment 1:
        Erasing external memory sector 0
        Error: failed to erase memory
        
        
        Error: failed to erase memory
        
        Hard reset is performed
        gcc/Makefile:279: recipe for target '_flash_' failed
        make[1]: *** [_flash_] Error 1
        ../gcc/Makefile:50: recipe for target 'flash' failed
        make: *** [flash] Error 2
        Failed
    Failed

2 REPLIES 2
DMeis.1
Associate III

This is line 278 and 279 from the Makefile

_flash_:
	@$(st_stm32cube_programmer) -c port=SWD -d $(binary_output_path)/target.hex -el $(st_stm32cube_external_loader) -hardRst

And this is line 38 -50 of the Makefile

board_name := STM32H750B-DK
platform := cortex_m7
cpp_compiler_options_local := -DUSE_HAL_DRIVER -DSTM32H750xx -DVECT_TAB_QSPI
c_compiler_options_local := -DUSE_HAL_DRIVER -DSTM32H750xx -DVECT_TAB_QSPI
 
.PHONY: all clean assets flash intflash
 
all: $(filter clean,$(MAKECMDGOALS))
all clean assets:
	@cd "$(application_path)" && $(MAKE) -r -f $(makefile_name) -s $(MFLAGS) _$@_
 
flash intflash: all
	@cd "$(application_path)" && $(MAKE) -r -f $(makefile_name) -s $(MFLAGS) _$@_

DMeis.1
Associate III

SOLUTION: I started a session with the wrong discovery board. It was looking for DSTM32H750 files but I have the STM32F7508-DISCO board.