How to debug SPS source code flow.

8 posts / 0 new
Last post
asmaitha
Offline
Last seen:5 years 1 month ago
Expert
加入:2014-11-20 08:45
How to debug SPS source code flow.

Hello,

I would like to debug Serial Port Service code --DSPS code using J-Link.
But what I observe is that only if I come out of debug-mode only then I am able to scan my DA14580 device using android application(provided by DA14580 for SPS). How can I still be in debug mode and trace my code flow.

Thanks
asm

VesaN
Offline
Last seen:5 years 5 months ago
Guru Master
加入:2014-06-26 08:49
Hello asmaitha,

Hello asmaitha,

Just a guess, but you could try to set optimizing flag to zero in the options, tab C/C++ (-O0). Is there any specific reason for you to debug the program flow?

The application layer overview is described quite well on page 7 of this user manual. It should not be a big struggle to locate specific parts of the code with that document.

Thanks!

asmaitha
Offline
Last seen:5 years 1 month ago
Expert
加入:2014-11-20 08:45
Hello VesaN,

Hello VesaN,
My requirement is not to print the data being received from Android Mobile App onto Tera-Term(for DA14580 chip).
My requirement is to save the data coming from Android mobile in a variable and pass that variable to drivers.
So I need to understand the code flow.

Thanks
asm

Nater
Offline
Last seen:6 years 1 month ago
加入:2014-09-24 15:40
I also am trying to debug my

I also am trying to debug my SPS Profile, it seems I can't send any characters to my TeraTerm application from an android, but the Android takes any characters generated in TeraTerm.
I noticed concerning this debugging issue: When in Debug mode, I can't even scan my device in the DSPS application, I also notice that the point my program seems to be stuck at is:
Line 849 of arch_system.c which reads:

while ((GetWord16(SYS_STAT_REG) & DBG_IS_UP) == DBG_IS_UP) {};

which looks like if the system is in debug mode, to hang indefinitely. How do I work around this? I tried the Optimization note suggested above and it made no difference.

Thank you for your help.
Nate

caicx
Offline
Last seen:6 years 1 month ago
加入:2014-07-24 04:25
I have same problem, waitting

I have same problem, waitting for the answer.

jd@exp-eng.com
Offline
Last seen:2 years 5 months ago
加入:2014-10-22 04:34
Also getting stuck here. I

Also getting stuck here. I have tried the above solution proposed by klim. Any other workarounds so it does not get stuck at this line of code?

MT_dialog
Offline
Last seen:1 week 5 days ago
工作人员
加入:2015-06-08 11:34
嗨jd@exp -eng.com,

Hijd@exp-eng.com,

There is no work-around about this, you wont be able to debug your program while it is in sleep mode. To disable sleep mode in SDK3 you have to undefine both extended and deep sleep in the da14580_config and if you are in SDK5 you will have to set the variable app_default_sleep_mode in ARCH_SLEEP_OFF in the user_config.h file.

Thanks MT_dialog

klim9531
Offline
Last seen:4 years 3 months ago
加入:2015-01-28 23:52
I think there are 2 problems

I think there are 2 problems here, one problem is that the device is going into sleep mode, the other is that the flow control is not set correctly. They both get fixed in the same place, the file you need to edit, da14580_config.h, is not visible within the Keil IDE.

So-- Use a file browser (like Windows Explorer) to navigate to your project's root, then right-click on the da14580_config.h file and select 'Open With=>Notepad'. Find the lines that define the sleep modes and undefine them (#undef CFG_EXT_SLEEP and #undef CFG_DEEP_SLEEP). Now find the section that defines the flow control (the lines that follow /*UART flow control configuration. One must be enabled when*/ /*sleep is enabled.*/) and comment everything in that section out. Replace the commented out code with the following:
//ENABLE SW FLOW CONTROL FOR DEV
#define CFG_UART_SW_FLOW_CTRL
#undef CFG_UART_HW_FLOW_CTRL
#ifdef CFG_UART_SW_FLOW_CTRL
#undef CFG_UART_HW_FLOW_CTRL
#endif

Make sure to fully rebuild your project, then test that you can connect to the debugger and all the chars are passed consistently in both directions. Not sure why nobody responded to this thread, they have been pretty good at helping out in most of the others. Hope this helps.

干杯,klim