Hello, I'm currently encountering a hardfault situation during the development process. The compilation is successful, but as soon as it runs, it enters the hardfault function.
I tried two approaches to solve it, but I didn't find the root cause of the problem.
Approach one: Move some global variables to ".dtcm_data",
eg.
__attribute__((section(".dtcm_data"))) Service_SocComm_TxSubCmd_t AppTxSub_0xDB_Cmd[] =
{
TX_SUBCMD_STRUCT(MCU_SOC_0XDB01_CMD,FRAME_TYPE_IMMEDIATELY,ACK_NO,200u,0u,0x00u),
};
Method Two: Remove the const modifier from some global variables that were originally defined as const.
Could you please infer the cause of the problem?thanks