Protocentral / protocentral-healthypi-v3

HealthyPi is the first fully open-source, full-featured vital sign monitor. Using the Raspberry Pi as its computing and display platform, the HealthyPi add-on HAT turns the Raspberry Pi into a vital sign monitoring system.
http://healthypi.protocentral.com
Other
194 stars 51 forks source link

"'sercom2' was not declared in this scope" compile error in Arduino #5

Closed docmollo closed 7 years ago

docmollo commented 7 years ago

Tried compiling the streaming version of the firmware with Arduino IDE 1.8.3 on a 64-bit Fedora 25 machine. The compiler error output is below (from the IDE).

Arduino: 1.8.3 (Linux), Board: "Arduino/Genuino Uno"

/home/dustin/src/arduino-1.8.3/arduino-builder -dump-prefs -logger=machine -hardware /home/dustin/src/arduino-1.8.3/hardware -hardware /home/dustin/.arduino15/packages -hardware /home/dustin/src/arduino/hardware -tools /home/dustin/src/arduino-1.8.3/tools-builder -tools /home/dustin/src/arduino-1.8.3/hardware/tools/avr -tools /home/dustin/.arduino15/packages -built-in-libraries /home/dustin/src/arduino-1.8.3/libraries -libraries /home/dustin/src/arduino/libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path /tmp/arduino_build_33309 -warnings=none -build-cache /tmp/arduino_cache_685491 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/home/dustin/src/arduino-1.8.3/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/home/dustin/src/arduino-1.8.3/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/home/dustin/src/arduino-1.8.3/hardware/tools/avr -verbose /home/dustin/src/healthypi-firmware/firmware/healthypi3_streaming/healthypi3_streaming.ino
/home/dustin/src/arduino-1.8.3/arduino-builder -compile -logger=machine -hardware /home/dustin/src/arduino-1.8.3/hardware -hardware /home/dustin/.arduino15/packages -hardware /home/dustin/src/arduino/hardware -tools /home/dustin/src/arduino-1.8.3/tools-builder -tools /home/dustin/src/arduino-1.8.3/hardware/tools/avr -tools /home/dustin/.arduino15/packages -built-in-libraries /home/dustin/src/arduino-1.8.3/libraries -libraries /home/dustin/src/arduino/libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path /tmp/arduino_build_33309 -warnings=none -build-cache /tmp/arduino_cache_685491 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/home/dustin/src/arduino-1.8.3/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/home/dustin/src/arduino-1.8.3/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/home/dustin/src/arduino-1.8.3/hardware/tools/avr -verbose /home/dustin/src/healthypi-firmware/firmware/healthypi3_streaming/healthypi3_streaming.ino
Using board 'uno' from platform in folder: /home/dustin/src/arduino-1.8.3/hardware/arduino/avr
Using core 'arduino' from platform in folder: /home/dustin/src/arduino-1.8.3/hardware/arduino/avr
Detecting libraries used...
"/home/dustin/src/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/variants/standard" "/tmp/arduino_build_33309/sketch/healthypi3_streaming.ino.cpp" -o "/dev/null"
"/home/dustin/src/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/variants/standard" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/SPI/src" "/tmp/arduino_build_33309/sketch/healthypi3_streaming.ino.cpp" -o "/dev/null"
"/home/dustin/src/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/variants/standard" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/SPI/src" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/Wire/src" "/tmp/arduino_build_33309/sketch/healthypi3_streaming.ino.cpp" -o "/dev/null"
"/home/dustin/src/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/variants/standard" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/SPI/src" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/Wire/src" "/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/SPI/src/SPI.cpp" -o "/dev/null"
"/home/dustin/src/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/variants/standard" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/SPI/src" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/Wire/src" "/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/Wire/src/Wire.cpp" -o "/dev/null"
"/home/dustin/src/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/variants/standard" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/SPI/src" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/Wire/src" "/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/Wire/src/utility/twi.c" -o "/dev/null"
Generating function prototypes...
"/home/dustin/src/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/variants/standard" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/SPI/src" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/Wire/src" "/tmp/arduino_build_33309/sketch/healthypi3_streaming.ino.cpp" -o "/tmp/arduino_build_33309/preproc/ctags_target_for_gcc_minus_e.cpp"
"/home/dustin/src/arduino-1.8.3/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_33309/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/home/dustin/src/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/variants/standard" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/SPI/src" "-I/home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/Wire/src" "/tmp/arduino_build_33309/sketch/healthypi3_streaming.ino.cpp" -o "/tmp/arduino_build_33309/sketch/healthypi3_streaming.ino.cpp.o"
healthypi3_streaming:58: error: 'sercom2' was not declared in this scope
 SPIClass ads1292rSPI (&sercom2, 4, 0, 1, SPI_PAD_2_SCK_3, SERCOM_RX_PAD_0);
                        ^
