[riot-notifications] [RIOT-OS/RIOT] boards: move programmer includes in Makefile.include (#15475)

Alexandre Abadie notifications at github.com
Thu Nov 19 19:06:40 CET 2020


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description

This PR is a refactoring of the way board programmer variables are set. The current logic is to include the corresponding makefile (openocd.inc.mk, jlink.inc.mk) for each board and to eventually manage some logic there depending on the programmer used.

The idea of this PR is to include the programmer logic once in Makefile.include and to only specify the related variables in the boards (`PROGRAMMER`, `OPENOCD_CONFIG`, `DEBUG_ADAPTER`, etc).

This saves a few redundant code and avoid the inclusion of programmer variable if they are not needed (if not using flash/debug targets for instance).

Some changes were applied to the avrdude management where there is also a PROGRAMMER used but with a different meaning: it's related to the avrdude sub-programmer and not the main programmer (avrdude itself).

If this PR makes sense, we could also apply the same logic with `serial.inc.mk`

<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->


### Testing procedure

- Test that all boards can still be flashed and debugged (tried on arduino-mkr1000, samr21-xpro, nucleo-l412kb but we need more :) )
- Green Murdock

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references

Had this idea while reviewing #15459 (in https://github.com/RIOT-OS/RIOT/pull/15459#discussion_r525507044 exactly)

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/15475

-- Commit Summary --

  * Makefile.include: include programmer logic in common place
  * boards: don't include programmer logic at board level

-- File Changes --

    M Makefile.include (5)
    M boards/6lowpan-clicker/Makefile.include (1)
    M boards/adafruit-clue/Makefile.include (2)
    M boards/arduino-nano-33-ble/Makefile.include (2)
    M boards/atmega1284p/Makefile.include (2)
    M boards/atmega256rfr2-xpro/Makefile.include (2)
    M boards/atmega328p/Makefile.include (2)
    M boards/b-l072z-lrwan1/Makefile.include (4)
    M boards/b-l475e-iot01a/Makefile.include (4)
    M boards/calliope-mini/Makefile.include (1)
    M boards/cc2650-launchpad/Makefile.include (2)
    M boards/cc2650stk/Makefile.include (2)
    M boards/common/arduino-due/Makefile.include (2)
    M boards/common/arduino-mkr/Makefile.include (1)
    M boards/common/atmega/Makefile.include (21)
    M boards/common/cc2538/Makefile.include (2)
    M boards/common/cc26x2_cc13x2/Makefile.include (6)
    M boards/common/frdm/Makefile.include (10)
    M boards/common/iotlab/Makefile.include (6)
    M boards/common/nrf51/Makefile.include (5)
    M boards/common/nrf52/Makefile.include (4)
    M boards/common/particle-mesh/Makefile.include (2)
    M boards/common/samd21-arduino-bootloader/Makefile.include (2)
    M boards/common/silabs/Makefile.include (6)
    M boards/ek-lm4f120xl/Makefile.include (2)
    M boards/feather-m0/Makefile.include (1)
    M boards/fox/Makefile.include (2)
    M boards/hamilton/Makefile.include (3)
    M boards/hifive1/Makefile.include (2)
    M boards/hifive1b/Makefile.include (2)
    M boards/i-nucleo-lrwan1/Makefile.include (2)
    M boards/ikea-tradfri/Makefile.include (2)
    M boards/im880b/Makefile.include (5)
    M boards/limifrog-v1/Makefile.include (5)
    M boards/lsn50/Makefile.include (10)
    M boards/maple-mini/Makefile.include (5)
    M boards/mcb2388/Makefile.include (3)
    M boards/microbit/Makefile.include (2)
    M boards/msba2/Makefile.include (1)
    M boards/mulle/Makefile.include (24)
    M boards/nrf51dk/Makefile.include (2)
    M boards/nrf52832-mdk/Makefile.include (1)
    M boards/nrf52840-mdk/Makefile.include (1)
    M boards/nz32-sc151/Makefile.include (2)
    M boards/p-l496g-cell02/Makefile.include (5)
    M boards/pba-d-01-kw2x/Makefile.include (6)
    M boards/pic32-wifire/Makefile.include (2)
    M boards/pinetime/Makefile.include (1)
    M boards/pyboard/Makefile.include (2)
    M boards/seeeduino_arch-pro/Makefile.include (8)
    M boards/sensebox_samd21/Makefile.include (12)
    M boards/spark-core/Makefile.include (5)
    M boards/stm32f0discovery/Makefile.include (5)
    M boards/stm32f3discovery/Makefile.include (5)
    M boards/stm32f429i-disc1/Makefile.include (5)
    M boards/stm32f4discovery/Makefile.include (5)
    M boards/stm32f723e-disco/Makefile.include (6)
    M boards/stm32f769i-disco/Makefile.include (6)
    M boards/stm32l0538-disco/Makefile.include (6)
    M boards/stm32l476g-disco/Makefile.include (5)
    M boards/ublox-c030-u201/Makefile.include (6)
    M boards/yunjia-nrf51822/Makefile.include (3)
    M makefiles/boards/sam0.inc.mk (8)
    M makefiles/boards/stm32.inc.mk (12)
    M makefiles/tools/avrdude.inc.mk (14)
    R makefiles/tools/dfu-util.inc.mk (0)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/15475.patch
https://github.com/RIOT-OS/RIOT/pull/15475.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15475
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201119/bb146e8a/attachment-0001.htm>


More information about the notifications mailing list