Skip to main content
Associate
Feb 13, 2024 9:09 PM UTC
Question

Connect BLE on B-U585I-IOT02A Board

Hello,

I have flashed the FUS and wireless stack to my B-U585I-IOT02A. However, there are no tutorials on how to set up a simple BLE app with the STBLE Toolbox with this specific board. All of the examples are built for different boards, as listed on this webpage. Does anyone have a small tutorial for how I can setup my STMCubeIDE environment to build a small BLE app to send simple sensor data from my B-U585I-IOT02A to the STBLE Toolbox or something else?

 

Thank you in advance!

This topic has been closed for replies.

10 replies

STTwo-32
ST Technical Moderator
Feb 13, 2024 9:22 PM UTC

Hello @maxwellfite,

I suggest you start from this example and try to adapt it to your needs.

Don't forget to read the readme file of the programme.

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.
Associate
Feb 13, 2024 9:41 PM UTC

Thank you for the quick response. However, when I build the project in the STMCubeIDE, I get the following error:

fatal error: stm32u5xx_hal.h: No such file or directory

Where should I get that file?

Associate
Feb 13, 2024 10:05 PM UTC

If I change the stm32u5xx_hal_conf.h to stm32u5xx_hal.h, I then get the error below:

fatal error: stm32u5xx_hal_rcc.h: No such file or directory

@STTwo-32, why is the implementation missing files and having me change file names?

Associate
Feb 13, 2024 10:21 PM UTC

@STTwo-32, I was able to copy the files from 

https://github.com/STMicroelectronics/stm32u5xx_hal_driver/tree/f1946d68701260860cdb5eae9f7bc5c3ff7f1cd1 

to include, the necessary files. However, now I am receiving the error below:

fatal error: stm32u5xx.h: No such file or directory

Any suggestions? 

 

Associate
Feb 13, 2024 10:37 PM UTC

@STTwo-32, I was able to import all of the necessary files. However, now I am receiving the following build errors:. 

14:34:08 **** Build of configuration Debug for project BLE_AT_Client ****
make -j12 all 
arm-none-eabi-gcc "C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/ble_at_appli.c" -mcpu=cortex-m33 -std=gnu11 -g3 -DDEBUG -DSTM32U585xx -DUSE_HAL_DRIVER -DUSE_B_U585I_IOT02A -c -I../../Inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/CMSIS/Device/ST/STM32U5xx/Include -I../../../../../../../Drivers/STM32U5xx_HAL_Driver/Inc -I../../../../../../../Drivers/BSP/B-U585I-IOT02A -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/Components/stm32wb_at -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Example/User/ble_at_appli.d" -MT"Example/User/ble_at_appli.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Example/User/ble_at_appli.o"
arm-none-eabi-gcc "C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c" -mcpu=cortex-m33 -std=gnu11 -g3 -DDEBUG -DSTM32U585xx -DUSE_HAL_DRIVER -DUSE_B_U585I_IOT02A -c -I../../Inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/CMSIS/Device/ST/STM32U5xx/Include -I../../../../../../../Drivers/STM32U5xx_HAL_Driver/Inc -I../../../../../../../Drivers/BSP/B-U585I-IOT02A -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/Components/stm32wb_at -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Example/User/main.d" -MT"Example/User/main.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Example/User/main.o"
arm-none-eabi-gcc "C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/stm32u5xx_hal_msp.c" -mcpu=cortex-m33 -std=gnu11 -g3 -DDEBUG -DSTM32U585xx -DUSE_HAL_DRIVER -DUSE_B_U585I_IOT02A -c -I../../Inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/CMSIS/Device/ST/STM32U5xx/Include -I../../../../../../../Drivers/STM32U5xx_HAL_Driver/Inc -I../../../../../../../Drivers/BSP/B-U585I-IOT02A -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/Components/stm32wb_at -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Example/User/stm32u5xx_hal_msp.d" -MT"Example/User/stm32u5xx_hal_msp.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Example/User/stm32u5xx_hal_msp.o"
arm-none-eabi-gcc "C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/stm32u5xx_it.c" -mcpu=cortex-m33 -std=gnu11 -g3 -DDEBUG -DSTM32U585xx -DUSE_HAL_DRIVER -DUSE_B_U585I_IOT02A -c -I../../Inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/CMSIS/Device/ST/STM32U5xx/Include -I../../../../../../../Drivers/STM32U5xx_HAL_Driver/Inc -I../../../../../../../Drivers/BSP/B-U585I-IOT02A -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/Components/stm32wb_at -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Example/User/stm32u5xx_it.d" -MT"Example/User/stm32u5xx_it.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Example/User/stm32u5xx_it.o"
make: *** No rule to make target 'C:/Users/maxwe/github_repos/STM32CubeU5/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal.c', needed by 'Drivers/STM32U5xx_HAL_Driver/stm32u5xx_hal.o'. Stop.
make: *** Waiting for unfinished jobs....
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c: In function 'main':
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:65:3: warning: implicit declaration of function 'HAL_Init'; did you mean 'HAL_LIN_Init'? [-Wimplicit-function-declaration]
 65 | HAL_Init();
 | ^~~~~~~~
 | HAL_LIN_Init
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/stm32u5xx_it.c: In function 'SysTick_Handler':
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/stm32u5xx_it.c:138:3: warning: implicit declaration of function 'HAL_IncTick' [-Wimplicit-function-declaration]
 138 | HAL_IncTick();
 | ^~~~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/stm32u5xx_it.c: In function 'EXTI13_IRQHandler':
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/stm32u5xx_it.c:169:24: error: 'hpb_exti' undeclared (first use in this function)
 169 | HAL_EXTI_IRQHandler(&hpb_exti[0]);
 | ^~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/stm32u5xx_it.c:169:24: note: each undeclared identifier is reported only once for each function it appears in
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:73:3: warning: implicit declaration of function 'BSP_LED_Init' [-Wimplicit-function-declaration]
 73 | BSP_LED_Init(LED_GREEN);
 | ^~~~~~~~~~~~
