Skip to content

Unaligned access in networking code causes unaligned exception on Nucleo-F429ZI #6307

@therealprof

Description

@therealprof

Trying to run some networking sample code (with the default configuration) on my new Nucleo-F429ZI board yields this interesting exception:

**** BOOTING ZEPHY***** USAGE FAULT *****
Executing thread ID (thread): 0x200038ac
Faulting instruction address: 0x80097e6
Unaligned memory access
Fatal fault in essential thread! Spinning...

Very much to my surprise it is somewhat obvious where that unaligned exception is coming from:

 80097e0:       689b            ldr     r3, [r3, #8]
        dst->s6_addr[0]   = 0xFF;
 80097e2:       f240 22ff       movw    r2, #767        ; 0x2ff
        UNALIGNED_PUT(0, &dst->s6_addr16[1]);
 80097e6:       e9c3 2506       strd    r2, r5, [r3, #24]
        UNALIGNED_PUT(0, &dst->s6_addr16[3]);

It's somewhat less obvious (to me at least) what to do about it...

Metadata

Metadata

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions