adafruit / Adafruit_nRF52_Bootloader

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

Add definable flag to skip app CRC check. #156

Closed nitz closed 4 years ago

nitz commented 4 years ago

If a board.mk defines a symbol named DISABLE_APPLICATION_CRC_CHECK (such as via CFLAGS += -DDISABLE_APPLICATION_CRC_CHECK), the code that would otherwise check for the application's CRC validity will not be compiled, and success will be assumed.

This would be an optional feature for users like in #115 that don't have CRC calculation (and setting) as part of their flash process.

nitz commented 4 years ago

Okay, I'm stumped as to why that build would fail. It only failed on the one feather_nrf52832 board, and succeeded on the other 23? And the error had nothing to do with the changed file. build_all.py builds all 24 just fine locally here...

hathach commented 4 years ago

Okay, I'm stumped as to why that build would fail. It only failed on the one feather_nrf52832 board, and succeeded on the other 23? And the error had nothing to do with the changed file. build_all.py builds all 24 just fine locally here...

action ci can fail randomly under heavy load, reset the run would fix that. I will review the PR later on.

nitz commented 4 years ago

Ah, this shows my poor understanding of some of the tooling I'm using here! 🙂

I guess this brings the question then: Is this the sort of thing you'd want to be supported via the bootloader makefile then? Seeing how circuitpython does it by directly poking the 1 into the settings address, do you feel it should be an option similar to that in the bootloader? Or should it just be up to the application/user?

Also not directly related: I'm using pyocd to flash, so I'm building then flashing in two separate steps. Would a 'FLASHER' option like circuitpython uses to choose between $(NRFJPROG) and pyocd be acceptable?

hathach commented 4 years ago

Ah, this shows my poor understanding of some of the tooling I'm using here!

I guess this brings the question then: Is this the sort of thing you'd want to be supported via the bootloader makefile then? Seeing how circuitpython does it by directly poking the 1 into the settings address, do you feel it should be an option similar to that in the bootloader? Or should it just be up to the application/user?

I think we should better to go through the code to disable it. It will take a bit more than your changes to do that, I am just too lazy for now to do so. Having supported via bootlaoder makefile is kind of awkward I think. If you don't want to spend time to proceed with the PR, feel free to open an issue as reminder, I will do it whenever I have time.

Also not directly related: I'm using pyocd to flash, so I'm building then flashing in two separate steps. Would a 'FLASHER' option like circuitpython uses to choose between $(NRFJPROG) and pyocd be acceptable?

having pyocd as additional FLASHER is welcome, many people use cheap DAPLink such as particle debugger or on-board. I don't see any issues having more flasher except for work hour spent on the PR :smile:

nitz commented 4 years ago

I think we should better to go through the code to disable it. It will take a bit more than your changes to do that, I am just too lazy for now to do so. Having supported via bootlaoder makefile is kind of awkward I think. If you don't want to spend time to proceed with the PR, feel free to open an issue as reminder, I will do it whenever I have time.

Yeah, I think you're right. I'm gonna toss this one on my backburner for now, since just poking 1 in the settings address will work for the time being. I'll open an issue just to keep it on the radar!

having pyocd as additional FLASHER is welcome, many people use cheap DAPLink such as particle debugger or on-board. I don't see any issues having more flasher except for work hour spent on the PR 😄

Excellent, I think I will work on this, this evening then. I'm finding myself wanting to keep my application and bootloader pretty separate at this point still, so being able to easily flash from the BL project will be nice to do all in one step. And you said it, I'm a big fan of the cheap DAPLink stuff, at least until I put on my big person britches and shell out for a real J-Link. (Cause of course every time I go look at them, I end up coveting the most expensive one 🙃)