healthypi3_streaming:58: error: 'SPI_PAD_2_SCK_3' was not declared in this scope
 SPIClass ads1292rSPI (&sercom2, 4, 0, 1, SPI_PAD_2_SCK_3, SERCOM_RX_PAD_0);
                                          ^
healthypi3_streaming:58: error: 'SERCOM_RX_PAD_0' was not declared in this scope
 SPIClass ads1292rSPI (&sercom2, 4, 0, 1, SPI_PAD_2_SCK_3, SERCOM_RX_PAD_0);
                                                           ^
healthypi3_streaming:60: error: 'sercom0' was not declared in this scope
 SPIClass afe4490SPI (&sercom0, 17, 9 , 8, SPI_PAD_2_SCK_3, SERCOM_RX_PAD_0);    
                       ^
healthypi3_streaming:60: error: 'SPI_PAD_2_SCK_3' was not declared in this scope
 SPIClass afe4490SPI (&sercom0, 17, 9 , 8, SPI_PAD_2_SCK_3, SERCOM_RX_PAD_0);    
                                           ^
healthypi3_streaming:60: error: 'SERCOM_RX_PAD_0' was not declared in this scope
 SPIClass afe4490SPI (&sercom0, 17, 9 , 8, SPI_PAD_2_SCK_3, SERCOM_RX_PAD_0);    
                                                            ^
healthypi3_streaming:62: error: 'Uart' does not name a type
 Uart  RpiSerial(&sercom4, 38, 22 , SERCOM_RX_PAD_1, UART_TX_PAD_0);    
 ^
healthypi3_streaming:64: error: 'sercom1' was not declared in this scope
 TwoWire max30205(&sercom1, 11, 13);
                   ^
/home/dustin/src/healthypi-firmware/firmware/healthypi3_streaming/healthypi3_streaming.ino: In function 'void setup()':
healthypi3_streaming:271: error: 'SerialUSB' was not declared in this scope
     SerialUSB.begin(115200);
     ^
healthypi3_streaming:272: error: 'RpiSerial' was not declared in this scope
     RpiSerial.begin(57600);
     ^
/home/dustin/src/healthypi-firmware/firmware/healthypi3_streaming/healthypi3_streaming.ino: In function 'void loop()':
healthypi3_streaming:435: error: 'SerialUSB' was not declared in this scope
           SerialUSB.write(DataPacket[i]);
           ^
healthypi3_streaming:436: error: 'RpiSerial' was not declared in this scope
           RpiSerial.write(DataPacket[i]);        
           ^
/home/dustin/src/healthypi-firmware/firmware/healthypi3_streaming/healthypi3_streaming.ino: In function 'void ads1292Rbegin()':
healthypi3_streaming:457: error: 'PIO_SERCOM_ALT' was not declared in this scope
    pinPeripheral(4, PIO_SERCOM_ALT);
                     ^
healthypi3_streaming:457: error: 'pinPeripheral' was not declared in this scope
    pinPeripheral(4, PIO_SERCOM_ALT);
                                   ^
/home/dustin/src/healthypi-firmware/firmware/healthypi3_streaming/healthypi3_streaming.ino: In function 'void afe4490begin()':
healthypi3_streaming:686: error: 'PIO_SERCOM_ALT' was not declared in this scope
     pinPeripheral(17, PIO_SERCOM_ALT);
                       ^
healthypi3_streaming:686: error: 'pinPeripheral' was not declared in this scope
     pinPeripheral(17, PIO_SERCOM_ALT);
                                     ^
/home/dustin/src/healthypi-firmware/firmware/healthypi3_streaming/healthypi3_streaming.ino: In function 'void max30205begin()':
healthypi3_streaming:757: error: 'PIO_SERCOM' was not declared in this scope
     pinPeripheral(11, PIO_SERCOM);
                       ^
healthypi3_streaming:757: error: 'pinPeripheral' was not declared in this scope
     pinPeripheral(11, PIO_SERCOM);
                                 ^
Using library SPI at version 1.0 in folder: /home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/SPI 
Using library Wire at version 1.0 in folder: /home/dustin/src/arduino-1.8.3/hardware/arduino/avr/libraries/Wire 
exit status 1
'sercom2' was not declared in this scope
docmollo commented 7 years ago

By the way, this is the firmware zip file from the v1.1 release.

VenkateshBhat commented 7 years ago

@docmollo Good day! Please select the board as Arduino/Genuino zero(Native Port).

docmollo commented 7 years ago

Yes, this was entirely user error. I woke up this morning and immediately realized what I had done last night. I made the change and everything worked as expected. Sorry for the trouble and thanks to @VenkateshBhat for the quick response!