首页 > 解决方案 > 为 ARM 发布交叉编译 FreeRTOS 程序

问题描述

我想为我的目标构建 FreeRTOS 可执行文件,该目标是具有 AM335X ARM Cortex-A8 处理器的 beaglebone black。我正在运行 Windows,但我使用的是运行 linux debian 10 的虚拟机,这是我交叉编译的。uname -a提供:

Linux debian 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux

我是 FreeRTOS 的新手,所以如果我以错误的方式处理这个问题,请告诉我。我的计划是用 C 编写一个 FreeRtos 程序并交叉编译它,然后简单地将可执行文件发送到 beaglebone 并运行可执行文件。我成功地尝试了一个 Hello world 程序,所以我认为它应该可以使用 FreeRTOS 程序。我想让它在两个不同的编译器上工作,因为我想测试两者。第一个是 arm-linux-gnueabihf-gcc,第二个是裸机版本,称为 gcc-arm-8.2-2019.01-x86_64-arm-eabi。我的项目可以在这里找到:https ://github.com/frank2597/FreeRTOS_BBB.git作为快捷方式,我的编译器选项设置可以在这两个文件中找到:

https://github.com/frank2597/FreeRTOS_BBB/blob/master/source/CMakeLists.txt

https://github.com/frank2597/FreeRTOS_BBB/blob/master/source/toolchain.cmake

