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

Hard Fault Handler

Hi

I am trying to implement a lightweight algorithm on nRF52832 Development Kit. When I try to debug the code, it shows "unknown function at address "0x00000A60".  I am attaching the code.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "ascon_api.h"
#include "ascon_endian.h"
#include "ascon_permutations.h"
#include "nrf_log.h"
#define RATE (128 / 8)
#define PA_ROUNDS 12
#define PB_ROUNDS 8
#define IV \
((u64)(8 * (CRYPTO_KEYBYTES)) << 56 | (u64)(8 * (RATE)) << 48 | \
(u64)(PA_ROUNDS) << 40 | (u64)(PB_ROUNDS) << 32)
int ascon_crypto_aead_encrypt(unsigned char* c, unsigned long long* clen,
const unsigned char* m, unsigned long long mlen,
const unsigned char* ad, unsigned long long adlen,
const unsigned char* nsec, const unsigned char* npub,
const unsigned char* k) {
u32_2 K0, K1, N0, N1;
u32_2 x0, x1, x2, x3, x4;
u32_2 t0, t1;
u64 tmp0, tmp1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The error comes in the last lines:

" from_bit_interleaving(tmp0, x3);
*(u64*)c = U64BIG(tmp0);
from_bit_interleaving(tmp1, x4);
*(u64*)(c + 8) = U64BIG(tmp1);"

When I try to run further, it shows me "Hard Fault Handler." Here is the apsr register value: