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

add option that will update user row to enable smarteeprom #16

Closed
wants to merge 1 commit into from

Conversation

daltona
Copy link

@daltona daltona commented Jan 4, 2020

Signed-off-by: Alexandre d'Alton alex@alexdalton.org

Signed-off-by: Alexandre d'Alton <alex@alexdalton.org>
@ash0x0
Copy link

ash0x0 commented Jan 12, 2020

FYI for reviewers, refer to qmk/qmk_firmware#6068. Also, the referenced PR is waiting on this one to be merged.

@robhaswell
Copy link

robhaswell commented Jan 16, 2020

Hi, what is blocking this PR from being reviewed and merged?

The Masssdrop CTRL/ALT keyboard discussions have a great deal of comments and complaints about eeprom support: https://drop.com/buy/drop-ctrl-mechanical-keyboard/talk?search=eeprom

A successful review of this PR would be able to address all of these concerns, as the downstream support is ready to go.

Thanks.

@Shooooooooo
Copy link

Shooooooooo commented Jan 16, 2020

@just-another-jxliu Bumping this.
Maybe this will repository will become active once again before they release Drop SHIFT?
Really hope this can be made into the next release.

@ash0x0
Copy link

ash0x0 commented Jan 31, 2020

@pschmuckal you seem to be taking over things at least on the firmware side. You're probably too swamped with all you have to do there but if you have some time and can get control over this repo and have this merged in it'd be a real improvement for all MD boards. It's not a big review and we can all help with testing/whatever you'd need to get it through.

@robhaswell
Copy link

robhaswell commented Apr 20, 2020

Hi, any movement on this?

@nicoelayda
Copy link

nicoelayda commented Jun 21, 2020

Tested this on my ALT and it works like a charm. I've had to make some changes to keymap.c to make the backlight mode persist across reboots, but other than that I've found no other issues.

I've uploaded precompiled binaries for macOS, Windows and Linux on my fork until this is merged to the official repo, in case anyone needs them.

EDIT: Precompiled binaries here: https://github.com/nicoelayda/mdloader/releases/latest

@Ignit3d
Copy link

Ignit3d commented Jun 28, 2020

Tested this earlier today and works great. Thank you so very much for moving this forward. Two quotations of I may;

  1. Would it be possibly to please provide details of the changes made to Keymap.c as I have a different configuration for my outer right keys to the default keymap?
  2. Would changes to the polling rate also persist across reboots?
    Many thanks again

