Keyboard and mouse examples won't advertise

8 posts / 0 new
Last post
Peace
Offline
Last seen:5 years 3 weeks ago
Joined:2016-01-22 11:37
Keyboard and mouse examples won't advertise

Hi,

I'm going to develope a HID device (gamepad) basing on DS examples. Unfortunately I have a problem with advertising. I'm using DA14580 dev kit (basic) with Keil and both examples won't advertise. I've already read some threads about this problem. I undefined eeprom and sleep modes, but program still stucks on line:
while ((GetWord16(SYS_STAT_REG) & DBG_IS_UP) == DBG_IS_UP) {};
Then I commented out this and the next line, but the chip still can't be discovered by any host in range. Does anyone have any idea what more should I modify or configure to make this thing work?

I'll be grateful for any advice.
Marcin

PS. BLE examples from SDK 5 works fine and advertise.

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi Peace,

Hi Peace,

该设备设置在扩展或深度睡眠mode wont advertise or do anything while the debugger is attached please place the line you ve commented and you can either remove the sleep from the da1450_config by undefining both of the CFG_EXT_SLEEP and CFG_DEEP_SLEEP and debug through keil or stop the debugger and then you should see your device advertise. On SDK 5 in most of the examples the sleep is disabled.

Thanks MT_dialog

Peace
Offline
Last seen:5 years 3 weeks ago
Joined:2016-01-22 11:37
Thank You very much for Your

Thank You very much for Your answer!
As I wrote before, first thing I done was undefining sleep modes, but the application still stucks on a mentioned line. Even when I hit "Stop Debug Session" nothing seems to change. I can't discover the chip also after loading code with SmartSnippets.
Any other thoughts?
I need fast test of HoGP under Windows before I start to implement my code for my gamepad, so DS examples would be a very nice way to do it...

Marcin

Joacimwe
Offline
Last seen:1 year 6 months ago
Guru
Joined:2014-01-14 06:45
Remove the line app_set

Remove the line app_set_extended_sleep(); in app_init_func.
You can also add app_disable_sleep(); instead.

Peace
Offline
Last seen:5 years 3 weeks ago
Joined:2016-01-22 11:37
Hi, thanks!

Hi, thanks!
Application now seems to be running - when I halt the program, debugger always points on:
// restore interrupts
GLOBAL_INT_START();

but I still cant discover the board. Neither by the Windows or Android LE scanners.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi Peace,

Hi Peace,

Sorry, most of the customers stuck in this line of code usually forget to get the sleep modes undefined Joacimwe is right. In the app_init_func() there is a command that enables the extended sleep of the device unconditionally, comment that out. Also please make sure that you have some of the below settings in your project.

In the app_kbd_config.h file:

#define NORMALLY_CONNECTABLE_ON

#undef INACTIVITY_TIMEOUT

Also since you have undefined the EEPROM you should have disabled the multibond as well by undefining it in the da14580_config.h please try that.

Thanks MT_dialog

Peace
Offline
Last seen:5 years 3 weeks ago
Joined:2016-01-22 11:37
Yes, that was it! Definition

Yes, that was it! Definition of NORMALLY_CONNECTABLE_ON was needed. Now everything works.

It's my very first time with Dialog's chips, thank You so much for help!

wangxp
Offline
Last seen:5 years 1 month ago
Joined:2015-09-07 03:21
thanks a lot, i met the same

thanks a lot, i met the same problem, now it is working because of your steps!