Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: MAVLINK Library crashing Teensy 3.1 [Error 43]

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    19

    MAVLINK Library crashing Teensy 3.1 [Error 43]

    I've read about the Error 43 and had it before (flashed hex compiled for UNO).
    I can always get it working by flashing the blink.ino.

    Now i want to implement the MAVLINK telemtry protocol.
    For the most basic usage you need to send a "heartbeat", with just a little bit of code:

    Code:
    #include <mavlink.h>
    
    int system_type = MAV_FIXED_WING;
    int autopilot_type = MAV_AUTOPILOT_GENERIC;
    mavlink_message_t msg;
    uint8_t buf[MAVLINK_MAX_PACKET_LEN];
    
    void setup(){
      Serial.begin(115200);
      Serial.println("Serial online");
      pinMode(13, OUTPUT);
      Serial1.begin(57600);
      Serial.println("Mavlink online");
    }
    
    void loop(){
    	digitalWrite(13, HIGH);
    	heartbeat();
    	//mav.air_speed();
    	Serial.println("Heartbeat");
    	digitalWrite(13, LOW);
    	delay(500);
    }
    
    void heartbeat(){
    	mavlink_msg_heartbeat_pack(100, 200, &msg, system_type, autopilot_type);
    	uint16_t len = mavlink_msg_to_send_buffer(buf, &msg);
    	Serial1.write(buf, len);
    }
    I pretty much follow the http://qgroundcontrol.org/dev/mavlin...ation_tutorial tutorial
    with mavlink.zip as header files.

    I suspect that in the library some unsupported functions are used. But what could that be and how can i find it?



    edit:
    I got it working with the official c_library for Mavlink:
    https://github.com/mavlink/c_library
    The definitions and include functions are a bit different but should work.
    Last edited by Flydroid; 05-03-2015 at 12:41 AM.

  2. #2
    Junior Member
    Join Date
    Mar 2015
    Location
    US, Midwest
    Posts
    5
    Also had this problem. Traced it down to the existence of the "bittest.c" file in the library directory. When the mavlink library gets included in the Teensy sketch, the bittest.c file also gets compiled and included. The bittest.c file has a "main()" function in it and I think that's what messes up the Teensy. I removed the bittest.c file from the library directory and now things appear to be compiling and working properly. At least the Teensy isn't hanging or locking up and screwing up the USB interface as soon as the sketch is downloaded.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •