lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] ARM Cortex-A and ip4_addr_copy -> Data abort


From: Arjan van Vught
Subject: [lwip-users] ARM Cortex-A and ip4_addr_copy -> Data abort
Date: Mon, 9 Jan 2023 02:35:37 +0100

Dear users,

Using version : 2.1.3

The 

/** Copy IP address - faster than ip4_addr_set: no NULL check */
#define ip4_addr_copy(dest, src) ((dest).addr = (src).addr)

gives an data abort where it used with : #define ip_addr_copy_from_ip4(dest, src)        ip4_addr_copy(dest, src)

in file ip4.c :

  /* copy IP addresses to aligned ip_addr_t */
  ip_addr_copy_from_ip4(ip_data.current_iphdr_dest, iphdr->dest);
  ip_addr_copy_from_ip4(ip_data.current_iphdr_src, iphdr->src); 

Where the header destination address and header source address are not 32-bit aligned. 

In the ARM reset handler I have :

    mrc p15, 0, r0, c1, c0, 0

bic r0, r0, #0x0002 @ Allow misalignment

     mcr p15, 0, r0, c1, c0, 0

But still, this does not allow to assign an aligned 32-bit value. 

Any hints and tips are much appreciated.

Many thanks in advance, Arjan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]