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

Womier k66 rgb support #1

Open
wants to merge 36 commits into
base: chibios-upgrade
Choose a base branch
from
Open

Conversation

toastdb
Copy link
Collaborator

@toastdb toastdb commented Mar 2, 2020

Description

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@pgillan145
Copy link

pgillan145 commented Jun 3, 2020

I get a couple of minor warnings and a linking error when I try to build this branch:

Compiling: keyboards/womier/k66/matrix.c keyboards/womier/k66/matrix.c:56:13: warning: 'unselect_col' defined but not used [-Wunused-function]
static void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); }
^~~~~~~~~~~~
keyboards/womier/k66/matrix.c:51:13: warning: 'select_col' defined but not used [-Wunused-function]
static void select_col(uint8_t col) {
^~~~~~~~~~
Compiling: keyboards/womier/k66/led_matrix.c keyboards/womier/k66/led_matrix.c:208:6: warning: function declaration isn't a prototype [-Wstrict-prototypes]
void RgbIsr() {
^~~~~~

Linking: .build/womier_k66_default.elf [ERRORS]
|
| /usr/local/Cellar/gcc-arm-none-eabi/20180627/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/libg_nano.a(lib_a-sbrkr.o): In function '_sbrk_r':
| sbrkr.c:(.text._sbrk_r+0xc): undefined reference to '_sbrk'
| collect2: error: ld returned 1 exit status
|
make[1]: *** [.build/womier_k66_default.elf] Error 1
make: *** [womier/k66:default] Error 1
Make finished with errors

NOTE: Running on OS X 10.15.5.

@pgillan145
Copy link

I got more linking errors when I tried compiling this on Ubuntu 20.04:

Linking: .build/womier_k66_default.elf [ERRORS]
|
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: .build/womier_k66_default.elf section '.text' will not fit in region 'flash0'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: region 'flash0' overflowed by 4792 bytes
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-sbrkr.o): in function '_sbrk_r':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/reent/../../../../../../../../newlib/libc/reent/sbrkr.c:51: undefined reference to '_sbrk'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-abort.o): in function 'abort':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/stdlib/../../../../../../../../newlib/libc/stdlib/abort.c:59: undefined reference to '_exit'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-signalr.o): in function '_kill_r':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/reent/../../../../../../../../newlib/libc/reent/signalr.c:53: undefined reference to '_kill'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-signalr.o): in function '_getpid_r':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/reent/../../../../../../../../newlib/libc/reent/signalr.c:83: undefined reference to '_getpid'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-writer.o): in function '_write_r':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/reent/../../../../../../../../newlib/libc/reent/writer.c:49: undefined reference to '_write'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-closer.o): in function '_close_r':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/reent/../../../../../../../../newlib/libc/reent/closer.c:47: undefined reference to '_close'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-fstatr.o): in function '_fstat_r':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/reent/../../../../../../../../newlib/libc/reent/fstatr.c:55: undefined reference to '_fstat'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-isattyr.o): in function '_isatty_r':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/reent/../../../../../../../../newlib/libc/reent/isattyr.c:52: undefined reference to '_isatty'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-lseekr.o): in function '_lseek_r':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/reent/../../../../../../../../newlib/libc/reent/lseekr.c:49: undefined reference to '_lseek'
| /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libg_nano.a(lib_a-readr.o): in function '_read_r':
| /build/newlib-CVVEyx/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v6-m/nofp/newlib/libc/reent/../../../../../../../../newlib/libc/reent/readr.c:49: undefined reference to '_read'
| collect2: error: ld returned 1 exit status
|
make[1]: *** [tmk_core/rules.mk:300: .build/womier_k66_default.elf] Error 1
make: *** [Makefile:579: womier/k66:default] Error 1
Make finished with errors

@GalvareyPoco
Copy link

GalvareyPoco commented Jul 2, 2020

any solution? i got the same error .build/womier_k66_default.elf section '.text' will not fit in region 'flash0'

@pgillan145
Copy link

any solution? i got the same error .build/womier_k66_default.elf section '.text' will not fit in region 'flash0'

I was able to get it to compile by increasing the flash size in 'lib/chibios-contrib/os/common/startup/ARMCMx/compilers/GCC/ld/SN32F260.ld'. I changed:
ram0 (wx) : org = 0x20000000, len = 2k
to:
ram0 (wx) : org = 0x20000000, len = 2216

It compiled, and seemed to work, but I'm pretty positive it's not the correct long term solution.

@GalvareyPoco
Copy link

GalvareyPoco commented Jul 2, 2020

@pgillan145 didn't it brick your keyboard? after flashing?

edit: changed the settings to match yours and i got the same error

@toastdb
Copy link
Collaborator Author

toastdb commented Jul 2, 2020

I had an issue with the linker where I couldn't get a user defined Vector84 to link properly so I modified lib\chibios\os\common\startup\ARMCMx\compilers\GCC\vectors.S to replace 'Vector84' with 'RgbIsr'. I was building using mingw and didn't have issues, people have reported issues building with WSL but the parent branch does build with WSL as far as i know. I also have an uncommitted lib\chibios\os\common\startup\ARMCMx\compilers\GCC\ld\SN32F260.ld (
SN32F260.txt) but I can't remember if that's required or not. I've been running the firmware for a few months now.

There is a discord here with a dev room that might be able to help better. Sorry I never got around to cleaning this up, Hope this helps though.

@pgillan145
Copy link

@pgillan145 didn't it brick your keyboard? after flashing?

edit: changed the settings to match yours and i got the same error

It didn't brick my keyboard (which is weird, that's what I expected to happen too). You might need to fiddle with the value '2216' -- that was what I used based on the error value I got during linking. When I enabled MOUSEKEYS and EXTRAKEYS (neither of which seemed to work), the error message I got was:

rules_memory.ld:314 cannot move location counter backwards (from 00000000200008c8 to 0000000020000800)

c8 is 200 in decimal, so I added 200 to 2k (2048), and had to use the value '2248' to make it work.

And, again, these are pretty bad hacks, and I'm not sure why going over the physical ram limits doesn't brick the keyboard, but <shrug>.

@toastdb
Copy link
Collaborator Author

toastdb commented Jul 2, 2020

@pgillan145 @GalvareyPoco please read my comment above. You really need that vector change otherwise it will instantly hardfault after setting up the RGB.

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

Successfully merging this pull request may close these issues.

5 participants