Sysprogs forums › Forums › VisualGDB › loading two separate projects
- This topic has 3 replies, 2 voices, and was last updated 9 years, 1 month ago by support.
-
AuthorPosts
-
October 13, 2015 at 23:09 #7069ferasobeid2Participant
So I have essentially reconstructed code that was made on IAR and modified it to make it compatible with Visual GDB/VS. The solution has two projects in it. The first is the Bootloader, and the second is my program. I want to know how I can load the Bootloader on to the MCU and succeed that load with the second project.
Regards
October 15, 2015 at 22:00 #7075supportKeymasterThe answer depends on your setup. If you have the full JTAG connection, you can combine both images into one by editing the linker script and then just debug them as one project.
The easiest way to do this is to convert the entire bootloader binary into a .o file containing a specially-named section and then modify the linker script to place that section at a given address. Let us know if you need more details.
October 16, 2015 at 19:42 #7076ferasobeid2ParticipantEssentially what I did was the following:
I went into the files appdata/local/visualGDB/EmbeddedBSPs/at91sam7s-ek folder, and created a replicate of the flash.lds file. I renamed both files bootloader.lds and code.lds respectively. I then edited the SRAM/FLASH memory allocation for both to match the memory allocation on the .map file generated by the .xcl in the original IAR code I am converting to VS.
After building the solution, I select the Debug/Program and Start Debugging option, It seems to only be loading the bootloader.elf file into the MCU. I confirmed this when I selected the Debug/Start without debugging option. Essentially despite the fact that I have two .elf files in the solution( the bootloader.elf and the code.elf file) , its only programming the bootloader.elf.
What I did is that I created two new solutions a solution simply for the bootloader code, and a solution for the code. I also changed the .mak file in these solutions to read the booloader.lds and code.lds respectively. I then programmed the solutions one after the other and the behaviour of the MCU was consistent with how it would behave had I programmed it with IAR.
Essentially I am trying to create one solution with two project whereby one .elf file is programmed and is followed by the second one. Is there anyway to two this with VisualGDB?
October 18, 2015 at 02:39 #7078supportKeymasterHi,
You can try adding the following commands to the GDB startup commands (after target selection) in VisualGDB Project Properties:
file <first.elf> load file <second.elf> load
This will load both images before debugging, however if the images share some of the FLASH pages or if the FLASH driver you are using does a full erase before programming, this won’t work. Then you would need to make a special linker script to join both ELF files into one.
-
AuthorPosts
- You must be logged in to reply to this topic.