SOLVED: problem uploading Arduino Sketch

The more technical aspects of Spirit, and carry-over discussion from Kickstarter updates.
User avatar
esba1ley
Posts: 58
Joined: Sun Jan 01, 2017 2:15 am
Location: Pasadena, CA
Contact:

Re: problem uploading Arduino Sketch

Postby esba1ley » Sun Feb 04, 2018 4:24 am

When you compile -- do you compile with all warnings enabled? I get the following warnings during compilation:

Code: Select all


In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:37:0: warning: "INT0" redefined [enabled by default]
 #define INT0 4        //PIC pulls low when urgent status is present
 ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:272:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:21,
                 from Spirit_PreLoadedDemo_Rev01.ino:20:
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/iom328p.h:167:0: note: this is the location of the previous definition
 #define INT0 0
 ^
In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:38:0: warning: "INT1" redefined [enabled by default]
 #define INT1 A2       //Other user defined interrupt uses. Connects to Raspberry Pi GPIO17
 ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:272:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:21,
                 from Spirit_PreLoadedDemo_Rev01.ino:20:
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/iom328p.h:168:0: note: this is the location of the previous definition
 #define INT1 1
 ^
In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:820:34: warning: backslash and newline separated by space [enabled by default]
    #define RecordedDataRefresh() \
 ^
In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:430:20: warning: 'irData' initialized and declared 'extern' [enabled by default]
 extern byte irData[]={0x00,0xFF,0x00,0x00};
                    ^
In file included from /var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:770:0,
                 from Spirit_PreLoadedDemo_Rev01.ino:20:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/EEPROM/EEPROM.h:43:30: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
     operator const uint8_t() const       { return **this; }
                              ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/EEPROM/EEPROM.h:92:26: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
     operator const int() const          { return index; }
                          ^
In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:803:86: warning: 'typedef' was ignored in this declaration [enabled by default]
   typedef struct RecordedDataStruct{int left; int leftaver; int leftamb;  uint32_t t;};//can edit number, names, and data types
                                                                                      ^
