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

Documentation and tutorial are missing details on flashing #15202

Closed
1 task done
WhyNotHugo opened this issue Nov 18, 2021 · 8 comments · Fixed by #15207
Closed
1 task done

Documentation and tutorial are missing details on flashing #15202

WhyNotHugo opened this issue Nov 18, 2021 · 8 comments · Fixed by #15207
Labels
stale Issues or pull requests that have become inactive without resolution.

Comments

@WhyNotHugo
Copy link

Information

  • None of the other issue templates apply

Description

I'm following the tutorial to flash a keyboard, and the instructions indicate I should use qmk flash -kb <my_keyboard> -km <my_keymap>.

I'm not entirely sure what these arguments should be:

$ qmk flash -kb moonlander -km ~/downloads/moonlander_moonlander_layout_moonlander_mine.bin
Ψ Compiling keymap with make --jobs=1 moonlander:/home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash


QMK Firmware 0.14.31
Making moonlander with keymap default and target /home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash [ERRORS]
make[1]: *** No rule to make target '/home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash'.  Stop.
Making moonlander with keymap drashna and target /home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash [ERRORS]
make[1]: *** No rule to make target '/home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash'.  Stop.
Making moonlander with keymap jjerrell and target /home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash [ERRORS]
make[1]: *** No rule to make target '/home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash'.  Stop.
Making moonlander with keymap manna-harbour_miryoku and target /home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash [ERRORS]
make[1]: *** No rule to make target '/home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash'.  Stop.
Making moonlander with keymap shahn-neo and target /home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash [ERRORS]
make[1]: *** No rule to make target '/home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash'.  Stop.
Making moonlander with keymap via and target /home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash [ERRORS]
make[1]: *** No rule to make target '/home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash'.  Stop.
Make finished with errors
make: *** [Makefile:510: moonlander:/home/hugo/downloads/moonlander_moonlander_layout_moonlander_mine.bin:flash] Error 1

The help output doesn't say much, and there's no further documentation (e.g.: No man entry for qmk).

$ qmk help flash
usage: qmk [-h] [-V] [-v] [--datetime-fmt DATETIME_FMT] [--log-fmt LOG_FMT] [--log-file-fmt LOG_FILE_FMT]
           [--log-file-level {debug,info,warning,error,critical}] [--log-file LOG_FILE] [--color] [--no-color] [--unicode]
           [--no-unicode] [--interactive] [--config-file CONFIG_FILE]
           {config,clone,console,env,setup,c2json,cd,chibios-confmigrate,clean,compile,doctor,flash,generate-rgb-breathe-table,info,json2c,lint,list-keyboards,list-keymaps,list-layouts,new-keyboard,new-keymap}
           ...
qmk: error: argument {config,clone,console,env,setup,c2json,cd,chibios-confmigrate,clean,compile,doctor,flash,generate-rgb-breathe-table,info,json2c,lint,list-keyboards,list-keymaps,list-layouts,new-keyboard,new-keymap}: invalid choice: 'help' (choose from 'config', 'clone', 'console', 'env', 'setup', 'bux', 'c2json', 'cd', 'cformat', 'chibios-confmigrate', 'clean', 'compile', 'docs', 'doctor', 'fileformat', 'flash', 'format-c', 'format-json', 'format-python', 'format-text', 'generate-api', 'generate-config-h', 'generate-dfu-header', 'generate-docs', 'generate-info-json', 'generate-keyboard-h', 'generate-layouts', 'generate-rgb-breathe-table', 'generate-rules-mk', 'generate-version-h', 'hello', 'info', 'json2c', 'lint', 'list-keyboards', 'list-keymaps', 'list-layouts', 'kle2json', 'multibuild', 'new-keyboard', 'new-keymap', 'pyformat', 'pytest')

I tried looking through the source code, but there's no mentions of flash, and I got lost trying to follow how it all works.

I used qmk_configurator to create a layout and generated the moonlander_moonlander_layout_moonlander_mine.bin file mentioned above.

What parameters does the flash command take? I can try and write a PR with the missing details/steps on this so future newcomers don't get stuck on this too.


