Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling plain AVR C example is causing sed errors #335

Closed
sudar opened this issue Mar 28, 2015 · 4 comments
Closed

Compiling plain AVR C example is causing sed errors #335

sudar opened this issue Mar 28, 2015 · 4 comments

Comments

@sudar
Copy link
Owner

sudar commented Mar 28, 2015

While trying to compile our BlinkInAVRC example, I am getting the following error in Mac.

@sej7278 Are you getting this error in Linux?

I think this is because of the small difference between sed in Linux and Mac.

$ make
-------------------------
Arduino.mk Configuration:
- [AUTODETECTED]       CURRENT_OS = MAC 
- [USER]               ARDUINO_DIR = /Users/sudar/Applications/Arduino.app/Contents/Resources/Java/ 
- [USER]               ARDMK_DIR = /Users/sudar/Dropbox/code/Arduino-Makefile 
- [AUTODETECTED]       ARDUINO_VERSION = 106 
- [DEFAULT]            ARCHITECTURE =  
- [DEFAULT]            VENDOR = arduino 
- [AUTODETECTED]       ARDUINO_PREFERENCES_PATH = /Users/sudar/Library/Arduino/preferences.txt 
- [AUTODETECTED]       ARDUINO_SKETCHBOOK = /Users/sudar/Dropbox/code/arduino-sketches (from arduino preferences file)
- [BUNDLED]            AVR_TOOLS_DIR = /Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/tools/avr (in Arduino distribution)
- [COMPUTED]           ARDUINO_LIB_PATH = /Users/sudar/Applications/Arduino.app/Contents/Resources/Java//libraries (from ARDUINO_DIR)
- [COMPUTED]           ARDUINO_VAR_PATH = /Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/arduino//variants (from ARDUINO_DIR)
- [COMPUTED]           BOARDS_TXT = /Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/arduino//boards.txt (from ARDUINO_DIR)
- [DEFAULT]            USER_LIB_PATH = /Users/sudar/Dropbox/code/arduino-sketches/libraries (in user sketchbook)
- [DEFAULT]            PRE_BUILD_HOOK = pre-build-hook.sh 
- [USER]               BOARD_TAG = atmega16 
- [COMPUTED]           OBJDIR = build-atmega16 (from BOARD_TAG)
- [DEFAULT]            ARDUINO_CORE_PATH = /Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/arduino//cores/arduino 
- [MANUAL]             NO_CORE set so core library will not be built
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
- [DEFAULT]            OPTIMIZATION_LEVEL = s 
- [DEFAULT]            MCU_FLAG_NAME = mmcu 
- [DEFAULT]            CFLAGS_STD =  
- [DEFAULT]            CXXFLAGS_STD =  
- [AUTODETECTED]       DEVICE_PATH =  
- [DEFAULT]            FORCE_MONITOR_PORT =  
- [AUTODETECTED]       Size utility: AVR-aware for enhanced output
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
sed: RE error: illegal byte sequence
- [COMPUTED]           BOOTLOADER_PARENT = /Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/arduino//bootloaders (from ARDUINO_DIR)
- [COMPUTED]           ARDMK_VERSION = 1.3.4 
- [COMPUTED]           CC_VERSION = 4.3.2 (avr-gcc)
-------------------------
mkdir -p build-atmega16
/Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/tools/avr/bin/avr-gcc -MMD -c -mmcu=atmega16 -DF_CPU=8000000L -DARDUINO=106  -D__PROG_TYPES_COMPAT__ -I/Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/arduino//cores/arduino -I/Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/arduino//variants/    -Wall -ffunction-sections -fdata-sections -Os  blink.c -o build-atmega16/blink.o
/Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/tools/avr/bin/avr-ar rcs build-atmega16/libcore.a        
/Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/tools/avr/bin/avr-gcc -mmcu=atmega16 -Wl,--gc-sections -Os -o build-atmega16/BlinkInAVRC.elf build-atmega16/blink.o build-atmega16/libcore.a  -lc -lm
/Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/tools/avr/bin/avr-objcopy -j .eeprom --set-section-flags=.eeprom='alloc,load' \
        --change-section-lma .eeprom=0 -O ihex build-atmega16/BlinkInAVRC.elf build-atmega16/BlinkInAVRC.eep
/Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/tools/avr/bin/avr-objcopy: --change-section-lma .eeprom=0x00000000 never used
/Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom build-atmega16/BlinkInAVRC.elf build-atmega16/BlinkInAVRC.hex

/Users/sudar/Applications/Arduino.app/Contents/Resources/Java//hardware/tools/avr/bin/avr-size --mcu=atmega16 -C --format=avr build-atmega16/BlinkInAVRC.elf
AVR Memory Usage
----------------
Device: atmega16

Program:     214 bytes (1.3% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)


Maximum flash memory of atmega16 is not specified. Make sure the size of build-atmega16/BlinkInAVRC.hex is less than atmega16's flash memory
@sudar
Copy link
Owner Author

sudar commented Mar 28, 2015

Okay, I found the line where the error is happening.

ifndef ARDUINO_LIBS
    # automatically determine included libraries
    ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_DIR)/libraries/*)), \
        $(shell sed -ne 's/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p' $(LOCAL_SRCS)))
    ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_SKETCHBOOK)/libraries/*)), \
        $(shell sed -ne 's/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p' $(LOCAL_SRCS)))
    ARDUINO_LIBS += $(filter $(notdir $(wildcard $(USER_LIB_PATH)/*)), \
        $(shell sed -ne 's/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p' $(LOCAL_SRCS)))
    ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_PLATFORM_LIB_PATH)/*)), \
        $(shell sed -ne 's/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p' $(LOCAL_SRCS)))
endif

@sej7278
Copy link
Collaborator

sej7278 commented Mar 28, 2015

no i don't get the error in linux with 1.0.5 or 1.6.1

ah - i suspect its the copyright symbol, as some googling refers to utf-8 characters and osx's locale.

try replacing the © with (c) - yes, tested on mavericks and it is that.

sej7278 pushed a commit to sej7278/Arduino-Makefile that referenced this issue Mar 28, 2015
@sej7278
Copy link
Collaborator

sej7278 commented Mar 28, 2015

Fixed in 2nd commit of PR #336

Just merged it - hope that's ok?

@sej7278 sej7278 closed this as completed Mar 28, 2015
@sudar
Copy link
Owner Author

sudar commented Mar 29, 2015

Thank you very much for figuring it out. I was breaking my head with the regular expression..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants