GithubHelp home page GithubHelp logo

[Bug] custom firmware compiling for doio kb28 keeps giving errors with quantum/encoder.h and quantum/util.h about qmk_firmware HOT 10 CLOSED

Nebula-0-System avatar Nebula-0-System commented on September 27, 2024
[Bug] custom firmware compiling for doio kb28 keeps giving errors with quantum/encoder.h and quantum/util.h

from qmk_firmware.

Comments (10)

tzarc avatar tzarc commented on September 27, 2024

Pretty sure your avr-gcc is just plain too old.

from qmk_firmware.

Nebula-0-System avatar Nebula-0-System commented on September 27, 2024

Pretty sure your avr-gcc is just plain too old.

if i may ask, what is that? and how do i update it?

from qmk_firmware.

tzarc avatar tzarc commented on September 27, 2024

It's the compiler that effectively converts the source code for QMK into a usable binary to flash your keyboard.
Unfortunately Debian-derived Linux distro's such as the Linux Mint you're using package an ancient copy of avr-gcc.

If you've got Docker installed, it's probably simplest to use that to build as the container includes a newer version:

./util/docker_cmd.sh qmk compile -kb kb28 -km aleena

from qmk_firmware.

Nebula-0-System avatar Nebula-0-System commented on September 27, 2024

It's the compiler that effectively converts the source code for QMK into a usable binary to flash your keyboard. Unfortunately Debian-derived Linux distro's such as the Linux Mint you're using package an ancient copy of avr-gcc.

If you've got Docker installed, it's probably simplest to use that to build as the container includes a newer version:

./util/docker_cmd.sh qmk compile -kb kb28 -km aleena

wow, had no idea it'd be something like that. i'll try it and get back to you

from qmk_firmware.

Nebula-0-System avatar Nebula-0-System commented on September 27, 2024

new errors, so at least we're getting somewhere. it prompted me to change some values in the code, but still giving errors now that i fixed that

Ψ Compiling keymap with gmake -r -R -f builddefs/build_keyboard.mk -s KEYBOARD=kb28 KEYMAP=aleena KEYBOARD_FILESAFE=kb28 TARGET=kb28_aleena INTERMEDIATE_OUTPUT=.build/obj_kb28_aleena VERBOSE=false COLOR=true SILENT=false QMK_BIN="qmk"


avr-gcc (GCC) 8.3.0
Copyright (C) 2018 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: .build/obj_kb28_aleena/src/default_keyboard.c                                            [OK]
Compiling: quantum/keymap_introspection.c                                                          quantum/keymap_introspection.c: In function 'keymap_layer_count_raw':
quantum/keymap_introspection.c:17:49: error: 'keymaps' undeclared (first use in this function)
 #define NUM_KEYMAP_LAYERS_RAW ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t))))
                                                 ^~~~~~~
quantum/keymap_introspection.c:20:12: note: in expansion of macro 'NUM_KEYMAP_LAYERS_RAW'
     return NUM_KEYMAP_LAYERS_RAW;
            ^~~~~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c:17:49: note: each undeclared identifier is reported only once for each function it appears in
 #define NUM_KEYMAP_LAYERS_RAW ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t))))
                                                 ^~~~~~~
quantum/keymap_introspection.c:20:12: note: in expansion of macro 'NUM_KEYMAP_LAYERS_RAW'
     return NUM_KEYMAP_LAYERS_RAW;
            ^~~~~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c: At top level:
quantum/keymap_introspection.c:17:49: error: 'keymaps' undeclared here (not in a function)
 #define NUM_KEYMAP_LAYERS_RAW ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t))))
                                                 ^~~~~~~
quantum/keymap_introspection.c:28:16: note: in expansion of macro 'NUM_KEYMAP_LAYERS_RAW'
 _Static_assert(NUM_KEYMAP_LAYERS_RAW <= MAX_LAYER, "Number of keymap layers exceeds maximum set by DYNAMIC_KEYMAP_LAYER_COUNT");
                ^~~~~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c:17:31: error: expression in static assertion is not an integer
 #define NUM_KEYMAP_LAYERS_RAW ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t))))
                               ^
