forked from gary/BCU
2
0
Fork 0

更新网口功能

This commit is contained in:
ahu_gq 2025-03-16 12:04:56 +08:00
parent 61d1af0b1d
commit fc164fe8e5
6 changed files with 1799 additions and 1141336 deletions

View File

@ -106,9 +106,9 @@ void bms_w5500_net_protocol(void)
uint16_t port, *port_array;
uint32_t ip, len, addr, net_mask, gateway_ip;
ip = 2831155300;//get_eeprom_data(kEEData_Eth1IPAddr2_1, kEepromDataType_Double);
net_mask = 4294967040;//get_eeprom_data(kEEData_Eth1Mask2_1, kEepromDataType_Double);
gateway_ip = 2831155201;//= get_eeprom_data(kEEData_Eth1Gate1Addr2_1, kEepromDataType_Double);
ip = get_eeprom_data(kEEData_Eth1IPAddr2_1, kEepromDataType_Double);
net_mask = get_eeprom_data(kEEData_Eth1Mask2_1, kEepromDataType_Double);
gateway_ip = get_eeprom_data(kEEData_Eth1Gate1Addr2_1, kEepromDataType_Double);
drv_w5500_init(&w5500, ip, port_array, gateway_ip, net_mask, (uint8_t *)(STM32_ID_ADDR + 4), 40000);
}

View File

@ -23,7 +23,7 @@ extern "C" {
#define BMS_485_CHANNEL (3u)
#define W5500_MODBUS_NUM (8u)
#define W5500_MODBUS_NUM (2u)
typedef enum
{

View File

@ -8,11 +8,11 @@
task_array_t tcp_server_task[W5500_MODBUS_NUM];// __attribute__((section (".CCM_RAM")));
//OS_STK tcp_server_stk[W5500_MODBUS_NUM][300];
OS_STK tcp_server_stk[W5500_MODBUS_NUM][300];
extern const UintArgFunCall tcp_server_poll[W5500_MODBUS_NUM];
const uint8_t tcp_server_task_name[W5500_MODBUS_NUM][14] =
{
"tcp_server1", "tcp_server2", "tcp_server3", "tcp_server4", "tcp_server5", "tcp_server6", "tcp_server7", "tcp_server8"
"tcp_server1", "tcp_server2"
};
void poll_1ms_task_init(void);
@ -173,7 +173,7 @@ void poll_10ms_task_init(void)
bsp_create_task(&modbus_rtu_task2, (uint8_t *)"exter1_modbus");
bsp_create_task(&modbus_rtu_task3, (uint8_t *)"exter2_modbus");
/*
bms_w5500_net_protocol();
for(i = 0; i < W5500_MODBUS_NUM; i++)
{
@ -185,7 +185,7 @@ void poll_10ms_task_init(void)
tcp_server_task[i].handler_func = tcp_server_poll[i];
bsp_create_task(&tcp_server_task[i], (uint8_t *)&tcp_server_task_name[i][0]);
}
*/
}

View File

@ -10,15 +10,15 @@
<TargetName>stm32f407</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pArmCC>5060960::V5.06 update 7 (build 960)::.\ARMCC</pArmCC>
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
<pArmCC>5060750::V5.06 update 6 (build 750)::ARMCC</pArmCC>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F407ZGTx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F4xx_DFP.3.0.0</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<PackID>Keil.STM32F4xx_DFP.2.14.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x00020000) IRAM2(0x10000000,0x00010000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
@ -83,7 +83,7 @@
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name>D:\Soft\Setup\Keil\ARM\ARM_Compiler_5.06u7\bin\fromelf.exe --bin -o D:\Code\BMS\BCU\app/BCU_APP2.bin D:\Code\BMS\BCU\app/BCU_APP2.axf"</UserProg1Name>
<UserProg1Name>fromelf --m32combined --output=$L@L.s19 !L</UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
@ -186,7 +186,6 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>1</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -353,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -472,7 +471,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<ClangAsOpt>0</ClangAsOpt>
<uClangAs>2</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -876,7 +875,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<ClangAsOpt>0</ClangAsOpt>
<uClangAs>2</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1216,7 +1215,6 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>1</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1383,7 +1381,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1943,13 +1941,4 @@
</files>
</RTE>
<LayerInfo>
<Layers>
<Layer>
<LayName>BCU_APP</LayName>
<LayPrjMark>1</LayPrjMark>
</Layer>
</Layers>
</LayerInfo>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -271,12 +271,15 @@ const UintArgCall tcp_server_poll[W5500_MODBUS_NUM] =
{
protocol_w5500_modbus_tcp_server1_poll,
protocol_w5500_modbus_tcp_server2_poll,
/*
protocol_w5500_modbus_tcp_server3_poll,
protocol_w5500_modbus_tcp_server4_poll,
protocol_w5500_modbus_tcp_server5_poll,
protocol_w5500_modbus_tcp_server6_poll,
protocol_w5500_modbus_tcp_server7_poll,
protocol_w5500_modbus_tcp_server8_poll,
*/
};