[EXT_SITMPUSW-317] C++ code not working as expected on M4F Created: 26/Mar/26 Updated: 26/Mar/26 Resolved: 26/Mar/26 |
|
| Status: | Fixed |
| Project: | Sitara MPU & SPMCU SDKs |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | TI User | Assignee: | TI User |
| Resolution: | Fixed | Votes: | 0 |
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Internal ID: | SITSW-6383 |
| Found In Release: | 10.01.00 |
| Fix In Release: | 12.00.00 |
| Affected Platform/Device: | am243x-evm am243x-lp am64xx-evm am64xx-sk |
| Description |
|
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(); } |