Skip to content

Commit

Permalink
Merge pull request #32 from Wiznet/Develop_1.4.1
Browse files Browse the repository at this point in the history
Develop 1.4.1
  • Loading branch information
seok930927 authored Nov 7, 2024
2 parents 686df2e + 1383d2a commit d95a3c9
Show file tree
Hide file tree
Showing 10 changed files with 5,538 additions and 5,455 deletions.
Binary file modified Projects/S2E_App/bin/W7500x_S2E_App.bin
Binary file not shown.
5,367 changes: 2,689 additions & 2,678 deletions Projects/S2E_App/bin/W7500x_S2E_App.hex

Large diffs are not rendered by default.

49 changes: 42 additions & 7 deletions Projects/S2E_App/src/Configuration/segcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ extern uint8_t tmp_timeflag_for_debug;

void do_segcp(void)
{
struct __serial_info *serial = (struct __serial_info *)get_DevConfig_pointer()->serial_info;
DevConfig *dev_config = get_DevConfig_pointer();

uint8_t ret = 0;
Expand Down Expand Up @@ -192,7 +193,19 @@ void do_segcp(void)
{
if(opmode == DEVICE_AT_MODE)
{
if(dev_config->serial_info[0].serial_debug_en) uart_puts(SEG_DATA_UART, "REBOOT\r\n", 8);
//1.4.1
if(dev_config->serial_info[0].serial_debug_en){
if(serial->uart_interface == UART_IF_RS422_485)
{
uart_rs485_enable(SEG_DATA_UART);
uart_puts(SEG_DATA_UART, "REBOOT\r\n", 8);
uart_rs485_disable(SEG_DATA_UART);
}
else
{
uart_puts(SEG_DATA_UART, "REBOOT\r\n", 8);
}
}
}

device_reboot();
Expand Down Expand Up @@ -1360,16 +1373,17 @@ uint16_t proc_SEGCP_tcp(uint8_t* segcp_req, uint8_t* segcp_rep)

uint16_t proc_SEGCP_uart(uint8_t * segcp_rep)
{
//1.4.1
struct __serial_info *serial = (struct __serial_info *)get_DevConfig_pointer()->serial_info;
DevConfig *dev_config = get_DevConfig_pointer();

uint16_t len = 0;
uint16_t ret = 0;
uint8_t segcp_req[SEGCP_PARAM_MAX*2];

if(BUFFER_USED_SIZE(data_rx))
{
{
len = uart_get_commandline(SEG_DATA_UART, segcp_req, (sizeof(segcp_req) - 1));

if(len != 0)
{
gSEGCPPRIVILEGE = SEGCP_PRIVILEGE_SET | SEGCP_PRIVILEGE_WRITE;
Expand All @@ -1380,9 +1394,18 @@ uint16_t proc_SEGCP_uart(uint8_t * segcp_rep)
{
printf("%s",segcp_rep);
}

uart_puts(SEG_DATA_UART, segcp_rep, strlen(segcp_rep));

//1.4.1
if(serial->uart_interface == UART_IF_RS422_485 )
{
uart_rs485_enable(SEG_DATA_UART);
uart_puts(SEG_DATA_UART, segcp_rep, strlen(segcp_rep));
uart_rs485_disable(SEG_DATA_UART);
}
else
{
uart_puts(SEG_DATA_UART, segcp_rep, strlen(segcp_rep));
}
// BUFFER_CLEAR(data_rx);
}
}
}
Expand All @@ -1391,6 +1414,8 @@ uint16_t proc_SEGCP_uart(uint8_t * segcp_rep)

uint16_t uart_get_commandline(uint8_t uartNum, uint8_t* buf, uint16_t maxSize)
{
//1.4.1
struct __serial_info *serial = (struct __serial_info *)get_DevConfig_pointer()->serial_info;
DevConfig *dev_config = get_DevConfig_pointer();

uint16_t i;
Expand All @@ -1410,7 +1435,17 @@ uint16_t uart_get_commandline(uint8_t uartNum, uint8_t* buf, uint16_t maxSize)
if(dev_config->options.serial_command_echo == SEGCP_ENABLE)
{
//for(j = 0; j < i; j++) uart_putc(uartNum, buf[j]);
uart_puts(uartNum, buf, i);
//1.4.1
if(serial->uart_interface == UART_IF_RS422_485)
{
uart_rs485_enable(SEG_DATA_UART);
uart_puts(uartNum, buf, i);
uart_rs485_disable(SEG_DATA_UART);
}
else
{
uart_puts(uartNum, buf, i);
}
}
}
else
Expand Down
16 changes: 10 additions & 6 deletions Projects/S2E_App/src/PlatformHandler/uartHandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ void serial_info_init(UART_TypeDef *pUART, struct __serial_info *serial)
}
uart_rs485_rs422_init(SEG_DATA_UART);
}

GPIO_Configuration(GPIOC, GPIO_Pin_14, GPIO_Mode_IN, PAD_AF1);
//1.4.1
GPIO_Configuration(GPIOA, GPIO_Pin_14, GPIO_Mode_IN, PAD_AF0);

/* Configure the UARTx */
UART_InitStructure.UART_Mode = UART_Mode_Rx | UART_Mode_Tx;
Expand Down Expand Up @@ -330,6 +330,9 @@ int32_t uart_putc(uint8_t uartNum, uint8_t ch)
{
DevConfig *value = get_DevConfig_pointer();

//1.4.1
// When the baudrate is low and long data is sent, the WDT is triggered.
WDT_SetWDTLoad(0xFF0000);
if(uartNum == SEG_DATA_UART)
{
UartPutc(UART_data, ch);
Expand Down Expand Up @@ -443,11 +446,11 @@ void uart_rx_flush(uint8_t uartNum)

uint8_t get_uart_rs485_sel(uint8_t uartNum)
{
if(uartNum == 0) // UART0
if(uartNum == 0) // UART0
{
GPIO_Configuration(UART0_RTS_PORT, UART0_RTS_PIN, GPIO_Mode_IN, UART0_RTS_PAD_AF); // UART0 RTS pin: GPIO / Input
GPIO_SetBits(UART0_RTS_PORT, UART0_RTS_PIN);

if(GPIO_ReadInputDataBit(UART0_RTS_PORT, UART0_RTS_PIN) == UART_IF_RS422)
{
uart_if_mode = UART_IF_RS422;
Expand Down Expand Up @@ -553,10 +556,11 @@ void uart_rs485_disable(uint8_t uartNum)
{
GPIO_ResetBits(UART1_RTS_PORT, UART1_RTS_PIN);
}
delay(1);
//delay(1); //1.4.1
}
else if(uart_if_mode == UART_IF_RS485_REVERSE)
{

// RTS pin -> High
if(uartNum == 0) // UART0
{
Expand All @@ -566,7 +570,7 @@ void uart_rs485_disable(uint8_t uartNum)
{
GPIO_SetBits(UART1_RTS_PORT, UART1_RTS_PIN);
}
delay(1);
//delay(1); //1.4.1
}

//UART_IF_RS422: None
Expand Down
28 changes: 25 additions & 3 deletions Projects/S2E_App/src/Serial_to_Ethernet/seg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,16 @@ void init_trigger_modeswitch(uint8_t mode)
if(serial->serial_debug_en)
{
printf(" > SEG:AT Mode\r\n");
uart_puts(SEG_DATA_UART, (uint8_t *)"SEG:AT Mode\r\n", sizeof("SEG:AT Mode\r\n"));
if(serial->uart_interface == UART_IF_RS422_485)
{
uart_rs485_enable(SEG_DATA_UART);
uart_puts(SEG_DATA_UART, (uint8_t *)"SEG:AT Mode\r\n", sizeof("SEG:AT Mode\r\n"));
uart_rs485_disable(SEG_DATA_UART);
}
else
{
uart_puts(SEG_DATA_UART, (uint8_t *)"SEG:AT Mode\r\n", sizeof("SEG:AT Mode\r\n"));
}
}
}
else // DEVICE_GW_MODE
Expand All @@ -1233,7 +1242,16 @@ void init_trigger_modeswitch(uint8_t mode)
if(serial->serial_debug_en)
{
printf(" > SEG:GW Mode\r\n");
uart_puts(SEG_DATA_UART, (uint8_t *)"SEG:GW Mode\r\n", sizeof("SEG:GW Mode\r\n"));
if(serial->uart_interface == UART_IF_RS422_485)
{
uart_rs485_enable(SEG_DATA_UART);
uart_puts(SEG_DATA_UART, (uint8_t *)"SEG:GW Mode\r\n", sizeof("SEG:GW Mode\r\n"));
uart_rs485_disable(SEG_DATA_UART);
}
else
{
uart_puts(SEG_DATA_UART, (uint8_t *)"SEG:GW Mode\r\n", sizeof("SEG:GW Mode\r\n"));
}
}

}
Expand Down Expand Up @@ -1569,7 +1587,11 @@ uint16_t debugSerial_dataTransfer(uint8_t * buf, uint16_t size, teDEBUGTYPE type
if((type == SEG_DEBUG_S2E) || (type == SEG_DEBUG_E2S))
{
printf("[%s][%04d] ", (type == SEG_DEBUG_S2E)?"S2E":"E2S", size);
for(bytecnt = 0; bytecnt < size; bytecnt++) printf("%02X ", buf[bytecnt]);
//1.4.1
for(bytecnt = 0; bytecnt < size; bytecnt++){
WDT_SetWDTLoad(0xFF0000);
printf("%02X ", buf[bytecnt]);
}
printf("\r\n");
}

Expand Down
2 changes: 1 addition & 1 deletion Projects/S2E_App/src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* Application Firmware Version */
#define MAJOR_VER 1
#define MINOR_VER 4
#define MAINTENANCE_VER 0
#define MAINTENANCE_VER 1

//#define STR_VERSION_STATUS //"Final"//"Develop" // or "Stable"
#define STR_VERSION_STATUS "Stable"
Expand Down
Binary file modified Projects/S2E_Boot/bin/W7500x_S2E_Boot.bin
Binary file not shown.
82 changes: 41 additions & 41 deletions Projects/S2E_Boot/bin/W7500x_S2E_Boot.hex
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
:1015F00000280BD0787B002803D008A95CA001F05C
:1016000091FF182102A802F05AFAE2E7002001F047
:1016100096F90023224617321946184601F0BDF903
:1016200001F0D0FC01F0B8FD012528460FB0F0BD57
:1016200001F0D0FC01F0B7FD012528460FB0F0BD58
:1016300001B582B0FEF7D4FD704902F0A0FA02991C
:10164000484300E0401E00900028FBD10EBD01F091
:10165000B7FC044601F073FC694900200A46FEF716
Expand All @@ -363,14 +363,14 @@
:101690008DFF01F04FFDFFF759FF2646A036307A47
:1016A0000127002501280CD1022001F08BFA2146E8
:1016B0003572AB31002002F05AFA2A20075501F0AA
:1016C0006BFD072636033068401C0DD020462030C5
:1016C0006AFD072636033068401C0DD020462030C6
:1016D000817A00292CD001F049FC002804D031681F
:1016E000706881F3088880472A2005554034607B64
:1016F000002801D0FFF70CFF01F0FFFD607B002800
:1017000001D001F07CFD41480770002001F036FC5B
:1016F000002801D0FFF70CFF01F0FEFD607B002801
:1017000001D001F07BFD41480770002001F036FC5C
:101710003F4C00F024FF2078002806D0002001F084
:1017200039FC012001F036FC257001F08EF9F0E75C
:10173000877201F031FDD7E70D0A00003D3D3D3DC8
:10173000877201F030FDD7E70D0A00003D3D3D3DC9
:101740003D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3DC9
:101750003D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3DB9
:101760003D3D3D3D3D3D3D3D3D3D3D3D3D3D000023
Expand Down Expand Up @@ -600,12 +600,12 @@
:1025600000F02EFD044633493348FFF72CFF0646A2
:1025700030493148FFF766FE0546354328042AD422
:10258000002D28D0280702D500F076FA0FE0E806E3
:1025900002D500F001FE0AE0E80408D527A000F00B
:1025900002D500F000FE0AE0E80408D527A000F00C
:1025A000C1FF002000F0CBF9012000F0C8F9680657
:1025B00023D5022000F006FB002180280CD0A820A3
:1025C00001552146AB31002001F0D1FA00F0E4FDC5
:1025C00001552146AB31002001F0D1FA00F0E3FDC6
:1025D0000420FDF7F7FF70BDA82001552146AB315F
:1025E000002001F0C4FA01202034A07200F0D4FDD4
:1025E000002001F0C4FA01202034A07200F0D3FDD5
:1025F000FF20F530FFF71CF801E02806EBD500F0CE
:1026000054FA70BD0E484178002910D082880D4BD5
:1026100000219A4203D28288521C828000E081808D
Expand Down Expand Up @@ -679,7 +679,7 @@
:102A5000411CE160232803D3FFF7C8FF0020E0609A
:102A600010BD7047B00100209C00002010B5E1208F
:102A70004002FDF71DFD10BD10B500F0A3FA00F0F7
:102A80008BFB10BD10B59F48FDF736FD172808D009
:102A80008AFB10BD10B59F48FDF736FD172808D00A
:102A90001C2806D00220FDF795FD0120FDF792FDD0
:102AA00010BD0220FDF760FEF7E7FFF7EBFFBFF375
:102AB0004F8F96499448C860BFF34F8FFEE7944804
Expand Down Expand Up @@ -766,7 +766,7 @@
:102FC000E7487047F8B5E64EF92030700020707081
:102FD000B0700125F570044630710F21701D00F0AE
:102FE0006CFD0922DFA1701D00F00AFD357504207B
:102FF0007075B475C0217177A822B2770B23D848B9
:102FF0007075B575C0217177A822B2770B23D848B8
:10300000F37702262030067041708270C37005711C
:10301000FF2646718671C671047245728572C1724F
:10302000027343730321D24A8173C11C0A73130ACA
Expand All @@ -790,37 +790,37 @@
:103140000120FFF7E3FB864A0021062317320846D9
:10315000FFF7DCFB824C607821780002084302D044
:103160009449884207D1FFF72DFFF9237C4A0021BB
:103170000120FFF712FC0120207504216175002158
:10318000A175774C4034A17A032903D0042901D0DA
:10319000FFF7E5FE607110BDF0B5714E00254036B9
:1031A0007D27BFB02C46FF00F9236D4A0021012086
:1031B000FFF7F3FBF9236A4600210120FFF7A6FB86
:1031C000F9226946664800F049FB002811D0641CCA
:1031D000707BE4B2002803D0214677A000F0A2F96A
:1031E0003846FEF725FA052C01D2012DDCD13FB07F
:1031F000F0BD0125F4E710B500F002FC10BD30B5BC
:1032000089B0574D03A90120FDF790FF6846427C25
:10321000017CC07B6B4607C36846837B427B017B96
:103220006FA000F07FF928462330417B007B090224
:1032300001436846407D009001916846037DC27C51
:10324000817C71A000F06EF96846407F009068466E
:10325000037FC27E817E75A000F064F96846407EDF
:1032600000906846037EC27D817D76A000F05AF909
:1032700008A84078009008A803786846C27F817F3C
:1032800076A000F04FF92C462034607A01282DD02A
:103290006420415D601C0129417C0FD0027C080242
:1032A000A17B104301900091637B227BE17A71A0A6
:1032B00000F038F9607A032809D017E00A02007C90
:1032C00029460243693176A000F02CF90EE0E07A3D
:1032D000002808D1207B002805D1607B002802D17E
:1032E000A07B002807D078A000F01CF975A000F0A2
:1032F00019F909B030BD79A0F6E710B5184C86B0C1
:103300002146062217316846FFF775FF214601A8BE
:1033100004221D310230FFF76EFF214603A804226C
:1033200021310230FFF767FF214602A80422253130
:103330000230FFF760FF214604A804226531023005
:10334000FFF759FF6034E078002801D0022000E048
:103350000120694688750020FDF7E8FE06B010BD23
:103170000120FFF712FC0120207504216175A07564
:10318000774C4034A17A032903D0042901D0FFF7FA
:10319000E6FE607110BDF0B5714E002540367D270A
:1031A000BFB02C46FF00F9236D4A00210120FFF734
:1031B000F4FBF9236A4600210120FFF7A7FBF9225F
:1031C0006946674800F04AFB002811D0641C707BF8
:1031D000E4B2002803D0214677A000F0A3F93846D6
:1031E000FEF726FA052C01D2012DDCD13FB0F0BD4F
:1031F0000125F4E710B500F003FC10BD30B589B02F
:10320000574D03A90120FDF791FF6846427C017CE0
:10321000C07B6B4607C36846837B427B017B70A003
:1032200000F080F928462330417B007B09020143EE
:103230006846407D009001916846037DC27C817C98
:1032400071A000F06FF96846407F00906846037FE8
:10325000C27E817E75A000F065F96846407E0090D0
:103260006846037EC27D817D76A000F05BF908A8E8
:103270004078009008A803786846C27F817F77A0D5
:1032800000F050F92C462034607A01282DD06420BB
:10329000415D601C0129417C0FD0027C0802A17BAA
:1032A000104301900091637B227BE17A71A000F0D2
:1032B00039F9607A032809D017E00A02007C294610
:1032C0000243693176A000F02DF90EE0E07A002883
:1032D00008D1207B002805D1607B002802D1A07B8B
:1032E000002807D078A000F01DF976A000F01AF9A8
:1032F00009B030BD79A0F6E710B5194C86B021466B
:10330000062217316846FFF775FF214601A80422FF
:103310001D310230FFF76EFF214603A80422213140
:103320000230FFF767FF214602A804222531023050
:10333000FFF760FF214604A8042265310230FFF741
:1033400059FF6034E078002801D0022000E001201D
:10335000694688750020FDF7E9FE06B010BD000043
:10336000000E002057495A373530535200000000F4
:1033700088130000B80B0000581B000052C3000067
:103380006465766963652E77697A77696B692E6EF5
Expand Down
Binary file modified Projects/W7500x_S2E_Production.bin
Binary file not shown.
Loading

0 comments on commit d95a3c9

Please sign in to comment.