Learn MoreFAQsTutorials

3 posts / 0 new
Last post
moguilevski
Offline
Last seen:2 days 11 hours ago
加入:2019-04-30 12:25
Platform reset function

Dear Dialog team,

I use UART for communication between the DA14585 development kit and a development board from another manufacturer. In the case of the extensive data exchange the communication process interrupts sometimes by calling the platform reset function and gets stuck there. It happens while code is executed in a debug session. What would happen during the normal operation - when the image with the code is flashed on DA14585? How to avoid that the code execution gets stuck (watchdog is freezed during the UART communication)? The SW reset at this point would also work for me, however, as I see from the function content, the PRODUCTION_TEST macro must be defined for this which is not the case here. Is there any walk-around possible, without making changes in the SDK code?

void platform_reset_func(uint32_t error) { uint16_t tmp; #if (!PRODUCTION_TEST) // Trigger assert if the reset reason is other than RESET_AFTER_SUOTA_UPDATE ASSERT_WARNING(error == RESET_AFTER_SUOTA_UPDATE); #endif // Trigger SW reset tmp = GetWord16(SYS_CTRL_REG); tmp = (tmp & ~REMAP_ADR0) | 0; // Map ROM at address 0 tmp |= SW_RESET; SetWord16(SYS_CTRL_REG, tmp); }

Device:
PM_Dialog
Offline
Last seen:1 day 21 hours ago
工作人员
加入:2018-02-08 11:03
Hi moguilevski.

Hi moguilevski.

Thanks for your question online. This meant that a platform reset takes place. Τhe platform_reset_func() is invoked by the platform_reset(), which is implemented in the ROM code. The most possible reason why you get this assertion is due to insufficient memory, because you are allocating messages which are never consumed. For example, if you are allocating notification messages and you have a small connection interval the messages are piled up until a connection event arrives, but with a large connection interval your run out of memory before the connection event arrives. You could increase the connection interval. Probably, in your application there might be some kind of memory leakage pilling up after each connection, as the error code is RESET_MEM_ALLOC_FAIL. To do so, check if there are any pending messages and make sure that you are consuming the messages that you get when the message is handled or if you are allocating data they should be freed.

Thanks, PM_Dialog

moguilevski
Offline
Last seen:2 days 11 hours ago
加入:2019-04-30 12:25
Thank you very much for the

Thank you very much for the detailed answer.