cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get the advertising state

Franklin
Associate II

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.

13 REPLIES 13
Christophe Arnal
ST Employee

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
Associate II

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.

Christophe Arnal
ST Employee

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
Associate II

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 ?

Christophe Arnal
ST Employee

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
Associate II

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.

Christophe Arnal
ST Employee

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.

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.

Christophe Arnal
ST Employee

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.