[SOLVED] Project command specified twice: Target.LoadMemoryMap

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Project command specified twice: Target.LoadMemoryMap

    Hello,

    I get an unexpected message Project command specified twice: Target.LoadMemoryMap.

    The relevant part of the command file:

    C Source Code

    1. void OnProjectLoad (void) {
    2. int debug;
    3. debug = 0;
    4. Project.SetDevice ("STM32L496VG");
    5. Project.SetHostIF ("USB", "");
    6. Project.SetTargetIF ("SWD");
    7. Project.SetTIFSpeed ("4 MHz");
    8. Project.AddPathSubstitute ("/home/vadim/work/PROJECT", "$(ProjectDir)");
    9. if (debug == 1) {
    10. File.Open ("$(ProjectDir)/build/dev/PROJECT.elf");
    11. Target.LoadMemoryMap ("$(ProjectDir)/build/dev/PROJECT.map");
    12. } else {
    13. File.Open ("$(ProjectDir)/build/rel/PROJECT.elf");
    14. Target.LoadMemoryMap ("$(ProjectDir)/build/rel/PROJECT.map");
    15. }
    16. }
    Display All

    Console output:

    Source Code

    1. Disabled output of control characters
    2. SEGGER Ozone - The J-Link Debugger V3.28d
    3. J-Link software found at: /opt/SEGGER/Ozone_Linux_V328d_x86_64/Lib/libjlinkarm.so
    4. File.Open ("/home/vadim/work/PROJECT/ozone-PROJECT.jdebug");
    5. Project.SetDevice ("STM32L496VG");
    6. Project.SetHostIF ("USB", "");
    7. Project.SetTargetIF ("SWD");
    8. Project.SetTIFSpeed ("4 MHz");
    9. Project.AddPathSubstitute ("/home/vadim/work/PROJECT", "$(ProjectDir)");
    10. File path resolved: "$(ProjectDir)/build/rel/PROJECT.elf" was found at "/home/vadim/work/PROJECT/build/rel/PROJECT.elf"
    11. File.Open ("/home/vadim/work/PROJECT/build/rel/PROJECT.elf");
    12. Target.LoadMemoryMap ("$(ProjectDir)/build/rel/PROJECT.map");
    13. File path resolved: "$(ProjectDir)/build/rel/PROJECT.map" was found at "/home/vadim/work/PROJECT/build/rel/PROJECT.map"
    14. Project command specified twice: Target.LoadMemoryMap.
    Display All


    Am I doing anything wrong?

    Kind regards,
    Vadim B
  • Hi Vadim B,

    you're not really doing anything wrong. However, your usage of the Target.LoadMemoryMap() command in the if/else construct is beyond mainstream usage.

    This construct leads to Target.LoadMemoryMap() being present twice in your OnProjectLoad() function. And this is what the routine, that finally leads to the warning "Project command specified twice" being printed, actually checks for: The presence of multiple such statements. In particular, the routine does not check whether the command was actually executed twice.


    So in your case you may safely ignore that warning.

    You may also consider reworking your Ozone script: Normally, release code does not provide debug information, so operating a debugger on such code is of rather limited use.

    Best regards
    -- AlexD
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • You're very welcome. I'll close this thread now.
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.