adafruit / Adafruit_nRF52_Bootloader

USB-enabled bootloaders for the nRF52 BLE SoC chips
MIT License
445 stars 401 forks source link

Accept uf2 generated with family ID = VID/PID as board specific #130

Closed hathach closed 4 years ago

hathach commented 4 years ago

Is your feature request related to a problem? Please describe.

together with #129, accepting additional family as board specific (VID/PID) allow us to bundle multiple firmware of different boards into a single big uf2 (e.g a circuitpyhon uf2 file for all nRF52 boards ). Following is the original discussion

FamilyID is meant as both board-id and MCU-id - for example, binaries generated from MakeCode Arcade would run on all NRF54840 boards provided they have the right bootloader settings (that define pinout, screen type, etc.). OTOH some other binaries may have pin configuration baked in, so they will only work on say 840 Feather. So it actually makes perfect sense for the bootloader to accept MCU-wide familyID and a specific boardID.

Generally, this can thought of as a sub-divsion tree of devices and bootloader accepts everything on one path from root to leaf. In this case I think we have 3 levels (all UF2 file - familyID==0, NRF52840, specific board), but it could be more if needed (eg different revisions of a specific board).

_Originally posted by @mmoskal in https://github.com/adafruit/Adafruit_nRF52_Bootloader/pull/128_

Describe the solution you'd like Bootloader accept family ID = ada52840 as generic nrf binary and also family id = vid+pid as board specific one.

Describe alternatives you've considered Application can also use pinconfig in CF2 of bootloader to write generic binary for all boards.

henrygab commented 4 years ago

@hathach -- See WIP PR #152.

It appears that allowing multiple family IDs, and basing the second allowed family ID on the USB VID/PID, may be relatively easy.

The above PR is still a WIP, mostly because I've not tested the bootloader (and am unsure if I can do so in any reasonable fashion). However, I created the PR to show that it might be a simple change.

hathach commented 4 years ago

@hathach -- See WIP PR #152.

It appears that allowing multiple family IDs, and basing the second allowed family ID on the USB VID/PID, may be relatively easy.

The above PR is still a WIP, mostly because I've not tested the bootloader (and am unsure if I can do so in any reasonable fashion). However, I created the PR to show that it might be a simple change.

Thanks, It is much simpler than I thought. Was switched to other task by now :)