nrf_ecb_hal_data_t encryption_parm;
memset(&encryption_parm, 0, sizeof(encryption_parm));
memcpy(encryption_parm.key, encryption_key, sizeof(encryption_key));
memcpy(encryption_parm.cleartext, clear_text, sizeof(clear_text));
memcpy(encryption_parm.ciphertext, cypher_text, sizeof(cypher_text));
//encryption_parm
err_code=sd_ecb_block_encrypt(&encryption_parm);
APP_ERROR_CHECK(err_code);
Above is the code for AES encryption. The code resets when APP_ERROR_CHECK function is executed. Should I set any other parameters or use any function before calling the d_ecb_block_encrypt function. Encryption function is called before initializing the BLE stack.