2019-06-23 04:12 AM
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.
2019-06-24 04:34 AM
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.
2019-06-24 04:11 PM
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.
2019-06-25 04:21 AM
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.
2019-06-26 02:10 PM
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 ?
2019-06-27 12:40 AM
Hello,
Could you please check the two points below :
IPCCDBA should be set to 0
TL_RefTable should be mapped @0x20030000
Regards
2019-06-29 10:25 AM
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.
2019-07-01 03:37 AM
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.
2019-07-07 08:46 AM
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) :
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.
2019-07-08 04:05 AM
Hello,
As long as IPCC_C1_RX_IRQHandler() is not called, it means either
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.