2024-11-18 06:23 PM - edited 2024-11-18 11:22 PM
Hi. I bought the ble_p2pServer example code on an stm32 wb55rg board and am trying to get ble communication. The example code was imported via stm32 cubemx. The current problem is that I am getting a HardFault error in the SendCmd function in the hci_tl.c code. Specifically, the error occurs on line 8 where it calls pCmdBuffer.
static void SendCmd(uint16_t opcode, uint8_t plen, void *param) {
if (pCmdBuffer == NULL) {
printf("error");
}
pCmdBuffer->cmdserial.cmd.cmdcode = opcode;
pCmdBuffer->cmdserial.cmd.plen = plen;
memcpy(pCmdBuffer->cmdserial.cmd.payload, param, plen);
hciContext.io.Send(0, 0);
return;
}
My complete main.c code is shown below.
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.c
* @brief : Main program body
******************************************************************************
* @attention
*
* Copyright (c) 2024 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "custom_stm.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */
#define LSM9DS1_ADDR (0x6A << 1)
#define MAG_ADDR (0x1E << 1)
#define WHO_AM_I_REG 0x0F
#define CTRL_REG1_G 0x10
//#define CTRL_REG1_G 0x20
#define CTRL_REG5_XL 0x1F
#define CTRL_REG6_XL 0x20
#define CTRL_REG1_M 0x20
#define CTRL_REG3_M 0x22
#define CTRL_REG4_G 0x1E
#define CTRL_REG7_G 0x16
#define CTRL_REG8 0x22
#define CTRL_REG9 0x23
//#define FIFO_CTRL 0x2E
#define OUT_X_G 0x18
#define OUT_X_XL 0x28
#define OUT_X_M 0x28
#define OUT_X_L_G 0x18
#define OUT_X_H_G 0x19
#define OUT_Y_L_G 0x1A
#define OUT_Y_H_G 0x1B
#define OUT_Z_L_G 0x1C
#define OUT_Z_H_G 0x1D
#define GYRO_SENSITIVITY_245DPS 8.75f
#define ACCEL_SENSITIVITY_2G 16384.0f
#define MAG_SENSITIVITY_4GAUSS 6842.0f
#define betaDef 0.5f
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
I2C_HandleTypeDef hi2c1;
IPCC_HandleTypeDef hipcc;
RTC_HandleTypeDef hrtc;
/* USER CODE BEGIN PV */
uint8_t gyro_status;
int16_t gyroX, gyroY, gyroZ;
int16_t accelX, accelY, accelZ;
int16_t magX, magY, magZ;
float accel_x, accel_y, accel_z;
float gyro_x, gyro_y, gyro_z;
float mag_x, mag_y, mag_z;
static uint8_t imu_data_buffer[12];
float ax1, ay1, az1, gx1, gy1, gz1, mx1, my1, mz1, mx2, my2, mz2;
volatile float beta = betaDef;
volatile float q0 = 1.0f, q1 = 0.0f, q2 = 0.0f, q3 = 0.0f;
float test_flag = 0;
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
void PeriphCommonClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_I2C1_Init(void);
static void MX_IPCC_Init(void);
static void MX_RTC_Init(void);
static void MX_RF_Init(void);
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
uint8_t LSM9DS1_ReadRegister(uint8_t addr, uint8_t reg) {
uint8_t value;
HAL_I2C_Mem_Read(&hi2c1, addr, reg, I2C_MEMADD_SIZE_8BIT, &value, 1,
HAL_MAX_DELAY);
return value;
}
void LSM9DS1_WriteRegister(uint8_t addr, uint8_t reg, uint8_t value) {
HAL_I2C_Mem_Write(&hi2c1, addr, reg, I2C_MEMADD_SIZE_8BIT, &value, 1,
HAL_MAX_DELAY);
}
void LSM9DS1_Init() {
//gyro reset
LSM9DS1_WriteRegister(LSM9DS1_ADDR, CTRL_REG8, 0x05);
HAL_Delay(50);
//gyro setting
LSM9DS1_WriteRegister(LSM9DS1_ADDR, CTRL_REG1_G, 0xA0);
HAL_Delay(50);
LSM9DS1_WriteRegister(LSM9DS1_ADDR, CTRL_REG4_G, 0x38);
HAL_Delay(50);
LSM9DS1_WriteRegister(LSM9DS1_ADDR, CTRL_REG9, 0x02);
HAL_Delay(50);
//accel setting
LSM9DS1_WriteRegister(LSM9DS1_ADDR, CTRL_REG6_XL, 0x20);
HAL_Delay(50);
//mag setting
LSM9DS1_WriteRegister(MAG_ADDR, CTRL_REG1_M, 0x70);
HAL_Delay(50);
LSM9DS1_WriteRegister(MAG_ADDR, CTRL_REG3_M, 0x00);
}
void LSM9DS1_ReadGyro() {
uint8_t buffer[6];
if (HAL_I2C_Mem_Read(&hi2c1, LSM9DS1_ADDR, OUT_X_G | 0x80,
I2C_MEMADD_SIZE_8BIT, buffer, 6, HAL_MAX_DELAY) == HAL_OK) {
gyroX = (int16_t) ((buffer[1] << | buffer[0]);
gyroY = (int16_t) ((buffer[3] << | buffer[2]);
gyroZ = (int16_t) ((buffer[5] << | buffer[4]);
gyro_x = gyroX * GYRO_SENSITIVITY_245DPS / 1000.0f;
gyro_y = gyroY * GYRO_SENSITIVITY_245DPS / 1000.0f;
gyro_z = gyroZ * GYRO_SENSITIVITY_245DPS / 1000.0f - 4.6;
} else {
gyroX = gyroY = gyroZ = 0;
}
}
void LSM9DS1_ReadAccel() {
uint8_t buffer[6];
if (HAL_I2C_Mem_Read(&hi2c1, LSM9DS1_ADDR, OUT_X_XL | 0x80,
I2C_MEMADD_SIZE_8BIT, buffer, 6, HAL_MAX_DELAY) == HAL_OK) {
accelX = (int16_t) ((buffer[1] << | buffer[0]);
accelY = (int16_t) ((buffer[3] << | buffer[2]);
accelZ = (int16_t) ((buffer[5] << | buffer[4]);
accel_x = accelX / ACCEL_SENSITIVITY_2G * 10;
accel_y = accelY / ACCEL_SENSITIVITY_2G * 10;
accel_z = accelZ / ACCEL_SENSITIVITY_2G * 10;
} else {
accelX = accelY = accelZ = 0;
}
}
void LSM9DS1_ReadMag() {
uint8_t buffer[6];
if (HAL_I2C_Mem_Read(&hi2c1, MAG_ADDR, OUT_X_M | 0x80, I2C_MEMADD_SIZE_8BIT,
buffer, 6, HAL_MAX_DELAY) == HAL_OK) {
magX = (int16_t) ((buffer[1] << | buffer[0]);
magY = (int16_t) ((buffer[3] << | buffer[2]);
magZ = (int16_t) ((buffer[5] << | buffer[4]);
mag_x = magX / MAG_SENSITIVITY_4GAUSS;
mag_y = magY / MAG_SENSITIVITY_4GAUSS;
mag_z = magZ / MAG_SENSITIVITY_4GAUSS;
} else {
magX = magY = magZ = 0;
}
}
void P2P_Server_SendIMUData() {
// tBleStatus result;
// IMU ?��?��?�� 버퍼?�� �? ???��
imu_data_buffer[0] = (uint8_t) (accel_x * 1000) >> 8;
imu_data_buffer[1] = (uint8_t) (accel_x * 1000) & 0xFF;
imu_data_buffer[2] = (uint8_t) (accel_y * 1000) >> 8;
imu_data_buffer[3] = (uint8_t) (accel_y * 1000) & 0xFF;
imu_data_buffer[4] = (uint8_t) (accel_z * 1000) >> 8;
imu_data_buffer[5] = (uint8_t) (accel_z * 1000) & 0xFF;
imu_data_buffer[6] = (uint8_t) (gyro_x * 1000) >> 8;
imu_data_buffer[7] = (uint8_t) (gyro_x * 1000) & 0xFF;
imu_data_buffer[8] = (uint8_t) (gyro_y * 1000) >> 8;
imu_data_buffer[9] = (uint8_t) (gyro_y * 1000) & 0xFF;
imu_data_buffer[10] = (uint8_t) (gyro_z * 1000) >> 8;
imu_data_buffer[11] = (uint8_t) (gyro_z * 1000) & 0xFF;
imu_data_buffer[12] = (uint8_t) (mag_x * 1000) >> 8;
imu_data_buffer[13] = (uint8_t) (mag_x * 1000) & 0xFF;
imu_data_buffer[14] = (uint8_t) (mag_y * 1000) >> 8;
imu_data_buffer[15] = (uint8_t) (mag_y * 1000) & 0xFF;
imu_data_buffer[16] = (uint8_t) (mag_z * 1000) >> 8;
imu_data_buffer[17] = (uint8_t) (mag_z * 1000) & 0xFF;
tBleStatus ret = Custom_STM_App_Update_Char(CUSTOM_STM_MYCHARWRITE,
imu_data_buffer);
if (ret != BLE_STATUS_SUCCESS) {
test_flag = test_flag + 1;
printf("Failed to send IMU data over BLE, error code: 0x%x\n", ret);
}
// result = P2PS_STM_App_Update_Char(P2P_NOTIFY_CHAR_UUID, imu_data_buffer,
// sizeof(imu_data_buffer));
//
// if (result != BLE_STATUS_SUCCESS) {
// printf("Failed to send IMU data over BLE, error code: %d\n", result);
// }
}
/* USER CODE END 0 */
/**
* @brief The application entry point.
* @retval int
*/
int main(void) {
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Config code for STM32_WPAN (HSE Tuning must be done before system clock configuration) */
MX_APPE_Config();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* Configure the peripherals common clocks */
PeriphCommonClock_Config();
/* IPCC initialisation */
MX_IPCC_Init();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_I2C1_Init();
MX_RTC_Init();
MX_RF_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Init code for STM32_WPAN */
MX_APPE_Init();
/* Infinite loop */
/* USER CODE BEGIN WHILE */
LSM9DS1_Init();
HAL_Delay(50);
while (1) {
LSM9DS1_ReadGyro();
// HAL_Delay(10);
LSM9DS1_ReadAccel();
// HAL_Delay(10);
LSM9DS1_ReadMag();
// HAL_Delay(10);
P2P_Server_SendIMUData();
HAL_Delay(10);
/* USER CODE END WHILE */
MX_APPE_Process();
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
/**
* @brief System Clock Configuration
* @retval None
*/
void SystemClock_Config(void) {
RCC_OscInitTypeDef RCC_OscInitStruct = { 0 };
RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 };
/** Configure LSE Drive Capability
*/
HAL_PWR_EnableBkUpAccess();
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_MEDIUMHIGH);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI
| RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_LSE
| RCC_OSCILLATORTYPE_MSI;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_10;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
Error_Handler();
}
/** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4 | RCC_CLOCKTYPE_HCLK2
| RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1
| RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
Error_Handler();
}
}
/**
* @brief Peripherals Common Clock Configuration
* @retval None
*/
void PeriphCommonClock_Config(void) {
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
/** Initializes the peripherals clock
*/
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS
| RCC_PERIPHCLK_RFWAKEUP;
PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSI;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
Error_Handler();
}
/* USER CODE BEGIN Smps */
/* USER CODE END Smps */
}
/**
* @brief I2C1 Initialization Function
* None
* @retval None
*/
static void MX_I2C1_Init(void) {
/* USER CODE BEGIN I2C1_Init 0 */
/* USER CODE END I2C1_Init 0 */
/* USER CODE BEGIN I2C1_Init 1 */
/* USER CODE END I2C1_Init 1 */
hi2c1.Instance = I2C1;
hi2c1.Init.Timing = 0x00B07CB4;
hi2c1.Init.OwnAddress1 = 0;
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c1.Init.OwnAddress2 = 0;
hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
if (HAL_I2C_Init(&hi2c1) != HAL_OK) {
Error_Handler();
}
/** Configure Analogue filter
*/
if (HAL_I2CEx_ConfigAnalogFilter(&hi2c1, I2C_ANALOGFILTER_ENABLE)
!= HAL_OK) {
Error_Handler();
}
/** Configure Digital filter
*/
if (HAL_I2CEx_ConfigDigitalFilter(&hi2c1, 0) != HAL_OK) {
Error_Handler();
}
/* USER CODE BEGIN I2C1_Init 2 */
/* USER CODE END I2C1_Init 2 */
}
/**
* @brief IPCC Initialization Function
* None
* @retval None
*/
static void MX_IPCC_Init(void) {
/* USER CODE BEGIN IPCC_Init 0 */
/* USER CODE END IPCC_Init 0 */
/* USER CODE BEGIN IPCC_Init 1 */
/* USER CODE END IPCC_Init 1 */
hipcc.Instance = IPCC;
if (HAL_IPCC_Init(&hipcc) != HAL_OK) {
Error_Handler();
}
/* USER CODE BEGIN IPCC_Init 2 */
/* USER CODE END IPCC_Init 2 */
}
/**
* @brief RF Initialization Function
* None
* @retval None
*/
static void MX_RF_Init(void) {
/* USER CODE BEGIN RF_Init 0 */
/* USER CODE END RF_Init 0 */
/* USER CODE BEGIN RF_Init 1 */
/* USER CODE END RF_Init 1 */
/* USER CODE BEGIN RF_Init 2 */
/* USER CODE END RF_Init 2 */
}
/**
* @brief RTC Initialization Function
* None
* @retval None
*/
static void MX_RTC_Init(void) {
/* USER CODE BEGIN RTC_Init 0 */
/* USER CODE END RTC_Init 0 */
/* USER CODE BEGIN RTC_Init 1 */
/* USER CODE END RTC_Init 1 */
/** Initialize RTC Only
*/
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;
if (HAL_RTC_Init(&hrtc) != HAL_OK) {
Error_Handler();
}
/** Enable the WakeUp
*/
if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0, RTC_WAKEUPCLOCK_RTCCLK_DIV16)
!= HAL_OK) {
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
/* USER CODE END RTC_Init 2 */
}
/**
* @brief GPIO Initialization Function
* None
* @retval None
*/
static void MX_GPIO_Init(void) {
GPIO_InitTypeDef GPIO_InitStruct = { 0 };
/* USER CODE BEGIN MX_GPIO_Init_1 */
/* USER CODE END MX_GPIO_Init_1 */
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_6 | GPIO_PIN_7, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOB, LD2_Pin | LD3_Pin | LD1_Pin, GPIO_PIN_RESET);
/*Configure GPIO pins : PA6 PA7 */
GPIO_InitStruct.Pin = GPIO_PIN_6 | GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pin : B1_Pin */
GPIO_InitStruct.Pin = B1_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : LD2_Pin LD3_Pin LD1_Pin */
GPIO_InitStruct.Pin = LD2_Pin | LD3_Pin | LD1_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/*Configure GPIO pins : USB_DM_Pin USB_DP_Pin */
GPIO_InitStruct.Pin = USB_DM_Pin | USB_DP_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF10_USB;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pins : B2_Pin B3_Pin */
GPIO_InitStruct.Pin = B2_Pin | B3_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
/*Configure GPIO pins : STLINK_RX_Pin STLINK_TX_Pin */
GPIO_InitStruct.Pin = STLINK_RX_Pin | STLINK_TX_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* USER CODE BEGIN MX_GPIO_Init_2 */
/* USER CODE END MX_GPIO_Init_2 */
}
/* USER CODE BEGIN 4 */
/* USER CODE END 4 */
/**
* @brief This function is executed in case of error occurrence.
* @retval None
*/
void Error_Handler(void) {
/* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return state */
__disable_irq();
while (1) {
}
/* USER CODE END Error_Handler_Debug */
}
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* file: pointer to the source file name
* line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t *file, uint32_t line)
{
/* USER CODE BEGIN 6 */
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */
The debug output from the stm32 cubeIDE is shown below.
2024-11-26 02:10 AM
Hello @junhee
I suggest you try the BLE_p2pServer example from the STM32CubeWB V1.20.0 that should be working fine. After that try to integrate step by step your changes so you can understand the reason behind this hardFault.
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.