I tried compiling locally with qmk compile ~/downloads/moonlander_layout_moonlander_mine\(4\).json, and then running qmk flash --keyboard moonlander --keymap moonlander_layout_moonlander_mine (I copied these values from the json file), but that fails too:

$ qmk flash --keyboard moonlander --keymap moonlander_layout_moonlander_mine
Ψ Compiling keymap with make --jobs=1 moonlander:moonlander_layout_moonlander_mine:flash


QMK Firmware 0.14.31
Making moonlander with keymap default and target moonlander_layout_moonlander_mine:flash       [ERRORS]
make[1]: *** No rule to make target 'moonlander_layout_moonlander_mine:flash'.  Stop.
Making moonlander with keymap drashna and target moonlander_layout_moonlander_mine:flash       [ERRORS]
make[1]: *** No rule to make target 'moonlander_layout_moonlander_mine:flash'.  Stop.
Making moonlander with keymap jjerrell and target moonlander_layout_moonlander_mine:flash      [ERRORS]
make[1]: *** No rule to make target 'moonlander_layout_moonlander_mine:flash'.  Stop.
Making moonlander with keymap manna-harbour_miryoku and target moonlander_layout_moonlander_mine:flash [ERRORS]
make[1]: *** No rule to make target 'moonlander_layout_moonlander_mine:flash'.  Stop.
Making moonlander with keymap shahn-neo and target moonlander_layout_moonlander_mine:flash     [ERRORS]
make[1]: *** No rule to make target 'moonlander_layout_moonlander_mine:flash'.  Stop.
Making moonlander with keymap via and target moonlander_layout_moonlander_mine:flash           [ERRORS]
make[1]: *** No rule to make target 'moonlander_layout_moonlander_mine:flash'.  Stop.
Make finished with errors
make: *** [Makefile:510: moonlander:moonlander_layout_moonlander_mine:flash] Error 1
@fauxpark fauxpark transferred this issue from qmk/qmk_cli Nov 18, 2021
@WhyNotHugo
Copy link
Author

Oh qmk flash --help had better output, my bad facepalm

This should work, but looks like I'm missing a step:

✘ qmk flash ~/downloads/moonlander_layout_moonlander_mine\(5\).json
Ψ Wrote keymap to /home/hugo/workspace/qmk/qmk_firmware/keyboards/moonlander/keymaps/moonlander_layout_moonlander_mine/keymap.c
Ψ Compiling keymap with make -s --jobs=1 -r -R -f build_keyboard.mk flash KEYBOARD=moonlander KEYMAP=moonlander_layout_moonlander_mine KEYBOARD_FILESAFE=moonlander TARGET=moonlander_moonlander_layout_moonlander_mine KEYBOARD_OUTPUT=.build/obj_moonlander KEYMAP_OUTPUT=.build/obj_moonlander_moonlander_layout_moonlander_mine MAIN_KEYMAP_PATH_1=.build/obj_moonlander_moonlander_layout_moonlander_mine MAIN_KEYMAP_PATH_2=.build/obj_moonlander_moonlander_layout_moonlander_mine MAIN_KEYMAP_PATH_3=.build/obj_moonlander_moonlander_layout_moonlander_mine MAIN_KEYMAP_PATH_4=.build/obj_moonlander_moonlander_layout_moonlander_mine MAIN_KEYMAP_PATH_5=.build/obj_moonlander_moonlander_layout_moonlander_mine KEYMAP_C=.build/obj_moonlander_moonlander_layout_moonlander_mine/src/keymap.c KEYMAP_PATH=.build/obj_moonlander_moonlander_layout_moonlander_mine/src VERBOSE=false COLOR=true SILENT=false QMK_BIN=qmk


arm-none-eabi-gcc (Arch Repository) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Size before:
   text	   data	    bss	    dec	    hex	filename
      0	  62810	      0	  62810	   f55a	.build/moonlander_moonlander_layout_moonlander_mine.hex

