Skip to main content
Franklin
Associate II
June 23, 2019
Question

Can't get the advertising state

  • June 23, 2019
  • 9 replies
  • 4246 views

Hello everyone,

I'm trying to build a server application with the STM32WB55 but I can't get the advertising state. I took example on the server example in the STM32Cube_FW_WB_V1.0.0 and I think it is pretty similar but it doen't work as intended.

I made some researches and I find someone with the same problem here : https://community.st.com/s/question/0D50X0000AhPJcCSQW/trying-to-get-the-advertising-state . However the proposed solution didn't work for me and I still can't get the advertising state. The programm doesn't run APPE_SysUserEvtRx() because I don't receive VS_HCI_C2_Ready I think.

Would anyone has any idea on why it behaves this way and how to solve this problem ?

Thank you.

This topic has been closed for replies.

9 replies

ST Employee
June 24, 2019

Hello,

The first thing to check is where the event flow reporting is broken.

Could you please check Figure 50. System ready event notification from the Application Note:

AN5289: Building wireless applications with STM32WB Series microcontrollers 

Its shows which API are called from the interrupt up to the user.

Most of the time, the root cause is part of this short list:

Regards.

Franklin
FranklinAuthor
Associate II
June 24, 2019

Hello,

Thank you for your response.

I do have both of the interrupt handler IPCC_C1_RX_IRQHandler() and IPCC_C1_TX_IRQHandler() but it still does not work with them.

I checked where the event flow could be broken. I found that shci_notify_asynch_evt is not called.

I am sorry but how could I find the linker file ? I am using Keil uvison5 if it can help.

Thank you for your help.

ST Employee
June 25, 2019

Hello,

The linker file for keil is located in

\Firmware\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_p2pServer\MDK-ARM\stm32wb55xx_flash_cm4.sct

Please make sure your keil project links with that one. The setting is in the linker tab of the option of the project where "Use Memory Layout from Target Dialog" shall be unchecked and the entry box "Scatter File" below shall point to the linker file above.

You may also quickly check in you mapfile where is located TL_RefTable. By default, it should be 0x20030000.

If it is located somewhere at 0x2000xxxx, it means for sure something is wrong in the linker file.

Basically, we are checking that all buffers used for communication between the CPU1 and CPU2 are located in the SRAM2 so that it could be accessed by CPU2.

Regards.

Franklin
FranklinAuthor
Associate II
June 26, 2019

Hello,

I found that the "Use Memory Layout from Target Dialog" was checked. So I unchecked it and the linker file is the right one but it stil does not work.

The rest seems ok and I could not find where does the issue come from.

At  0x20030000 is SRAM2A_START_SECURE_ADDR_0. I suppose it is what it supposed to have ?

ST Employee
June 27, 2019

Hello,

Could you please check the two points below :

  • At which address TL_RefTable has been mapped ? ( this can be found in the map file)
  • What is the value of the user option byte IPCCDBA ?

IPCCDBA should be set to 0

TL_RefTable should be mapped @0x20030000

Regards

Franklin
FranklinAuthor
Associate II
June 29, 2019

Hello,

I checked and IPCCDBA is set to 0 AND Tl_RefTable is mapped at 0x2003000. Is there another possibility which could be the reason of this problem ?

Thank you for your help.

ST Employee
July 1, 2019

Hello,

In the flow, there are a couple of API called in the interrupt context and then some others in the background context.

The last one called from the IPCC interrupt context before forwarding the request to the background is shci_notify_asynch_evt().

Are you able to receive it at startup ?

Regards.

Franklin
FranklinAuthor
Associate II
July 7, 2019

Hello,

No I can't receive it.

I did some tracking and here what I found (I don't know if it can help to determine the issue) :

  • APP_BLE_Init isn't called()
  • APPE_SysUserEvtRx() isn't called
  • appe_Tl()_Init is called
  • shci_init() is called
  • APPE_Init() is called
  • shci_notify_asynch_evt() is not called
  • TlUserEvtReceived() isn't called
  • TlInit() is called
  • shci_user_evt_proc() isn't called
  • IPCC_C1_RX_IRQHandler() isn't called
  • IPCC_C1_TX_IRQHandler() isn't called

The fact that shci_user_evt_proc() makes me think that CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID isn't registered, is it right ?

Thank you for your help.

DPesk.1
Associate II
March 18, 2021

Hello,

I've the same problem.

All buffers (like, EvtPool, SystemCmdBuffer, SystemSpareEvtBuffer,BleSpareEvtBuffer) locate in SRAM2.

But IPCC_C1_RX_IRQHandler is not called.

What did you do with it?

ST Employee
July 8, 2019

Hello,

As long as IPCC_C1_RX_IRQHandler() is not called, it means either

  • The IPCC interrupt is masked
  • The CM0+ has not started
  • The CM0+ has started and crashed.

IPCC_C1_RX_IRQHandler() is the very first communication from the CPU2 at startup.

What is left to be checked is the pool of asynchronous event that shall be located in SRAM2.

in appe_Tl_Init(), we are providing to the CPU2 the buffers

EvtPool, SystemCmdBuffer, SystemSpareEvtBuffer,BleSpareEvtBuffer. They shall all be located in SRAM2.

If this is the case, that could help if you can provide the .map file.

I would also load an unmodified working project to check the debug setup. The fact you do not received IPCC_C1_RX_IRQHandler() whereas all buffers are properly located is very strange. We need to make sure this is really the case.

Regards.

Camille Louapre
Associate
November 28, 2019

Hello all,

If some of you encounter problems to detect the Stack ready event (like I), please find my code below (working fine).

Note that this event is named SHCI_SUB_EVT_CODE_READY in shci.h, not VS_HCI_C2_Ready, as mentioned earlier in this thread.

void APPE_SysUserEvtRx (void * pv_iPayload)
{
 tSHCI_UserEvtRxParam * pst_userEventRxParam = NULL;
 TL_AsynchEvt_t st_asynchEvt = {0};
 
 /* Get SHCI evt code from payload */
 pst_userEventRxParam = (tSHCI_UserEvtRxParam*)pv_iPayload;
 memcpy(&st_asynchEvt, pst_userEventRxParam->pckt->evtserial.evt.payload, sizeof(st_asynchEvt));
 
 /* SHCI_SUB_EVT_CODE_READY => BLE stack is ready on M0+ MCU */ 
 if ((SHCI_EVTCODE == pst_userEventRxParam->pckt->evtserial.evt.evtcode) && 
 (SHCI_SUB_EVT_CODE_READY == st_asynchEvt.subevtcode))
 {
 /* Your code here */
 }
 else {/*Nothing */}
}

Enyoy.

Camille

AValt.1
Associate II
September 16, 2020

Hi Camille,

Where did you find this solution? is in any official ST document?

Regards

�?lvaro

ST Employee
September 22, 2020

​Hello,

Examples can be found in both Ble_Ota and BLE_RfWithFlash projects.

Regards.