system76 / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
93 stars 33 forks source link

[Bug] ERROR trying to compile QMK firmware #47

Closed daniloraisi closed 2 months ago

daniloraisi commented 7 months ago

Describe the Bug

I'm trying to compile the QMK firmware to get a custom layout into my Launch Lite, but I can't get it working due to these errors.

The produced log:

QMK Firmware 0.21.0          
Making system76/launch_lite_1 with keymap default                                                                     

avr-gcc (GCC) 13.2.0                        
Copyright (C) 2023 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.                                           

Compiling: keyboards/system76/system76_ec.c                                                         [OK]
Compiling: platforms/avr/drivers/i2c_master.c                                                      In function 'i2c_start_impl',                                            
    inlined from 'i2c_start' at platforms/avr/drivers/i2c_master.c:103:18:                 
platforms/avr/drivers/i2c_master.c:60:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
   60 |     TWCR = 0;                                                                                                                                                                                                                       
      |          ^                                                                                                    
In function 'i2c_start':     
cc1: note: source object is likely at address zero                                                                    
In function 'i2c_start_impl',                                                                                                                                                                                                               
    inlined from 'i2c_start' at platforms/avr/drivers/i2c_master.c:103:18:                 
platforms/avr/drivers/i2c_master.c:62:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
   62 |     TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN);                                                                                                                                                                               
      |          ^                                                                                                    
In function 'i2c_start':     
cc1: note: source object is likely at address zero                                                                    
In file included from /usr/avr/include/avr/io.h:99,                                                                                                                                                                                         
                 from platforms/avr/drivers/i2c_master.c:20:
In function 'i2c_start_impl',                                                                                         
    inlined from 'i2c_start' at platforms/avr/drivers/i2c_master.c:103:18:                                                                                                                                                                  
platforms/avr/drivers/i2c_master.c:65:14: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
   65 |     while (!(TWCR & (1 << TWINT))) {
      |              ^~~~                                                                                             
In function 'i2c_start':                                                                                                                                                                                                                    
cc1: note: source object is likely at address zero
In function 'i2c_start_impl',                                                                                         
    inlined from 'i2c_start' at platforms/avr/drivers/i2c_master.c:103:18:                                                                                                                                                                  
platforms/avr/drivers/i2c_master.c:72:11: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
   72 |     if (((TW_STATUS & 0xF8) != TW_START) && ((TW_STATUS & 0xF8) != TW_REP_START)) {
      |           ^~~~~~~~~                                                                                           
In function 'i2c_start':                                                                                                                                                                                                                    
cc1: note: source object is likely at address zero
In function 'i2c_start_impl',
    inlined from 'i2c_start' at platforms/avr/drivers/i2c_master.c:103:18:
platforms/avr/drivers/i2c_master.c:72:47: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
   72 |     if (((TW_STATUS & 0xF8) != TW_START) && ((TW_STATUS & 0xF8) != TW_REP_START)) {
      |                                               ^~~~~~~~~                                             
In function 'i2c_start':                                                                                                                                                                                                                    
cc1: note: source object is likely at address zero                                                                    
In function 'i2c_start_impl',         
    inlined from 'i2c_start' at platforms/avr/drivers/i2c_master.c:103:18:
platforms/avr/drivers/i2c_master.c:77:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
   77 |     TWDR = address;
      |          ^
In function 'i2c_start':
cc1: note: source object is likely at address zero
In function 'i2c_start_impl',
    inlined from 'i2c_start' at platforms/avr/drivers/i2c_master.c:103:18:
platforms/avr/drivers/i2c_master.c:79:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
   79 |     TWCR = (1 << TWINT) | (1 << TWEN);
      |          ^
In function 'i2c_start':
cc1: note: source object is likely at address zero
In function 'i2c_start_impl',
    inlined from 'i2c_start' at platforms/avr/drivers/i2c_master.c:103:18:
platforms/avr/drivers/i2c_master.c:82:14: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
   82 |     while (!(TWCR & (1 << TWINT))) {
      |              ^~~~
In function 'i2c_start':
cc1: note: source object is likely at address zero
In function 'i2c_start_impl',
    inlined from 'i2c_start' at platforms/avr/drivers/i2c_master.c:103:18:
platforms/avr/drivers/i2c_master.c:89:30: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
   89 |     uint8_t twst = TW_STATUS & 0xF8;
      |                              ^
In function 'i2c_start':
cc1: note: source object is likely at address zero
In function 'i2c_stop',
    inlined from 'i2c_transmit' at platforms/avr/drivers/i2c_master.c:165:5:
platforms/avr/drivers/i2c_master.c:298:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
  298 |     TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);
      |          ^
In function 'i2c_transmit':
cc1: note: source object is likely at address zero
In function 'i2c_stop',
    inlined from 'i2c_receive' at platforms/avr/drivers/i2c_master.c:187:5:
platforms/avr/drivers/i2c_master.c:298:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
  298 |     TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);
      |          ^
In function 'i2c_receive':
cc1: note: source object is likely at address zero
In function 'i2c_stop',
    inlined from 'i2c_writeReg' at platforms/avr/drivers/i2c_master.c:202:5:
platforms/avr/drivers/i2c_master.c:298:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
  298 |     TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);
      |          ^
In function 'i2c_writeReg':
cc1: note: source object is likely at address zero
In function 'i2c_stop',
    inlined from 'i2c_writeReg16' at platforms/avr/drivers/i2c_master.c:221:5:
platforms/avr/drivers/i2c_master.c:298:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
  298 |     TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);
      |          ^
