Jump to content
43oh

Recommended Posts

  • Replies 107
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi, After a couple of hours of work porting the enc26j80 driver from my own mini ipv6 stack to uip, I have my enc28j60 booster pack working with the Stellaris Launchpad. The current example code i

Ok, this took a bit longer than I had anticipated, and there is a lot of room for improvements. I extended the example as suggested by BlueHash to be able to read and toggle the GPIO-pins via a web-b

hi,  i tried enc module but froze on "wainting for ip" Welcome ENC_ESTAT: 1 Econ: 0 Silicon Revision: 6

Posted Images

hi, 

i tried enc module but froze on "wainting for ip"

Welcome                                 
ENC_ESTAT: 1                            
Econ: 0                                 
Silicon Revision: 6
int enabled
Waiting for IP address...

 

dhcp on router is on, works fine on other pc, i tried set static ip but server not working

Any thoughts?

 

That sounds a bit strange. As the Silicon Revision is reported correctly, the MISO/MOSI and CLK lines are ok. Is the interrupt line correctly connected? It's supposed to be on PE4.

Are you using the lwIP or the uIP version?

Link to post
Share on other sites

I'm working with latest copy of your lwIP branch and running into some trouble.

 

 Welcome
ENC_ESTAT: 1
Econ: 0
Silicon Revision: 6
int enabled
launching lwip init
lwip initialized
adding netif add


[Hard fault handler - all numbers in hex]
R0 = 20004f44
R1 = 20004fb9
R2 = 12910
R3 = 6
R12 = 6
LR [R14] = 0  subroutine call return address
PC [R15] = c71f  program counter
PSR = 12290
BFAR = e000ed38
CFSR = 10000
HFSR = 40000000
DFSR = 0
AFSR = 0

 

I'm getting a Hard Fault when trying to call the netif_add() function.  I've tried both static and dhcp configurations, but no luck.  I'm going to try digging deeper but was wondering/hoping you had ran into it and knew a quick fix.

 

Thanks!

Link to post
Share on other sites

I'm working with latest copy of your lwIP branch and running into some trouble.

 

 Welcome
ENC_ESTAT: 1
Econ: 0
Silicon Revision: 6
int enabled
launching lwip init
lwip initialized
adding netif add


[Hard fault handler - all numbers in hex]
R0 = 20004f44
R1 = 20004fb9
R2 = 12910
R3 = 6
R12 = 6
LR [R14] = 0  subroutine call return address
PC [R15] = c71f  program counter
PSR = 12290
BFAR = e000ed38
CFSR = 10000
HFSR = 40000000
DFSR = 0
AFSR = 0

 

I'm getting a Hard Fault when trying to call the netif_add() function.  I've tried both static and dhcp configurations, but no luck.  I'm going to try digging deeper but was wondering/hoping you had ran into it and knew a quick fix.

 

Thanks!

 

Interessting. I haven't experienced that. If you could provide me with either the binary ELF file or the output of "objdump -d" run on the ELF file I will try and see if I can figure out what goes wrong.

 

Cheers,

Paul

Link to post
Share on other sites

Sure, attached is the main.elf.  Be warned, it's pretty messy and riddled with snippets testing the LED ports and printf's from stepping through the program to see if it was indeed the netif_add() function.

 

Thanks again!

 

So, from what I've gathered with online resources, I'm thinking it is a stack/heap memory issue.  I've tried adjusting the stack in startup_gcc as well as adjusting the memory variable in the lwip.opts without much luck.  Not sure offhand what the last compiled combination that elf I've attached used.

main.zip

Link to post
Share on other sites

Sure, attached is the main.elf.  Be warned, it's pretty messy and riddled with snippets testing the LED ports and printf's from stepping through the program to see if it was indeed the netif_add() function.

 

Thanks again!

 

So, from what I've gathered with online resources, I'm thinking it is a stack/heap memory issue.  I've tried adjusting the stack in startup_gcc as well as adjusting the memory variable in the lwip.opts without much luck.  Not sure offhand what the last compiled combination that elf I've attached used.

