0

I am trying to work with the (new) sparkfun razor IMU 9dof, I wrote a silple sktetch to calibrate the magnetometer:

#include <SparkFunMPU9250-DMP.h> // Include SparkFun MPU-9250-DMP library
#include <Wire.h> // Depending on your Arduino version, you may need to include Wire.h
MPU9250_DMP imu; // Create an instance of the MPU9250_DMP clas
void setup() {
  Serial.begin(115200);

  Serial.println(F("Adafruit 10 DOF Board AHRS Calibration Example")); Serial.println("");

  if (imu.begin() != INV_SUCCESS){
    while (1) {
    Serial.println("Failed to initialize MPU-9250, loop forever");
   }

  }

 imu.setGyroFSR(2000); // Set gyro to 2000 dps

 imu.setAccelFSR(2); // Set accel to +/-2g

 imu.setLPF(5); // Set LPF corner frequency to 5Hz

 imu.setSampleRate(100); // Set sample rate to 10Hz

imu.setCompassSampleRate(100); // Set mag rate to 10Hz
}

void loop(void){
  imu.update();

  // Print the sensor data
  Serial.print("Raw:");
  Serial.print(imu.ax);
  Serial.print(',');
  Serial.print(imu.ay);
  Serial.print(',');
  Serial.print(imu.az);
  Serial.print(',');
  Serial.print(imu.gx);
  Serial.print(',');
  Serial.print(imu.gy);
  Serial.print(',');
  Serial.print(imu.gz);
  Serial.print(',');
  Serial.print(imu.mx);
  Serial.print(',');
  Serial.print(imu.my);
  Serial.print(',');
  Serial.print(imu.mz);
  Serial.println();  

  delay(50);
}

To be sure the Arduino IDE can access to dev/ttcACM0, I did sudo chmod 666 /dev/ttyACM0

I can dowload successfully but when I want to open the terminal I got the following error:

Erreur d'ouverture du port série « /dev/ttyACM0 ». (Port busy) (see attached screenshot)

More over when I entered dmesg on the console, I can see the following messages:

[   94.133923] usb 3-2: USB disconnect, device number 2
[   94.133978] cdc_acm 3-2:1.1: urb 12 failed submission with -19
[   94.135862] cdc_acm 3-2:1.1: urb 13 failed submission with -19
[   94.136059] cdc_acm 3-2:1.1: urb 14 failed submission with -19
[   94.136257] cdc_acm 3-2:1.1: urb 15 failed submission with -19
[   94.136457] cdc_acm 3-2:1.1: urb 2 failed submission with -19
[   94.136656] cdc_acm 3-2:1.1: urb 3 failed submission with -19
[   94.136852] cdc_acm 3-2:1.1: urb 5 failed submission with -19
[   94.137048] cdc_acm 3-2:1.1: urb 6 failed submission with -19
[   94.138841] xhci_hcd 0000:03:00.0: WARN Cannot submit Set TR Deq Ptr
[   94.138843] xhci_hcd 0000:03:00.0: A Set TR Deq Ptr command is pending.
[   94.931853] usb 3-2: new full-speed USB device number 3 using xhci_hcd
[   95.316578] usb 3-2: New USB device found, idVendor=1b4f, idProduct=9d0f
[   95.316581] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   95.316582] usb 3-2: Product: SFE 9DOF-D21
[   95.316584] usb 3-2: Manufacturer: SparkFun
[   95.320306] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[  858.774849] usb 3-2: USB disconnect, device number 3
[  904.529058] TCP: wlp1s0: Driver has suspect GRO implementation, TCP performance may be compromised.

Does anyone outhere experienced such issue?

Thank you for your help

Fabrice

  • 1
    Remove the modemmanager package. – Majenko Dec 6 '17 at 15:57
  • Also you should add your user to the group which owns serial devices - the chmod trick would have to be repeated every time you reboot or replug the board. Finally, you can use lsof | grep ttyACM to see which process is holding the port (might possibly need to run lsof as root, but try it first as yourself) – Chris Stratton Dec 6 '17 at 17:40
  • Just to odd simple things out first: have you closed all serial monitors in other instances? – Sim Son Feb 21 at 16:41
2

sudo apt-get purge modemmanager It helps me for linux user and for many other peoples. Now I am playing with stm32f103 and opening port was painfull. That was problem only for stm32 chip. Arduino nano was working without problems. Before I need reopened few times port to initiate communication. That was painfull. After finding that solution now Arduino ID is working without problems. I am not sure if deleting modemmanager will have impact for my system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.