davidgfnet/stm32-dfu-bootloader

application can never boot with undefined `ENABLE_CHECKSUM`

diggit opened this issue · 2 comments

Not defining ENABLE_CHECKSUM causes imagesize = 0.
later follows code...

   	uint32_t xorv = 0xB4DC0FEE;
   	for (unsigned i = 0; i < imagesize; i++) // compiler knows, there will be 0 iterations
   		xorv ^= base_addr[i];

   	if (xorv == 0) { // this branch can never happen with zero iterations of the loop above
   		//... unreachable code, including jump to app
   	}

"checksum" part of code should also be disabled when ENABLE_CHECKSUM is not defined.

Мало того, эта часть когда принципиально не работает, попытка использовать чексумму вызовет невозможность запуска основной программы

I just pushed d11fbc8 which should fix it. Thanks for the report, I missed it completely when I updated the checksum function!