This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

GATT read requests fail for many characteristics with nRF Connect SDK

Hello everyone,

I hope that you are all doing well during those hard times...

I am writing a code for a nRF52840. The connection is successfully established with a cycling powermeter. Three services are sucessfully discovered, according to the Cycling Power Profile from Bluetooth SIG. Then the characteristics of these profiles are also discovered. Finally, after releasing all the discovery data, I am trying to read the values of the characteristics or subscribe to notifications on some characteristics. 

Subscribing and reading both work fine as long as I am only doing 1 or 2 requests. But as soon as I am trying to read more than two characteristics (or subscribing to one and reading more than 1 characteristic), it crashes and causes a reset of the board : 

Reset logfile

My configuration is the following one : 

- zephyr pointed on tag zephyr-v2.2.0

- nRF Connect SDK pointed on v1.2.0 

I declared the bt_gatt_read_params and bt_gatt_subscribe_params struct statically as global variables : 

They are global and filled with parameters from the discovery of services : 

And finally they are used like that after all the services and characteristics have been discovered : 

My prj.conf file looks like that : 

If needed, I could provide more log files or code.

I hope that I was clear enough and that someone can explain me what I am doing wrong :-)

Cheers,

Sellig

Parents
  • Hi

    According to your screenshot, this error is caused by an MPU fault, which means that you're trying to read more characteristics than your throughput or memory can handle. The error message tells you at which RAM addresses the error occurs and which one is the faulting instruction address. 

    You can try increasing the CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE  to 2048 in your project. Also, please check out this prj.conf file to see how you can edit the various throughput defines in your project. 

    Best regards,

    Simon

Reply
  • Hi

    According to your screenshot, this error is caused by an MPU fault, which means that you're trying to read more characteristics than your throughput or memory can handle. The error message tells you at which RAM addresses the error occurs and which one is the faulting instruction address. 

    You can try increasing the CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE  to 2048 in your project. Also, please check out this prj.conf file to see how you can edit the various throughput defines in your project. 

    Best regards,

    Simon

Children