ESP32 Custom Build Step

Sysprogs forums Forums VisualGDB ESP32 Custom Build Step

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #10605
    Pawel Szabaciuk
    Participant

    Hello.

    Can you tell me how can I configure custom build step for embedded msbuild project?

    I need convert some files to hex array .h file before compile project.

    #10613
    support
    Keymaster

    Hi,

    If you are using a Custom edition or higher, you can add a custom pre-built step via VisualGDB Project Properties -> Custom Build Steps.

    If you are using a lower edition, you would need to manually create a custom MSBuild target as described in the MSBuild documentation.

    Note that for converting binary files to resources you can conveniently use the embedded resource mechanism as described here: https://visualgdb.com/tutorials/arm/resources/

    • This reply was modified 7 years, 9 months ago by support.
    #10619
    Pawel Szabaciuk
    Participant

    Oh, that embedded resources is genius. Thank you!

    #10620
    Pawel Szabaciuk
    Participant

    And of course it doesn’t work with ESP32 😐

    #10630
    support
    Keymaster

    Hi,

    Sorry, we have indeed not tested this explicitly with ESP32, so it may need some minor adjustments. Feel free to let us know the errors you encounter and we will suggest how to solve them.

    #10632
    Pawel Szabaciuk
    Participant

    I have marked one file as Embedded Binary File. This is build output:

    1> C:\SysGCC\esp32\bin\xtensa-esp32-elf-ld.exe: --relax and -r may not be used together 1> Sysprogs.Build.Tasks.VisualGDBTask+ToolFailedException 1> Sysprogs.Build.Tasks.VisualGDBTask+ToolFailedException: Build failed: xtensa-esp32-elf-ld.exe exited with code 1 1> at Sysprogs.Build.Tasks.VisualGDBSimpleTask.RunToolLocally(String tool, SimpleToolInvocation[] invocations) 1> at Sysprogs.Build.Tasks.VisualGDBSimpleTask.DoExecuteOrThrow(String tool) 1> at Sysprogs.Build.Tasks.VisualGDBTask.Execute() 1>C:\Program Files (x86)\Sysprogs\VisualGDB\MSBuild\Targets\binary.targets(7,2): error : Build failed: xtensa-esp32-elf-ld.exe exited with code 1

    #10634
    support
    Keymaster

    Hi,

    OK, this means that the esp32 linker cannot convert the binary file to an ELF file (so that the linker could merge it into your project). Please try locating the <file>.bin2obj.rsp file in your build folder and running the xtensa-esp32-elf-ld.exe manually with the flags specified there. Then try experimenting with adding and removing flags to see if ESP32 requires some special options to make it work.

    Once you get a combination of options that work, you can edit the %VISUALGDB_DIR%\MSBuild\Targets\binary.targets file to ensure VisualGDB always uses those options.

    #10638
    Pawel Szabaciuk
    Participant

    Ok, I’ve changed:

    CommandFormat="-r -b binary $< -o $@"

    into:

    CommandFormat="-r -no-relax -b binary $< -o $@"

    But I have another issue:

    1> C:\SysGCC\esp32\bin\xtensa-esp32-elf-objcopy.exe:VisualGDB/Debug/login.o0: File format not recognized 1> Sysprogs.Build.Tasks.VisualGDBTask+ToolFailedException 1> Sysprogs.Build.Tasks.VisualGDBTask+ToolFailedException: Build failed: xtensa-esp32-elf-objcopy.exe exited with code 1 1> at Sysprogs.Build.Tasks.VisualGDBSimpleTask.RunToolLocally(String tool, SimpleToolInvocation[] invocations) 1> at Sysprogs.Build.Tasks.VisualGDBSimpleTask.DoExecuteOrThrow(String tool) 1> at Sysprogs.Build.Tasks.VisualGDBTask.Execute() 1>C:\Program Files (x86)\Sysprogs\VisualGDB\MSBuild\Targets\binary.targets(23,2): error : Build failed: xtensa-esp32-elf-objcopy.exe exited with code 1

    #10646
    support
    Keymaster

    Hi,

    This error happens when VisualGDB tries to move the generated binary from the .data section to .rodata. Looks like the ESP32 objcopy tool has troubles parsing the ESP32 ELF files.

    Similarly to the previous step, please try locating the .data2rodata.rsp file and experiment with the command line to find a setting that works.

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