Does the output from your Hard Fault handler come from the ELF file you sent? 

 

I'll try to run flash the ELF file tonight and see if I can figure out what is happening.

 

Cheers

Link to post
Share on other sites

Jalder, I tried out your ELF file and tried to see if I could figure out what went wrong, but couldn't seem to get anywhere within the short time I had available.

If you are willing to share the source code with me I'll try to have a second look at it.

 

Cheers,

Link to post
Share on other sites
  • 2 weeks later...

Hello,

This is pretty new to me, but I have finally made some progress. However, I am stuck again. Any suggestions? Make complains of inability to fit into restrictions:

 

user@ubuntu:~/stellaris-enc28j60-booster$ make
arm-none-eabi-gcc -DDTARGET_IS_BLIZZARD_RA2 -DPART_LM4F120H5QR  -Dgcc -I/home/user/stellaris-enc28j60-booster/lwip/src/include -I/home/user/stellaris-enc28j60-booster/lwip/src/include/ipv4 -I/home/user/stellaris-enc28j60-booster/lwip/src/include/ipv6 -I./ -I/home/user/stellarisware -std=c99 -fno-common -O0 -g -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp  -mthumb -T bootlink.ld -nostartfiles -o main.elf  main.c echo.c /home/user/stellarisware/driverlib/uart.c /home/user/stellarisware/utils/uartstdio.c /home/user/stellarisware/utils/ustdlib.c /home/user/stellaris-enc28j60-booster/lwip/src/core/raw.c /home/user/stellaris-enc28j60-booster/lwip/src/core/init.c /home/user/stellaris-enc28j60-booster/lwip/src/core/tcp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/udp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/tcp_in.c /home/user/stellaris-enc28j60-booster/lwip/src/core/tcp_out.c /home/user/stellaris-enc28j60-booster/lwip/src/core/pbuf.c /home/user/stellaris-enc28j60-booster/lwip/src/core/sys.c /home/user/stellaris-enc28j60-booster/lwip/src/core/def.c /home/user/stellaris-enc28j60-booster/lwip/src/core/mem.c /home/user/stellaris-enc28j60-booster/lwip/src/core/memp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/ip4.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/ip4_addr.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/icmp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/ip_frag.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/igmp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/stats.c /home/user/stellaris-enc28j60-booster/lwip/src/core/inet_chksum.c /home/user/stellaris-enc28j60-booster/lwip/src/core/netif.c /home/user/stellaris-enc28j60-booster/lwip/src/core/timers.c /home/user/stellaris-enc28j60-booster/lwip/src/core/dhcp.c /home/user/stellaris-enc28j60-booster/lwip/src/netif/etharp.c startup_gcc.c arch/sys_arch.c /home/user/stellarisware/driverlib/gcc-cm4f/libdriver-cm4f.a enc28j60.c
/home/user/sat/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: main.elf section `.text' will not fit in region `FLASH'
/home/user/sat/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: main.elf section `.bss' will not fit in region `SRAM'
/home/user/sat/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 3688 bytes
/home/user/sat/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: region `SRAM' overflowed by 8200 bytes
collect2: error: ld returned 1 exit status
make: *** [main.elf] Error 1
 

Link to post
Share on other sites

Hello,

This is pretty new to me, but I have finally made some progress. However, I am stuck again. Any suggestions? Make complains of inability to fit into restrictions:

 

Have you made any changes to the code? Which compiler are you using?

Link to post
Share on other sites

Hello,

This is pretty new to me, but I have finally made some progress. However, I am stuck again. Any suggestions? Make complains of inability to fit into restrictions:

 

user@ubuntu:~/stellaris-enc28j60-booster$ make

arm-none-eabi-gcc -DDTARGET_IS_BLIZZARD_RA2 -DPART_LM4F120H5QR  -Dgcc -I/home/user/stellaris-enc28j60-booster/lwip/src/include -I/home/user/stellaris-enc28j60-booster/lwip/src/include/ipv4 -I/home/user/stellaris-enc28j60-booster/lwip/src/include/ipv6 -I./ -I/home/user/stellarisware -std=c99 -fno-common -O0 -g -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp  -mthumb -T bootlink.ld -nostartfiles -o main.elf  main.c echo.c /home/user/stellarisware/driverlib/uart.c /home/user/stellarisware/utils/uartstdio.c /home/user/stellarisware/utils/ustdlib.c /home/user/stellaris-enc28j60-booster/lwip/src/core/raw.c /home/user/stellaris-enc28j60-booster/lwip/src/core/init.c /home/user/stellaris-enc28j60-booster/lwip/src/core/tcp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/udp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/tcp_in.c /home/user/stellaris-enc28j60-booster/lwip/src/core/tcp_out.c /home/user/stellaris-enc28j60-booster/lwip/src/core/pbuf.c /home/user/stellaris-enc28j60-booster/lwip/src/core/sys.c /home/user/stellaris-enc28j60-booster/lwip/src/core/def.c /home/user/stellaris-enc28j60-booster/lwip/src/core/mem.c /home/user/stellaris-enc28j60-booster/lwip/src/core/memp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/ip4.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/ip4_addr.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/icmp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/ip_frag.c /home/user/stellaris-enc28j60-booster/lwip/src/core/ipv4/igmp.c /home/user/stellaris-enc28j60-booster/lwip/src/core/stats.c /home/user/stellaris-enc28j60-booster/lwip/src/core/inet_chksum.c /home/user/stellaris-enc28j60-booster/lwip/src/core/netif.c /home/user/stellaris-enc28j60-booster/lwip/src/core/timers.c /home/user/stellaris-enc28j60-booster/lwip/src/core/dhcp.c /home/user/stellaris-enc28j60-booster/lwip/src/netif/etharp.c startup_gcc.c arch/sys_arch.c /home/user/stellarisware/driverlib/gcc-cm4f/libdriver-cm4f.a enc28j60.c

/home/user/sat/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: main.elf section `.text' will not fit in region `FLASH'

