cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WL5MOCH6 - HardFault when reading from pointer during second core initialization

AlexandreMagno
Associate

When running second core initialization, the program goes into HardFault on line "i_feature = *(i + p_MBMUX_Cm0plusFeatureList->Feat_Info_TableAddress);"

 

The code was automatically generated by CubeIDE when opening the ST program "SubGHz_Phy_PingPong_DualCore"

---------------------------------------------------------------------------------------------------------------------------------------------------------

mbmux.c

 

static uint8_t MBMUX_CheckIfFeatureSupportedByCm0plus(FEAT_INFO_IdTypeDef e_featID)

{

int8_t ret = 0;

uint8_t i;

uint8_t cm0plus_nr_of_supported_features;

FEAT_INFO_Param_t i_feature;

/* USER CODE BEGIN MBMUX_CheckIfFeatureSupportedByCm0plus_1 */

 

/* USER CODE END MBMUX_CheckIfFeatureSupportedByCm0plus_1 */

 

if (p_MBMUX_Cm0plusFeatureList != NULL)

{

cm0plus_nr_of_supported_features = p_MBMUX_Cm0plusFeatureList->Feat_Info_Cnt;

for (i = 0; i < cm0plus_nr_of_supported_features; i++)

{

i_feature = *(i + p_MBMUX_Cm0plusFeatureList->Feat_Info_TableAddress);

if (i_feature.Feat_Info_Feature_Id == e_featID)

{

ret = 1;

break;

}

}

}

/* USER CODE BEGIN MBMUX_CheckIfFeatureSupportedByCm0plus_Last */

 

/* USER CODE END MBMUX_CheckIfFeatureSupportedByCm0plus_Last */

return ret;

}

--------------------------------------------------------------------------------------

features_info.h

 

typedef struct

{

uint32_t Feat_Info_Cnt;

FEAT_INFO_Param_t *Feat_Info_TableAddress;

} FEAT_INFO_List_t;

--------------------------------------------------------------------------------------

typedef struct

{

FEAT_INFO_IdTypeDef Feat_Info_Feature_Id;

uint32_t Feat_Info_Feature_Version;

uint32_t Feat_Info_Config_Size;

void *Feat_Info_Config_Ptr;

} FEAT_INFO_Param_t;

--------------------------------------------------------------------------------------

The structure has values but still crashes when i read from it.Captura de ecrã 2024-07-19 153407.png

 

 Thank you for your help.

1 REPLY 1
STTwo-32
ST Employee

Hello @AlexandreMagno 

Could you please give more details (are you using your own design or the B-WL5M-SUBG1, have you followed the run/debug steps mentioned on the readme file of the Project) I'm not able to reproduce this on my B-WL5M-SUBG1.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.