This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Secure Bootloader SDK13.0.0 array alignement GCC

Hi Nordic, During DFU tests i had weird issue. If i compileed bootloader using your makefile everything works fine, instead of compiling with Eclipse IDE. With Eclipse i dfu returns: "Signature failed" during update. The reason for that i think was bad array alignment in nrf_crypto_ecdsa.h

static uint8_t name ## buffer[STRING_CONCATENATE(NRF_CRYPTO_ECDSA_SIGNATURE_SIZE, type)] ;

I think this array should be aligned, if you want to check alignment every time. With makefile it works because of luck. Fortunately linker setup data with aligned arraybut in my case it didnt happen, hence i was getting signature errors. After adding one directive everything works fine.

static uint8_t name ## buffer[STRING_CONCATENATE(NRF_CRYPTO_ECDSA_SIGNATURE_SIZE, type)] attribute((aligned(4)));

Correct me if im wrong, or correct SDK if im right. Best Tomek

Related