Reply not received while sending a create_db message in the empty_template_ext project

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
18 posts / 0 new
Last post
tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Reply not received while sending a create_db message in the empty_template_ext project

Hi,

I am trying to modify the empty_template_ext project to use the cust1 profile. I added my characteristics details in the user_custs1_def.h/.c files and included "custs1.h" in user_profiles_config.h

When I send the message to create the cust1 DB, I do not receive any reply. I've attached a screenshot of the messages sent and received from the host(which is a modified version of the host_proxr project).

I've tested the working of the characteristics by modifying the prox_reporter_ext project and this had worked as expected.

I'm unable to find the function which handles the UART messages on the DA14580. Is there any way to debug this function?

Thanks,

Gowtham

Keywords:
Attachment:
Device:
PM_Dialog
Offline
Last seen:5 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi tsgowtham,

Hi tsgowtham,

My apologies but for me it’s nor clear what is the issue. Could you please clarify your question?

If I understood correctly, you would like to print debugging messages over UART? If yes, please try to use the arch_printf() function. Take a look at CFG_PRINTF macro in da1458x_config_basic.h header file.

Thanks, PM_Dialog

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
No, I'm not trying to print

No, I'm not trying to print debug messages.

我试图使用emp custs1概要文件ty_template_ext project. When I send the CUSTS1_CREATE_DB_REQ message to the DA14580, I do not receive any reply from it.

PM_Dialog
Offline
Last seen:5 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi tsgowtham,

Hi tsgowtham,

My apologies - it was a misunderstanding in my side. Let me check it and I'll get back to you..

Thanks, PM_Dialog

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Hi PM_dialog,

Hi PM_dialog,

Any update on this issue?

PM_Dialog
Offline
Last seen:5 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi tsgowtham,

Hi tsgowtham,

Could you please run it in debug mode and add a break porin into app_custs1_create_db() function? Is it executed properly, or the code gets stuck?

Thanks, PM_Dialog

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Hi PM_Dialog,

Hi PM_Dialog,

I'm using the external UART template, so I believe that app_custs1_create_db() is not called in the external projects. I did place a breakpoint in custs1_create_db_req_handler() but the code never hit this breakpoint

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Hi PM_dialog,

Hi PM_dialog,

Any update on this issue?

PM_Dialog
Offline
Last seen:5 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi tsgowtham,

Hi tsgowtham,

My recommendation would be to follow the pxp_reporter_ext in order to add the custom profile. In the pxp_reporter_ext project, you can follow how the proximity Monitor and the DISC profiles are enabled. Then, you should run it in debug mode, try to send to send the appropriate commands over UART and check is the app_custs1_create_db() is executed. Please add a breakpoint there and check if that function is getting triggered.

Thanks, PM_Dialog

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Hi PM_Dialog,

Hi PM_Dialog,

You have mentioned pxp_reporter_ext project but I couldn't find such a project under the target_apps folder. I take it that you meant the prox_reporter_ext project. I have a modified version of it where I have added the cust1 task and it works perfectly for prototyping. I don't have any issues in creating the db or connectiong to a device or sending data, it works as expected. But this is only for the prox_reporter_ext project.

But now I would like to make a project for production code and that's why I used empty_template_ext.

And as I have mentioned in one of my older comments, since this is an external program, is it required for app_custs1_create_db() to be called?? Because in user_custs_config.c when BLE_APP_PRESENT is 0 (which I believe is the case for external), app_custs1_create_db and app_custs1_enable are replaced by NULL and NULL. And the prox_reporter_ext project didn't have a definition for it.

Thanks

Gowtham

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Hi PM_Dialog,

Hi PM_Dialog,

Any progress on this issue? I'm close to my deadlines and it would be great if this can be solved soon

PM_Dialog
Offline
Last seen:5 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi tsgowtham,

Hi tsgowtham,

My apologies – it was a typo, I meant the prox_reporter_ext project of the SDK.

Let me ask you some questions in order to understand the steps that you have already done :

In case of prox_reporter_ext project, the custom 1 profile is not included – only the proximity Monitor and the DISC profiles are enabled.

To do so, you modified the pro_reporter_ext project and added the custom 1 profile.

In this step, if I understood correctly there is not any problem - the app_custs1_create_db() is executed correctly.

Did you add a break point to verify it?

So, in case of empty_template_ext, you have followed exactly the same steps in order to include the custom1 profile. Is that correct?

However, the app_custs1_create_db() is never executed – (this is the problem). Please correct me if it is anything wrong.

Can you please run the empty_template_ext project in debug mode and add a break point in that function? What is the behavior? Does the break point hit, or does the firmware get stack anywhere (WDOG, NMI , any assertion etc) ?

Thanks, PM_Dialog

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Hi PM_Dialog,