Spirit_PreLoadedDemo_Rev01.ino: In function 'void loop()':
Spirit_PreLoadedDemo_Rev01.ino:86:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Spirit_PreLoadedDemo_Rev01.ino:180:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Spirit_PreLoadedDemo_Rev01.ino:264:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Comms.ino: In function 'void __vector_17()':
Comms.ino:877:24: warning: statement has no effect [-Wunused-value]
Comms.ino: In function 'void I2CWriteRegs(uint8_t, uint8_t, uint8_t*, uint8_t)':
Comms.ino:960:26: warning: array subscript has type 'char' [-Wchar-subscripts]
Comms.ino: In function 'void I2CWrite(uint8_t, uint8_t, uint8_t)':
Comms.ino:984:25: warning: array subscript has type 'char' [-Wchar-subscripts]
Hardware.ino: In function 'boolean gripGrasp(int)':
Hardware.ino:251:36: warning: third operand of conditional expression has no effect [-Wunused-value]
Hardware.ino: In function 'void RxIRRestart(char)':
Hardware.ino:445:7: warning: unused variable 'i' [-Wunused-variable]
Hardware.ino: In function 'void IRHandler()':
Hardware.ino:515:31: warning: array subscript has type 'char' [-Wchar-subscripts]
Hardware.ino: In function 'void MoveWithOptions(int, int, int, int, int, void (*)(char), char)':
Hardware.ino:844:7: warning: variable 'Input' set but not used [-Wunused-but-set-variable]
Hardware.ino:844:13: warning: unused variable 'Output' [-Wunused-variable]
Hardware.ino:844:20: warning: unused variable 'Proportional' [-Wunused-variable]
Hardware.ino:844:33: warning: unused variable 'Integral' [-Wunused-variable]
Hardware.ino:844:44: warning: unused variable 'Derivative' [-Wunused-variable]
Hardware.ino:845:7: warning: unused variable 'MinLeftEdge' [-Wunused-variable]
Hardware.ino:845:19: warning: unused variable 'MinRightEdge' [-Wunused-variable]
Hardware.ino:846:8: warning: unused variable 'left' [-Wunused-variable]
Hardware.ino:846:13: warning: unused variable 'right' [-Wunused-variable]
Hardware.ino:847:15: warning: unused variable 'BackAway' [-Wunused-variable]
Hardware.ino:848:15: warning: unused variable 'OffsetDir' [-Wunused-variable]
Hardware.ino:849:8: warning: unused variable 'StartedInRightDirection' [-Wunused-variable]
Hardware.ino:850:8: warning: unused variable 'DirectionCount' [-Wunused-variable]
Hardware.ino: In function 'void playBoredom()':
Hardware.ino:1019:16: warning: unused variable 'freq' [-Wunused-variable]
Hardware.ino: In function 'void playSweep(int, int, int)':
Hardware.ino:1067:19: warning: statement has no effect [-Wunused-value]
Hardware.ino:1073:19: warning: statement has no effect [-Wunused-value]
Hardware.ino: In function 'void ModulateIR(unsigned int, unsigned int)':
Hardware.ino:1223:12: warning: unused variable 'temp' [-Wunused-variable]
Navigation.ino: In function 'void SimpleGyroNavigation()':
Navigation.ino:106:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:106:45: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:106:60: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:107:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:107:41: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:114:21: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:114:43: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:114:58: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void SimpleNavigation()':
Navigation.ino:175:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:175:45: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:175:60: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:176:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:176:41: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:185:21: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:185:43: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:185:58: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:205:28: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:205:51: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:205:67: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:208:24: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:208:46: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:209:30: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:209:48: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:213:26: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:213:50: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:220:28: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:220:51: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:220:67: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:152:12: warning: unused variable 'n' [-Wunused-variable]
Navigation.ino:155:11: warning: unused variable 'AccelVelocityNewDat' [-Wunused-variable]
Navigation.ino:156:11: warning: unused variable 'GyroPositionNewDat' [-Wunused-variable]
Navigation.ino: In function 'void NavigationXY(int, int)':
Navigation.ino:310:19: warning: unused variable 'n' [-Wunused-variable]
Navigation.ino: In function 'void CalibrateNavigationSensors()':
Navigation.ino:467:13: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:468:4: warning: overflow in implicit constant conversion [-Woverflow]
Navigation.ino:473:15: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:473:28: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:477:17: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:477:27: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:481:13: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:482:4: warning: overflow in implicit constant conversion [-Woverflow]
Navigation.ino:487:15: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:487:29: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:491:18: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:491:28: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:492:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:506:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void ZeroNavigation()':
Navigation.ino:554:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:555:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:557:21: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void PauseNavigation()':
Navigation.ino:574:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void ResumeNavigation()':
Navigation.ino:587:18: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:587:33: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:596:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:596:39: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:599:19: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void NavigationBegin()':
Navigation.ino:611:8: warning: unused variable 'i' [-Wunused-variable]
Navigation.ino: In function 'void DelayWithSimpleNavigation(int)':
Navigation.ino:713:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Navigation.ino: In function 'void DelayWithNavigation(int)':
Navigation.ino:720:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Navigation.ino: In function 'int GyroGetFrequencyFromChip()':
Navigation.ino:816:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
Navigation.ino:912:14: note: in expansion of macro 'GF_380Hz'
Navigation.ino:817:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
Navigation.ino:914:14: note: in expansion of macro 'GF_760Hz'
Navigation.ino: In function 'int32_t GyroDegreesToRaw(int)':
Navigation.ino:941:11: warning: unused variable 'raw' [-Wunused-variable]
Navigation.ino: In function 'int GyroRawToDegrees(int32_t)':
Navigation.ino:973:11: warning: unused variable 'deg' [-Wunused-variable]
Navigation.ino: In function 'int MinTurn(int)':
Navigation.ino:1038:9: warning: statement has no effect [-Wunused-value]
Navigation.ino:1040:16: warning: statement has no effect [-Wunused-value]
Navigation.ino: In function 'int16_t GyroGetAxis(char)':
Navigation.ino:847:62: warning: 'val' is used uninitialized in this function [-Wuninitialized]
Navigation.ino: In function 'int SineFunction(int)':
Navigation.ino:248:43: warning: array subscript is below array bounds [-Warray-bounds]
Navigation.ino: In function 'void GyroSetFrequency(int)':
Navigation.ino:934:64: warning: 'FrequencyByte' may be used uninitialized in this function [-Wmaybe-uninitialized]
Navigation.ino: In function 'void NavigationXY(int, int)':
Navigation.ino:402:84: warning: 'N_accelyraw' may be used uninitialized in this function [-Wmaybe-uninitialized]
Navigation.ino:402:31: warning: 'N_accelxraw' may be used uninitialized in this function [-Wmaybe-uninitialized]



