Sysprogs forums › Forums › VisualGDB › ESP32 Custom Build Step
- This topic has 8 replies, 2 voices, and was last updated 7 years, 8 months ago by support.
-
AuthorPosts
-
March 9, 2017 at 10:18 #10605Pawel SzabaciukParticipant
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.
March 10, 2017 at 06:19 #10613supportKeymasterHi,
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, 8 months ago by support.
March 10, 2017 at 07:09 #10619Pawel SzabaciukParticipantOh, that embedded resources is genius. Thank you!
March 10, 2017 at 07:23 #10620Pawel SzabaciukParticipantAnd of course it doesn’t work with ESP32 š
March 10, 2017 at 22:09 #10630supportKeymasterHi,
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.
March 11, 2017 at 08:23 #10632Pawel SzabaciukParticipantI 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
March 11, 2017 at 17:51 #10634supportKeymasterHi,
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.
March 11, 2017 at 19:48 #10638Pawel SzabaciukParticipantOk, 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
March 12, 2017 at 20:15 #10646supportKeymasterHi,
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.
-
AuthorPosts
- You must be logged in to reply to this topic.