App crashing when bleprofile_WriteHandle() is called

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I began working on something I hadn't touched in about two months and started having an issue I had never run into before. After having the chip try to change one of its characteristics, the app would crash. I traced the crash into the bleprofile_WriteHandle() function, but since I don't have access to the source code of that function, I can't trace the crash further. Is there anyway to run some sort of debugger so I could step through my code and find the issue?

0 Likes
1 Solution
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

swelan

Per the BLE spec, the maximum size of a characteristic is 20 bytes.

Jacob

View solution in original post

0 Likes
12 Replies
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Unfortunately, we do not support single step debugging on this platform, only traces.

Are you familiar with how to setup and view traces? There are alot of existing threads on the topic that you will find useful.

Bluetooth Trace Tool

0 Likes
Anonymous
Not applicable

I am not, could you explain what they are and how to use them to me?

0 Likes

Start with the WICED Smart Quick Start Guide (SDK 2.x and TAG3 Board)

There is also an encoded trace viewer inside of the SDK.

0 Likes
Anonymous
Not applicable

The traces aren't helping, It outputs traces up until the crash, but nothing in the traces is useful for telling me what the crash is...

0 Likes
Anonymous
Not applicable

Hello swelan

Can you give us some visibility on how it is crashing?

Can you send us a code snippet?

Thanks

JT

0 Likes
Anonymous
Not applicable

At the moment, I can't give a snippet of code. All i know is it enters the bleprofile_WriteHandle() function and crashes somewhere there with no error code that I can find. For now, I'm just gonna start with a fresh project...

0 Likes
Anonymous
Not applicable

Turns out, there's some sort of limit to the length of message the bleprofile_WriteHandle() function can handle, even if it is smaller than the characteristic you are writing to. No idea what the limit is, but I think its around 40 bytes. Do any of you know why this limit exists? mwf_mmfae j.t

0 Likes

We will need to check with the developers.

0 Likes
Anonymous
Not applicable

I don't know if it's an intentional limit, I just found it using another BLE app on my phone with the chip. At roughly 40 bytes, the app on my phone errors out saying it can't write to the characteristic. It looks like this is handled gracefully somewhere, as the application on the chip doesn't crash then, however when calling the bleprofile_WriteHandle() function in my code with a length above the limit I found, it crashes the application on the chip.

0 Likes
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

swelan

Per the BLE spec, the maximum size of a characteristic is 20 bytes.

Jacob

0 Likes
Anonymous
Not applicable

I did not realize that! Should've read the spec closer, in that case, the IDE allows you to make larger characteristics, so you may want to look at that. Thanks for the clarification.

0 Likes

Note that there is a long characteristic sample app included in the SDK.

0 Likes