These errors should eventually all get cleaned up -- it's just good coding practice...
----------
Erik S. Bailey
Entry, Descent, and Landing Aerospace Engineer
Maker, and Musician
SpiritRover Kickstarter Backer #460

gpvillamil
Posts: 75
Joined: Fri Jan 26, 2018 5:03 pm

Re: problem uploading Arduino Sketch

Postby gpvillamil » Sun Feb 04, 2018 4:26 am

Perhaps Kevin changed the Ringowire libraries for Spirit, but we are still using the old ones?

All my other libraries are current and working.

gpvillamil
Posts: 75
Joined: Fri Jan 26, 2018 5:03 pm

Re: problem uploading Arduino Sketch

Postby gpvillamil » Sun Feb 04, 2018 4:33 am

Yep, I saw a bunch of those. Some are from the included libraries. Makes me think there is a version mismatch, Kevin may be using different versions of the core libraries.

Some of them are just poor practice, or maybe leftover from code specific to other robots.

Also, looking at some of the comments makes me think that the RPi GPIO mapping is defined in hardware.h...

esba1ley wrote:When you compile -- do you compile with all warnings enabled? I get the following warnings during compilation:

Code: Select all


In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:37:0: warning: "INT0" redefined [enabled by default]
 #define INT0 4        //PIC pulls low when urgent status is present
 ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:272:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:21,
                 from Spirit_PreLoadedDemo_Rev01.ino:20:
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/iom328p.h:167:0: note: this is the location of the previous definition
 #define INT0 0
 ^
In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:38:0: warning: "INT1" redefined [enabled by default]
 #define INT1 A2       //Other user defined interrupt uses. Connects to Raspberry Pi GPIO17
 ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:272:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/pgmspace.h:88,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28,
                 from /var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:21,
                 from Spirit_PreLoadedDemo_Rev01.ino:20:
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/iom328p.h:168:0: note: this is the location of the previous definition
 #define INT1 1
 ^
In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:820:34: warning: backslash and newline separated by space [enabled by default]
    #define RecordedDataRefresh() \
 ^
In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:430:20: warning: 'irData' initialized and declared 'extern' [enabled by default]
 extern byte irData[]={0x00,0xFF,0x00,0x00};
                    ^
In file included from /var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:770:0,
                 from Spirit_PreLoadedDemo_Rev01.ino:20:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/EEPROM/EEPROM.h:43:30: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
     operator const uint8_t() const       { return **this; }
                              ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/EEPROM/EEPROM.h:92:26: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
     operator const int() const          { return index; }
                          ^
In file included from Spirit_PreLoadedDemo_Rev01.ino:20:0:
/var/folders/mp/myrl3wz08xl4jq006s7khhl80000gn/T/build5224635901671299867.tmp/Hardware.h:803:86: warning: 'typedef' was ignored in this declaration [enabled by default]
   typedef struct RecordedDataStruct{int left; int leftaver; int leftamb;  uint32_t t;};//can edit number, names, and data types
                                                                                      ^
