Hello Team,
This is regarding a Hardfault issue in LPC55S69.
I have created a c++ project and implemented changes for my project. As part of it, I am making use of C++ STL library features.
Below is the code snippet,
I have an enum defined with few CMD codes,
typedef enum
{
CMD_INVALID = 0x9999,
CMD_0 = 0x0000,
CMD_1 = 0x0001,
CMD_2 = 0x0002,
CMD_3 = 0x0003,
CMD_4 = 0x0004,
CMD_5 = 0x0005,
CMD_6 = 0x0006,
CMD_7 = 0x0007,
CMD_8 = 0x0008,
CMD_9 = 0x0009,
}CMD_CODES;
I have initialized the map container
std::map<std::string, CMD_CODES> Protocol::commands_map;
In an initialization routine, inserting the elements
commands_map.emplace( std::string( "CMD1" ), CMD_1);
commands_map.emplace( std::string( "CMD2" ), CMD_2 );
commands_map.emplace( std::string( "CMD3" ), CMD_3 );
commands_map.emplace( std::string( "CMD4" ), CMD_4 );
commands_map.emplace( std::string( "CMD5" ), CMD_5 );
commands_map.emplace( std::string( "CMD6" ), CMD_6 );
commands_map.emplace( std::string( "CMD7" ), CMD_7 );
commands_map.emplace( std::string( "CMD8" ), CMD_8 );
commands_map.emplace( std::string( "CMD9" ), CMD_9 );
After this initialization, I will performing other tasks.
But I am getting a hardfault error, in the initialization routine while inserting the elements. I am wondering, what is going on here.

Can someone please let me know, what the issue is?
Regards,
San