__asm("BKPT #0\n"); problem

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
Kevleo94
Offline
Last seen:2 years 9 months ago
加入:2017-09-05 07:18
__asm("BKPT #0\n"); problem

Hi, Everybody!
My name is Kevin.
i have a project, which is simillar to ble_app_peripheral. so i edited the program from ble_app_peripheral to run in my project on the custom board.

During debug session, when I run the program , this notification is always pop-out

"this pin has not been previously reserved" - and the program can't be run

and after several times of pressing run button, the program could be launch but I couldn't send any data through my DA
( but the dialog can be detected in Light Blue )

hereby, I attach my program and screenshot of the failure enclose with this post.
Please help me to solve what's going wrong and what to do afterwards.

kind regards,
Kevin

Attachment:
Device:
MT_dialog
Offline
Last seen:2 months 4 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Kevleo94,

Hi Kevleo94,

The assertion that the SDK indicates warns you about using a pin that you have not previously reserved it, when using a pin and configure it to operate in a specific function the GPIO_ConfigurePin() function will check if you have reserve that pin first, that means that before using that pin you will have to use the RESERVE_GPIO() macro in order to reserve the pin before using it. The reservation of the pins should be done in the GPIO_reservations() function.

Thanks MT_dialog

Kevleo94
Offline
Last seen:2 years 9 months ago
加入:2017-09-05 07:18
Hi MT_dialog,

Hi MT_dialog,
thanks for your answer. i have already solved that problem.
but i get another problem.
1) when i debug program to my custom board, i have a trouble to connect it with my phone.
sometimes it can connect, sometimes it can't, and sometimes the bluetooth on my custom board didn't advertise at all.
is it any suggestion to solve the problem?

2) If I want to run a function repeatedly, is there any possibility that the program will crash?

MT_dialog
Offline
Last seen:2 months 4 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Kevleo94,

Hi Kevleo94,

  1. 这是一个相当通用的描述and quite a few side-effects for just one issue, the fact that you cannot connect could be anything from the XTALs used to the antenna or to the state of device. If the device doesn't advertise, then you cannot connect to the device. The fact that the device doesn't advertise could be anything, from another assertion in the code so the device is stucked to an instruction. You will have to debug a bit before i am able to help you.
  2. I dont quite get the question, if you send for example an advertise command, the BLE will operate periodically at the given advertising interval.

Thanks MT_dialog

Kevleo94
Offline
Last seen:2 years 9 months ago
加入:2017-09-05 07:18
hi MT_dialog.

hi MT_dialog.
thanks before.
here I get a new problem. I tried to run the ble program and then i send command via bluetooth to the da14580, then with the timer to produce a ringtone.
but when the ringtone start to make a sound, after a few second, then the program crash.
the error log show that the problem is the same with the subject of this forum (__asm(BKPT #0\n);).
do you have any solution?

MT_dialog
Offline
Last seen:2 months 4 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Kevleo94,

Hi Kevleo94,

In the SDK in order for the developer to be aware of the issue there are more than a few assertions that use the BKPT command in order to halt the processor, so by mentioning that you hit a BKPT assertion doesn't help me at all in order to see where the problem is, i hope that this is clear. If the assertion occurs at the same location as your original post, then the solution is what i ve allready mentioned.

Thanks MT_dialog