Compiling: .build/obj_moonlander_moonlander_layout_moonlander_mine/src/keymap.c                     [OK]
Compiling: quantum/command.c                                                                        [OK]
Linking: .build/moonlander_moonlander_layout_moonlander_mine.elf                                    [OK]
Creating binary load file for flashing: .build/moonlander_moonlander_layout_moonlander_mine.bin     [OK]
Creating load file for flashing: .build/moonlander_moonlander_layout_moonlander_mine.hex            [OK]

Size after:
   text	   data	    bss	    dec	    hex	filename
      0	  62810	      0	  62810	   f55a	.build/moonlander_moonlander_layout_moonlander_mine.hex

Copying moonlander_moonlander_layout_moonlander_mine.bin to qmk_firmware folder                     [OK]
Bootloader not found. Trying again every 0.5s (Ctrl+C to cancel)..........................................^Cmake: *** [platforms/chibios/flash.mk:84: flash] Interrupt

@fauxpark
Copy link
Member

fauxpark commented Nov 18, 2021

qmk flash cannot flash arbitrary firmware files, it only accepts a keyboard and keymap name which exist in qmk_firmware/keyboards/ (or a Configurator export). You need to use the Toolbox or run the flashing commands directly.

@WhyNotHugo
Copy link
Author

Ah, so it seems that using qmk flash ~/downloads/moonlander_layout_moonlander_mine\(5\).json did work.

The Bootloader not found. Trying again every 0.5s meant that my keyboard was not in DFU mode.

I'll try and write a short PR to clarify both items in case anyone else stumbles across this.

You need to use the Toolbox

AFAIK, that's only for Window and Mac, but I've no devices running either.

or run the flashing commands directly.

Isn't qmk flash the flashing command?

@fauxpark
Copy link
Member

Isn't qmk flash the flashing command?

The Toolbox and qmk flash simply run the appropriate external flashing tool based on the connected bootloader device (for the former) or the bootloader specified for the keyboard/keymap being compiled (for the latter).

https://docs.qmk.fm/#/flashing

@WhyNotHugo
Copy link
Author

I see the same file is present in two places:

https://github.com/qmk/qmk_firmware/blob/9dea6f772077dc5c09daf40378e45884d29ab2e2/docs/newbs_flashing.md?plain=1

https://github.com/qmk/qmk_mkdocs/blob/2f86c7e2639e459d3965a20bdb809d8df9869725/docs/en/docs/tutorial_flashing.md?plain=1

I'm not sure which one is current; which one should I update? I assume that one is deprecated, but can't figure out which one.

tzarc pushed a commit that referenced this issue Dec 27, 2021
Makes this a bit more foolproof.

See #15202
roccojiang added a commit to roccojiang/qmk_firmware that referenced this issue Feb 26, 2022
* Start `develop` for 2022q1.

