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

Thread: Malloc error on Teensy 3.1 using Mac OS 10.9 and Arduino IDE

  1. #1
    Member
    Join Date
    Jul 2014
    Location
    Currently Sarande, Albania
    Posts
    66

    Malloc error on Teensy 3.1 using Mac OS 10.9 and Arduino IDE

    After switching all my SD card code form SD to SdFat once I got all the normal new lib errors worked thru I get what looks like a linker error:

    Code:
      Using previously compiled: /var/folders/rb/y3bt7gq151x05xlwpzpzc0hm0000gt/T/build7533490590131683916.tmp/arduino/hooks.c.o
    /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=118 -DTIME_T=1404214698 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 -I/Users/freddie/Documents/Arduino/libraries/arduino -I/Applications/Arduino.app/Contents/Resources/Java/libraries/OneWire -I/Applications/Arduino.app/Contents/Resources/Java/libraries/UTFT -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Time -I/Users/freddie/Documents/Arduino/libraries/UTouch -I/Users/freddie/Documents/Arduino/libraries/DallasTemperature -I/Users/freddie/Documents/Arduino/libraries/SdFat -I/Users/freddie/Documents/Arduino/libraries/arduino/utility /Users/freddie/Documents/Arduino/libraries/arduino/malloc.c -o /var/folders/rb/y3bt7gq151x05xlwpzpzc0hm0000gt/T/build7533490590131683916.tmp/arduino/malloc.c.o 
    /Users/freddie/Documents/Arduino/libraries/arduino/malloc.c:67:26: warning: initialization makes pointer from integer without a cast [enabled by default]
    /Users/freddie/Documents/Arduino/libraries/arduino/malloc.c: In function 'malloc':
    /Users/freddie/Documents/Arduino/libraries/arduino/malloc.c:163:7: error: 'AVR_STACK_POINTER_REG' undeclared (first use in this function)
    /Users/freddie/Documents/Arduino/libraries/arduino/malloc.c:163:7: note: each undeclared identifier is reported only once for each function it appears in
    /Users/freddie/Documents/Arduino/libraries/arduino/malloc.c: In function 'realloc':
    /Users/freddie/Documents/Arduino/libraries/arduino/malloc.c:359:9: error: 'AVR_STACK_POINTER_REG' undeclared (first use in this function)
    Can anyone tell me which one of these include files is the guilty culprit for including malloc which seems to only work with AVR:

    Code:
    // Arduino Libraries:
    #include "Arduino.h"
    #include "OneWire.h" //These are the libs for the One-Wire interface
    //#include "SD.h"  // We also need the SD card libraries for storing the data on the disk.
    #include "UTFT.h"  // We are going to use the TFT Display instead of the monitor
    #include "Time.h"  // Time is a library that provides timekeeping functionality for Teensy 3.1.
    
    // User Libraries:
    #include <UTouch.h>  // We are also going to use the Touch Panel of the Display
    #include <DallasTemperature.h> //This is for reading the DS18S20 Temp Sensors.
    #include <SdFat.h>
    //#include <SdFatUtil.h>  // define FreeRam()
    #include <ArduinoStream.h>
    #include <bufstream.h>
    #include <ios.h>
    #include <iostream.h>
    #include <istream.h>
    #include <MinimumSerial.h>
    #include <ostream.h>
    #include <Sd2Card.h>
    #include <SdBaseFile.h>
    #include <SdFatConfig.h>
    #include <SdFatmainpage.h>
    #include <SdFatStructs.h>
    #include <SdFile.h>
    #include <SdInfo.h>
    #include <SdSpi.h>
    #include <SdStream.h>
    #include <SdVolume.h>
    Any suggestions would be greatly appreciated!

    Thanks,
    Freddie

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,791
    Perhaps whatever you installed in /Users/freddie/Documents/Arduino/libraries/arduino ?

  3. #3
    Member
    Join Date
    Jul 2014
    Location
    Currently Sarande, Albania
    Posts
    66
    Quote Originally Posted by PaulStoffregen View Post
    Perhaps whatever you installed in /Users/freddie/Documents/Arduino/libraries/arduino ?
    Paul:
    Thanks, that was what was responsible for all the errors.
    I have no idea were that folder came from, very strange!

    Thanks again,
    Freddie

Posting Permissions

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