Hi PM_Dialog,

Below are the answers to the questions you asked

Q : " the app_custs1_create_db() is executed correctly. Did you add a break point to verify it?"

Ans: On my proxr_reporter_ext, I am able to connect to it and view the profile. So I believe the DB creation is occuring.

About if app_custs1_create_db is executed, I had tried it sometime ago and it did not hit the breakpoint. I will verify it again tomorrow and get back to you on that.

Also, if I understood the below code snipppet correctly, app_custs1_create_db is not supposed to be called for ext project.

const struct cust_prf_func_callbacks cust_prf_funcs[] = { #if (BLE_CUSTOM1_SERVER) { TASK_CUSTS1, custs1_att_db, CUST1_IDX_NB, #if (BLE_APP_PRESENT) app_custs1_create_db, app_custs1_enable, #else NULL, NULL, #endif custs1_init, NULL }, #endif #if (BLE_CUSTOM2_SERVER) { TASK_CUSTS2, NULL, 0, #if (BLE_APP_PRESENT) app_custs2_create_db, app_custs2_enable, #else NULL, NULL, #endif custs2_init, NULL }, #endif {TASK_NONE, NULL, 0, NULL, NULL, NULL, NULL}, // DO NOT MOVE. Must always be last };

I believe that BLE_APP_PRESENT is 0 for external projects.

Q: "in case of empty_template_ext, you have followed exactly the same steps in order to include the custom1 profile. Is that correct?"

Ans: Yes, I have followed the same steps

Q : "However, the app_custs1_create_db() is never executed – (this is the problem)"

Ans: I believe it is not executed and am not sure if it is supposed to be executed for external projects.

I'll place breakpoints in the function and check for assertions and confirm the behaviour tomorrrow. Please do let me know if app_custs1_create_db is supposed to be called for ext projects

Thanks

Edit: I was unable to find app_custs1_create_db in my project folders. Is this function supposed to exist on the code for the DA14580 or the master MCU?

PM_Dialog
Offline
Last seen:5 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi tsgowtham,

Hi tsgowtham,

Just to summarize : In case of prox_reporter_ext, did you add a BKPT into the app_custs1_create_db() ? Can you please indicate if the app_custs1_create_db() is getting triggered?

If yes, can you verify the same into the empty_template_ext() ?

I assume that the app_custs1_create_db() should be called. Would it be possible to share both projects with the modifications you have done?

Thanks, PM_Dialog

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Hi PM_dialog,

Hi PM_dialog,

对不起,the delay in replying. I got confused and was checking the target project for the definition of app_custs1_create_db. app_custs1_create_db is being called in the host project when I ran it with empty_template_ext.

I'll share the projects by tomorrow

Thanks

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Hi PM_Dialog,

Hi PM_Dialog,

I'm attaching the link to the 2 target projects for proxr_reporter_ext and empty_template_ext and the host windows proxr project.

https://drive.google.com/file/d/1LUbIPkL4PQhfg8T8tT-a_YadCQJolqZm/view?u...

I couldn't upload them as it exceeded the size limit.

Thanks

Gowtham

tsgowtham
Offline
Last seen:3 months 2 weeks ago
加入:2020-05-04 12:39
Hi PM_Dialog,

Hi PM_Dialog,

Were you able to try the projects I have shared? Any updates on this?

Thanks

PM_Dialog
Offline
Last seen:5 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi tsgowtham,

Hi tsgowtham,

Apologies for my late response. Just run your projects, so find below my comments :

In case of prox_reporter_ext, the project is running properly ( as you have already mentioned ) – the device starts advertising - I can connect and see the PROXR, DISS , SPOTAR and CUSTS1 profiles. I am running both \binaries\host\windows\proximity\reporter\host_proxr_sdk.exe and your provided application.

In case of empty_template_ext, the device cannot start advertising neither with the usage of SDK host_proxr_sdk.exe nor your provided Windows application.

你能在你身边请检查如果是开始吗advertising?

This can be replicated in the prox_reporter_ext if you comment out the following includes in the user_profiles_config.h :

#include "proxr.h"

#include "diss.h"

#include "spotar.h"

This is expected because the host_proxr_sdk.exe send GTL commands for the creation of the aforementioned profiles too. If you include all the above profiles in your provided empty_template_ext project, you will see that the device will start advertising and the Custom 1 profile is also included.

If you are interested in including only the Custom 1 profile, then you should modify the host_proxr_sdk.exe by yourself and send the GTL commands only for the specific profile. This is not a straight forward implementation because you should remove many GTL commands. For example you could use a logic analyzer on the UART signals and check what commands you should send or not. To do so, my suggestion would be to base your project on the prox_reporter_ext.

Thanks, PM_Dialog