printf("\n");
if ((user_row[1] & 0x7f) != 0x12) {
printf("SmartEEPROM not configured, proceed\n");
user_row[1] |= (0x12);
Copy link

@sigprof sigprof Jul 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be:

Suggested change
user_row[1] |= (0x12);
user_row[1] = (user_row[1] & ~0x7fUL) | 0x12;

so that it won't produce anything unexpected if the SmartEEPROM was already configured, but with some other settings?

@ifonefox
Copy link

ifonefox commented Aug 13, 2020

Any update on this? I saw that @just-another-jxliu released 1.0.4 a month ago, but it doesn't seem to change any of the SmartEEPROM functionality.

@drashna
Copy link

drashna commented Sep 15, 2020

@just-another-jxliu @pschmuckal @Massdrop or whomever, is there any actual plan to review this and merge it in?

qmk/qmk_firmware#6068 is waiting on this to be merged, so that the ATSAM boards can actually have EEPROM/persistent setting storage.

And it is pretty clear that this is wanted by the community. However, the lack of even any reviews or even any comments is concerning, especially for such a critical feature like SmartEEPROM support

@a7hybnj2
Copy link

a7hybnj2 commented Nov 7, 2020

This PR is amazing BUT it doesn't work for the Drop/Ctrl that I received in the mail today. I did use the same PR to get my older Massdrop/Alt working and it is flawless. The Ctrl times out on the 60 seconds and never finds a valid device. I tested the master branch massdrop/mdloader and loaded qmk_firmware/ctrl:mac without issue.

Thanks!

@robhaswell
Copy link

robhaswell commented Nov 7, 2020

@a7hybnj2 the master branch received some updates recently so perhaps they are required for your new CTRL to work.

Could you try checking this branch out, merging master into it and then giving it a go?

@a7hybnj2
Copy link

a7hybnj2 commented Nov 7, 2020

@a7hybnj2 the master branch received some updates recently so perhaps they are required for your new CTRL to work.

Could you try checking this branch out, merging master into it and then giving it a go?

Great thinking!

git clone git@github.com:Massdrop/mdloader.git
cd mdloader/
git fetch origin pull/16/head:enable-smart-eeprom
git branch
git merge enable-smart-eeprom 
make
./build/mdloader -f --smarteep --restart
Massdrop Loader 1.05

Massdrop Loader  Copyright (C) 2018-2020 Massdrop Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Scanning for device for 60 seconds
............
Device port: /dev/cu.usbmodem33201 (SAMD51J18A)

Opening port '/dev/cu.usbmodem33201'... Success!
Found MCU: SAMD51J18A
Bootloader version: v2.20 Mar 27 2019 10:04:47 [ctrl]
user row: 0xfe9a9239 0xaeecff80 0xffffffff 0xffffffff 
SmartEEPROM not configured, proceed
dsu statusb: 00000010
nvm config: 00000004

Near the end had me worried because there was no success indicator. So, initially I just read SmartEEPROM not configured and I was all worried. Also, it appears when setting --smarteep --restart that restart never actually happens. I have to unplug and replug my device (which is fine). Using mdloader to write the .bin restarts the keyboard just fine.

@a7hybnj2
Copy link

a7hybnj2 commented Nov 11, 2020

I am overall very satisfied with this update but I think I have found some issues. There is noway to clear the eeprom, the only way I knew how to clear eeprom was via qmk-toolbox - clear eeprom button but that doesn't seem to have an effect. I am trying to flash a new firmware file to my keyboard but it is behaving very strangely because I think it is trying to apply settings from the previous version that has been saved in eeprom. Also, there is no way to fully reset the board as reflashing the firmware doesn't clear the eeprom.

I tried this using mdloader again with the same flag thinking maybe it would act as a toggle but that wasn't the case. The message was something to the effect of 'already enabled'.

If anyone could let me know what I should try next. Thanks.

@tzarc
Copy link

tzarc commented Nov 17, 2020

Add an EEP_RST keycode to your keymap, hit it, then unplug/replug. Should wipe things.

@a7hybnj2
Copy link

a7hybnj2 commented Nov 17, 2020

@tzarc YES!!! Fn+esc (which I picked) is now my clear. It totally works! Awesome!

@Stvad
Copy link

Stvad commented Nov 23, 2020

Add an EEP_RST keycode to your keymap, hit it, then unplug/replug. Should wipe things.

How does one do that? Can I do that with online configurator https://drop.com/mechanical-keyboards/configurator/preset/ctrl--default or do I need to work with the "raw" qmk firmware?

@Stvad
Copy link

Stvad commented Nov 23, 2020

ok. for future people who have no clue like me - the approximate order of actions is:

@a7hybnj2
Copy link

a7hybnj2 commented Nov 23, 2020

@Stvad yes that looks like the same order of operations as I performed.

Don't forget the last step of loading the *.bin

@jnahc
Copy link

jnahc commented Jan 3, 2021

ok. for future people who have no clue like me - the approximate order of actions is:

  • setup qmk env https://docs.qmk.fm/#/newbs_getting_started
  • checkout the https://github.com/qmk/qmk_firmware and merge in the qmk/qmk_firmware#6068
    - i ran into a bunch of link errors gh pr checkout 9485, git checkout master, git branch, git merge fix-massdrop-gcc10
    - I ran into another link error that required gh pr checkout 10728, git checkout master, git merge cambios
  • change your chosen firmware to have EEP_RST (i.e. in my case it was changing https://github.com/qmk/qmk_firmware/blob/master/keyboards/massdrop/ctrl/keymaps/mac/keymap.c )
    - go to the same file on your computer, under const uint16_t, on [1] = LAYOUT - replace _______ (7 underscores) with EEP_RST to the corresponding key above
  • build firmware via qmk compile (e.g. qmk compile -kb massdrop/ctrl -km mac)
  • it's gonna produce the bin of the firmware
    - to make things simple, move the bin file it produced to where your mdloader is
  • get master of this repo, merge in this PR and build mdloader
  • use resulting binary to load the firmware as usual
    - use make to build
  • run ./build/mdloader -f --smarteep to enable persistence
    *- press & hold fn b for 1 sec and release, you have 60 seconds to do this
    - after this command you'll need to unplug/replug your keyboard
    - just to play it safe i did ./mdloader --first -U ctrl_default.bin --addr 0x4000 --size 0x10000 --restart to grab the original settings
    - press & hold fn b as above
    - to write the bin we produced from above files ./mdloader --first -D massdrop_ctrl_mac.bin --restart
    - press & hold fn b
  • restart keyboard

Thanks all, this worked beautifully for me on Big Sur. Added some other things I had to do in bold.

@TheZoc
Copy link

TheZoc commented Jan 31, 2021

Hi there :)

I rewrote this ticket in #49 and hopefully it's easier to review and merge into the main branch.
I'd love if you guys could take a look and review my suggested changes :)

@TheZoc TheZoc mentioned this pull request Feb 1, 2021
@jbradforddillon
Copy link

jbradforddillon commented Feb 1, 2021

Just wanted to throw a note in here that I just used these instructions along with @TheZoc's branch, and it worked perfectly. Thanks all!

@peepeetee
Copy link

peepeetee commented Feb 25, 2021

Why is this not merged? Seems trivial

@TheZoc
Copy link

TheZoc commented Feb 25, 2021

@peepeetee there are a few issues in this PR, and as a whole this PR is hard to read. That's why I rewrote it so it is easier to understand and fix a few issues I found along the way. I have no idea, though, why it didn't get a review.
If qmk guys are willing to merge the PR over there, I can happily maintain a fork of this repo with my changes :)

@ash0x0
Copy link

ash0x0 commented Feb 28, 2021

@just-another-jxliu it seems you're the only one affiliated with Massdrop at the moment. Can we get some update on the status of this repo? Is this abandonware or is this just for you guys to maintain new boards or is it being actively maintained or what?

@pdm-pcb
Copy link

pdm-pcb commented Sep 11, 2021

+1 to the above, even now. Not sure what's going on with this repo, but this is an important program, so... =)

@maxromanovsky
Copy link

maxromanovsky commented Oct 14, 2021

@just-another-jxliu @daltona Any info why this PR was closed?

@daltona
Copy link
Author

daltona commented Oct 14, 2021

@maxromanovsky cause the feature is now merged with #62

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.

None yet