*Apparent BUG, ver: 3.22a* Variables out of scope when should not be!

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

    • *Apparent BUG, ver: 3.22a* Variables out of scope when should not be!

      Here is a snippet of my code. currString and currDot are out of scope in the watch window and mouse over will not show a variable. NOTE: This is C++.

      STM32F4, and here is the gcc --version output

      Source Code

      1. arm-none-eabi-gcc (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)
      2. Copyright (C) 2019 Free Software Foundation, Inc.
      3. This is free software; see the source for copying conditions. There is NO
      4. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      and

      Source Code

      1. CFLAGS += -g -gdwarf-2



      C Source Code

      1. /* Infinite loop */
      2. while (1) {
      3. int currLedString;
      4. for (currLedString = 0; currLedString < NoLedStrings; currLedString++) {
      5. struct ledString *currString = &ledStrings[currLedString];
      6. if (currString->changes) {
      7. currString->changes = 0;
      8. if (currString->mode == LedModeOff) {
      9. memset(&leds, 0, sizeof(leds));
      10. } else {
      11. // All other modes have a back ground color
      12. currString->backColor.parts.lead = 0xFF;
      13. volatile int ctr;
      14. for (ctr = 0; ctr <= MAX_LEDS; ctr++) { leds.led[ctr].raw = currString->backColor.raw; }
      15. for (ctr = 0; ctr < MaxLedDots; ctr++) {
      16. struct ledDot *currDot = &currString->dots[ctr];
      17. if (currDot->size > 0) {
      18. int pos;
      19. asm("nop");
      20. for (pos = (1 + currDot->pos - (currDot->size - 1));
      21. pos < (1 + currDot->pos + (currDot->size - 1)); pos++) {
      22. asm("nop");
      23. int delta = pos - currDot->pos; // How far from the center of the dot
      24. if (delta < 0)
      25. delta *= -1;
      26. delta++;
      Display All
    • Hello,

      Thank you for your inquiry.
      Such an issue is not known to us.
      Could you provide a simple reproducer that could run on an STM32F4 eval board?
      The compiled elf file and the source file in question should be sufficient.

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      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.