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

RESET/DFU not working on TADA68 #1215

Closed
AndreasBackx opened this issue Apr 8, 2017 · 18 comments
Closed

RESET/DFU not working on TADA68 #1215

AndreasBackx opened this issue Apr 8, 2017 · 18 comments

Comments

@AndreasBackx
Copy link

AndreasBackx commented Apr 8, 2017

I was working on my own layout for my TADA68 and while doing so I found that the RESET keycode doesn't seem to trigger the keyboard to go into DFU mode and dfu-programmer also doesn't detect the keyboard while it's in its reprogrammable state. Is there a way I can perhaps make a PR to get this to work? Where would I start?

@fredizzimo
Copy link
Contributor

According to the instructions, the TADA68 has a special way of flashing it, so it probably don't work at all with the dfu-programmer.

That custom bootloader is also probably the reason why the reset button doesn't do anything.

@evyd13
Copy link
Contributor

evyd13 commented May 23, 2017

What if one would flash a different bootloader to the chip?

@evyd13
Copy link
Contributor

evyd13 commented May 23, 2017

Maybe this will help.
http://www.fourwalledcubicle.com/files/LUFA/Doc/120219/html/_page__software_bootloader_start.html

The file where this probably should be implemented is tmk_core/common/avr/bootloader.c.

@evyd13
Copy link
Contributor

evyd13 commented May 27, 2017

I'm a bit blind; a link to that is in the file itself. Tried a lot of stuff to get it working but I didn't succeed.

@fredizzimo
Copy link
Contributor

I'm just guessing, but based on the way that this keyboard is flashed, it's using the lufa mass storage bootloader. The instructions for that, states that the bootloader size is 6KB plus an auxillary section.

So based on that, I think the jump should work if you change the bootloader size to 6KB in the makefile.

@skullydazed
Copy link
Member

I'm closing this to clean up our open issues, but if you still have questions @AndreasBackx and @Maartenwut please reopen this or open a new issue.

@tokyovigilante
Copy link
Contributor

Hi, sorry to resurrect an old bug, but is there any clarification on whether software DFU is possible on this board, by changing the bootloader memory size or otherwise? I know it's a bit of an odd-ball flashing mechanism, but the board is otherwise great with QMK, it's just a pain to have to keep disassembling it every time I want to update the keymap. Thanks!

@fauxpark
Copy link
Member

The Tada68 doesn't have DFU, when in bootloader mode it appears as a mass storage device, and is very susceptible to bricking. Could you try adding BOOTLOADER_SIZE = 6144 to the rules.mk and see if that works?

@tokyovigilante
Copy link
Contributor

Will give it a roll, thanks for the reply. The 6K/ 6144 byte figure that was mentioned before however, I've read the LUFA docs above and it comments:

...with an 8KB bootloader section size, and will fit into 6KB of bootloader space...

Does 6K definitely apply here?

@fauxpark
Copy link
Member

That sentence relates to the AT90USB128 which the LUFA mass storage bootloader builds for by default, but the Tada68 is using an ATmega32U4. The max bootloader section size for the former is 8kB, and 4kB for the 32U4. Thus you lose 2kB of firmware space when using this bootloader on anything with less than 128kB of flash (basically only the USB128) as the FAT filesystem code is just too large to fit in 4kB.

@tokyovigilante
Copy link
Contributor

Make sense, thanks for clarifying. Will try later in the day and report.

@tokyovigilante
Copy link
Contributor

tokyovigilante commented Dec 16, 2019

Unfortunately this doesn't seem to help. Rebuilding with make tada68:<keymap>:flashbin results in a file with an updated shasum so I assume the updated bootloader size to 6144 (in bootloader.mk) seems to have taken in the build, but the behaviour is the same. The keyboard LEDs flash off and on once, so I assume the board has reset, but does not enter the mass storage flashing mode.

@fauxpark
Copy link
Member

So the keyboard level rules.mk has the Command feature enabled, which will change the checksum on every build because it bakes in the build time along with some other diagnostic info eg. compiler version. If I disable that and add BOOTLOADER_SIZE = 6144 directly underneath the BOOTLOADER rule, I get the same MD5 as without Command or BOOTLOADER_SIZE. Commenting out BOOTLOADER results in a different MD5.

@drashna
Copy link
Member

drashna commented Dec 16, 2019

Another option is to simply replace the bootloader with something less ... fragile. You can use an ISP flasher to replace the bootloader and change the fuses to use DFU instead. This may be a better long term solution, too.

@tokyovigilante
Copy link
Contributor

Thanks @fauxpark I'd run several builds without the checksum updating, but will give it another crack this evening. The only other thing I noticed is that the boot key differs from the published boot key in the LUFA documentation, but even swapping the key didn't help.

@drashna good to know that's an option, when you say "change the fuses" is that a HW mod? I'm not the world's most competent solderer (although did get all the switches in without needing to visit a burns unit...) Is there any documentation for that process (the actual flashing with an ISP programmer looks relatively straightfoward), and reliable source for the firmware or build instructions? Thanks.

@fauxpark
Copy link
Member

Fuses in the context of AVRs are not the electrical component, they're more like EEPROM memory and are used to configure some low level stuff about the chip: https://hackaday.com/2012/08/30/avr-fuse-bits-explained/
You'll be able to modify them using avrdude when ISP flashing. Drashna has a great Reddit post about ISP flashing the QMK-DFU bootloader (the target is a Pro Micro but it can work for this board too): https://www.reddit.com/r/olkb/comments/8sxgzb/replace_pro_micro_bootloader_with_qmk_dfu/

@tokyovigilante
Copy link
Contributor

Oh right, makes much more sense. That's great thanks, I might get a hold of a programmer and give it a crack.

@tokyovigilante
Copy link
Contributor

So after a stressful evening with a USBasp, avrdude and crossed fingers I've got the QMK bootloader installed on my board, and it's great! Quick key combo into DFU mode, with LED feedback and escape to exit, and command-line flashing with the QMK build tools works great. This is exactly what I wanted out of the board, thanks @fauxpark and @drashna for your help!

mattpcaswell pushed a commit to mattpcaswell/qmk_firmware that referenced this issue Jun 7, 2023
* fix keymap usage of KC_NLCK

`KC_NLCK` -> `KC_NUM`

* fix keymap usage of KC_SLCK

`KC_SLCK` -> `KC_SCRL`

* fix keymap usage of KC_LCTRL

`KC_LCTRL` -> `KC_LCTL`

* fix keymap usage of RESET

`RESET` -> `QK_BOOT`

* fix keymap usage of EEP_RST

`EEP_RST` -> `EE_CLR`

* fix keymap usage of KC_GESC

`KC_GESC` -> `QK_GESC`

* fix keymap usage of KC_HENK

`KC_HENK` -> `KC_INT4`

* fix keymap usage of KC_MHEN

`KC_MHEN` -> `KC_INT5`

* fix keymap usage of KC_BSPACE

`KC_BSPACE` -> `KC_BSPC`

* fix instance of KC_LCTR in rate/pistachio_pro keymap

* fix keymap usage of DEBUG

`DEBUG` -> `DB_TOGG`
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

No branches or pull requests

7 participants