make: *** [Example/User/subdir.mk:40: Example/User/stm32u5xx_it.o] Error 1
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:73:16: error: 'LED_GREEN' undeclared (first use in this function)
 73 | BSP_LED_Init(LED_GREEN);
 | ^~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:73:16: note: each undeclared identifier is reported only once for each function it appears in
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:74:16: error: 'LED_RED' undeclared (first use in this function)
 74 | BSP_LED_Init(LED_RED);
 | ^~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:79:3: warning: implicit declaration of function 'BSP_LED_Off' [-Wimplicit-function-declaration]
 79 | BSP_LED_Off(LED_GREEN);
 | ^~~~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/ble_at_appli.c:42:22: error: unknown type name 'Button_TypeDef'
 42 | void BSP_PB_Callback(Button_TypeDef Button)
 | ^~~~~~~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:88:3: warning: implicit declaration of function 'HAL_Delay' [-Wimplicit-function-declaration]
 88 | HAL_Delay(2000);
 | ^~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/ble_at_appli.c: In function 'stm32wb_at_BLE_EVT_WRITE_cb':
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/ble_at_appli.c:110:7: warning: implicit declaration of function 'BSP_LED_Off' [-Wimplicit-function-declaration]
 110 | BSP_LED_Off(LED_GREEN);
 | ^~~~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:106:3: warning: implicit declaration of function 'BSP_PB_Init' [-Wimplicit-function-declaration]
 106 | BSP_PB_Init(BUTTON_USER, BUTTON_MODE_EXTI);
 | ^~~~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/ble_at_appli.c:110:19: error: 'LED_GREEN' undeclared (first use in this function)
 110 | BSP_LED_Off(LED_GREEN);
 | ^~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/ble_at_appli.c:110:19: note: each undeclared identifier is reported only once for each function it appears in
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:106:15: error: 'BUTTON_USER' undeclared (first use in this function)
 106 | BSP_PB_Init(BUTTON_USER, BUTTON_MODE_EXTI);
 | ^~~~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/ble_at_appli.c:114:7: warning: implicit declaration of function 'BSP_LED_On' [-Wimplicit-function-declaration]
 114 | BSP_LED_On(LED_GREEN);
 | ^~~~~~~~~~