我正在使用 Cmake 生成 makefile。两个交叉编译器都无法使用我的 testing.c freertos 程序进行编译。当我使用 arm-linux-gnueabihf-gcc 编译器时,我收到各种警告和一些未定义的引用,但编译器达到 100%,make命令的错误如下所示(由于字符限制,无法发布详细输出):

    [  0%] Building C object application/CMakeFiles/src_application.dir/TaskLED2.c.o
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/TaskLED2.c: In function ‘vLED_blink_evBits_ActivateHook’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/TaskLED2.c:70:39: warning: variable ‘xResult’ set but not used [-Wunused-but-set-variable]
      BaseType_t xHigherPriorityTaskWoken, xResult;
                                           ^~~~~~~

    [  2%] Building C object application/CMakeFiles/src_application.dir/app_MultiSinkLogger.c.o
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function ‘vMultiSinkLoggerConsole_main’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:105:30: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
                 char * q       = pMsg;
                                  ^~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function ‘InitSerialisedLogPrintf’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:144:30: warning: returning ‘QueueHandle_t’ {aka ‘struct QueueDefinition *’} from a function with return type ‘uint32_t’ {aka ‘unsigned int’} makes integer from pointer without a cast [-Wint-conversion]
         return ConsoleInterafceQ = q;
                ~~~~~~~~~~~~~~~~~~^~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function ‘prvPrefixStringToMessage’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:153:14: warning: unused variable ‘rv’ [-Wunused-variable]
         uint32_t rv = pdFAIL;
                  ^~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function ‘prvPrefixDebugStringToMessage’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:173:36: warning: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘long unsigned int’ [-Wformat=]
             snprintf(pMsg,m,"%s:%s:%s:%d:%s",pcTaskName,pcFileName,pcFuncName,ulLine,msg);
                                       ~^                                      ~~~~~~
                                       %ld
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:168:14: warning: unused variable ‘rv’ [-Wunused-variable]
         uint32_t rv = pdFAIL;
                  ^~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function ‘SerialisedLogPrintf’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:216:19: warning: pointer targets in initialization of ‘char *’ from ‘uint8_t *’ {aka ‘unsigned char *’} differ in signedness [-Wpointer-sign]
         char * pMsg = BUFFERPOOL_GetFreeBuffer(&m);
                       ^~~~~~~~~~~~~~~~~~~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:235:37: warning: pointer targets in passing argument 1 of ‘BUFFERPOOL_ReturnBuffer’ differ in signedness [-Wpointer-sign]
                 BUFFERPOOL_ReturnBuffer(pMsg);
                                         ^~~~
    In file included from /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:43:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/ported_aws_bufpool/inc/aws_bufferpool.h:72:6: note: expected ‘uint8_t * const’ {aka ‘unsigned char * const’} but argument is of type ‘char *’
     void BUFFERPOOL_ReturnBuffer( uint8_t * const pucBuffer );
          ^~~~~~~~~~~~~~~~~~~~~~~
    [  3%] Building C object application/CMakeFiles/src_application.dir/app_utils.c.o
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_utils.c: In function ‘vAssertCalled’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_utils.c:185:22: warning: unused variable ‘xPrinted’ [-Wunused-variable]
     static portBASE_TYPE xPrinted = pdFALSE;
                          ^~~~~~~~
    /usr/arm-linux-gnueabihf/include/unistd.h: In function ‘_exit’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_utils.c:107:1: warning: ‘noreturn’ function does return
     }
     ^
    At top level:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_utils.c:185:22: warning: ‘xPrinted’ defined but not used [-Wunused-variable]
     static portBASE_TYPE xPrinted = pdFALSE;
                          ^~~~~~~~
    [  3%] Building C object application/CMakeFiles/src_application.dir/enet_wrapper.c.o
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c: In function ‘InitLwipStack’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:279:21: warning: unused variable ‘rv’ [-Wunused-variable]
                 uint8_t rv = PhyReset(CPSW0_MDIO_REGS, ifNum);
                         ^~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c: In function ‘lwip_main’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:369:18: warning: unused variable ‘ipAddr’ [-Wunused-variable]
         unsigned int ipAddr;
                      ^~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c: In function ‘lwIPDHCPComplete’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:672:19: warning: assignment to ‘volatile unsigned char *’ from incompatible pointer type ‘void **’ [-Wincompatible-pointer-types]
                 state = &(cpswNetIF[ifNum].state);
                       ^
    At top level:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:654:13: warning: ‘lwIPDHCPComplete’ defined but not used [-Wunused-function]
     static void lwIPDHCPComplete(unsigned int ifNum)
                 ^~~~~~~~~~~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:618:13: warning: ‘IpAddrDisplay’ defined but not used [-Wunused-function]
     static void IpAddrDisplay(unsigned int ipAddr)
                 ^~~~~~~~~~~~~
    make[2]: Entering directory '/home/frank/eclipse-workspace/FreeRTOS_BBB/build'
    [ 80%] Building C object netif/CMakeFiles/src_portable_lwip_ports_cpsw_netif.dir/cpswif.c.o
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c: In function ‘cpswif_ale_entry_match_free’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c:320:51: warning: passing argument 3 of ‘CPSWALETableEntryGet’ from incompatible pointer type [-Wincompatible-pointer-types]
         CPSWALETableEntryGet(cpswinst->ale_base, idx, ale_entry);
                                                       ^~~~~~~~~
    In file included from /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c:61:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/lib/third_party/ti/include/cpsw.h:297:41: note: expected ‘unsigned int *’ but argument is of type ‘u32_t *’ {aka ‘long unsigned int *’}
                               unsigned int *aleEntryPtr);
                               ~~~~~~~~~~~~~~^~~~~~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c: In function ‘cpswif_port_to_host_vlan_cfg’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c:371:49: warning: passing argument 3 of ‘CPSWALETableEntrySet’ from incompatible pointer type [-Wincompatible-pointer-types]
       CPSWALETableEntrySet(cpswinst->ale_base, idx, ale_v_entry);
                                                     ^~~~~~~~~~~
    In file included from /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c:61:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/lib/third_party/ti/include/cpsw.h:295:41: note: expected ‘unsigned int *’ but argument is of type ‘u32_t *’ {aka ‘long unsigned int *’}
                               unsigned int *aleEntryPtr);
                               ~~~~~~~~~~~~~~^~~~~~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c:389:49: warning: passing argument 3 of ‘CPSWALETableEntrySet’ from incompatible pointer type [-Wincompatible-pointer-types]
       CPSWALETableEntrySet(cpswinst->ale_base, idx, ale_vu_entry);
                                                     ^~~~~~~~~~~~
    In file included from /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c:61:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/lib/third_party/ti/include/cpsw.h:295:41: note: expected ‘unsigned int *’ but argument is of type ‘u32_t *’ {aka ‘long unsigned int *’}
                               unsigned int *aleEntryPtr);
                               ~~~~~~~~~~~~~~^~~~~~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c: In function ‘cpswif_rx_inthandler’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/lwip/ports/cpsw/netif/cpswif.c:2144:8: warning: implicit declaration of function ‘ethernet_input’; did you mean ‘etharp_input’? [-Wimplicit-function-declaration]
         if(ethernet_input((struct pbuf *)pbuf, netif_arr + if_num) != ERR_OK) {
            ^~~~~~~~~~~~~~
            etharp_input

    [ 87%] Building C object ARM_CA8_amm335x/CMakeFiles/src_portable_FreeRTOS_portable_GCC_ARM_CA8_amm335x.dir/port.c.o
 /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c: In function ‘vPortEnterCritical’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c:361:23: warning: unused variable ‘xInsideISR’ [-Wunused-variable]
      extern portBASE_TYPE xInsideISR;
                           ^~~~~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c: In function ‘vPortExitCritical’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c:387:23: warning: unused variable ‘xInsideISR’ [-Wunused-variable]
      extern portBASE_TYPE xInsideISR;
                           ^~~~~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c: In function ‘ulPortSetInterruptMask’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c:123:2: warning: macro expands to multiple statements [-Wmultistatement-macros]
      __asm volatile ( "CPSID i" );         \
      ^~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c:448:3: note: in expansion of macro ‘portCPU_IRQ_DISABLE’
       portCPU_IRQ_DISABLE();
       ^~~~~~~~~~~~~~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c:447:2: note: some parts of macro expansion are not guarded by this ‘if’ clause
      if(ulPortInterruptNesting == 0)
      ^~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c:128:2: warning: macro expands to multiple statements [-Wmultistatement-macros]
      __asm volatile ( "CPSIE i" );         \
      ^~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c:464:3: note: in expansion of macro ‘portCPU_IRQ_ENABLE’
       portCPU_IRQ_ENABLE();
       ^~~~~~~~~~~~~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/FreeRTOS/portable/GCC/ARM_CA8_amm335x/port.c:463:2: note: some parts of macro expansion are not guarded by this ‘if’ clause
      if(ulPortInterruptNesting == 0)
      ^~
    [ 92%] Building C object AM335X/CMakeFiles/src_portable_AM335X.dir/bsp_platform.c.o
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/bsp_platform.c: In function ‘vApplicationFPUSafeIRQHandler’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/bsp_platform.c:89:14: warning: unused variable ‘IrqPrio’ [-Wunused-variable]
         uint32_t IrqPrio     = IntCurrIrqPriorityGet();
                  ^~~~~~~
    [ 93%] Building C object AM335X/CMakeFiles/src_portable_AM335X.dir/hal_bspInit.c.o
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/hal_bspInit.c: In function ‘configure_platform’:
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/hal_bspInit.c:97:5: warning: implicit declaration of function ‘InitMem’ [-Wimplicit-function-declaration]
         InitMem();
         ^~~~~~~
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/hal_bspInit.c:103:5: warning: implicit declaration of function ‘CP15BranchPredictionEnable’; did you mean ‘IntProtectionEnable’? [-Wimplicit-function-declaration]
         CP15BranchPredictionEnable();
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
         IntProtectionEnable
    [100%] Linking C executable freeRTOSBBB
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: AM335X/libsrc_portable_AM335X.a(bsp_platform.c.o): in function `vSetupTickInterrupt':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/bsp_platform.c:47: undefined reference to `ConsoleUtilsPrintf'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/bsp_platform.c:47: undefined reference to `DMTimerIntEnable'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: AM335X/libsrc_portable_AM335X.a(bsp_platform.c.o): in function `vApplicationFPUSafeIRQHandler':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/bsp_platform.c:99: undefined reference to `xInsideISR'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: AM335X/libsrc_portable_AM335X.a(ported_am335x_interrupt.c.o): in function `IntMasterIRQEnable':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/ported_am335x_interrupt.c:479: undefined reference to `CPUirqe'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: AM335X/libsrc_portable_AM335X.a(ported_am335x_interrupt.c.o): in function `IntMasterIRQDisable':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/ported_am335x_interrupt.c:496: undefined reference to `CPUirqd'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: AM335X/libsrc_portable_AM335X.a(ported_am335x_interrupt.c.o): in function `IntMasterFIQEnable':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/ported_am335x_interrupt.c:513: undefined reference to `CPUfiqe'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: AM335X/libsrc_portable_AM335X.a(ported_am335x_interrupt.c.o): in function `IntMasterFIQDisable':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/ported_am335x_interrupt.c:530: undefined reference to `CPUfiqd'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: AM335X/libsrc_portable_AM335X.a(ported_am335x_interrupt.c.o): in function `IntMasterStatusGet':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/AM335X/ported_am335x_interrupt.c:544: undefined reference to `CPUIntStatus'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: application/libsrc_application.a(app_MultiSinkLogger.c.o): in function `vMultiSinkLoggerConsole_main':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:94: undefined reference to `BUFFERPOOL_ReturnBuffer'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: application/libsrc_application.a(app_MultiSinkLogger.c.o): in function `prvPrefixStringToMessage':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:162: undefined reference to `BUFFERPOOL_GetFreeBuffer'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: application/libsrc_application.a(app_MultiSinkLogger.c.o): in function `prvPrefixDebugStringToMessage':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:176: undefined reference to `BUFFERPOOL_GetFreeBuffer'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: application/libsrc_application.a(app_MultiSinkLogger.c.o): in function `SerialisedConsolePrintfDebug':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:193: undefined reference to `BUFFERPOOL_ReturnBuffer'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: application/libsrc_application.a(app_MultiSinkLogger.c.o): in function `SerialisedConsolePrintf':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:209: undefined reference to `BUFFERPOOL_ReturnBuffer'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: application/libsrc_application.a(app_MultiSinkLogger.c.o): in function `SerialisedLogPrintf':
    /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:241: undefined reference to `BUFFERPOOL_GetFreeBuffer'
    /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:241: undefined reference to `BUFFERPOOL_ReturnBuffer'
    collect2: error: ld returned 1 exit status
    make[2]: *** [CMakeFiles/freeRTOSBBB.dir/build.make:101: freeRTOSBBB] Error 1
    make[2]: Leaving directory '/home/frank/eclipse-workspace/FreeRTOS_BBB/build'
    make[1]: *** [CMakeFiles/Makefile2:89: CMakeFiles/freeRTOSBBB.dir/all] Error 2
    make[1]: Leaving directory '/home/frank/eclipse-workspace/FreeRTOS_BBB/build'
    make: *** [Makefile:87: all] Error 2

当我使用裸机编译器 gcc-arm-8.2-2019.01-x86_64-arm-eabi 时,我得到了一些汇编错误。完整输出如下:

frank@debian:~/eclipse-workspace/FreeRTOS_BBB/mybuild$ make
[  0%] Building C object application/CMakeFiles/src_application.dir/TaskLED2.c.o
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/TaskLED2.c: In function 'vLED_blink_evBits_ActivateHook':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/TaskLED2.c:70:39: warning: variable 'xResult' set but not used [-Wunused-but-set-variable]
  BaseType_t xHigherPriorityTaskWoken, xResult;
                                       ^~~~~~~
[  1%] Building C object application/CMakeFiles/src_application.dir/app_InitOSEvents.c.o
[  2%] Building C object application/CMakeFiles/src_application.dir/app_MultiSinkLogger.c.o
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function 'vMultiSinkLoggerConsole_main':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:105:30: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
             char * q       = pMsg;
                              ^~~~
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function 'InitSerialisedLogPrintf':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:144:30: warning: returning 'QueueHandle_t' {aka 'struct QueueDefinition *'} from a function with return type 'uint32_t' {aka 'long unsigned int'} makes integer from pointer without a cast [-Wint-conversion]
     return ConsoleInterafceQ = q;
            ~~~~~~~~~~~~~~~~~~^~~
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function 'prvPrefixStringToMessage':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:153:14: warning: unused variable 'rv' [-Wunused-variable]
     uint32_t rv = pdFAIL;
              ^~
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function 'prvPrefixDebugStringToMessage':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:173:36: warning: format '%d' expects argument of type 'int', but argument 7 has type 'long unsigned int' [-Wformat=]
         snprintf(pMsg,m,"%s:%s:%s:%d:%s",pcTaskName,pcFileName,pcFuncName,ulLine,msg);
                                   ~^                                      ~~~~~~
                                   %ld
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:168:14: warning: unused variable 'rv' [-Wunused-variable]
     uint32_t rv = pdFAIL;
              ^~
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c: In function 'SerialisedLogPrintf':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:216:19: warning: pointer targets in initialization of 'char *' from 'uint8_t *' {aka 'unsigned char *'} differ in signedness [-Wpointer-sign]
     char * pMsg = BUFFERPOOL_GetFreeBuffer(&m);
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:235:37: warning: pointer targets in passing argument 1 of 'BUFFERPOOL_ReturnBuffer' differ in signedness [-Wpointer-sign]
             BUFFERPOOL_ReturnBuffer(pMsg);
                                     ^~~~
In file included from /home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_MultiSinkLogger.c:43:
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/portable/ported_aws_bufpool/inc/aws_bufferpool.h:72:6: note: expected 'uint8_t * const' {aka 'unsigned char * const'} but argument is of type 'char *'
 void BUFFERPOOL_ReturnBuffer( uint8_t * const pucBuffer );
      ^~~~~~~~~~~~~~~~~~~~~~~
[  3%] Building C object application/CMakeFiles/src_application.dir/app_utils.c.o
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_utils.c: In function 'vAssertCalled':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_utils.c:185:22: warning: unused variable 'xPrinted' [-Wunused-variable]
 static portBASE_TYPE xPrinted = pdFALSE;
                      ^~~~~~~~
/usr/gcc-arm-8.2-2019.01-x86_64-arm-eabi/arm-eabi/include/sys/unistd.h: In function '_exit':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_utils.c:107:1: warning: 'noreturn' function does return
 }
 ^
