cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WL5MOCH6 - HardFault when reading from pointer during second core initialization

AlexandreMagno
Visitor

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.

0 REPLIES 0