Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricky-Kwon committed Apr 11, 2018
2 parents 4e2199e + d704c55 commit f4eeba2
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 47 deletions.
67 changes: 34 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
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 IDE (it has been optimized in LPCXpresso v7.5.0_254(recommend)).
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).

These are can't build on LPCXpresso v8.x.x. We recommend LPCXpresso v7.5.0_254.

- [Official Download Page](https://nxp.flexnetoperations.com/control/frse/product?child_plneID=730797&cert_num=276240197&ver=ARC).
- [Direct Download Link](https://s3.amazonaws.com/LPCXpresso7/LPCXpresso_7.5.0_254.exe) (Windows).
- [Direct Download Link for LPCXpresso7.5.0_254 for Windows](https://s3.amazonaws.com/LPCXpresso7/LPCXpresso_7.5.0_254.exe)

Firmware source code are two types as follows.
- Application
Expand Down Expand Up @@ -130,13 +127,36 @@ 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.0.0
- First release : Apr. 2015
### 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.0.1
- Fixed Project set
### 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.
- After : Work normally
- Upper and lower case problems in config Data.
- Before : Only uppercase letters work normally.
- 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.
- After : AT command is actived regard of AT command enable.
- Add function
- AT+NMODE : (AT command) Saving the changes made to AT mode to memory.

v1.0.2
### 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 @@ -148,27 +168,8 @@ v1.0.2
- Check unlink in mixed mode
- AT+FDNS = domain name

v1.0.3
- Fixed bug
- AT Command Trigger
- Before : AT command is actived regardless of AT command enable.
- After : AT command is actived regard of AT command enable.
- Add function
- AT+NMODE : (AT command) Saving the changes made to AT mode to memory.

v1.0.4
- Fixed bug
- Time packing problem in UDP mode.
- Before : Not work normally after the first time.
- After : Work normally
- Upper and lower case problems in config Data.
- Before : Only uppercase letters work normally.
- After : Works in both uppercase and lowercase.

v1.1.0
- ioLibrary Update
- Dependency Removal (remove "board.h" in "w5500.h")
- Remove garbage file
### v1.0.1
- Fixed Project set

v1.1.1
- Add inactivity time function in Server/Mixed Mode
### v1.0.0
- First release : Apr. 2015
20 changes: 17 additions & 3 deletions WIZ550S2E_App/src/ATcmd/cmdrun.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ static uint8_t udpip[ATC_SOCK_NUM_TOTAL+ATC_SOCK_AO][4] = {{0,},}; // to store
static uint16_t udpport[ATC_SOCK_NUM_TOTAL+ATC_SOCK_AO] = {0,}; // to store UDP Destination port
static int8_t recvflag[ATC_SOCK_NUM_TOTAL+ATC_SOCK_AO] = {0,}; // for recv check

extern int32_t checkAtcUdpSendStatus;

static int8_t sock_get(int8_t initval, uint16_t srcport)
{
int8_t i;
Expand Down Expand Up @@ -100,7 +102,7 @@ void atc_async_cb(uint8_t sock, uint8_t item, int32_t ret)
}
break;
case WATCH_SOCK_TCP_SEND: DBG("WATCH_SOCK_TCP_SEND");
// 블로??모드로만 ?™ìž‘??그러므ë¡?Watch???„요가 ?†ìŒ
// 블로??모드로만 ?�작??그러므�?Watch???�요가 ?�음
break;
case WATCH_SOCK_CONN_TRY: DBG("WATCH_SOCK_CONN_TRY");
sockbusy[sock] = VAL_FALSE;
Expand Down Expand Up @@ -392,6 +394,7 @@ void act_nopen_a(int8_t type, uint16_t sport, uint8_t *dip, uint16_t dport)
MAKE_TCMD_DIGIT(atci.tcmd.arg1, sock);
cmd_resp(RET_OK, VAL_NONE);
ARG_CLEAR(atci.tcmd.arg1);
checkAtcUdpSendStatus = 0;
return;
}
else { // 'A' mode
Expand Down Expand Up @@ -595,7 +598,7 @@ void act_nsend(uint8_t sock, int8_t *buf, uint16_t len, uint8_t *dip, uint16_t *
memcpy(remote_ip, dip, 4);
remote_port = *dport;

ret = sendto(sock, (uint8_t *)buf, len, remote_ip, remote_port);
checkAtcUdpSendStatus = ret = sendto(sock, (uint8_t *)buf, len, remote_ip, remote_port);
/*
if(ret == SOCK_BUSY) {
getsockopt(sock, SO_SENDBUF, &availlen);
Expand All @@ -621,6 +624,8 @@ void act_nrecv(int8_t sock, uint16_t maxlen){
int32_t len=0, offset=0;
uint16_t recvsize;

if(maxlen > 1000) maxlen = 1000; // limit max size of receive data from ethernet. (20170525)

if(sock == VAL_NONE) { DBG("sock==NONE");
for(i=ATC_SOCK_NUM_START; i<=ATC_SOCK_NUM_END; i++) {
if(recvflag[i] == VAL_SET) {
Expand Down Expand Up @@ -653,7 +658,9 @@ 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 { // UDP
uint16_t bufleft = maxlen;

Expand Down Expand Up @@ -704,7 +711,7 @@ void act_nrecv(int8_t sock, uint16_t maxlen){
atci.recvbuf[len] = 0;
recvflag[sock] = VAL_CLEAR;

if((sockstat[sock] & SOCK_STAT_PROTMASK) == SOCK_STAT_IDLE) { // ?”버그용?? ?ˆì •?˜ë©´ 간단?˜ê²Œ ?˜ì •??ê²
if((sockstat[sock] & SOCK_STAT_PROTMASK) == SOCK_STAT_IDLE) { // ?�버그용?? ?�정?�면 간단?�게 ?�정??�
CRITICAL_ERRA("Impossible status - recv from closed sock(%d)", sock);
} else if(sockstat[sock] & SOCK_STAT_TCP_MASK) { // TCP
if(sockstat[sock] & SOCK_STAT_CONNECTED)
Expand All @@ -723,8 +730,15 @@ 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);
UART_write("\r\n", 2);
#endif

return;

Expand Down
15 changes: 5 additions & 10 deletions WIZ550S2E_App/src/ATcmd/library/sockutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
static watch_cbfunc watch_cb[TOTAL_SOCK_NUM] = {0,};
static uint8_t watch_sock[TOTAL_SOCK_NUM] = {0,};


int32_t checkAtcUdpSendStatus = 0;
/**
* Assign a callback function to a socket.
* When @ref sockwatch_run function detected a event, \n
Expand Down Expand Up @@ -219,17 +219,12 @@ do { \
// 블로킹 모드로만 동작함 그러므로 Watch할 필요가 없음
}
if(watch_sock[i] & WATCH_SOCK_UDP_SEND) {
ctlsocket(i, CS_GET_INTERRUPT, (uint8_t*)&ret);
if((uint8_t)ret & Sn_IR_SENDOK) {
uint8_t set = (uint8_t)Sn_IR_SENDOK;
ctlsocket(i, CS_CLR_INTERRUPT, &set);
WCF_HANDLE(WATCH_SOCK_UDP_SEND, RET_OK);
}
else if((uint8_t)ret & Sn_IR_TIMEOUT) {
uint8_t set = Sn_IR_TIMEOUT;
ctlsocket(i, CS_CLR_INTERRUPT, &set);
if(checkAtcUdpSendStatus < 0) {
WCF_HANDLE(WATCH_SOCK_UDP_SEND, RET_NOK);
}
else {
WCF_HANDLE(WATCH_SOCK_UDP_SEND, RET_OK);
}
}
}

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 2
#define MAINTENANCE_VER 3

#define SOCK_DATA 0
#define SOCK_CONFIG 1
Expand Down

0 comments on commit f4eeba2

Please sign in to comment.