Page 1 of 1

W5500 question

Posted: Thu Jan 30, 2020 7:21 pm
by TSMroz
Hi,
So I have another feather device that I'm trying to learn on, which is W5500 based. I'm using it with the 32U4 (using a dedicated programmer now, which works with avrisp from within FC). Using the webserver example, are the initialize and CreateServerSocket macros the barebones needed to be able to connect from a browser for testing? I've been trying for a couple days to get it connected, but am having no luck.

I'm able to ping the device with the IP that I've configured within the component, no problem. I just can't seem to connect any other way. Even with specifying the port (80).


When compiling, it says successful, but also seeing a lot of messages. Are all of these normal?:


C:\Users\lab1\DOCUME~1>"C:\PROGRA~2\Flowcode\Common\COMPIL~1\avr\BATCHF~1\..\bin\avr-gcc.exe" -mmcu=atmega32u4 -Os -ffunction-sections -fdata-sections -funsigned-char -o "C:\Users\lab1\DOCUME~1\Flowcode1.elf" "C:\Users\lab1\DOCUME~1\Flowcode1.c" -lm -Wl,-gc-sections
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:1068,
from C:\Users\lab1\DOCUME~1\Flowcode1.c:346:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:146:3: warning: #warning "Important user information. Please read."
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:147:3: warning: #warning "Hardware SPI may cause a lockup in your program if Hardware SS Pin is left as an input!";
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:148:3: warning: #warning "Suggest using the SS pin as the CS pin to ensure no lockup."
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:149:3: warning: #warning "SS pin must be set to an output or pulled high before initialising the SPI."
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:150:3: warning: #warning "Refer to the device datasheet for the SPI hardware SS pin.";
C:\Users\lab1\DOCUME~1\Flowcode1.c: In function 'FCD_0ece1_Webserver_W5500__ParseParamValue':
C:\Users\lab1\DOCUME~1\Flowcode1.c:1027: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c: In function 'FCD_0ece1_Webserver_W5500__SetOutValue':
C:\Users\lab1\DOCUME~1\Flowcode1.c:1075: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c:1089: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c:1197: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c: In function 'FCD_0ece1_Webserver_W5500__GetInValue':
C:\Users\lab1\DOCUME~1\Flowcode1.c:1786: warning: passing argument 1 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c: In function 'FCD_0ece1_Webserver_W5500__Write_String':
C:\Users\lab1\DOCUME~1\Flowcode1.c:1905: warning: passing argument 1 of 'FCD_0ece1_Webserver_W5500__Write_String_Var' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c:1918: warning: passing argument 1 of 'FCD_0ece1_Webserver_W5500__Write_String_Var' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c:2026: warning: passing argument 1 of 'FCD_0ece1_Webserver_W5500__Write_String_Var' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c: In function 'FCD_0ece1_Webserver_W5500__ResetInValues':
C:\Users\lab1\DOCUME~1\Flowcode1.c:2520: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c: In function 'FCD_0ece1_Webserver_W5500__Initialise':
C:\Users\lab1\DOCUME~1\Flowcode1.c:2575: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c:2580: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type
C:\Users\lab1\DOCUME~1\Flowcode1.c:2585: warning: passing argument 3 of 'FCI_SCOPY' discards qualifiers from pointer target type

C:\Users\lab1\DOCUME~1>"C:\PROGRA~2\Flowcode\Common\COMPIL~1\avr\BATCHF~1\..\bin\avr-objdump.exe" -S "C:\Users\lab1\DOCUME~1\Flowcode1.elf" 1>"C:\Users\lab1\DOCUME~1\Flowcode1.lst"

C:\Users\lab1\DOCUME~1>"C:\PROGRA~2\Flowcode\Common\COMPIL~1\avr\BATCHF~1\..\bin\avr-size.exe" -B -d "C:\Users\lab1\DOCUME~1\Flowcode1.elf"
text data bss dec hex filename
1270 244 169 1683 693 C:\Users\lab1\DOCUME~1\Flowcode1.elf

Compilation successful!



Thanks,
Tom

Re: W5500 question

Posted: Fri Jan 31, 2020 2:07 pm
by Benj
Hi Tom,

There are some examples here that might help.
https://www.matrixtsl.com/wiki/index.ph ... ada16cd3ef

I've just got some hardware with the W5500 chip mounted so I'm going to be playing with it very soon and hopefully I can help more then.
Leigh may know more on this one.

Re: W5500 question

Posted: Fri Jan 31, 2020 2:28 pm
by TSMroz
Thank you. I did start with the example from that page. Hopefully it's just something I'm doing wrong. It does work fine using the webserver example sketch from within the Arduino environment, so I know the device is ok.

Re: W5500 question

Posted: Fri Jan 31, 2020 2:35 pm
by Benj
These warnings are worth paying attention to if you haven't already.
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:146:3: warning: #warning "Important user information. Please read."
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:147:3: warning: #warning "Hardware SPI may cause a lockup in your program if Hardware SS Pin is left as an input!";
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:148:3: warning: #warning "Suggest using the SS pin as the CS pin to ensure no lockup."
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:149:3: warning: #warning "SS pin must be set to an output or pulled high before initialising the SPI."
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_SPI.c:150:3: warning: #warning "Refer to the device datasheet for the SPI hardware SS pin.";
On an AVR chip if the SS pin is left as an input and allowed to read a 0 then the hardware SPI will go into slave mode and lock up the processor. If you are driving the pin as an output then the problem goes away.

Re: W5500 question

Posted: Fri Jan 31, 2020 3:26 pm
by stefan.erni
Hi TSMroz

I'm using the W5500 on a hardware.
It's a clickboard where you can choose 2 clickboard
I choosed: place1 the W5500 and place2 a oled display
Both are working with the FC program in the attachment, I can conncet to the PC and send and get some data.

But there is a lot of this wrong in my code I'm working on it.
but soon I will improve it and see that it works with Flowcode SCADA.You may want to look at the hardware.

regards

Stefan

MIKROE-1718
https://www.distrelec.ch/de/eth-wiz-cli ... ggest=true
MIKROE-1585
https://www.distrelec.ch/de/oled-click- ... ggest=true
MIKROE-2800
https://www.distrelec.ch/de/clicker-for ... ggest=true
EMG2020-network_IF1_display_socket_server.fcfx
(40.15 KiB) Downloaded 195 times
WP_20200131_15_00_32_Pro.jpg
WP_20200131_15_00_32_Pro.jpg (220.48 KiB) Viewed 3114 times

Re: W5500 question

Posted: Fri Jan 31, 2020 8:08 pm
by TSMroz
Thanks Stefan. I will have a look at your code.

I'm currently using PortB.6 for the CS. The 32u4 SS pin, (PortB.0) doesn't appear to be connected to anything on the 32u4 proto feather. I tried setting that as an output, but still no luck. I didn't have much time to try different things today. I was able to verify that CS stays stuck low with the FC code while the Arduino sketch shows lots of activity. Will keep at it.