cancel
Showing results for 
Search instead for 
Did you mean: 

BLE not advertising - STM32WB5MMGH

LR.2
Associate III

Hi,
I'm working with stm32wb5mmgh to transmit data. The thing is BLE starts to advertise only in the debug mode if I upload it in the device its not showing. So what I did I turned on led when it starts to advertise as I mentioned in the below code.

 

 

 

/* Update Advertising data */
ret = aci_gap_update_adv_data(sizeof(a_AdvData), (uint8_t*) a_AdvData);
if (ret != BLE_STATUS_SUCCESS)
{
APP_DBG_MSG("==>> Start Fast Advertising Failed , result: %d \n\r", ret);
}
else
{
APP_DBG_MSG("==>> Success: Start Fast Advertising \n\r");
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_SET);
}

 

 

 

The LED turned on after I uploaded the code but the BLE is not showing.

Used FUS Version : v1.2.0.0, STACK Version : v1.16.0.4, stm32wb5x_BLE_Stack_full_fw.bin.

Also I change the linker Script as mentioned in this wiki link. I also share the linker script.

 

 

 

/*
******************************************************************************
**
**  File        : LinkerScript.ld
**
**  Author      : STM32CubeIDE
**
**  Abstract    : Linker script for STM32WB5MMG Device
**                      1024Kbytes FLASH
**                      256Kbytes RAM
**
**                Set heap size, stack size and stack location according
**                to application requirements.
**
**                Set memory bank area and size if external memory is used.
**
**  Target      : STMicroelectronics STM32
**
**  Distribution: The file is distributed as is without any warranty
**                of any kind.
**
*****************************************************************************
** @attention
**
** Copyright (c) 2022 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.
**
*****************************************************************************
*/

/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = ORIGIN(RAM1) + LENGTH(RAM1);    /* end of RAM1 */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200;      /* required amount of heap  */
_Min_Stack_Size = 0x400;   /* required amount of stack */

/* Specify the memory areas */
MEMORY
{
FLASH (rx)                 : ORIGIN = 0x08000000, LENGTH = 512K
RAM1 (xrw)                 : ORIGIN = 0x20000008, LENGTH = 0x2FFF8
RAM_SHARED (xrw)           : ORIGIN = 0x20030000, LENGTH = 2K
RAMB_SHARED (xrw)          : ORIGIN = 0x20038000, LENGTH = 10K
}

/* Define output sections */
SECTIONS
{
  /* The startup code goes first into FLASH */
  .isr_vector :
  {
    . = ALIGN(4);
    KEEP(*(.isr_vector)) /* Startup code */
    . = ALIGN(4);
  } >FLASH

  /* The program code and other data goes into FLASH */
  .text :
  {
    . = ALIGN(4);
    *(.text)           /* .text sections (code) */
    *(.text*)          /* .text* sections (code) */
    *(.glue_7)         /* glue arm to thumb code */
    *(.glue_7t)        /* glue thumb to arm code */
    *(.eh_frame)

    KEEP (*(.init))
    KEEP (*(.fini))

    . = ALIGN(4);
    _etext = .;        /* define a global symbols at end of code */
  } >FLASH

  /* Constant data goes into FLASH */
  .rodata :
  {
    . = ALIGN(4);
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
    . = ALIGN(4);
  } >FLASH

  .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
  .ARM : {
    __exidx_start = .;
    *(.ARM.exidx*)
    __exidx_end = .;
  } >FLASH

  .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array*))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  } >FLASH
  .init_array :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT(.init_array.*)))
    KEEP (*(.init_array*))
    PROVIDE_HIDDEN (__init_array_end = .);
  } >FLASH
  .fini_array :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT(.fini_array.*)))
    KEEP (*(.fini_array*))
    PROVIDE_HIDDEN (__fini_array_end = .);
  } >FLASH

  /* used by the startup to initialize data */
  _sidata = LOADADDR(.data);

  /* Initialized data sections goes into RAM, load LMA copy after code */
  .data :
  {
    . = ALIGN(4);
    _sdata = .;        /* create a global symbol at data start */
    *(.data)           /* .data sections */
    *(.data*)          /* .data* sections */
    *(.RamFunc)        /* .RamFunc sections */
    *(.RamFunc*)       /* .RamFunc* sections */

    . = ALIGN(4);
    _edata = .;        /* define a global symbol at data end */
  } >RAM1 AT> FLASH

  /* Uninitialized data section */
  . = ALIGN(4);
  .bss :
  {
    /* This is used by the startup in order to initialize the .bss section */
    _sbss = .;         /* define a global symbol at bss start */
    __bss_start__ = _sbss;
    *(.bss)
    *(.bss*)
    *(COMMON)

    . = ALIGN(4);
    _ebss = .;         /* define a global symbol at bss end */
    __bss_end__ = _ebss;
  } >RAM1

  /* User_heap_stack section, used to check that there is enough RAM left */
  ._user_heap_stack :
  {
    . = ALIGN(8);
    PROVIDE ( end = . );
    PROVIDE ( _end = . );
    . = . + _Min_Heap_Size;
    . = . + _Min_Stack_Size;
    . = ALIGN(8);
  } >RAM1

  /* Remove information from the standard libraries */
  /DISCARD/ :
  {
    libc.a ( * )
    libm.a ( * )
    libgcc.a ( * )
  }

  .ARM.attributes 0       : { *(.ARM.attributes) }
   MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
   MB_MEM1 (NOLOAD)       : { *(MB_MEM1) } >RAMB_SHARED

   /* used by the startup to initialize .MB_MEM2 data */
  _siMB_MEM2 = LOADADDR(.MB_MEM2);
  .MB_MEM2 :
  {
    _sMB_MEM2 = . ;
    *(.MB_MEM2) ;
    _eMB_MEM2 = . ;
  } >RAMB_SHARED AT> FLASH
}

 

 

 

can any one help me with this issue??!!

3 REPLIES 3
Roger SHIVELY
ST Employee

Hello @LR.2 ,

There has been a case created to resolve this question and we will be reaching out to you directly.

Regards,
Roger

Hey Roger,

Thanks for your timely response.  I hope to hear from you soon.

Regards,
Lakshmanan

Remy ISSALYS
ST Employee

Hello,

The modification around the linker script describes in the wiki pages need to be done when using extended binaries (stm32wbxx_BLE_Stack_full_extended_fw.bin, stm32wbxx_BLE_HCILayer_extended_fw.bin), in your case it's not needed. You are currently facing to this issue:
https://community.st.com/t5/wireless-mcu/pay-attention-issue-in-stm32cubeide-linker-template-file-causes/m-p/55840

Best Regards