/home/user/sat/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: main.elf section `.bss' will not fit in region `SRAM'

/home/user/sat/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 3688 bytes

/home/user/sat/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: region `SRAM' overflowed by 8200 bytes

collect2: error: ld returned 1 exit status

make: *** [main.elf] Error 1

 

 

Ok, I just figured this one out. You have set SERIALPROG=1 in toolchainsettings, which seems reasonable. However, when doing that the Makefile I am using is using a wrong linker script (both Makefile and linker script are borrowed from http://teholabs.com/). Try set SERIALPROG=0 again, and you should get a nice resulting main.bin, which you will need to flash yourself using lm4flash.

I apologize for the confusion.

 

Cheers,

Paul

Link to post
Share on other sites

hmm, well as is typical for me. one mountain crossed another on the horizon looms.

 

so I got the programmed flashed and running, with the ETH chip wired up. Now I am getting a hard fault like jalder

 

@jalder did you ever make any progress on that error?

 

here is a capture of the output, i added a print statement is the only change to the code

so i am guessing it get's lost somewhere in here

 printf("netif setup\n");
  netif_add(&netif, &ipaddr, &netmask, &gw, NULL, enc28j60_init, ethernet_input);
  netif_set_default(&netif);
  netif_set_up(&netif);
  printf("netif done\n");

 

Welcome
ENC_ESTAT: 1
Econ: 0
Silicon Revision: 6
int enabled
lwip init complete
netif setup


[Hard fault handler - all numbers in hex]
R0 = 20004f44
R1 = 20004fb9
R2 = 107f0
R3 = 6
R12 = 20004fb9
LR [R14] = 0  subroutine call return address
PC [R15] = ae77  program counter
PSR = 10222
BFAR = e000ed38
CFSR = 10000
HFSR = 40000000
DFSR = 0
AFSR = 0
 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...