At top level:
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/ble_at_appli.c:29:32: warning: 'tick_snapshot2' defined but not used [-Wunused-variable]
 29 | static uint32_t tick_snapshot, tick_snapshot2;
 | ^~~~~~~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/ble_at_appli.c:29:17: warning: 'tick_snapshot' defined but not used [-Wunused-variable]
 29 | static uint32_t tick_snapshot, tick_snapshot2;
 | ^~~~~~~~~~~~~
make: *** [Example/User/subdir.mk:34: Example/User/ble_at_appli.o] Error 1
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:106:28: error: 'BUTTON_MODE_EXTI' undeclared (first use in this function)
 106 | BSP_PB_Init(BUTTON_USER, BUTTON_MODE_EXTI);
 | ^~~~~~~~~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c: In function 'Error_Handler':
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:317:3: warning: implicit declaration of function 'BSP_LED_On' [-Wimplicit-function-declaration]
 317 | BSP_LED_On(LED_RED);
 | ^~~~~~~~~~
C:/Users/maxwe/github_repos/STM32CubeU5/Projects/B-U585I-IOT02A/Applications/BLE/BLE_AT_Client/Src/main.c:317:14: error: 'LED_RED' undeclared (first use in this function)
 317 | BSP_LED_On(LED_RED);
 | ^~~~~~~
make: *** [Example/User/subdir.mk:36: Example/User/main.o] Error 1
"make -j12 all" terminated with exit code 2. Build might be incomplete.

14:34:09 Build Failed. 13 errors, 11 warnings. (took 616ms)

I was under the impression that I would be able to build this project as an example. Do you have a detailed walkthrough for this example?

Associate
Feb 14, 2024 1:07 AM UTC

@STTwo-32, now I just seem to be hung up here:

--------------------------------------------
Start of the STM32WB5M module AT example.
Run ST BLE sensor application on your smartphone and connect to you device. 
Press user button:
- once to notify a value.
- twice to toggle the BLE service.
 - -------------------------------------------
TX: AT
Associate
Feb 14, 2024 1:32 AM UTC

@STTwo-32 please see my response to the post below, where other users are having the same issue:

https://community.st.com/t5/stm32-mcus-wireless/can-t-detect-bluetooth-from-b-u585i-iot02a-board/m-p/575035

Associate
Feb 14, 2024 4:44 AM UTC

My source code is below for my main.c:

/**
 ******************************************************************************
 * @file BLE/BLE_AT_Client/Src/main.c
 * @author MCD Application Team
 * @brief Main program body
 ******************************************************************************
 * @attention
 *
 * Copyright (c) 2021 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.
 *
 ******************************************************************************
 */

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include <stdio.h>

#include "stm32wb_at.h"
#include "stm32wb_at_ble.h"
#include "stm32wb_at_client.h"
#include "ble_at_appli.h"

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
UART_HandleTypeDef huart1;
UART_HandleTypeDef huart4;

/* Private function prototypes -----------------------------------------------*/
#if defined (__ICCARM__) || defined (__ARMCC_VERSION)
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#elif defined(__GNUC__)
 /* With GCC, small printf (option LD Linker->Libraries->Small printf
 set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#endif /* __ICCARM__ || __ARMCC_VERSION */

static void SystemClock_Config(void);
static void CACHE_Enable(void);
static void MX_USART1_UART_Init(void);
static void MX_USART4_UART_Init(void);

/* Private functions ---------------------------------------------------------*/

/**
 * @brief Main program
 * @PAram None
 * @retval None
 */
