This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: memory alignment issue when compile eCos with codesourcery toolchain arm-none-eabi-gcc


> We are using arm-none-eabi toolchain (we downloaded 2008q1 release 
> from CodeSoucery website) to build eCos/redboot. Thanks to Chris, we 
> resolved the link issues in arm.ld but we are meeting memory alignment 
> issue now. In ecos/package/redboot/current/include/net/net.h, we have 
> to modify the code, add?__attribute__((aligned(4),packed)) for struct 
> eth_header_t and pktbuf_t and force them to the 4-byte aligned. 
> Otherwise, Ethernet driver code will hang the system during RedBoot 
> startup. We also find in ecos/package/redboot/current/src/fconfig.c, 
> we also have to force val_ptr in
> get_config() to be 4-byte aligned otherwise we can't config IP address 
> when we run fconfig in redboot. This command will abort and report "**
command abort - illegal memory access?"
> We can modify the code manually whenever we meet such kind of memory
alignment problem but it is really annoying. We wanted to find a compile
option > in arm-none-eabi-gcc to work around this issue but failed. Did you
meet the similar memory alignment issue? How did you work around this issue?

Hi Karl,

I didn't run into any alignment issues per se.  Without knowing anything
else, where is val_ptr pointed at?  Is the pointer valid and pointing to what
it should be?  I would suspect something other than the EABI related stuff
directly.

Which ARM processor are you targeting?
 
Just for the sake of comparison, I'm attaching the linker script that I use
for EABI.  Have a look at that and let's go from there.  

--Chris

Attachment: arm.ld
Description: arm.ld

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]