Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

LeMo_2657571
Level 1
Level 1

Hi everyone!

I have designed a wireless application where cysmart dongle is used to record data using ble as the way of communication.

It works quite fine but when the connection falls , I push a button to reconnect and 'sometimes/randomly' the application crashes.

The error message which appeares before to crash is:

Uncontrolled exception: System.ObjectDisposedException: Cannot access a disposed object.

Object name: 'CySmart.Common.Base.CyBlePrioritySyncQueue`2[[CySmart.Common.Base.Hardware.CyBleCommandType, cyblecommonbase, Version=1.2.1.553, Culture=neutral, PublicKeyToken=null],[CySmart.Common.Base.Hardware.ICyBleCommandRequest, cyblecommonbase, Version=1.2.1.553, Culture=neutral, PublicKeyToken=null]]'.

   in CySmart.Common.Base.CyBlePrioritySyncQueue`2.CheckDisposed()

   in CySmart.Common.Base.CyBlePrioritySyncQueue`2.ClearMask(TKey key)

   in CySmart.DongleCommunicator.CyBleDongleIoAsyncMgr.NotifyResponse(CyBleDonglePacket responseData)

   in CySmart.Common.Base.Hardware.CyBleDeviceIoAsyncMgr.ResponseWorkerThread()

   in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   in System.Threading.ThreadHelper.ThreadStart()

The thing is that it is usual to loose the connection because it is a situation where user is in movement and I often push that button and the reconnection is succesfull but sometimes it crashes.

Thank you in advance!

0 Likes
5 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Can you please attach the log present in the Logcat window when the App crashes? It will have information on the exact line of code where the problem occured and also information about what caused it.

Regards,

Dheeraj

0 Likes

Hi!

The situation is a room with more than 6 devices which are placed in the

walls.

Dongle has to connect with each device, sends some commands to configure

them and finally it acts as a sniffer recording a stream of data from each

device.

As ble is an unstable communication in streaming conditions, each time

there is a fail, software reset is done.

This software reset consists on clearing the information of the dongle and

connecting again to it.

This solution was proposed because we discovered that the dongle sometimes

enters in an idle state after a fail in the connection.

The problem increases in frequency as we increase in number of devices.

I think that the core of the problem is in the fact that this kind of

communication should be done using the advertising information instead of

trying to establish a streaming communication.

The information that I attached you is the only message that I have in my

application, I don't know if an extra log is automatic created somewhere.

Thank you for taking time to answer the message!

On Fri, 7 Feb 2020 at 08:00, DheerajK_81 <community-manager@cypress.com>

0 Likes

You can find the Logcat window at the bottom as shown below. Please select the filter as Error. Now connect the phone via USB and then run the app. Please copy the logs and share them once the crash happens.

android.png

Regards,

Dheeraj

0 Likes

Thank you for the aclaration, now I see why you insist on the logcat.

Unfortunately, we are not using Android Studio.

We are developing a computer-based application, so we are using Qt with the

api provided by CySmart.

We generate a .exe and typical console is the only way to debug what's

happening.

On Fri, 14 Feb 2020 at 10:17, DheerajK_81 <community-manager@cypress.com>

0 Likes

Would you be able to attach your application here for further debugging?

Regards,

Dheeraj

0 Likes