-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
bootloader_jump doesn't work #179
Comments
I glanced over your codes; keymap and Makefile. It looks to me ok and should work. And jummping wrong address won't have any permanent effect on hardware or firmware. |
Ah, I didn't notice this in the output before:
Could this be why it's not working? |
Interestingly, the physical button doesn't work after I try to get into the bootloader via the action function. I need to unplug the USB cable, re-plug it back in, and then hit the physical button for it to do anything. |
Weird, reset button should work all the time even if firmware goes mad. |
You can try this old code instead of current bootloader_jump(). The old code is from PJRC article and expected to work with Teensy bootloader. |
Drat, forgot to mention that |
I can confirm this on my Teensy: https://github.com/technomancy/tmk_keyboard/commit/876f356900504a8d38af72c918c1373073df0cf3 |
@technomancy Does that SHIFT macro work? I'd love to get rid of the tons of |
It doesn't work, but I have a lead on how to make it work; see #184.
|
@kejadlen |
Add this to the top of the file where you're using #include "bootloader.h" Works fine for me on my Teensy2: p3lim/keyboard_firmware@5ad92cd |
@p3lim Tried that, but it doesn't work for me. |
@kejadlen Any errors when compiling? |
@p3lim No, it compiles just fine, but trying to use |
What's your keyboard hardware in fact? and Which Teensy? Seems like it jumps wrong address and goes mad. |
Using a Teensy 2.0. Pushing it for 5-10 seconds doesn't do anything either. That sounds plausible to me. Still not sure what the difference is between what I'm doing and other Teensy 2.0 projects, though. (source) |
@kejadlen I got this working by just dumping in some code from pjrc.com: https://github.com/technomancy/tmk_keyboard/commit/ebb4f96b074e06be8ab3ee3727ad384f5b78f58b Probably would be better if it were fixed properly inside the TMK common code, but this works for me. |
Hmm, it smells like this line is fishy. Perhaps it can be compiled differently depending on compiler version? https://github.com/tmk/tmk_keyboard/blob/master/common/avr/bootloader.c#L75 We should use assembly code fragment there? |
Curiously, |
@technomancy Thanks, that workaround works for me as well. Unfortunately, I'm fairly out of my depth here, but I'd be happy to investigate further if anyone has any suggestions for what I could do to provide more info. |
This C code is comipled with EDIT: all AVR branch instructions take word address of ROM.
I think using inline assembler is safer again future compiler behaviour changes, like PJRC describes here. https://www.pjrc.com/teensy/jump_to_bootloader.html
Old LUFA document expects GCC uses byte address to jump. New documents make use of word address with logical shift(>>1). Similar icall and byte/word address problem: |
TMK had refered to old wrong LUFA documentaion. Jump address should be word counted. LUFA fixed it. GCC version is not related at all. |
TMK fixed this problem at Sep 18, 2013 with this commit 0ca4150. Make sure setting proper value to
|
I have the same problem.
instead of
but when I use gcc-avr 4.8.1 under ubuntu ,both of them don't work.
|
hmm, I have to check WinAVR again some time later.
BTW, I confirmed the current code works on Teensy++2.0 with gcc 4.8.1/avr libc1.8.0. |
Thanks for reply. |
Thanks. I think WinAVR is not guilty. |
Added Windows and Linux instructions to BUILD_GUIDE.md
I feel like I must be doing something wrong, but I can't get
bootloader_jump
to work. Is there anything else I need to do besides changingBOOTLOADER_SIZE
inconfig.h
and using the following code in the keymap?Source here, if that helps at all: https://github.com/kejadlen/tmk_keyboard/tree/master/keyboard/planckeus
I also inadvertently ran the bootloader jump with the wrong bootloader size before realizing that needed to be changed - would that have any effect on future uses of
bootloader_jump
?The text was updated successfully, but these errors were encountered: