When set ADVERTISING_DURATION 180 sec, project resetted from main after elapsed this time

I run project on SDK17 central example and added some code for advertising.

But when elapsed 180 sec, my project starts from main again. I suppose, when called end of advertising, error appears and due to this error I got reset my project.

Project from example with just advertising- works properly. After 180 sec advertisig disapears. I copied all functions from this project to my central project and got described problem.

What settings should I check ?

Thanks.

Related