Spirit_PreLoadedDemo_Rev01.ino: In function 'void loop()':
Spirit_PreLoadedDemo_Rev01.ino:86:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Spirit_PreLoadedDemo_Rev01.ino:180:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Spirit_PreLoadedDemo_Rev01.ino:264:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Comms.ino: In function 'void __vector_17()':
Comms.ino:877:24: warning: statement has no effect [-Wunused-value]
Comms.ino: In function 'void I2CWriteRegs(uint8_t, uint8_t, uint8_t*, uint8_t)':
Comms.ino:960:26: warning: array subscript has type 'char' [-Wchar-subscripts]
Comms.ino: In function 'void I2CWrite(uint8_t, uint8_t, uint8_t)':
Comms.ino:984:25: warning: array subscript has type 'char' [-Wchar-subscripts]
Hardware.ino: In function 'boolean gripGrasp(int)':
Hardware.ino:251:36: warning: third operand of conditional expression has no effect [-Wunused-value]
Hardware.ino: In function 'void RxIRRestart(char)':
Hardware.ino:445:7: warning: unused variable 'i' [-Wunused-variable]
Hardware.ino: In function 'void IRHandler()':
Hardware.ino:515:31: warning: array subscript has type 'char' [-Wchar-subscripts]
Hardware.ino: In function 'void MoveWithOptions(int, int, int, int, int, void (*)(char), char)':
Hardware.ino:844:7: warning: variable 'Input' set but not used [-Wunused-but-set-variable]
Hardware.ino:844:13: warning: unused variable 'Output' [-Wunused-variable]
Hardware.ino:844:20: warning: unused variable 'Proportional' [-Wunused-variable]
Hardware.ino:844:33: warning: unused variable 'Integral' [-Wunused-variable]
Hardware.ino:844:44: warning: unused variable 'Derivative' [-Wunused-variable]
Hardware.ino:845:7: warning: unused variable 'MinLeftEdge' [-Wunused-variable]
Hardware.ino:845:19: warning: unused variable 'MinRightEdge' [-Wunused-variable]
Hardware.ino:846:8: warning: unused variable 'left' [-Wunused-variable]
Hardware.ino:846:13: warning: unused variable 'right' [-Wunused-variable]
Hardware.ino:847:15: warning: unused variable 'BackAway' [-Wunused-variable]
Hardware.ino:848:15: warning: unused variable 'OffsetDir' [-Wunused-variable]
Hardware.ino:849:8: warning: unused variable 'StartedInRightDirection' [-Wunused-variable]
Hardware.ino:850:8: warning: unused variable 'DirectionCount' [-Wunused-variable]
Hardware.ino: In function 'void playBoredom()':
Hardware.ino:1019:16: warning: unused variable 'freq' [-Wunused-variable]
Hardware.ino: In function 'void playSweep(int, int, int)':
Hardware.ino:1067:19: warning: statement has no effect [-Wunused-value]
Hardware.ino:1073:19: warning: statement has no effect [-Wunused-value]
Hardware.ino: In function 'void ModulateIR(unsigned int, unsigned int)':
Hardware.ino:1223:12: warning: unused variable 'temp' [-Wunused-variable]
Navigation.ino: In function 'void SimpleGyroNavigation()':
Navigation.ino:106:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:106:45: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:106:60: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:107:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:107:41: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:114:21: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:114:43: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:114:58: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void SimpleNavigation()':
Navigation.ino:175:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:175:45: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:175:60: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:176:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:176:41: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:185:21: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:185:43: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:185:58: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:205:28: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:205:51: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:205:67: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:208:24: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:208:46: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:209:30: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:209:48: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:213:26: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:213:50: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:220:28: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:220:51: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:220:67: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:152:12: warning: unused variable 'n' [-Wunused-variable]
Navigation.ino:155:11: warning: unused variable 'AccelVelocityNewDat' [-Wunused-variable]
Navigation.ino:156:11: warning: unused variable 'GyroPositionNewDat' [-Wunused-variable]
Navigation.ino: In function 'void NavigationXY(int, int)':
Navigation.ino:310:19: warning: unused variable 'n' [-Wunused-variable]
Navigation.ino: In function 'void CalibrateNavigationSensors()':
Navigation.ino:467:13: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:468:4: warning: overflow in implicit constant conversion [-Woverflow]
Navigation.ino:473:15: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:473:28: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:477:17: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:477:27: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:481:13: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:482:4: warning: overflow in implicit constant conversion [-Woverflow]
Navigation.ino:487:15: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:487:29: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:491:18: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:491:28: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:492:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:506:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void ZeroNavigation()':
Navigation.ino:554:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:555:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:557:21: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void PauseNavigation()':
Navigation.ino:574:20: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void ResumeNavigation()':
Navigation.ino:587:18: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:587:33: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:596:23: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:596:39: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino:599:19: warning: array subscript has type 'char' [-Wchar-subscripts]
Navigation.ino: In function 'void NavigationBegin()':
Navigation.ino:611:8: warning: unused variable 'i' [-Wunused-variable]
Navigation.ino: In function 'void DelayWithSimpleNavigation(int)':
Navigation.ino:713:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Navigation.ino: In function 'void DelayWithNavigation(int)':
Navigation.ino:720:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Navigation.ino: In function 'int GyroGetFrequencyFromChip()':
Navigation.ino:816:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
Navigation.ino:912:14: note: in expansion of macro 'GF_380Hz'
Navigation.ino:817:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
Navigation.ino:914:14: note: in expansion of macro 'GF_760Hz'
Navigation.ino: In function 'int32_t GyroDegreesToRaw(int)':
Navigation.ino:941:11: warning: unused variable 'raw' [-Wunused-variable]
Navigation.ino: In function 'int GyroRawToDegrees(int32_t)':
Navigation.ino:973:11: warning: unused variable 'deg' [-Wunused-variable]
Navigation.ino: In function 'int MinTurn(int)':
Navigation.ino:1038:9: warning: statement has no effect [-Wunused-value]
Navigation.ino:1040:16: warning: statement has no effect [-Wunused-value]
Navigation.ino: In function 'int16_t GyroGetAxis(char)':
Navigation.ino:847:62: warning: 'val' is used uninitialized in this function [-Wuninitialized]
Navigation.ino: In function 'int SineFunction(int)':
Navigation.ino:248:43: warning: array subscript is below array bounds [-Warray-bounds]
Navigation.ino: In function 'void GyroSetFrequency(int)':
Navigation.ino:934:64: warning: 'FrequencyByte' may be used uninitialized in this function [-Wmaybe-uninitialized]
Navigation.ino: In function 'void NavigationXY(int, int)':
Navigation.ino:402:84: warning: 'N_accelyraw' may be used uninitialized in this function [-Wmaybe-uninitialized]
Navigation.ino:402:31: warning: 'N_accelxraw' may be used uninitialized in this function [-Wmaybe-uninitialized]