At top level:
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/app_utils.c:185:22: warning: 'xPrinted' defined but not used [-Wunused-variable]
 static portBASE_TYPE xPrinted = pdFALSE;
                      ^~~~~~~~
[  3%] Building C object application/CMakeFiles/src_application.dir/enet_wrapper.c.o
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c: In function 'InitLwipStack':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:279:21: warning: unused variable 'rv' [-Wunused-variable]
             uint8_t rv = PhyReset(CPSW0_MDIO_REGS, ifNum);
                     ^~
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c: In function 'lwip_main':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:369:18: warning: unused variable 'ipAddr' [-Wunused-variable]
     unsigned int ipAddr;
                  ^~~~~~
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c: In function 'lwIPDHCPComplete':
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:672:19: warning: assignment to 'volatile unsigned char *' from incompatible pointer type 'void **' [-Wincompatible-pointer-types]
             state = &(cpswNetIF[ifNum].state);
                   ^
At top level:
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:654:13: warning: 'lwIPDHCPComplete' defined but not used [-Wunused-function]
 static void lwIPDHCPComplete(unsigned int ifNum)
             ^~~~~~~~~~~~~~~~
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/src/application/enet_wrapper.c:618:13: warning: 'IpAddrDisplay' defined but not used [-Wunused-function]
 static void IpAddrDisplay(unsigned int ipAddr)
             ^~~~~~~~~~~~~
[  4%] Building ASM object application/CMakeFiles/src_application.dir/imageLoad.S.o

[ 49%] Building ASM object armv7a/CMakeFiles/lib_third_party_ti_system_config_armv7a.dir/gcc/cp15.S.o
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/lib/third_party/ti/system_config/armv7a/gcc/cp15.S: Assembler messages:
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/lib/third_party/ti/system_config/armv7a/gcc/cp15.S:123: Error: selected processor does not support `dmb' in ARM mode
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/lib/third_party/ti/system_config/armv7a/gcc/cp15.S:136: Error: selected processor does not support `isb' in ARM mode
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/lib/third_party/ti/system_config/armv7a/gcc/cp15.S:142: Error: selected processor does not support `clz r5,r4' in ARM mode
/home/frank/eclipse-workspace/FreeRTOS_BBB/source/lib/third_party/ti/system_config/armv7a/gcc/cp15.S:574: Error: selected processor does not support `ubfx r0,r0,#4,#12' in ARM mode
make[2]: *** [armv7a/CMakeFiles/lib_third_party_ti_system_config_armv7a.dir/build.make:89: armv7a/CMakeFiles/lib_third_party_ti_system_config_armv7a.dir/gcc/cp15.S.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:416: armv7a/CMakeFiles/lib_third_party_ti_system_config_armv7a.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

我正在努力弄清楚这两个编译器有什么问题,我不确定我是否缺少编译器标志,缺少一些源文件,或者可能只是使用了错误的编译器。理想情况下,我希望两者都工作,但感谢您对任一问题的帮助。我还应该说我的项目基于这个似乎实现了一种稍微不同的方法,尽管它对我不起作用:https ://github.com/kryochronic/AM335X-FreeRTOS-lwip.git 如果让我知道你需要任何额外的信息。谢谢您的帮助。

额外信息:我在我的 github 项目中添加了详细的输出。对于 arm-linux-gnueabihf-gcc:https ://raw.githubusercontent.com/frank2597/FreeRTOS_BBB/master/make-output-arm-linux-gnueabihf.md

对于裸机版本 gcc-arm-8.2-2019.01-x86_64-arm-eabi:https ://raw.githubusercontent.com/frank2597/FreeRTOS_BBB/master/make-output-arm-eabi-gcc.md

标签: assemblycmakearmfreertoscortex-a8

解决方案


推荐阅读