alexforencich / xboot

XBoot Extensible Bootloader
125 stars 69 forks source link

make arduino328p fails if i2c is enabled in config file #28

Open MOOSFETT opened 7 years ago

MOOSFETT commented 7 years ago

hi,

if i enable the i2c-option(s) in the arduino328p.conf.mk i'm getting an odd output on the make command. i've no clue what went wrong... when setting back e.g. to UART bus, everything goes fine.

unfortunately, i'm very new to the raspi and all the linux stuff, so i would really appreciate any hints and support also in terms of posting issues here.

i hope it is okay to post all the stuff in this form of presentation... first, the enabled lines of the conf.mk, after that i've pasted the mentioned output of the make-command.

resulting switches in the conf.mk:

USE_CONFIG_H = yes MCU = atmega328p BOOTSZ=0 F_CPU = 16000000 USE_DFLL = yes OVERRIDE_AVRDUDE_PROGRAMMER = yes AVRDUDE_PROGRAMMER = avrispmkII AVRDUDE_PORT = usb AVRDUDE_FUSES = USE_ENTER_DELAY = yes USE_ENTER_PIN = no USE_ENTER_UART = no USE_ENTER_I2C = yes USE_ENTER_FIFO = no USE_ENTER_EEPROM = no LOCK_SPM_ON_EXIT = no USE_LED = yes USE_UART = no USE_UART_EN_PIN = no USE_I2C = yes USE_I2C_ADDRESS_NEGOTIATION = no USE_ATTACH_LED = no USE_FIFO = no USE_INTERRUPTS = no USE_WATCHDOG = no ENABLE_BLOCK_SUPPORT = yes ENABLE_FLASH_BYTE_SUPPORT = yes ENABLE_EEPROM_BYTE_SUPPORT = yes ENABLE_LOCK_BITS = yes ENABLE_FUSE_BITS = yes ENABLE_FLASH_ERASE_WRITE = yes ENABLE_CRC_SUPPORT = yes ENABLE_API = yes USE_API_VERSION = 1 ENABLE_API_LOW_LEVEL_FLASH = yes ENABLE_API_SPM_WRAPPER = yes ENABLE_API_FIRMWARE_UPDATE = yes ENABLE_CODE_PROTECTION = no ENABLE_EEPROM_PROTECTION = no ENABLE_BOOTLOADER_PROTECTION = no ENTER_PORT_NAME = C ENTER_PIN = 0 ENTER_PIN_STATE = 0 ENTER_PIN_PUEN = 1 ENTER_BLINK_COUNT = 3 ENTER_BLINK_WAIT = 300000 ENTER_EEPROM_ADDR = 0x3f8; WATCHDOG_TIMEOUT = WDT_PER_1KCLK_gc LED_PORT_NAME = B LED_PIN = 5 LED_INV = 1 UART_BAUD_RATE = 115200 UART_NUMBER = 0 UART_U2X = yes UART_RX_PUEN = yes UART_REMAP = no UART_EN_PORT_NAME = C UART_EN_PIN = 4 UART_EN_PIN_INV = 0 FIFO_DATA_PORT_NAME = C FIFO_CTL_PORT_NAME = D FIFO_RXF_N = 3 FIFO_TXE_N = 2 FIFO_RD_N = 1 FIFO_WR_N = 0 FIFO_BIT_REVERSE = yes I2C_DEVICE_PORT = C I2C_MATCH_ANY = 1 I2C_ADDRESS = 0x10 I2C_GC_ENABLE = 1

the output of the make command at prompt:

avr-gcc (GCC) 4.8.1 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Generating config.h for atmega328p

Compiling: xboot.c avr-gcc -c -mmcu=atmega328p -I. -gstabs -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -fno-jump-tables -Wall -Wa,-adhlns=xboot.lst -Wstrict-prototypes -std=gnu99 -MD -MP -MF .dep/xboot.o.d -DF_CPU=16000000L -DBOOT_SECTION_SIZE=0x001000 -DUSE_CONFIG_H xboot.c -o xboot.o In file included from xboot.c:34:0: xboot.c: In function ‘main’: xboot.h:366:46: error: ‘TWIC’ undeclared (first use in this function)

define I2C_DEVICE token_paste2(TWI, I2C_DEVICE_PORT)

                                          ^

xboot.h:43:32: note: in definition of macro ‘token_paste2_int’

define token_paste2_int(x, y) x ## y

                            ^

xboot.h:366:33: note: in expansion of macro ‘token_paste2’

define I2C_DEVICE token_paste2(TWI, I2C_DEVICE_PORT)

                             ^

i2c.h:45:31: note: in expansion of macro ‘I2C_DEVICE’

define i2c_address_match() ((I2C_DEVICE.SLAVE.STATUS & TWI_SLAVE_APIF_bm) && \

                           ^

xboot.c:388:21: note: in expansion of macro ‘i2c_address_match’ if (i2c_address_match()) ^ xboot.h:366:46: note: each undeclared identifier is reported only once for each function it appears in

define I2C_DEVICE token_paste2(TWI, I2C_DEVICE_PORT)

                                          ^

xboot.h:43:32: note: in definition of macro ‘token_paste2_int’

define token_paste2_int(x, y) x ## y

                            ^

xboot.h:366:33: note: in expansion of macro ‘token_paste2’

define I2C_DEVICE token_paste2(TWI, I2C_DEVICE_PORT)

                             ^

i2c.h:45:31: note: in expansion of macro ‘I2C_DEVICE’

define i2c_address_match() ((I2C_DEVICE.SLAVE.STATUS & TWI_SLAVE_APIF_bm) && \

                           ^

xboot.c:388:21: note: in expansion of macro ‘i2c_address_match’ if (i2c_address_match()) ^ In file included from xboot.h:432:0, from xboot.c:34: i2c.h:45:57: error: ‘TWI_SLAVE_APIF_bm’ undeclared (first use in this function)

define i2c_address_match() ((I2C_DEVICE.SLAVE.STATUS & TWI_SLAVE_APIF_bm) && \

                                                     ^

xboot.c:388:21: note: in expansion of macro ‘i2c_address_match’ if (i2c_address_match()) ^ i2c.h:46:36: error: ‘TWI_SLAVE_AP_bm’ undeclared (first use in this function) (I2C_DEVICE.SLAVE.STATUS & TWI_SLAVE_AP_bm)) ^ xboot.c:388:21: note: in expansion of macro ‘i2c_address_match’ if (i2c_address_match()) ^ xboot.c: In function ‘get_char’: xboot.c:1208:26: error: #error Not implemented!

error Not implemented!

                      ^

xboot.c: In function ‘send_char’: xboot.c:1314:26: error: #error Not implemented!

error Not implemented!

                      ^

xboot.c:1233:23: warning: unused variable ‘tmp’ [-Wunused-variable] unsigned char tmp; ^ Makefile:886: recipe for target 'xboot.o' failed make[1]: [xboot.o] Error 1 make[1]: Leaving directory '/home/pi/xboot' Makefile:779: recipe for target 'conf/arduino328p.conf.mk' failed make: [conf/arduino328p.conf.mk] Error 2

thank you guys for checking this issue (if it is a real one ;o) !

regards, richard