PSRAM causing runtime error with BLE

Hi there, running into this issue when trying to send commands: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothGatt.writeCharacteristic(android.bluetooth.BluetoothGattCharacteristic)' on a null object reference at edu.mit.appinventor.ble.BluetoothLEint$BLEWriteOperation.write(BluetoothLEint.java:726) at edu.mit.appinventor.ble.BluetoothLEint$BLEWriteOperation.run(BluetoothLEint.java:637) at android.os.Handler.handleCallback(Handler.java:959) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.app.ActivityThread.main(ActivityThread.java:8592) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878) Note: You will not see another error reported for 5 seconds.
The app was working before adding PSRAM into the arduino IDE code and now once a direction button is pressed the duration inputted is irrelevant and we can only manually stop the motors. The stop button also does not work. We think it may be due to saturation but any insight would be helpful. This is the App code:


Export the aia and post it here along with the sketch.

Expand the blocks at the bottom of that procedure and post a Download Blocks Image, not a screenshot.

Hi @Bernie,
this is pretty weird: you enable the PSRAM on your Arduino and the app crashes ?
I'm supposing you're using an ESP32 with PSRAM ?
If so, are you sure you've followed that correct way to use it ?
(for example in this way ? ESP32 - How To Use PSRAM • ThingPulse)
The Serial monitor of the Arduino IDE what is showing ? In other words: are there any exceptions raised during its running ? Is the Arduino board that you use "really" fitted with PSRAM (not all of them have this feature) ?
The error message that you've posted, is raised when ? When you strike a button, or when else ?