loading two separate projects

Sysprogs forums Forums VisualGDB loading two separate projects

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7069
    ferasobeid2
    Participant

    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

     

    #7075
    support
    Keymaster

    The 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.

    #7076
    ferasobeid2
    Participant

    Essentially 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?

    #7078
    support
    Keymaster

    Hi,

    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.

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