int main(void)
{
 uint8_t status = 0;
 /* STM32U5xx HAL library initialization:
 - Configure the Flash prefetch
 - Configure the Systick to generate an interrupt each 1 msec
 - Set NVIC Group Priority to 3
 - Low Level Initialization
 */
 HAL_Init();

 /* Enable the Instruction Cache */
 CACHE_Enable();

 /* Configure the System clock to have a frequency of 160 MHz */
 SystemClock_Config();

 BSP_LED_Init(LED_GREEN);
 BSP_LED_Init(LED_RED);

 MX_USART1_UART_Init();
 MX_USART4_UART_Init();

 BSP_LED_Off(LED_GREEN);
 printf("--------------------------------------------\n\r");
 printf("Start of the STM32WB5M module AT example.\n\r");
 printf("Run ST BLE sensor application on your smartphone and connect to you device.\n\r");
 printf("Press user button:\n\r");
 printf(" - once to notify a value.\n\r");
 printf(" - twice to toggle the BLE service.\n\r");
 printf("--------------------------------------------\n\r");

 HAL_Delay(2000);
 status |= stm32wb_at_Init(&at_buffer[0], sizeof(at_buffer));
 status |= stm32wb_at_client_Init();

 /* Test the UART communication link with BLE module */
 status |= stm32wb_at_client_Query(BLE_TEST);
 HAL_Delay(1000);

 if(status != 0)
 {
 Error_Handler();
 }
 /* Send a BLE AT command to start the BLE P2P server application */
 stm32wb_at_BLE_SVC_t param_BLE_SVC;
 global_svc_index = 1;
 param_BLE_SVC.index = global_svc_index;
 stm32wb_at_client_Set(BLE_SVC, &param_BLE_SVC);
 HAL_Delay(2000);
 stm32wb_at_client_Query(BLE_SVC);
 BSP_PB_Init(BUTTON_USER, BUTTON_MODE_EXTI);

 /* Infinite loop */
 while (1)
 {
 }
}

/**
 * @brief System Clock Configuration
 * The system Clock is configured as follows :
 * System Clock source = PLL (MSI)
 * SYSCLK(Hz) = 160000000
 * HCLK(Hz) = 160000000
 * AHB Prescaler = 1
 * APB1 Prescaler = 1
 * APB2 Prescaler = 1
 * APB3 Prescaler = 1
 * MSI Frequency(Hz) = 4000000
 * PLL_MBOOST = 1
 * PLL_M = 1
 * PLL_N = 80
 * PLL_Q = 2
 * PLL_R = 2
 * PLL_P = 2
 * Flash Latency(WS) = 4
 * @PAram None
 * @retval None
 */
void SystemClock_Config(void)
{
 RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
 RCC_OscInitTypeDef RCC_OscInitStruct = {0};

 /* Enable voltage range 1 for frequency above 100 Mhz */
 __HAL_RCC_PWR_CLK_ENABLE();
 HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);

 /* Switch to SMPS regulator instead of LDO */
 HAL_PWREx_ConfigSupply(PWR_SMPS_SUPPLY);

 __HAL_RCC_PWR_CLK_DISABLE();

 /* MSI Oscillator enabled at reset (4Mhz), activate PLL with MSI as source */
 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
 RCC_OscInitStruct.MSIState = RCC_MSI_ON;
 RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_4;
 RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
 RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
 RCC_OscInitStruct.PLL.PLLMBOOST = RCC_PLLMBOOST_DIV1;
 RCC_OscInitStruct.PLL.PLLM = 1;
 RCC_OscInitStruct.PLL.PLLN = 80;
 RCC_OscInitStruct.PLL.PLLR = 2;
 RCC_OscInitStruct.PLL.PLLP = 2;
 RCC_OscInitStruct.PLL.PLLQ = 2;
 RCC_OscInitStruct.PLL.PLLFRACN= 0;
 if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
 {
 /* Initialization Error */
 while(1);
 }

 /* Select PLL as system clock source and configure bus clocks dividers */
 RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | \
 RCC_CLOCKTYPE_PCLK2 | RCC_CLOCKTYPE_PCLK3);
 RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
 RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
 RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
 RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
 RCC_ClkInitStruct.APB3CLKDivider = RCC_HCLK_DIV1;
 if(HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK)
 {
 /* Initialization Error */
 while(1);
 }
}

/**
 * @brief USART1 Initialization Function
 * @PAram None
 * @retval None
 */
