Skip to main content

cannot compile using Segger RTT logging

DA1469x

5 months ago

Posted by geekydragon 140 points 12 replies
0 upvotes

Hi, I tried with CONFIG_RTT option following tutorial 4.2.7, but an error came up during compilation:

C:/Dialog_SDK/SDK_10.0.10.118/sdk/bsp/startup/config.c:42:17: fatal error: SEGGER_RTT.h: No such file or directory

The header file is actually located in C:\Dialog_SDK\SDK_10.0.10.118\sdk\middleware\segger_tools\SEGGER

Any idea how to solve this? Thanks.

5 months ago

geekydragon 140 points

after adding segger_tool to the SDK subfolder and include path, compilation of the hogp_host example went through successfully. However, there was no logging output at all except the following. 

 

###RTT Client: Connecting to J-Link RTT Server via localhost:19021 ......
###RTT Client: Connected.

SEGGER J-Link V6.86g - Real time terminal output
SEGGER J-Link ARM V9.4, SN=59418674
Process: JLinkGDBServerCL.exe

Tried to add a few printf in the main and system_init tasks and they worked. It seems printf only works for these two tasks but not others?

The hogp_host_task also seemed suspended as it did not break at breakpoints.

 

Looking forward to your reply. Thanks!

5 months ago

PM_Dialog

Hi geekydragon,

Thanks for your question and sharing the fix. Apologies also for the delay.

Yes, you should create a new folder in the SDK folder with the SEGGER sources (sdk/middleware/segger_tools) and include all the subfolders into compiler include path. Then you should rebuild the project and flash the DA1469x.

Could you please try it in the ble_adv project of the SDK and try to print in ble_adv_demo_task() ?

The hogp_host is a sample implementation of the HOGP Host of the HID Over GATT Profile. Please add a break point into the hogp_host_task. Does the BKPT hit?

When the device boots with the hogp_host application, the hogp_host_task is getting triggered and you should see the “HOGP Host application started” on the serial terminal.

Thanks, PM_Dialog

5 months ago

geekydragon 140 points

I was using Segger RTT since I'm using a custom board and uart2 is not available.

Printf worked when it's located in the main and system_init tasks of the HOPG Host demo. I did add break point into the hogp_host_task but it did not hit, and "HOGP Host application started" did not show on Segger RTT client. 

5 months ago

PM_Dialog

Hi geekydragon,

When the device is running the hogp_host application, the hogp_host_task should run, so the BKP should hit too.

This sounds that the application is not running correctly. Could you please try it with the ble_adv project of the SDK?

Thanks, PM_Dialog

5 months ago

geekydragon 140 points

Yes, the ble_adv and hogp_device projects could run without any error. In fact the original hogp_host project (using CONFIG_RETARGET) could run and hit BKP in hogp_host_task perfectly. The interesting problem is that those very same BKP won't hit when using CONFIG_RTT macro. 

5 months ago

PM_Dialog

Hi geekydragon,

So do you mean in case of the ble_adv, the BKP is not hit in the ble_adv_demo_task? Can you see the device start advertising?

Thanks, PM_Dialog

5 months ago

geekydragon 140 points

Yes the ble_adv runs perfectly. My question is when the hogp_host project and use CONFIG_RTT for logging, printf in the hogp_host_task does not print anything (it works when printing in main function). 

5 months ago

geekydragon 140 points

Yes the ble_adv runs perfectly. My question is when the hogp_host project and use CONFIG_RTT for logging, printf in the hogp_host_task does not print anything (it works when printing in main function). 

5 months ago

PM_Dialog

Hi geekydragon,

Is this issue related with the issue you have described in the ticket below?

https://www.dialog-semiconductor.com/products/bluetooth-low-energy?post_id=11756#tab-support_tab_content

Probably the application is not running correctly. Do you have any of our DKs to replicate it?

Thanks, PM_Dialog

5 months ago

geekydragon 140 points

I'm not sure if these two issues are related, and I don't have your DK to replicate it.

Printf still not working in hogp_host_task via CONFIG_RTT after disabling sleep mode. I will use BKP for debugging for now and kindly let me know if any possible solutions.    

5 months ago

geekydragon 140 points

Found the problem. After commenting out all cli and debug related macros in the config file and deleting relevant codes, RTT finally works as expected.

5 months ago

PM_Dialog

Hi geekydragon,

Thanks for your indication and glad that you figure it out. It is very helpful for the other community.

Regards,

PM_Dialog