These errors should eventually all get cleaned up -- it's just good coding practice...

User avatar
esba1ley
Posts: 58
Joined: Sun Jan 01, 2017 2:15 am
Location: Pasadena, CA
Contact:

Re: problem uploading Arduino Sketch

Postby esba1ley » Sun Feb 04, 2018 4:50 am

Maybe... something curious is that all the fuses are set to 0x0 0x0 0x0... some of which affect whether or not an external clock is used, and whether or not to divide the clock by 8...

Code: Select all

avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (E:00, H:00, L:00)


It would make sense to drive the PIC and the Arduino off a single clock, that way they could stay in "lock step" and not drift from one another. Also, if the clock speed is wrong, the bit speed going to the NeoPixels will be wrong, and it could very well be read as 0xFFFFFF for each pixel (full on bright) if it's too slow.

I really think this is a clock speed thing... it's smelling more like that the more I dig. It might be that we blew away the fuses when we wrote the new code thanks to how we used the Arduino IDE... or it could be something else.

-E
----------
Erik S. Bailey
Entry, Descent, and Landing Aerospace Engineer
Maker, and Musician
SpiritRover Kickstarter Backer #460

User avatar
esba1ley
Posts: 58
Joined: Sun Jan 01, 2017 2:15 am
Location: Pasadena, CA
Contact:

Re: problem uploading Arduino Sketch

Postby esba1ley » Sun Feb 04, 2018 5:02 am

See this thread:

https://forum.arduino.cc/index.php?topic=71580.0

BEFORE WE DO ANYTHING:

If we get this wrong, we can "brick" the board...

Kevin: What should the fuses be so we can reset them?

-Erik
----------
Erik S. Bailey
Entry, Descent, and Landing Aerospace Engineer
Maker, and Musician
SpiritRover Kickstarter Backer #460

gpvillamil
Posts: 75
Joined: Fri Jan 26, 2018 5:03 pm

Re: problem uploading Arduino Sketch

