digidotcom/xbee_ansic_library

alignment faults

syatech opened this issue · 2 comments

The code contains several casts that fail on processors with uint16_t and uint32_t alignment restrictions, such as the PIC32MX. For example:

response.value = be16toh( *(uint16_t FAR *)value);

If 'value' is not word-aligned then this will generate an exception.

I believe I've addressed this in e48e031 on my fork of this repository. Take a look at later commits which add support for the ARM-based Freescale FRDM-KL25Z, and include the helper functions a platform needs for unaligned memory access.

I've created a pull request (#1) for Digi to incorporate my recent work in their repo.

Thanks!