Author Topic: [partly solved] Random key press with Feather Bluefruit LE 32U4  (Read 3979 times)

0 Members and 1 Guest are viewing this topic.

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
[partly solved] Random key press with Feather Bluefruit LE 32U4
« on: Fri, 02 October 2020, 07:52:52 »
After flashing a QMK firmware on a Feather BLE, it makes random key presses on its own (without me touching anything). I initially thought there was error on my PCB but this was not the case. I tried to flash the same firmware on an unsoldered Feather and got the same error. I then compiled another firmware that uses same controller from QMK repository and still got the same error. Anyone know what's causing this?


here's my config.h
Code: [Select]
#pragma once

#include "config_common.h"

#define FEATHERBLECONIG_H

/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 11

/* pin-out for FEATHER BLUEFRUIT LE 32U4 */
#define MATRIX_ROW_PINS { F7, F6, F5, F4 }
#define MATRIX_COL_PINS { F1, F0, B1, B2, B3, D2, C7, D6, B7, B6, B5 }

#define UNUSED_PINS

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

here's rules.mk
Code: [Select]
# MCU name
MCU = atmega32u4

# Processor frequency
F_CPU = 8000000

# Bootloader selection
BOOTLOADER = caterina

# Build Options
#   change yes to no to disable
#
BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes       # Mouse keys
EXTRAKEY_ENABLE = yes       # Audio control and System control
CONSOLE_ENABLE = no         # Console for debug
COMMAND_ENABLE = no         # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes           # USB Nkey Rollover
BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no        # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = yes      # Enable Bluetooth
AUDIO_ENABLE = no           # Audio output
UNICODE_ENABLE = no         # Unicode
IOS_DEVICE_ENABLE = no      # connect to IOS Device

UNICODEMAP_ENABLE = no
UCIS_ENABLE = no

BLUETOOTH = AdafruitBLE

here's a link to an existing kb on the repo that i tried to copy (except that i changed the pins, matrix and keymap): https://github.com/qmk/qmk_firmware/tree/e258b10d71049645c2e6ce50f652ce3f11578603/keyboards/handwired/42
« Last Edit: Sat, 03 October 2020, 06:56:28 by pabile »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #1 on: Fri, 02 October 2020, 09:17:11 »
Is that a whole column or are 5 or 6 (and space?) in the same column?

Also I'm not familiar with the feather, does it have any LEDs on it?  If it does the pins they are on can cause keypresses to be detected because power flows through the LED, so it's easiest not to use them.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #2 on: Fri, 02 October 2020, 09:57:04 »
Is that a whole column or are 5 or 6 (and space?) in the same column?

Also I'm not familiar with the feather, does it have any LEDs on it?  If it does the pins they are on can cause keypresses to be detected because power flows through the LED, so it's easiest not to use them.

whole 5th column of my layout (4x11). now that you mention it, bottom key should be backspace. but there are times that alt, bottom of 4th col, is being keyed.

the feather is not yet connected/soldered to anything except usb cable. someone suggested to check mcu for shorts but i could not find any. solder looks clean.

(i actually have 2 feather, one is not yet soldered and the other is soldered on an pcb, both acts the same.)

Offline nevin

  • Posts: 1646
  • Location: US
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #3 on: Fri, 02 October 2020, 13:03:24 »
which feather are you using? there are a handful

check the pins specified

is the feather 8Mhz? because of the lower voltage?
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #4 on: Fri, 02 October 2020, 20:27:28 »
which feather are you using? there are a handful

check the pins specified

is the feather 8Mhz? because of the lower voltage?

hi nevin! im using fearher 32u4 https://www.adafruit.com/product/2829
i rechecked and it does say 8mhz 3.3v at the back

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #5 on: Fri, 02 October 2020, 21:45:14 »
i tried using Adafruit Bluefruit LE Connect app for Android to upgrade firmware (0.8.1) on one and still having issues. on the other unit (ble#2), i tried downgrading to 0.6.5 blespifriend. ble#2 now wont transmit bluetooth and does the same keypresses at a very very low speed :'( 

side question... adafruit mentioned HW Debugger to recover, what specific device are these? i think i might need to flash firmware of ble#2 via wire (https://learn.adafruit.com/introducing-adafruit-ble-bluetooth-low-energy-friend/field-updates)

Offline nevin

  • Posts: 1646
  • Location: US
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #6 on: Fri, 02 October 2020, 22:14:54 »
doesn't look like the feather is totally supported yet. i know i've seen projects around using them but it's not official yet.
https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_bluetooth

believe there is a fork of QMK that's more bluetooth compatible but don't have a link on hand.... ah, here ZMK (rather new and still in infant stage)
https://zmkfirmware.dev/
https://github.com/zmkfirmware

look at BlueMicro (hardware & source)
look at nrfmicro https://github.com/joric/nrfmicro/wiki
another  https://gist.github.com/wez/b30683a4dfa329b86b9e0a2811a8c593
more info    https://www.reddit.com/r/MechanicalKeyboards/comments/8h8jf4/introducing_the_bluemicro_a_dropin_bluetooth/
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #7 on: Sat, 03 October 2020, 00:10:17 »
doesn't look like the feather is totally supported yet. i know i've seen projects around using them but it's not official yet.
https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_bluetooth

believe there is a fork of QMK that's more bluetooth compatible but don't have a link on hand.... ah, here ZMK (rather new and still in infant stage)
https://zmkfirmware.dev/
https://github.com/zmkfirmware

look at BlueMicro (hardware & source)
look at nrfmicro https://github.com/joric/nrfmicro/wiki
another  https://gist.github.com/wez/b30683a4dfa329b86b9e0a2811a8c593
more info    https://www.reddit.com/r/MechanicalKeyboards/comments/8h8jf4/introducing_the_bluemicro_a_dropin_bluetooth/

thanks, nevin.

i am a bit confused. here it says it is supported :( https://github.com/qmk/qmk_firmware/blob/master/docs/feature_bluetooth.md

i am also interested with the nrfmicro. i actually have fabricated pcb with me. i just need the components. i just thought that feather is still a better option since it is directly supported by qmk, or should i say, i thought it is supported...

anyhow, i will try the forks for now :) thanks

Offline nevin

  • Posts: 1646
  • Location: US
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #8 on: Sat, 03 October 2020, 01:02:15 »
yes, look at the two models that are supported
- Bluefruit LE SPI Friend (https://www.adafruit.com/product/2633) not Adafruit Feather 32u4 Bluefruit LE (https://www.adafruit.com/product/2829)
- Roving Networks RN-42 (Sparkfun Bluesmirf)

another one to look at is the mitosis
https://github.com/qmk/qmk_firmware/tree/master/keyboards/mitosis

bluetooth compatibility is still spotty at best.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #9 on: Sat, 03 October 2020, 01:06:36 »
What happens if you change the pin for the problem column to another pin?  If you don't have a spare just change the order, either the problem will go away or it will move to the other column then you know if it's the pin or something else.

Doesn't sound like anything bluetooth-y or unsupported if the rest works properly but there must be a reason for the forks...
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #10 on: Sat, 03 October 2020, 02:08:27 »
yes, look at the two models that are supported
- Bluefruit LE SPI Friend (https://www.adafruit.com/product/2633) not Adafruit Feather 32u4 Bluefruit LE (https://www.adafruit.com/product/2829)
- Roving Networks RN-42 (Sparkfun Bluesmirf)

another one to look at is the mitosis
https://github.com/qmk/qmk_firmware/tree/master/keyboards/mitosis

bluetooth compatibility is still spotty at best.

ouch!
that mitosis board and build looks cool! ...to the bucket list.

What happens if you change the pin for the problem column to another pin?  If you don't have a spare just change the order, either the problem will go away or it will move to the other column then you know if it's the pin or something else.

Doesn't sound like anything bluetooth-y or unsupported if the rest works properly but there must be a reason for the forks...

i tried kc_no the 5th col and presses now moved to 4th row. i tried switching pins with 5th and 6th but got no response on keypress. pls note that i am currently working on a feather that is soldered to a board. this pcb works well with a promicro on it if that adds any useful information.

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #11 on: Sat, 03 October 2020, 04:01:52 »
using adafruit's bluefruit connect, i tried downgrading its firmware starting from 0.6.5 up to current (0.8.1) and still no good :(

update: tried hex file from this post on an unsoldered feather and it seems to work as his post: https://www.reddit.com/r/MechanicalKeyboards/comments/cpy8bn/photos_her_first_word_was_qqqqqq/?utm_medium=android_app&utm_source=share

i tried copying his configurations and rules on my soldered feather but still got the original error. i'll re-do my config files based on his files and see

update: so... i re-do my keyboard based on the post above: changed pins, updated matrix, and keymaps; compile; flash. to my dismay, i still got the same error. these said, i now assume that i may have pins tapped that should not?

[ Attachment Invalid Or Does Not Exist ]
« Last Edit: Sat, 03 October 2020, 06:00:30 by pabile »

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: Random key press with Feather Bluefruit LE 32U4
« Reply #12 on: Sat, 03 October 2020, 06:50:52 »
sorry for spamming... i just need a place to throw things out of my mind. i think this will be my last update for tonight since i think i figured it out...

as i assumed, there are pins that should not be used in keymap. based on my limited testing, my matrix and keyboard will work if keymap is not placed/tapped on these pins: B1 B2 B3 B7 B6 B5. so a total of seven less pins including DFU? i hope somebody can enlighten me on this for this is not a good option if there too little usable/exposed pins. thanks GH!

252917-0

Offline nevin

  • Posts: 1646
  • Location: US
Re: [partly solved] Random key press with Feather Bluefruit LE 32U4
« Reply #13 on: Sat, 03 October 2020, 15:11:23 »
yes. you should be good then. the "int" pins can cause problems, i've seen this issue on teensy's as well with their "int" pins. you might be able to change what those pins do, change their default function? (have to do a little more digging on that..)

and dfu is something unique to this microcontroller (looks like single purpose)
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: [partly solved] Random key press with Feather Bluefruit LE 32U4
« Reply #14 on: Sat, 03 October 2020, 23:57:17 »
yes. you should be good then. the "int" pins can cause problems, i've seen this issue on teensy's as well with their "int" pins. you might be able to change what those pins do, change their default function? (have to do a little more digging on that..)

and dfu is something unique to this microcontroller (looks like single purpose)

it is still nice to know that the int pins can be re-configured. i am seeing keyboards with these pins being used. i wonder what they did. so far, my keyboard is doing good with its 4x10 layout with minor revision on my pcb matrix. was able to use this on phones but i still could not figure out why this device could not be detected by my desktop and laptop... thanks :)

Offline nevin

  • Posts: 1646
  • Location: US
Re: [partly solved] Random key press with Feather Bluefruit LE 32U4
« Reply #15 on: Sun, 04 October 2020, 13:25:21 »
what type of computer are you trying it with? laptop, desktop? where's the receiver located? is there interference? BT does operate on the same 2.4Ghz band as some wifi and may other devices.

you probably have the feather right next to your phone. how close is the feather to your computer when you're trying to connect? will it connect if it's closer? would the feather benefit from a different/better antenna? (it's hard to see if there's one on this version, usually a little squiggly line of a certain length, might be under the shield)
like this (squiggly line where it's blue)


another thing to look at is a crushed paper matrix to reduce pin count.
https://geekhack.org/index.php?topic=103573.msg2840939#msg2840939

production boards do this (and worse) all the time. it makes the electrical matrix less straight forward, but if you get the gist of it, there's a lot you can do with this type of matrix design. just take good notes when wiring to you can accurately create your electrical matrix in the code and correctly transpose it into the physical layout.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline pabile

  • Thread Starter
  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: [partly solved] Random key press with Feather Bluefruit LE 32U4
« Reply #16 on: Sun, 04 October 2020, 22:18:18 »
what type of computer are you trying it with? laptop, desktop? where's the receiver located? is there interference? BT does operate on the same 2.4Ghz band as some wifi and may other devices.

you probably have the feather right next to your phone. how close is the feather to your computer when you're trying to connect? will it connect if it's closer? would the feather benefit from a different/better antenna? (it's hard to see if there's one on this version, usually a little squiggly line of a certain length, might be under the shield)
like this (squiggly line where it's blue)
(Attachment Link)

another thing to look at is a crushed paper matrix to reduce pin count.
https://geekhack.org/index.php?topic=103573.msg2840939#msg2840939

production boards do this (and worse) all the time. it makes the electrical matrix less straight forward, but if you get the gist of it, there's a lot you can do with this type of matrix design. just take good notes when wiring to you can accurately create your electrical matrix in the code and correctly transpose it into the physical layout.

thanks, nevin. i do not see any interference. i think it is more of a hardware/driver related. i will dedicate one whole day just to troubleshoot this connection issue.

"crushed paper matrix" so that's what they call this. that is some crazy build you linked there, full size on a 6x11. nice! thanks for another awesome resource!