Postby gpvillamil » Sun Feb 04, 2018 12:03 pm

I don’t think you can change the fuses when uploading via USB using the IDE... The thread discusses using an ISP.

Though it does look like a timing issue, and the fuses are wrong for an Uno. Perhaps Kevin used an ISP to program the boards, and used non standard fuse settings?

In fact I’m fairly certain this is what happened: an ISP was used to program the boards, because this would let you burn the bootloader and demo sketch at the same time. However the fuses that would let the IDE recognize it as an Uno board were not set (eg enable full USB vs serial over USB), so we are not able to upload correctly configured code.

Easy enough to fix w an ISP but I’d like some info on where to hook it up.

gpvillamil
Posts: 75
Joined: Fri Jan 26, 2018 5:03 pm

Re: problem uploading Arduino Sketch

Postby gpvillamil » Sun Feb 04, 2018 3:03 pm

Don’t even need an ISP, the RPi GPIO pins are already connected to the Arduino. Just need the pin assignments.

https://learn.adafruit.com/program-an-a ... s/overview

gpvillamil
Posts: 75
Joined: Fri Jan 26, 2018 5:03 pm

Re: problem uploading Arduino Sketch

Postby gpvillamil » Sun Feb 04, 2018 4:34 pm

Nope, looks like only RPi GPIO 17 is explained, that is the one that is used to signal a shutdown.

I'd dearly love to know what the RPi GPIO assignments are that match the Arduino SPI pins, then you could use avrdude on the Pi with linuxgpio as the programmer, and sort out the fuses. Or just upload code without the Arduino bootloader.

gpvillamil wrote:...

Also, looking at some of the comments makes me think that the RPi GPIO mapping is defined in hardware.h...

...

gpvillamil
Posts: 75
Joined: Fri Jan 26, 2018 5:03 pm

Re: problem uploading Arduino Sketch

Postby gpvillamil » Sun Feb 04, 2018 4:52 pm

I see the ISP pinouts now, they are in a group of 8 behind and to the right of the head. I see all the SPI pins. Adding headers to it should be easy but requires partial disassembly.

gpvillamil wrote:Just over USB. I don’t see any populated headers for another ISP.

...

User avatar
esba1ley
Posts: 58
Joined: Sun Jan 01, 2017 2:15 am
Location: Pasadena, CA
Contact:

Re: problem uploading Arduino Sketch

Postby esba1ley » Sun Feb 04, 2018 6:58 pm

I GOT IT!

SO it turns out by close inspection, it looks like the clock crystal next to the ATMega328p was 8MHz... so... by comparison I started looking at "which adruino boards have an ATMega328p, but have an 8MHz crystal, not a 16MHz crystal"... lo and behold, the Magical Arduino IDE settings for uplaod are:

Board: "Arduino Pro or Pro Mini"
Processor: "ATMega328 (3.3V, 8Hz)"
Programmer: "ArduinoISP"

By using these settings, I was able to build and re-burn the pre-loaded Demo code from PlumGeek's site, and I get proper behavior of the NeoPixels.

Yaaaaaay!

I think the reason we're not seeing the fuse values properly is that we're using a bootloader-enabled way of flashing the sketches on to the chip -- had we connected via the ISP header, we'd have both visibility (and control) of that.

I'm so glad we didn't have to head down that road... even if we had an ISP programmer, it would have been possible to get the chip into a configuration where we'd have to use a High Voltage Parallel/Serial programmer to fix the issue... and I was hoping we weren't staring down the barrel of needing that. Whew!

So, based on the fact that I fixed this via the proper IDE settings, my original hunch that there's something in the build process that sets what the processor speed is for internal variables seems to be correct.

Moral of the story: Use the above settings when using the Arduino IDE to program the board.

Now: if we could just get the proper configuration for the on-board RasPi to program the arduino, that will make us completely self-contained and not reliant on an external computer at all for development!
Last edited by esba1ley on Sun Feb 04, 2018 7:24 pm, edited 2 times in total.
----------
Erik S. Bailey
Entry, Descent, and Landing Aerospace Engineer
Maker, and Musician
SpiritRover Kickstarter Backer #460


Who is online

Users browsing this forum: No registered users and 3 guests