Closed xpix closed 9 years ago
Make the cpp and h a library, and put it to SKETCHBOOK/libraries.
For example, if your library name is CRC, so create a folder CRC, copy you cpp and h file to CRC folder, and move CRC folder to SKETCHBOOK/libraries folder.
Hello Will,
thanks forur fast answer. The crc16.h is a standard library in arduino 1.0.5. Please check ur path:
\arduino-1.0.5\hardware\tools\avr\avr\include\util\crc16.h
Thats my Problem, i guess the plugin must care about the standard libs ... or it's a misstake from me?
You are right, I did not know the libs. I added the path to includes.
Hello Will,
hmm, i got the last plugin and check ur changes in compiler. I get the error again. Ok, i wrote a little test for you, i think u can test this better :)
-----------------8<----------------
uint16_t gps_CRC16_checksum (char *string) { size_t i; uint16_t crc; uint8_t c;
crc = 0xFFFF;
// Calculate checksum ignoring the first two $s for (i = 2; i < strlen(string); i++) { c = string[i]; crc = _crc_xmodem_update (crc, c); }
return crc; }
void setup(){ Serial.begin(9600);
uint16_t result = gps_CRC16_checksum("text text text"); Serial.println(result); }
void loop() {} -----8< -------------
cu Frank
What‘s the error message? I compiled your code smoothly. Arduino 1.0.5, mega2560, ST3.
Compiling libtest... Creating E:\Documents\Arduino_Build\libtest\libtest.ino.cpp.o... Creating E:\Documents\Arduino_Build\libtest\malloc.c.o... Creating E:\Documents\Arduino_Build\libtest\realloc.c.o... Creating E:\Documents\Arduino_Build\libtest\CDC.cpp.o... Creating E:\Documents\Arduino_Build\libtest\HID.cpp.o... Creating E:\Documents\Arduino_Build\libtest\HardwareSerial.cpp.o... Creating E:\Documents\Arduino_Build\libtest\IPAddress.cpp.o... Creating E:\Documents\Arduino_Build\libtest\Print.cpp.o... Creating E:\Documents\Arduino_Build\libtest\Stream.cpp.o... Creating E:\Documents\Arduino_Build\libtest\Tone.cpp.o... Creating E:\Documents\Arduino_Build\libtest\USBCore.cpp.o... Creating E:\Documents\Arduino_Build\libtest\WInterrupts.c.o... Creating E:\Documents\Arduino_Build\libtest\WMath.cpp.o... Creating E:\Documents\Arduino_Build\libtest\WString.cpp.o... Creating E:\Documents\Arduino_Build\libtest\main.cpp.o... Creating E:\Documents\Arduino_Build\libtest\new.cpp.o... Creating E:\Documents\Arduino_Build\libtest\wiring.c.o... Creating E:\Documents\Arduino_Build\libtest\wiring_analog.c.o... Creating E:\Documents\Arduino_Build\libtest\wiring_digital.c.o... Creating E:\Documents\Arduino_Build\libtest\wiring_pulse.c.o... Creating E:\Documents\Arduino_Build\libtest\wiring_shift.c.o... Creating E:\Documents\Arduino_Build\libtest\core.a... Creating E:\Documents\Arduino_Build\libtest\libtest.elf... Creating E:\Documents\Arduino_Build\libtest\libtest.eep... Creating E:\Documents\Arduino_Build\libtest\libtest.hex... Binary sketch size: 3904 bytes (of a 258048 byte maximum, 1.51 percent). Estimated memory use: 721 bytes (of a 8196 byte maximum, 8.80 percent). [Stino - Done compiling.]
Hmm, strange:
Copy the message to me. Thanks.
Compiling Desktop... "C:\Users\c5125630\Dropbox\arduino-1.0.5/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105 "-IC:\Users\c5125630\Documents\Arduino_Build\Desktop" "-IC:\Users\c5125630\Desktop" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\arduino\cores\arduino" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\arduino\cores\arduino\avr-libc" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\arduino\variants\standard" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\VirtualWire" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\VirtualWire\util" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\tools\avr\avr\include" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\tools\avr\avr\include\avr" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\tools\avr\avr\include\compat" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\tools\avr\avr\include\util" "C:\Users\c5125630\Documents\Arduino_Build\Desktop\Desktop.ino.cpp" -o "C:\Users\c5125630\Documents\Arduino_Build\Desktop\Desktop.ino.cpp.o" C:\Users\c5125630\Documents\Arduino_Build\Desktop\Desktop.ino.cpp: In function 'uint16_t gps_CRC16_checksum(char*)': C:\Users\c5125630\Documents\Arduino_Build\Desktop\Desktop.ino.cpp:20: error: '_crc_xmodem_update' was not declared in this scope [Stino - Error 1]
The paths are in the command. Why?
"-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\tools\avr\avr\include" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\tools\avr\avr\include\avr" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\tools\avr\avr\include\compat" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\tools\avr\avr\include\util"
Hello,
Long story short, I had some compilation problems too, so I reinstalled my whole toolchain freshly (Arduino, Teensyduino, Stino) but with no luck...
Like @xpix, I use Sublime Text 2 (2.0.2 precisely). Here is an example of compilation command that I get:
"D:\Program Files\Arduino/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++"
-c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -MMD -mcpu=cortex-m4 -DF_CPU=48000000 -DARDUINO=105 -mthumb -nostdlib -D__MK20DX128__ -DUSB_SERIAL -DLAYOUT_US_ENGLISH -fno-rtti -felide-constructors -std=gnu++0x
"-IC:\Users\Gonzo\Documents\Arduino_Build\Dbg_Master"
"-IC:\Users\Gonzo\Documents\Arduino\rat_RxboardTiny\Dbg_Master"
"-ID:\Program Files\Arduino\hardware\teensy\cores\teensy3"
"-ID:\Program Files\Arduino\hardware\teensy\cores\teensy3\avr"
"-ID:\Program Files\Arduino\hardware\teensy\cores\teensy3\util"
"-ID:\Program Files\Arduino\hardware\teensy\cores\teensy3"
"-ID:\Program Files\Arduino\hardware\teensy\cores\teensy3\avr"
"-ID:\Program Files\Arduino\hardware\teensy\cores\teensy3\util"
"-ID:\Program Files\Arduino\libraries\Wire"
"-ID:\Program Files\Arduino\libraries\Wire\utility"
"-ID:\Program Files\Arduino\hardware\tools\arm-none-eabi\arm-none-eabi\include"
"-ID:\Program Files\Arduino\hardware\tools\arm-none-eabi\arm-none-eabi\include\c++"
"-ID:\Program Files\Arduino\hardware\tools\arm-none-eabi\arm-none-eabi\include\machine"
"-ID:\Program Files\Arduino\hardware\tools\arm-none-eabi\arm-none-eabi\include\rpc"
"-ID:\Program Files\Arduino\hardware\tools\arm-none-eabi\arm-none-eabi\include\sys"
"C:\Users\Gonzo\Documents\Arduino_Build\Dbg_Master\Dbg_Master.ino.cpp"
-o "C:\Users\Gonzo\Documents\Arduino_Build\Dbg_Master\Dbg_Master.ino.cpp.o"
For comparison purpose, here is the same project's compilation command on Arduino 1.0.5:
D:\Program Files\Arduino\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++
-c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=48000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX128__ -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_US_ENGLISH
-ID:\Program Files\Arduino\hardware\teensy\cores\teensy3
-ID:\Program Files\Arduino\libraries\Wire
C:\Users\Gonzo\AppData\Local\Temp\build5217747354165566708.tmp\Dbg_Master.cpp
-o C:\Users\Gonzo\AppData\Local\Temp\build5217747354165566708.tmp\Dbg_Master.cpp.o
Hope this could help.
I am have the following errors when I compile a program:
Compiling Set time DS1307... Creating /home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp.o... "/home/steve/Arduino IDE/arduino-1.0.5/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105 "-I/home/steve/Arduino_Build/Set time DS1307" "-I/home/steve/sketchbook/Set time DS1307" "-I/home/steve/Arduino IDE/arduino-1.0.5/hardware/tools/avr/avr/include" "-I/home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/cores/arduino" "-I/home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/cores/arduino/avr-libc" "-I/home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/variants/standard" "-I/home/steve/Arduino IDE/arduino-1.0.5/libraries/Wire" "-I/home/steve/Arduino IDE/arduino-1.0.5/libraries/Wire/utility" "/home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp" -o "/home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp.o" /home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp: In function ‘void setup()’: /home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp:44: error: no matching function for call to ‘HardwareSerial::begin()’ /home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/cores/arduino/HardwareSerial.h:55: note: candidates are: void HardwareSerial::begin(long unsigned int) /home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/cores/arduino/HardwareSerial.h:56: note: void HardwareSerial::begin(long unsigned int, uint8_t) [Stino - Error 1]
I've checked and hardwareserial.h is where it is supposed to be. Any suggestions would be appreciated.
Hello,
i use STM2 and Stino the first time and i like it VERY much.
Ok, my problem, if i try to build my project, then he dont find a follow methode:
Compiling xtrackballon... Creating C:\Users\c5125630\Documents\Arduino_Build\xtrackballon\xtrackballon.ino.cpp.o... "C:\Users\c5125630\Dropbox\arduino-1.0.5/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105 "-IC:\Users\c5125630\Documents\Arduino_Build\xtrackballon" "-IC:\Users\c5125630\Dropbox\GitHub\XTrack\xtrackballon" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\arduino\cores\arduino" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\arduino\cores\arduino\avr-libc" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\hardware\arduino\variants\standard" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\VirtualWire" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\VirtualWire\util" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\Wire" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\Wire\utility" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\BMP180" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\BMP180\BMP180_Example" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\TinyGPSPlus" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\AltSoftSerial" "-IC:\Users\c5125630\Dropbox\arduino-1.0.5\libraries\AltSoftSerial\config" "C:\Users\c5125630\Documents\Arduino_Build\xtrackballon\xtrackballon.ino.cpp" -o "C:\Users\c5125630\Documents\Arduino_Build\xtrackballon\xtrackballon.ino.cpp.o" C:\Users\c5125630\Documents\Arduino_Build\xtrackballon\xtrackballon.ino.cpp: In function 'uint16_t gps_CRC16_checksum(char*)': C:\Users\c5125630\Documents\Arduino_Build\xtrackballon\xtrackballon.ino.cpp:262: error: '_crc_xmodem_update' was not declared in this scope [Stino - Error 1]
The Problem code is here:
include "util/crc16.h"
... uint16_t gps_CRC16_checksum (char *string) { size_t i; uint16_t crc; uint8_t c;
crc = 0xFFFF;
// Calculate checksum ignoring the first two $s for (i = 2; i < strlen(string); i++) { c = string[i]; crc = _crc_xmodem_update (crc, c); }
return crc; }
How can the build process find the "util/crc16.h" file?