static void MX_USART1_UART_Init(void)
{

 /* USER CODE BEGIN USART1_Init 0 */

 /* USER CODE END USART1_Init 0 */

 /* USER CODE BEGIN USART1_Init 1 */

 /* USER CODE END USART1_Init 1 */
 huart1.Instance = USART1;
 huart1.Init.BaudRate = 115200;
 huart1.Init.WordLength = UART_WORDLENGTH_8B;
 huart1.Init.StopBits = UART_STOPBITS_1;
 huart1.Init.Parity = UART_PARITY_NONE;
 huart1.Init.Mode = UART_MODE_TX_RX;
 huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
 huart1.Init.OverSampling = UART_OVERSAMPLING_16;
 huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
 huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
 huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
 if (HAL_UART_Init(&huart1) != HAL_OK)
 {
 Error_Handler();
 }
 if (HAL_UARTEx_SetTxFifoThreshold(&huart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
 {
 Error_Handler();
 }
 if (HAL_UARTEx_SetRxFifoThreshold(&huart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
 {
 Error_Handler();
 }
 if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK)
 {
 Error_Handler();
 }
 /* USER CODE BEGIN USART1_Init 2 */

 /* USER CODE END USART1_Init 2 */

}

/**
 * @brief USART4 Initialization Function
 * @PAram None
 * @retval None
 */
static void MX_USART4_UART_Init(void)
{

 /* USER CODE BEGIN USART4_Init 0 */

 /* USER CODE END USART4_Init 0 */

 /* USER CODE BEGIN USART4_Init 1 */

 /* USER CODE END USART4_Init 1 */
 huart4.Instance = UART4;
 huart4.Init.BaudRate = 9600;
 huart4.Init.WordLength = UART_WORDLENGTH_8B;
 huart4.Init.StopBits = UART_STOPBITS_1;
 huart4.Init.Parity = UART_PARITY_NONE;
 huart4.Init.Mode = UART_MODE_TX_RX;
 huart4.Init.HwFlowCtl = UART_HWCONTROL_NONE;
 huart4.Init.OverSampling = UART_OVERSAMPLING_16;
 huart4.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
 huart4.Init.ClockPrescaler = UART_PRESCALER_DIV1;
 huart4.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
 if (HAL_UART_Init(&huart4) != HAL_OK)
 {
 Error_Handler();
 }
 if (HAL_UARTEx_SetTxFifoThreshold(&huart4, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
 {
 Error_Handler();
 }
 if (HAL_UARTEx_SetRxFifoThreshold(&huart4, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
 {
 Error_Handler();
 }
 if (HAL_UARTEx_DisableFifoMode(&huart4) != HAL_OK)
 {
 Error_Handler();
 }
 /* USER CODE BEGIN USART4_Init 2 */

 /* USER CODE END USART4_Init 2 */

}

/**
 * @brief Enable ICACHE with 1-way set-associative configuration.
 * @PAram None
 * @retval None
 */
static void CACHE_Enable(void)
{
 /* Configure ICACHE associativity mode */
 HAL_ICACHE_ConfigAssociativityMode(ICACHE_1WAY);

 /* Enable ICACHE */
 HAL_ICACHE_Enable();
}

/**
 * @brief Retargets the C library printf function to the USART.
 * @PAram None
 * @retval None
 */
PUTCHAR_PROTOTYPE
{
 /* Place your implementation of fputc here */
 /* e.g. write a character to the USART1 and Loop until the end of transmission */
 HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);

 return ch;
}

/**
 * @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 */
 /* Turn LED6 on */
 BSP_LED_On(LED_RED);
 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.
 * @PAram file: pointer to the source file name
 * @PAram line: assert_param error line source number
 * @retval None
 */
void assert_failed(uint8_t *file, uint32_t line)
{
 /* 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) */

 /* Infinite loop */
 while (1)
 {
 }
}
#endif
Associate
Feb 14, 2024 3:25 PM UTC

@STTwo-32, it looks like the community is looking for an answer from STM on this (https://community.st.com/t5/stm32-mcus-wireless/can-t-detect-bluetooth-from-b-u585i-iot02a-board/m-p/575035). We will have to move mountains to pivot from this board at this point. Help would be greatly appreciated.

STTwo-32
ST Technical Moderator
Apr 8, 2024 4:12 PM UTC

Hello @maxwellfite 

Sorry for my late replay. I've been able to make it work just following the Readme of the example.

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.