GameWithPixels / DiceFirmware

Pixels dice firmware code.
MIT License
15 stars 1 forks source link

Add preconfigured UICR hex file for validation and makefile commands … #12

Closed kylzrnr closed 2 years ago

kylzrnr commented 2 years ago

I've created a hex file that stores the address and data information for the bit that corresponds to validation mode. I've also added some makefile commands to merge this file with the release firmware hex file, flash it to a board, and zip it.

I tested that it does in fact set the correct bit by implementing it locally on my validation branch, but I wanted to push it here so that the code is contained within this particular issue.

kylzrnr commented 2 years ago

I accidentally pushed my change to the SDK_ROOT address. I pushed a new commit to correct it.

kylzrnr commented 2 years ago

Hmmm that is odd. It worked for me before I committed. I will double check what could be going on and get back to you. I will add the comments you requested as well.

obasille commented 2 years ago

Got this error on a clean clone (you'll probably get the same by deleting the _build folder)

nrfutil settings generate --family NRF52810 --application-version 0x1 --bootloader-version 0x1 --bl-settings-version 1 --application _build/firmware.hex _build/firmware_settings.hex
process_begin: CreateProcess(NULL, nrfutil settings generate --family NRF52810 --application-version 0x1 --bootloader-version 0x1 --bl-settings-version 1 --application _build/firmware.hex _build/firmware_settings.hex, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:347: settings] Error 2
kylzrnr commented 2 years ago

I eliminated the warning message about requesting a UICR write without erasing by changing the --sectorerase flag in the flash_validation call to nrfjprog to --sectoranduicrerase. This should ensure that each time we're flashing the validation firmware to a clean slate without needing to call a separate erase. As for ending up in normal mode, I'm guessing that you're calling flash_validation from this commit, which does not have the validation_manager module yet. If you run nrfjprog --memrd 0x10001080 after calling flash_validation it should read "0xFFFFFFFE" which would indicate a success in these circumstances.

kylzrnr commented 2 years ago

I can't seem to recreate the error message you've mentioned here. I deleted the entire contents of my _build folder and called flash_validation without any errors.

obasille commented 2 years ago

My bad, since this was a new clone I needed to copy nrfutil.exe... All good now!