May 23, 2019 at 14:51 #25008
I tried to follow the tutorial for an embedded bootloader with msbuild. However if I select “rebuild main application” there is the following error “Build failed: arm-eabi-ld.exe exited with code 1”.
I then copied the bootloader tutorial from github and got the same problem.
The only change to the cloned program was the start-project definition, as it was originally on the bootloader I had to set it to the main application.
I am using Visual Studio 2017 professional 15.9.12 and Visual GDB Custom Edition 5.4R5.
Any idea what I am doing wrong?
JanMay 23, 2019 at 17:46 #25009
Please check the built log (View->Output). It will show the output from ld.exe (GNU linker) that should contain more details about the cause of the error.May 24, 2019 at 06:43 #25010
it seems the Bootloader.bin file is missing, when building the two projects separately it gets generated. With rebuild however it gets deleted and is not regenerated(or deleted immideately after generation – hard to see), although the compilation itself happens for both projects.
So is there some general setting ( like only-delete-bin-files-at-first-rebuild? ) I am missing?
JanMay 24, 2019 at 08:20 #25011
As I do not have the hardware to debug the original tutorial program this is the result of the debugging of my own program (based on the tutorial) with the same problem:
If I build the two programs (bootloader, main app) separately I do not get an error. But when debugging it does start at disassembly (Starting point seems to be the reset-vector of the main application) and gets stuck at some point, therefore returning to the reset vector. I am however not able to get to a breakpoint either in the bootloader or the main app.
(Reset Target after programming is set).
When debugging the bootloader as standalone the _app_start address and the _estack seem correct in the debugger.
Also in the Embedded Memory Explorer of the main application I can see the .bootldr section with the correct range, but it says “Other” inside with the indication that the space has been lost due to padding between symbols. Is there another way to see the memory of the combined programs?
I rebuild the whole program using gnu make and the bootloader makefile tutorial. This seems to work without a problem.
May 24, 2019 at 17:33 #25013
- This reply was modified 1 month, 4 weeks ago by JStolle.
In order to solve the build issues please double-check that the bootloader project is set as a build dependency for the main project (step 19 of the tutorial). Otherwise Visual Studio will try to build both projects in parallel and will indeed not work.
To solve the entry point issue when debugging, please set the “reset after programming FLASH” checkbox in debug settings (step 23 of the same tutorial).May 31, 2019 at 08:21 #25037
I checked, but step 19 had been done. Build dependencies are looking good and the build itself is going well – first bootloader, then application, but at the linking at the end of both builds, the bootloader.bin is missing:
1>——————- Memory utilization report ——————-
1>Used FLASH: 2676 bytes out of 1024KB (0%)
1>Used SRAM: 44 bytes out of 128KB (0%)
1>Used CCMRAM: 0 bytes out of 64KB (0%)
2>—— Neues Erstellen gestartet: Projekt: MainApplication, Konfiguration: Debug VisualGDB ——
2>C:\SysGCC\arm-eabi\bin\arm-eabi-ld.exe: cannot find C:/Users/jan.stolle/source/repos/BootloaderDemo/VisualGDB/Debug/Bootloader.bin: No such file or directory
2>C:\Users\jan.stolle\source\repos\BootloaderDemo\MainApplication\bootloader.props(4,2): error : Build failed: arm-eabi-ld.exe exited with code 1
As written before, that program has been cloned directly from the git-hub repository. It is working if built separate, but not if done using the rebuild-function on the main-application. I can live with that, but it is a bit bothersome.
Regarding the entry point, it was my mistake. I misread the tutorial and changed the stackpointer of the bootloader instead of the main-application. That part has been fixed and is working.
June 3, 2019 at 06:02 #25044
- This reply was modified 1 month, 3 weeks ago by JStolle.
Good to know the entry point works.
Regarding bootloader.bin, please try enabling verbose logging via Tools->Options->Projects and Solutions->Build and Run->MSBuild Project Output Verbosity -> Diagnostic.
This should produce a detailed build log showing the project build order and also when the .bin file is generated and when it is used by another project. If it doesn’t help, please feel free to post it here and we will try to help you get it to work.
You must be logged in to reply to this topic.