* Added cancel_key_lock function (qmk#15321)

* [Core] Remove matrix_is_modified() and debounce_is_active() (qmk#15349)

* [Keyboard] Added Wakizashi 40 (qmk#15336)

Co-authored-by: Ryan <fauxpark@gmail.com>

* Change default USB Polling rate to 1kHz (qmk#15352)

* [Keyboard] Convert ergoinu to SPLIT_KEYBOARD (qmk#15305)

* Implement MAGIC_TOGGLE_CONTROL_CAPSLOCK (qmk#15368)

* Convert not_so_minidox to SPLIT_KEYBOARD (qmk#15306)

* Convert ai03/orbit to SPLIT_KEYBOARD (qmk#15340)

* Tidy up existing i2c_master implementations (qmk#15376)

* Move chibios defines out of header

* Make some avr defines internal

* Generalize Unicode defines (qmk#15409)

* Add missing define for unicode common (qmk#15416)

* Remove Deprecated USB Polling comment from vusb.c (qmk#15420)

* Expand rotational range for PMW3360 Optical Sensor (qmk#15431)

* Add support for 21.11.x, remove 21.6.x as ChibiOS "canceled" it. (qmk#15435)

* added missing audio_off_user() callback (qmk#15457)

Co-authored-by: Raoul Rubien <raoul.rubienr@gmail.com>

* [Core] Don't send keyboard reports that propagate no changes to the host  (qmk#14065)

* Migrate serial_uart usages to UART driver (qmk#15479)

* Migrate Thermal Printer feature to UART driver

* Migrate 40percentclub UT47 to UART driver

* Migrate Centromere to UART driver

* Migrate Chimera Ergo to UART driver

* Migrate Chimera Let's Split to UART driver

* Migrate Chimera Ortho to UART driver

* Migrate Chimera Ortho Plus to UART driver

* Migrate Comet46 to UART driver

* Migrate Palm USB converter to UART driver

* Migrate Sun USB converter to UART driver

* Migrate Dichotomy to UART driver

* Migrate Honeycomb to UART driver

* Migrate Mitosis to UART driver

* Migrate Redox W to UART driver

* Migrate Uni660 to UART driver

* Migrate Telophase to UART driver

* Fix build failure for UT47 (qmk#15483)

* Use the PR title rather than parsing the commit message. (qmk#15537)

* Migrate RN42 to UART driver and refactor (qmk#15492)

* [CI] Format code according to conventions (qmk#15541)

* Documentation Typo fix (qmk#15538)

* Fix some typos, especially the sensor name. (qmk#15557)

* Add open-drain GPIO support. (qmk#15282)

* Add open-drain GPIO support.

* `qmk format-c`

* Wording.

* Remove port GPIO implementations as the only board that uses it has its own internal defs anyway. Will wait for first-class handling of ports in core before reimplementing.

* Fixes potential wpm sampling overflow, along with code comment fixes (qmk#15277)

Co-authored-by: Trevor Powell <trevor@vectorstorm.com.au>

* Add a clarification to an error message (qmk#15207)

Makes this a bit more foolproof.

See qmk#15202

* [Core] Split support for pointing devices. (qmk#15304)

* Draft implementation

* formatting

* fix combined buttons

* remove pimoroni throttle

* sync pointing on a throttle loop with checksum

* no longer used

* doh

Co-authored-by: Drashna Jaelre <drashna@live.com>

* switch pimoroni to a cpi equivalent

* add cpi support

* allow user modification of seperate mouse reports

* a little tidy up

* add *_RIGHT defines.

* docs

* doxygen comments

* basic changelog

* clean up pimoroni

* small doc fixes

* Update docs/feature_pointing_device.md

Co-authored-by: Drashna Jaelre <drashna@live.com>

* performance tweak if side has usb

* Don't run init funtions on wrong side

* renamed some variables for consistency

* fix pimoroni typos

* Clamp instead of OR

* Promote combined values to uint16_t

* Update pointing_device.c

Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Nick Brassel <nick@tzarc.org>

* Format code according to conventions (qmk#15588)

* Make (un)register code functions weak (qmk#15285)

* Defer pin operations to gpio.h (qmk#15589)

* Add sym_defer_pr debouncer type (qmk#14948)

* Durgod: Increase scan rate by using wait_us GPT timer (qmk#14091)

Lower the tick rate from 10kHz to 1kHz (otherwise all the extra interrupts
reduce the achievable scan rate). Enable the WAIT_US_TIMER using GPT TIM3.

Observed scan rate on the K320 is increased from 625Hz to 2090-2120Hz.

* Format code according to conventions (qmk#15590)

* Fixup line endings

* More GPIO compilation fixes. (qmk#15592)

* Custom matrix lite support for split keyboards (qmk#14674)

* Custom matrix lite support for split keyboards

* WIP: matrix -> matrix_common refactor

* Move matrix_post_scan() to matrix_common.c

* Refactor `bootloader_jump()` implementations (qmk#15450)

* Refactor `bootloader_jump()` implementations

* Fix tests?

* Rename `atmel-samba` to `md-boot`

* [Keymap] Add vitoni keymap for GMMK Pro (ISO) (qmk#15006)

* [Keymap] Add vitoni layout for GMMK Pro (ISO)

Keymap has layered cursor keys similar to laptop keyboards.

* Configure RGB defaults for startup

* Configure encoder to change value/brightness on FN layer

* Remove FN layer and add dedicated RGB layer

* Make RGB layer sticky (using TG) to avoid holding FN while configuring RGB

* Add RGB indicators for active layers

* Add RGB indicator for active RESET mode

Signed-off-by: Victor Toni <victor.toni@gmail.com>

* Configure idle / USB suspend settings

* Add RGB fade in when resuming after suspend

* Add RGB fade out before suspend

* Add fade out before idle

* Add breathe effect when idle

* Convert some more boards to Matrix Lite (qmk#15489)

* Fix for SPI write timing in PMW3360 driver (qmk#15519)

Timing does not match Pixart documentation for this sensor (may have been carried forward from adns9800).
Not aware of any issues coming from this currently.
It should only cause issues when writing to multiple registers in succession which currently only happens during initialization for the PMW3360.
This should prevent future issues with write operations if other features of the sensor are added.

* Format code according to conventions (qmk#15593)

* pwm3360 driver cleanup and diff reduction to adns9800 (qmk#15559)

* Diff reduction between ADNS9800 and PMW3360 drivers.

They are very similar devices. This (somewhat) unreadable diff is
essentially a no-op, but it makes a `vimdiff` between the 2 drivers much
more readable.

* Cleanup pwm3360 driver some more.

Remove redundant calls to spi_start() and spi_stop(), as pmw3360_write()
will already call these.

* [Core] Fix bug and code regression for Split Common (qmk#15603)

* Format code according to conventions (qmk#15604)

* [Bug] Include missing string.h include (qmk#15606)

* move bm65hsrgb_iso and bm68hsrgb to rev1/ (qmk#15132)

* Move to organization folder (qmk#15481)

* move directory

* fix

* move wings42 to dailycraft

* Adjust wings42 to work with organization folder.

* [Keyboard] Update Tractyl Manuform to use Split Pointing Device Sync

* [Keyboard] Update grs_70ec to use newer custom matrix (qmk#15609)

* [Keyboard] Fix compiler issue with tractyl manuform 4x6 (qmk#15646)

* Fix split pointing for analog joystick (qmk#15691)

Co-authored-by: Nick Brassel <nick@tzarc.org>

* Format code according to conventions (qmk#15693)

* Update pmw3360 comments to match the datasheet better, fix delays. (qmk#15682)

* move @yangdigi 's keyboards to a YDKB folder (qmk#15681)

* Format code according to conventions (qmk#15705)

Co-authored-by: Nick Brassel <nick@tzarc.org>
Co-authored-by: QMK Bot <hello@qmk.fm>
Co-authored-by: wheredoesyourmindgo <moemanchu@icloud.com>
Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
Co-authored-by: xiao <307671+xia0@users.noreply.github.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Dipl.-Ing. Raoul Rubien, BSc <rubienr@sbox.tugraz.at>
Co-authored-by: Raoul Rubien <raoul.rubienr@gmail.com>
Co-authored-by: SmollChungus <38044391+SmollChungus@users.noreply.github.com>
Co-authored-by: uqs <uqs@FreeBSD.org>
Co-authored-by: vectorstorm <github@gridbug.org>
Co-authored-by: Trevor Powell <trevor@vectorstorm.com.au>
Co-authored-by: Hugo Osvaldo Barrera <hugo@barrera.io>
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
Co-authored-by: Chad Austin <chad@chadaustin.me>
Co-authored-by: Simon Arlott <70171+nomis@users.noreply.github.com>
Co-authored-by: Jay Greco <jayv.greco@gmail.com>
Co-authored-by: Victor Toni <ViToni@users.noreply.github.com>
Co-authored-by: Alabastard-64 <96358682+Alabastard-64@users.noreply.github.com>
Co-authored-by: peepeetee <43021794+peepeetee@users.noreply.github.com>
Co-authored-by: yfuku <30647434+yfuku@users.noreply.github.com>
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs.
For maintainers: Please label with bug, in progress, on hold, discussion or to do to prevent the issue from being re-flagged.

@stale stale bot added the stale Issues or pull requests that have become inactive without resolution. label Apr 17, 2022
@github-actions
Copy link

This issue has been automatically closed because it has not had activity in the last 30 days. If this issue is still valid, re-open the issue and let us know.
// [stale-action-closed]

@Am3ra
Copy link

Am3ra commented Jun 15, 2023

I'm also having issues with this, the documentation is somewhat sparse when it comes to using hex files through the cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues or pull requests that have become inactive without resolution.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants