C++ code not working as expected on M4F

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • SITSW-6383
    • 10.01.00
    • 12.00.00
    • Hide
      am243x-evm
      am243x-lp
      am64xx-evm
      am64xx-sk
      Show
      am243x-evm am243x-lp am64xx-evm am64xx-sk

      The below C++ code is not working in an expected way on M4FSS.

      The same code works fine on R5FSS.

      Please refer below code

      #include <stdio.h>
      #include <string.h>
      #include <kernel/dpl/DebugP.h>
      #include "ti_drivers_config.h"
      #include "ti_drivers_open_close.h"
      #include "ti_board_open_close.h"
      typedef unsigned int uint;
      
      /// Sample class that sets a string
      class Foo{
          public:    Foo(void);
          static const uint uStrLen = 20U;    
          char mystr[uStrLen + 1U];
      }; // class Foo
      
      Foo::Foo(void){
          strncpy(mystr, "Testing\r\n", uStrLen);
          mystr[uStrLen] = '\0';
      }
      /// Declare static class instanceFoo foo;
      void hello_world_main(void *args){
          /* Open drivers to open the UART driver for console */
          Drivers_open();
          Board_driversOpen();
          // Foo f;
          DebugP_log("Hello World!\r\n");
          DebugP_log("%s",foo.mystr);
          // DebugP_log("%s",f.mystr);
          Board_driversClose();
          Drivers_close();
      }
      

      E2E - https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1461822/mcu-plus-sdk-am243x-unable-to-debug-on-m4-hello-world-project 

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-6527 - C++ code not working as expected on...
                SYNCHRONIZED
                • Last Sync Date: