c - 在 MPLab X IDE 上设置 Harmony Configurator 的 TCP IP 堆栈

标签 c rtos

我已经在我的 Harmony 配置中添加了 TCP/IP 堆栈,但是它给我以下错误。我的问题是如何使用 MPLAB® Harmony Integrated Software Framework v1.04.01 在 MPLab X IDE V3 上正确设置 TCP/IP 堆栈。

尝试运行代码时出错:

../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/drivers/usart.c:81:19: error: 'U3MODE' undeclared here (not in a function)
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/drivers/usart.c:81:40: error: 'U3STA' undeclared here (not in a function)
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/drivers/usart.c:81:60: error: 'U3TXREG' undeclared here (not in a function)

nbproject/Makefile-tcp_ip.mk:693: recipe for target 'build/tcp_ip/production/_ext/28866467/usart.o' failed
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/drivers/usart.c:81:82: error: 'U3RXREG' undeclared here (not in a function)
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/drivers/usart.c:81:104: error: 'U3BRG' undeclared here (not in a function)
make[2]: *** [build/tcp_ip/production/_ext/28866467/usart.o] Error 1
make[2]: *** Waiting for unfinished jobs....

"/opt/microchip/xc32/v1.34/bin/xc32-gcc" -g -x c -c -mprocessor=32MX460F512L -ffunction-sections -O1 -D__XC \
    -I../src -I../../../../microchip/harmony/v1_04_01/framework -I../src/system_config/tcp_ip/framework -I../src/system_config/tcp_ip -I../../../../microchip/harmony/v1_04_01/bsp/pic32mx460_pim+e16 -I../../../../microchip/harmony/v1_04_01/third_party/rtos/FreeRTOS/Source/portable/MPLAB/PIC32MXI../../../../microchip/harmony/v1_04_01/third_party/rtos/FreeRTOS/Source/include \
    -MMD -MF build/tcp_ip/production/_ext/682004257/system_debug.o.d -o build/tcp_ip/production/_ext/682004257/system_debug.o ../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_debug.c

"/opt/microchip/xc32/v1.34/bin/xc32-gcc" -g -x c -c -mprocessor=32MX460F512L -ffunction-sections -O1 -D__XC -I../src \
    -I../../../../microchip/harmony/v1_04_01/framework -I../src/system_config/tcp_ip/framework -I../src/system_config/tcp_ip -I../../../../microchip/harmony/v1_04_01/bsp/pic32mx460_pim+e16 -I../../../../microchip/harmony/v1_04_01/third_party/rtos/FreeRTOS/Source/portable/MPLAB/PIC32MXI../../../../microchip/harmony/v1_04_01/third_party/rtos/FreeRTOS/Source/include \
    -MMD -MF build/tcp_ip/production/_ext/1577513309/tcpip_manager.o.d -o build/tcp_ip/production/_ext/1577513309/tcpip_manager.o ../../../../microchip/harmony/v1_04_01/framework/tcpip/src/tcpip_manager.c

"/opt/microchip/xc32/v1.34/bin/xc32-gcc" -g -x c -c -mprocessor=32MX460F512L -ffunction-sections -O1 -D__XC -I../src \
    -I../../../../microchip/harmony/v1_04_01/framework -I../src/system_config/tcp_ip/framework -I../src/system_config/tcp_ip -I../../../../microchip/harmony/v1_04_01/bsp/pic32mx460_pim+e16 -I../../../../microchip/harmony/v1_04_01/third_party/rtos/FreeRTOS/Source/portable/MPLAB/PIC32MXI../../../../microchip/harmony/v1_04_01/third_party/rtos/FreeRTOS/Source/include \
    -MMD -MF build/tcp_ip/production/_ext/682004257/system_command.o.d -o build/tcp_ip/production/_ext/682004257/system_command.o ../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_command.c


