Arduino_MachineControl icon indicating copy to clipboard operation
Arduino_MachineControl copied to clipboard

PMC freeze when using ArduinoBLE with Arduino_MachineControl included.

Open Bylund opened this issue 4 years ago • 4 comments

Portenta Machine Control (PMC) crash when the begin function is called for the ArduinoBLE library when Arduino_MachineControl.h is included in the same sketch.

How to replicate the issue:

  1. Upload the Portenta BLE example without changes (https://docs.arduino.cc/tutorials/portenta-h7/por-ard-ble).
  2. Verify functionality. (Optional).
  3. Include header file Arduino_MachineControl.h. (#include <Arduino_MachineControl.h>)
  4. Upload sketch and note that the Portenta Machine Control will freeze.

Library versions used:

  • ArduinoBLE v1.2.1.
  • Arduino_MachineControl v1.1.0.

Bylund avatar Oct 12 '21 17:10 Bylund

I have the same issue, the portenta not only freezes but stop working, causing also the computer not to recognise the device. In case this happens, use the bootloader mode (pushing two times fast the reset button) and the computer will reload the portenta.

pitdagosti avatar Mar 22 '22 13:03 pitdagosti

Hello,

Are there any updates on this subject?

gmacario avatar Jul 07 '22 06:07 gmacario

I'll provide a minimal sketch that will produce the Mbed OS crash reported here:

#include <Arduino_MachineControl.h>
#include <ArduinoBLE.h>
void setup() {
  BLE.begin();
}
void loop() {}

per1234 avatar Nov 26 '22 10:11 per1234

Hello, Remove EncoderClass out of Arduino_MachineControl\src\Arduino_MachineControl.h and its object out of Arduino_MachineControl\src\Objects.cpp. The issue will be solved. Because of I don't use the Encoder now so It can be a temp solution. I hope it is a key for someone will fix it in the future.

chminhph avatar Nov 26 '22 12:11 chminhph

Hello, I have the same problem. Are there any updates on this issue?

rickypid avatar Oct 07 '23 14:10 rickypid

Dear all, Thanks for reporting this malfunction. The problem is caused by an interrupt conflict between PMC Encoder pins and BLE pins dedicated to low power management. This issue will be fixed allowing the user to disable the low power mode of the BLE chip before starting the BLE stack. The function to manage BLE low power mode will be available in the new release of the ArduinoBLE library.

leonardocavagnis avatar Oct 11 '23 15:10 leonardocavagnis

ArduinoCore-mbed release 4.0.10 fixes this issue.

leonardocavagnis avatar Nov 30 '23 11:11 leonardocavagnis