DA14580 got reset immediately while connection is made

5 posts / 0 new
Last post
hardy.chen
Offline
Last seen:1 year 10 months ago
加入:2015-03-13 04:20
DA14580 got reset immediately while connection is made

Hi Dialog team,

It's a really a wired issue I recently found. My device just got reset by itself when I tried to connect it.
My application is based on DA14580_BEACON_3.40.6. Please advise what else I should try for this issue.

Here are some findings for your reference:

1) it works well (connection is made successfully without reset by itself) when I put my device running without creating additional application timer.
2) this issue happens when this additional timer is created after either
a) disconnection [I use GATT command to trigger it] or
b) power cycling [save configuration in nonvolatile storage for next boot up to trigger it]

3) I tried to check the debugging trace via replacing platform_reset_func with my own wrapper 'wrap_platform_reset' as below, and found that
a) application function 'app_connection_func(struct gapc_connection_req_ind const *param)' is not even called before it reset by itself (I set breakpoint here too, but not stopped)
b) the breakpoint set at function 'wrap_platform_reset' is stopped and the call stack is just as below:

- wrap_platform_reset 0x20000CEE void f(unsigned int)
|- error 0xF2F2F2F2 param - unsigned int
- Reset_Handler 0x00000000 void f()


void wrap_platform_reset(uint32_t error)
{
#ifdef CFG_FORCE_WDRST
// Power up peripherals' power domain
SetBits16 (PMU_CTRL_REG, PERIPH_SLEEP, 0);
while (!(GetWord16 (SYS_STAT_REG) & PER_IS_UP));

spi_flash_enable (SPI_GPIO_PORT, SPI_CS_PIN); // take spi flash out of power down mode for next bootup
spi_flash_wait_till_ready ();
#else
ASSERT_WARNING(1);
#endif

platform_reset_func(error);
}

Device:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
Staff
加入:2015-06-08 11:34
Hi hardy.chen,

Hi hardy.chen,

I ve placed an extra timer after the disconnection event in the app_disconnect_func, in order to trigger the advertising procudure, the device kept on advertising normally. The 0xF2F2F2F2 means that at some point the application is asked to allocate memory and the allocation failed due to limited resources. Check if there is a memory leak anywhere, you send any notifications and you dont free the messages. Do you return (KE_MSG_CONSUME) after the timer handler has executed and in general in all your handling functions?

Thanks MT_dialog

hardy.chen
Offline
Last seen:1 year 10 months ago
加入:2015-03-13 04:20
Hi MT_dialog,

Hi MT_dialog,

I've checked all handlers that KE_MSG_CONSUME is returned after its execution.

Do we have other ways to check the remaining memory space during runtime?

MT_dialog
Offline
Last seen:2 months 3 weeks ago
Staff
加入:2015-06-08 11:34
Hi hardy.chen,

Hi hardy.chen,

Currently there is no way to check the memory space during runtime. Are you using the arch_printf() function in your program in order to print data from your project ? printing too many data using the arch_printf() is a usual reason for geting this kind of error.

Thanks MT_dialog

hardy.chen
Offline
Last seen:1 year 10 months ago
加入:2015-03-13 04:20
Hi MT_Dialog,

Hi MT_Dialog,

I don't use any debugging printing in my application.
For now, I just had a workaround of leveraging another existed timer for my case. And without using additional timer, it's working fine now.
But, obviously, I suggest to have debugging tool for analyzing the crash issue.
So far, I've observed 2 weird crash/reset issue:
1) adding new timer on my application
2) sending OTA packet (write without response) quickly

For case 1), workaround of leveraging existed timer
case 2). workaround of using write with response, it will dramatically slow down the upgrading performance

We can close this topic.

Topic locked