nbproject/Makefile-tcp_ip.mk:699: recipe for target 'build/tcp_ip/production/_ext/682004257/system_command.o' failed
make[2]: Leaving directory '/home/myworkarea/HttpTester/firmware/HttpTester.X'
nbproject/Makefile-tcp_ip.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory '/home/myworkarea/HttpTester/firmware/HttpTester.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
In file included from ../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_command.c:46:0:

../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_command.h:49:21: error: redefinition of typedef 'SYS_CMD_HANDLE'
../../../../microchip/harmony/v1_04_01/framework/system/command/sys_command.h:251:21: note: previous declaration of 'SYS_CMD_HANDLE' was here
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_command.h:83:2: error: conflicting types for 'SYS_CMD_API'
../../../../microchip/harmony/v1_04_01/framework/system/command/sys_command.h:370:2: note: previous declaration of 'SYS_CMD_API' was here
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_command.h:95:2: error: conflicting types for 'SYS_CMD_DEVICE_NODE'
../../../../microchip/harmony/v1_04_01/framework/system/command/sys_command.h:489:2: note: previous declaration of 'SYS_CMD_DEVICE_NODE' was here
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_command.h:103:2: error: conflicting types for 'SYS_CMD_DEVICE_LIST'
../../../../microchip/harmony/v1_04_01/framework/system/command/sys_command.h:510:2: note: previous declaration of 'SYS_CMD_DEVICE_LIST' was here
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_command.h:109:15: error: conflicting types for 'SYS_CMD_FNC'
../../../../microchip/harmony/v1_04_01/framework/system/command/sys_command.h:559:15: note: previous declaration of 'SYS_CMD_FNC' was here
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_command.h:116:2: error: conflicting types for 'SYS_CMD_DESCRIPTOR'
../../../../microchip/harmony/v1_04_01/framework/system/command/sys_command.h:580:3: note: previous declaration of 'SYS_CMD_DESCRIPTOR' was here
../../../../microchip/harmony/v1_04_01/framework/tcpip/src/system/system_command.h:124:2: error: conflicting types for 'SYS_CMD_DESCRIPTOR_TABLE'
../../../../microchip/harmony/v1_04_01/framework/system/command/sys_command.h:602:3: note: previous declaration of 'SYS_CMD_DESCRIPTOR_TABLE' was here

最佳答案

“重新定义”错误的发生是因为包含了两个定义相同类型定义的头文件。 冲突的文件是:

...\v1_04_02\framework\system\command\sys_command.h

...\v1_04_02\framework\tcpip\src\system\system_command.h

包含在文件中

...\v1_04_02\framework\tcpip\src\system\system_command.c

仅当包含 Harmony 组件“TCPIP 堆栈 -> 使用 TCP/IP 命令”并且不包含“服务 -> 命令 -> 使用命令处理器系统服务”时,才会包含文件 system_command.c。

要消除冲突(和错误),要么禁用“TCPIP 堆栈 -> 使用 TCP/IP 命令”,要么启用“服务 -> 命令 -> 使用命令处理器系统服务”(我不知道这个组件是什么是为了,但如果启用它,代码将增长大约 30 kbytes)。

关于c - 在 MPLab X IDE 上设置 Harmony Configurator 的 TCP IP 堆栈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30411362/

相关文章:

rtos - 在 freeRTOS 任务中创建或使用的 v 和 x 是什么意思?

FreeRTOS:为什么要在 isrHandler 中调用 taskYIELD_FROM_ISR() 方法

c - 如何在 switch 语句的 case 字段中使用变量?

c - 为什么在 Linux 中没有库说明符就不会出错?

c - ARM cortex如何处理PendSV Handler

task - FreeRTOS - vTaskList 未定义引用

c - 在嵌入式 C 中使用 RTOS 处理多任务文件系统的最佳方法?

c - 为什么我的 printf 打印出错误的值?

c - 允许 ((int *)p)++ 的任何 gcc 选项

c - `*p=&` 和 `p=&` 之间的区别