In function 'i2c_writeReg16':
cc1: note: source object is likely at address zero
In function 'i2c_stop',
    inlined from 'i2c_readReg' at platforms/avr/drivers/i2c_master.c:254:5:
platforms/avr/drivers/i2c_master.c:298:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
  298 |     TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);
      |          ^
In function 'i2c_readReg':
cc1: note: source object is likely at address zero
In function 'i2c_stop',
    inlined from 'i2c_readReg16' at platforms/avr/drivers/i2c_master.c:291:5:
platforms/avr/drivers/i2c_master.c:298:10: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds=]
  298 |     TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);
      |          ^
In function 'i2c_readReg16':
cc1: note: source object is likely at address zero
cc1: all warnings being treated as errors
 [ERRORS]
 | 
 | 
 | 
make[1]: *** [builddefs/common_rules.mk:361: .build/obj_system76_launch_lite_1_default/i2c_master.o] Error 1
Make finished with errors
make: *** [Makefile:392: system76/launch_lite_1:default] Error 1

Keyboard Used

system76/launch_lite_1

Link to product page (if applicable)

https://system76.com/accessories/launch

Operating System

Arch Linux

qmk doctor Output

❯ qmk doctor
Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.1.5
Ψ QMK home: /home/danilo/Documents/code/qmk_firmware
Ψ Detected Linux (EndeavourOS).
Ψ Git branch: master
Ψ Repo version: 0.21.0
⚠ The official repository does not seem to be configured as git remote "upstream".
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 13.2.0
Ψ Found avr-gcc version 13.2.0
⚠ We do not recommend avr-gcc newer than 8. Downgrading to 8.x is recommended.
Ψ Found avrdude version 7.3
Ψ Found dfu-programmer version 1.0.0
Ψ Found dfu-util version 0.11
Ψ Submodules are up to date.
Ψ Submodule status:
Ψ - lib/chibios: 2023-04-15 13:48:04 +0000 --  (11edb1610)
Ψ - lib/chibios-contrib: 2023-01-11 16:42:27 +0100 --  (a224be15)
Ψ - lib/googletest: 2021-06-11 06:37:43 -0700 --  (e2239ee6)
Ψ - lib/lufa: 2022-08-26 12:09:55 +1000 --  (549b97320)
Ψ - lib/vusb: 2022-06-13 09:18:17 +1000 --  (819dbc1)
Ψ - lib/printf: 2022-06-29 23:59:58 +0300 --  (c2e3b4e)
Ψ - lib/pico-sdk: 2023-02-12 20:19:37 +0100 --  (a3398d8)
Ψ - lib/lvgl: 2022-04-11 04:44:53 -0600 --  (e19410f8)
Ψ - openocd: 2023-01-20 14:50:53 +0000 --  (8e3c38f78)
Ψ QMK is ready to go, but minor problems were found

Is AutoHotKey / Karabiner installed

Other keyboard-related software installed

No response

Additional Context

I have another QMK keyboard, a YMDK Air 40 and I can compile and flash the firmware without any problems.