[En-Nut-Discussion] PPP under ARM AT91SAM7S

Nicholas Preyss npreyss at ee.ethz.ch
Mon Feb 18 12:01:39 CET 2008

When I ported the ahdlcavr driver to AT91SAM7S I found a problem with 
the LCP Code. The way the structure XCPOPT is used fails with 
architectures with 32bit address alignment in 2 way. First because of 
the casts in the middle of the buffer, the structure doesn't start at an 
Word boundry causing a "Data Abort". Second because the compiler padds 
after the 2 u_chars. This leads to data corruption. I could circumvent 
the problem by declaring the structure packed. Now it works for me.
I am not sure how portable this solution is and actually I am not even 
sure that this attribute guarrantees that the first issue is solved in 
every case.

The Second thing is: I wonder why the AHDLC stuff was implemented as an 
UART driver on its own and not a portabel layer between PPP and an 
arch-specific UART driver.


More information about the En-Nut-Discussion mailing list