quantum/keymap_introspection.c:28:16: note: in expansion of macro 'NUM_KEYMAP_LAYERS_RAW'
 _Static_assert(NUM_KEYMAP_LAYERS_RAW <= MAX_LAYER, "Number of keymap layers exceeds maximum set by DYNAMIC_KEYMAP_LAYER_COUNT");
                ^~~~~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c: In function 'keymap_layer_count_raw':
quantum/keymap_introspection.c:21:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors
 [ERRORS]
 | 
 | 
 | 
gmake: *** [builddefs/common_rules.mk:373: .build/obj_kb28_aleena/quantum/keymap_introspection.o] Error 1

again, it's more core stuff to the repo, so i feel i shouldn't need to change it. any other ideas? if not i'll just fix it myself and put in a PR when this is all said and done

from qmk_firmware.

lesshonor avatar lesshonor commented on September 27, 2024

If your keyboards/doio/kb28/keymaps/default/keymap.c is identical to keymaps/doio/kb28/kb28g.c, you effectively don't have a keymap (which is required).

Examining other keyboards in the repository along with the documentation will provide helpful information about the structure of this file.

If I've misread or misunderstood, perhaps make is not rebuilding all the files it needs to; running qmk clean will help there.

from qmk_firmware.

Nebula-0-System avatar Nebula-0-System commented on September 27, 2024

If your keyboards/doio/kb28/keymaps/default/keymap.c is identical to keymaps/doio/kb28/kb28g.c, you effectively don't have a keymap (which is required).

Examining other keyboards in the repository along with the documentation will provide helpful information about the structure of this file.

wow, i did not read that well enough, thought that was the default keymap, not that it was just for the LEDs. i also just realized the error specifically states "keymaps undeclared"

i'll fix that now and let you know.

from qmk_firmware.

Nebula-0-System avatar Nebula-0-System commented on September 27, 2024

ok got very far, all the way to flashing in fact (after removing #include "kb28g.h" in the keymap.c), but at the last line i got

sh: 1: hid_bootloader_cli: not found
gmake: *** [platforms/avr/flash.mk:173: flash] Error 127

which i checked, and it requires you to specify the microcontroller, which i did, and it still didn't work.

that said there was a previous issue i thought i solved where it wouldn't let me compile the right bootloader for the chip, so i just chose qmk-hid as it seemed like the generic option and it stopped giving me "invalid bootloader specified". maybe that was a mistake and i didn't actually solve the issue? i don't think so as it did seem to work afterwards.

from qmk_firmware.

lesshonor avatar lesshonor commented on September 27, 2024

so i just chose qmk-hid as it seemed like the generic option

There is no generic option for bootloaders; these are hardware-specific.

It would be a good idea to upload the original code as-provided to a public repository, since it is unknown what you've changed or what microcontroller the PCB uses. Given the original error message you mention of an invalid bootloader, seeking assistance with the conversion in the QMK Discord is also recommended.

It doesn't sound like the bootloader situation is simple/standard, and getting this wrong has the potential to "brick" the PCB. (You would need to acquire a hardware programmer to reprogram the bootloader using specific pins if that happens.)

from qmk_firmware.

Nebula-0-System avatar Nebula-0-System commented on September 27, 2024

so i just chose qmk-hid as it seemed like the generic option

There is no generic option for bootloaders; these are hardware-specific.

It would be a good idea to upload the original code as-provided to a public repository, since it is unknown what you've changed or what microcontroller the PCB uses. Given the original error message you mention of an invalid bootloader, seeking assistance with the conversion in the QMK Discord is also recommended.

It doesn't sound like the bootloader situation is simple/standard, and getting this wrong has the potential to "brick" the PCB. (You would need to acquire a hardware programmer to reprogram the bootloader using specific pins if that happens.)

alright, thank you. i'll move there and close this then as clearly it's not a bug or whatever, but has to do with the KB code. thanks for the help in getting me closer

from qmk_firmware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.