Skip to content

Commit

Permalink
Merge branch 'hotfix/bug#16'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricky-Kwon committed Apr 11, 2018
2 parents c607031 + 32dd291 commit c3837f2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 52 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# WIZ550S2E

Serial to Ethernet Module based on [W5500](http://wizwiki.net/wiki/doku.php?id=products:w5500:start) & Cortex-M0

## Firmware

These are Firmware projects (source code) based on [LPCXpresso](http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/lpc1100-cortex-m0-plus-m0/lpcxpresso-ide-v8.2.2:LPCXPRESSO) IDE or [MCUXpresso](http://www.nxp.com/products/software-and-tools/run-time-software/mcuxpresso-software-and-tools/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE).

- [Direct Download Link for LPCXpresso7.5.0_254 for Windows](https://s3.amazonaws.com/LPCXpresso7/LPCXpresso_7.5.0_254.exe)
Expand Down Expand Up @@ -51,12 +53,14 @@ If you would like to use [.bin file](http://wizwiki.net/wiki/doku.php?id=product
</p>

## Images

### WIZ550S2E Module

<!-- WIZ550S2E pic -->
![WIZ550S2E](http://wizwiki.net/wiki/lib/exe/fetch.php?cache=&media=products:wiz550s2e:wiz550s2eds:wiz550s2e_pin.jpg "WIZ550S2E")

#### Features & Benefits & Hardware Specification

- Serial to Ethernet Module based on TCP/IP Controller W5500 & Cortex-M0(MCU LPC11E36FHN33)
- RJ-45 mounted, Pin-header type module
- Serial signals : TXD, RXD, RTS, CTS, GND
Expand All @@ -71,14 +75,17 @@ If you would like to use [.bin file](http://wizwiki.net/wiki/doku.php?id=product
- 2.54mm Header x2

### WIZ550S2E-232 Interface Board

<!-- WIZ550S2E-232 Interface Board pic -->
<p align="center">
<img width="70%" src="http://wizwiki.net/wiki/lib/exe/fetch.php?cache=&media=products:wiz550s2e:wiz550s2eds:rs232if_pin_20140729.jpg" />
</p>
<p align="center">
<img width="70%" src="http://wizwiki.net/wiki/lib/exe/fetch.php?cache=&media=products:wiz550s2e:wiz550s2eds:%ED%81%AC%EA%B8%B0%EB%B3%80%ED%99%98_wiz550s2e-232-evb.png" />
</p>

#### Features

- Line Driver SP3232EBEY
- System Reset Switch
- Factory Reset Switch
Expand All @@ -87,14 +94,17 @@ If you would like to use [.bin file](http://wizwiki.net/wiki/doku.php?id=product
- DC-Jack (for +5V Input Power)

### WIZ550S2E-485/422 Interface Board

<!-- WIZ550S2E-232 Interface Board pic -->
<p align="center">
<img width="70%" src="http://wizwiki.net/wiki/lib/exe/fetch.php?cache=&media=products:wiz550s2e:wiz550s2eds:rs485-422if_pin_20140729.jpg" />
</p>
<p align="center">
<img width="70%" src="http://wizwiki.net/wiki/lib/exe/fetch.php?cache=&media=products:wiz550s2e:wiz550s2eds:%ED%81%AC%EA%B8%B0%EB%B3%80%ED%99%98_wiz550s2e-485-evb.png" />
</p>

#### Features

- Line Driver SP3485EN
- System Reset Switch
- Factory Reset Switch
Expand All @@ -117,7 +127,7 @@ Install JAVA Runtime Environment
4. When you run the Terminal, type the "java -version" command, the following message is displayed.
![2](http://wizwiki.net/wiki/lib/exe/fetch.php?t=1428563628&w=500&h=100&tok=1cadd9&media=products:wiz550s2e:2.png "2")
5. [WIZ550S2E wiki page](http://wizwiki.net/wiki/doku.php?id=products:wiz550s2e:wiz550s2e_download).
6. Configuration Tool for WIZ550S2E download.
6. Configuration Tool for WIZ550S2E download.
![3](http://wizwiki.net/wiki/lib/exe/fetch.php?t=1428563629&w=500&h=375&tok=02960c&media=products:wiz550s2e:3.png "3")
7. Then Unzipped the downloaded zip file. Excutable jar file is created.
8. Excute file.
Expand All @@ -126,22 +136,32 @@ Install JAVA Runtime Environment
![4](http://wizwiki.net/wiki/lib/exe/fetch.php?t=1428563629&w=500&h=412&tok=8ab846&media=products:wiz550s2e:4.png "4")

## Revision History

### v1.1.4

- Fixed Problems receiving data in AT Mode

### v1.1.3

- Fixed UDP Send Fail in AT Mode

### v1.1.2

- Fixed recevied data loss(During trans to serial) problem in AT Mode
- Limit max size(1000byte) of receive data from ethernet.

### v1.1.1

- Add inactivity time function in Server/Mixed Mode

### v1.1.0

- ioLibrary Update
- Dependency Removal (remove "board.h" in "w5500.h")
- Remove garbage file

### v1.0.4

- Fixed bug
- Time packing problem in UDP mode.
- Before : Not work normally after the first time.
Expand All @@ -151,6 +171,7 @@ Install JAVA Runtime Environment
- After : Works in both uppercase and lowercase.

### v1.0.3

- Fixed bug
- AT Command Trigger
- Before : AT command is actived regardless of AT command enable.
Expand All @@ -159,6 +180,7 @@ Install JAVA Runtime Environment
- AT+NMODE : (AT command) Saving the changes made to AT mode to memory.

### v1.0.2

- Fixed bug
- In mixed mode
- Before : when connecting to the server, the '+' had to be include in the serial data.
Expand All @@ -171,7 +193,9 @@ Install JAVA Runtime Environment
- AT+FDNS = domain name

### v1.0.1

- Fixed Project set

### v1.0.0

- First release : Apr. 2015
68 changes: 19 additions & 49 deletions WIZ550S2E_App/src/ATcmd/cmdrun.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,7 @@ void act_nrecv(int8_t sock, uint16_t maxlen){
uint16_t dstport;
int32_t len=0, offset=0;
uint16_t recvsize;

if(maxlen > 1000) maxlen = 1000; // limit max size of receive data from ethernet. (20170525)
uint16_t sentlen=0, rbret=0;

if(sock == VAL_NONE) { DBG("sock==NONE");
for(i=ATC_SOCK_NUM_START; i<=ATC_SOCK_NUM_END; i++) {
Expand Down Expand Up @@ -658,9 +657,11 @@ void act_nrecv(int8_t sock, uint16_t maxlen){
ret = RET_NO_DATA;
goto FAIL_RET;
}
//printf("Socket's RECV SIZE : %d\r\n", recvsize);
len = recv(sock, (uint8_t*)atci.recvbuf, maxlen); //DBGA("TCPdbg---m(%d)l(%d)f(%d)", maxlen, len, GetSocketRxRecvBufferSize(sock));
//printf("RECV Length : %d, %d\r\n", len, maxlen);
else {
if(recvsize > maxlen)
recvsize = maxlen;
}
len = recv(sock, (uint8_t*)atci.recvbuf, recvsize); //DBGA("TCPdbg---m(%d)l(%d)f(%d)", maxlen, len, GetSocketRxRecvBufferSize(sock));
} else { // UDP
uint16_t bufleft = maxlen;

Expand All @@ -670,45 +671,13 @@ void act_nrecv(int8_t sock, uint16_t maxlen){
ret = RET_NO_DATA;
goto FAIL_RET;
}

if(bufleft < recvsize) {
DBGA("buffer not enough - sock(%d),buf(%d),recv(%d)", sock, bufleft, recvsize);
ret = RET_NO_FREEMEM;
goto FAIL_RET;
}

offset = recvfrom(sock, (uint8_t*)&atci.recvbuf[len], bufleft, dstip, &dstport);
if(offset <= 0 || offset > (int32_t)bufleft) { // Abnormal case - I don't think this could happen but just in case.
if(offset > (int32_t)bufleft) {
ERRA("buf overflw - off(%d), maxlen(%d)", offset, bufleft);
if(len == 0) {
ret = RET_UNSPECIFIED;
goto FAIL_RET;
}
bufleft = 0;
} else {
ERRA("wrong reaction - ret(%d)", offset);
if(len == 0) {
if(offset == SOCK_CLOSED) {
ret = RET_SOCK_CLS;
goto FAIL_RET;
} else if(offset < 0) {
ret = RET_UNSPECIFIED;
goto FAIL_RET;
} else {
ret = RET_NO_DATA;
goto FAIL_RET;
}
}
}
} else { // Normal case
DBGA("UDP Recv - off(%d), len(%d), maxlen(%d)", offset, len, bufleft);
len += offset;
bufleft -= offset;
else {
if(recvsize > maxlen)
recvsize = maxlen;
}
len = recvfrom(sock, (uint8_t*)atci.recvbuf, recvsize, dstip, &dstport);
}
//DBGA("RECV prt-len(%d), max(%d)", len, maxlen);
atci.recvbuf[len] = 0;
recvflag[sock] = VAL_CLEAR;

if((sockstat[sock] & SOCK_STAT_PROTMASK) == SOCK_STAT_IDLE) { // ?�버그용?? ?�정?�면 간단?�게 ?�정??�
Expand All @@ -730,15 +699,16 @@ void act_nrecv(int8_t sock, uint16_t maxlen){
ARG_CLEAR(atci.tcmd.arg2);
ARG_CLEAR(atci.tcmd.arg3);

#if 1 // added by kei for resolve RECV data loss issue. (20170525)
uint32_t send_len = 0;
do{
send_len += UART_write(&atci.recvbuf[send_len], len-send_len);
}while(len-send_len);
#else
UART_write(atci.recvbuf, len);
while (RingBuffer_IsEmpty(&txring)==0) {

}

while (len != sentlen) {
rbret = UART_write(atci.recvbuf+sentlen, len-sentlen);
sentlen += rbret;
}

UART_write("\r\n", 2);
#endif

return;

Expand Down
2 changes: 1 addition & 1 deletion WIZ550S2E_App/src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#define MAJOR_VER 1
#define MINOR_VER 1
#define MAINTENANCE_VER 3
#define MAINTENANCE_VER 4

#define SOCK_DATA 0
#define SOCK_CONFIG 1
Expand Down
2 changes: 1 addition & 1 deletion WIZ550S2E_App/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int main(void)
}
}

atc_init(&rxring, &txring);
atc_init();

op_mode = OP_DATA;
while (1) {
Expand Down

0 comments on commit c3837f2

Please sign in to comment.