Dear colleagues,
I have an issue with running LwIP stack version 1.4.1 on TMS570LS3137 HDK rev. E. I took and modified LwIP example provided by TI. It runs without problem if is linked in to internal SRAM. It falls (abort exception PC 0x10) if it runs from external SDRAM. I think it caused by unaligned access via EMIF controller. For debugger info see below.
I use GCC compiler version 4.8.3. and CCS v6.
ASM dump. Second LDR instruction causes the fall.
384 ip_addr_copy(current_iphdr_dest, iphdr->dest); 000c38cc: E51B3008 LDR R3, [R11, #--8] 000c38d0: E5932010 LDR R2, [R3, #16]
Register's values:
R2 0x00000105 General Purpose Register 2 [Core] R3 0x8001091E General Purpose Register 3 [Core] R11 0x0803FC6C General Purpose Register 11 [Core]
# # System failure: data abort exception (SFC_ABORT) # # failcode: 00000001 subcode: 00000001 param: 00000000 flags: 00000002 # | ESM (error signaling module): | | sr1: 40000000 sr2: 00000000 sr3: 00000000 sr4: 00000000 | epsr: 00000001 ssr2: 00000000 | | CP15 (system control coprocessor): | | sctlr: 8BE50878 actlr: 0E0000A7 sactlr: 00010002 cflr: 01000003 | dfsr: 00000001 adfsr: 00800000 dfar: 8001092E | ifsr: 00000000 aifsr: 00000000 ifar: 00000000 | | EFC (eFuse controller): | | error: 00000000 bound: 0000200F pins: 000082E0 | | TCRAM1 (tightly-coupled RAM): | | ramctrl: 0005000A thrshld: 00000001 errstat: 00000000 | cerrcnt: 00000000 cerraddr: 00000000 uerraddr: 00000010 perraddr: 00617150 | | TCRAM2 (tightly-coupled RAM): | | ramctrl: 0005000A thrshld: 00000001 errstat: 00000000 | cerrcnt: 00000000 cerraddr: 00000008 uerraddr: 00000018 perraddr: 00636200 | | FMC (flash module controller): | | fedacsts: 00000000 eedacsts: 00000000 | fcecnt: 00000000 fceaddr: 00000000 fcepos: 00000000 fueaddr: 00000010 | ececnt: 00000000 eceaddr: 00000000 ecepos: 00000000 eueaddr: 00000000 | | # system halted ...
I spent whole day by searching a solution. A change ETH_PAD_SIZE to 2 doesn't work. It generates incorrect ethernet frames. A modification of the packing macros for GCC tools in cc.h did not help as well.
Thak you for some reply and have a nice day.