p3p / pio-framework-arduino-lpc176x

10 stars 20 forks source link

error: 'TRANSFER_BLOCK_Type' has not been declared #48

Closed dzervas closed 1 month ago

dzervas commented 2 years ago

I'm trying to build https://github.com/grblHAL/LPC176x with the following platformio.ini:

[platformio]
src_dir = src
lib_dir = src

[env:LPC176x]
platform          = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.3.zip
platform_packages = framework-arduino-lpc176x@^0.2.8
framework         = arduino
board             = nxp_lpc1769
lib_ldf_mode      = off
lib_compat_mode   = strict
lib_archive = yes

src_filter = +<./*/*>
build_flags =
    ; Include paths
    ; -Isrc/eeprom
    -Isrc
    -Isrc/FatFs
    -Isrc/grbl
    -Isrc/lpc_chip_175x_6x/inc
    -Isrc/lpc_chip_175x_6x/inc/usbd

    ; Compiler options
    -D__CODE_RED
    -DCORE_M3
    -D __USE_CMSIS=CMSIS_CORE_LPC17xx
    -D__LPC17XX__
    -D__NEWLIB__
    -D__USE_LPCOPEN

    ; Debug flags
    -DDEBUG
    -O0
    -g3
    -Wall

    -c
    -fmessage-length=0
    -fno-builtin
    -fno-common
    -ffunction-sections
    -fdata-sections
    -fmerge-constants
    ; -fmacro-prefix-map="../\$(@D)/"=.
    ; -mcpu=cortex-m3-mthumb
    ; -mstack-usage
    -fstack-usage

    ; Linker options
    -nostdlib
    -Lsrc/lpc_chip_175x_6x/libs
    -Xlinker --defsym=__heap_size__=0xC00
    -Xlinker -Map="GRBL Driver LPC176x.map"
    -Xlinker --cref
    -Xlinker --gc-sections
    -Xlinker -print-memory-usage
    -T "GRBL_Driver_LPC176x_Debug.ld"
    ; -lusbd_175x_6x_lib

    ; Machine Options
    -DNO_BOARD_LIB
    -DN_AXIS=3
    -DUSB_ENABLE=1
    ; -DEEPROM_ENABLE=0
    ; -DUSE_HAL_DRIVER
    ; -DOVERRIDE_MY_MACHINE
    ; -DCHIP_LPC175X_6X
    ; -DBOARD_BTT_SKR_1.4_TURBO
    ; -Wl,-Map,output.map
    ; -v

I get the following error during pio run:

In file included from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/debug_frmwrk.h:35,
                 from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/lib/usb/cdcuser.h:22,
                 from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/lib/usb/usbcore.cpp:39:
/home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/lpc17xx_uart.h:598:20: error: 'TRANSFER_BLOCK_Type' has not been declared
  598 |   uint32_t buflen, TRANSFER_BLOCK_Type flag);
      |                    ^~~~~~~~~~~~~~~~~~~
/home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/lpc17xx_uart.h:600:20: error: 'TRANSFER_BLOCK_Type' has not been declared
  600 |   uint32_t buflen, TRANSFER_BLOCK_Type flag);
      |                    ^~~~~~~~~~~~~~~~~~~
Compiling .pio/build/LPC176x/CMSIS/system/system_LPC17xx.c.o
In file included from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/debug_frmwrk.h:35,
                 from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/lib/usb/usbuser.cpp:21:
/home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/lpc17xx_uart.h:598:20: error: 'TRANSFER_BLOCK_Type' has not been declared
  598 |   uint32_t buflen, TRANSFER_BLOCK_Type flag);
      |                    ^~~~~~~~~~~~~~~~~~~
/home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/lpc17xx_uart.h:600:20: error: 'TRANSFER_BLOCK_Type' has not been declared
  600 |   uint32_t buflen, TRANSFER_BLOCK_Type flag);
      |                    ^~~~~~~~~~~~~~~~~~~
Compiling .pio/build/LPC176x/lpc176x/HardwarePWM.cpp.o
Compiling .pio/build/LPC176x/lpc176x/SoftwarePWM.cpp.o
Compiling .pio/build/LPC176x/lpc176x/adc.cpp.o
*** [.pio/build/LPC176x/CMSIS/lib/usb/usbcore.cpp.o] Error 1
*** [.pio/build/LPC176x/CMSIS/lib/usb/usbuser.cpp.o] Error 1

Seems to me like it's a framework bug or versioning. Got any ideas? :)

p3p commented 1 month ago

Sorry for never replying to this, TRANSFER_BLOCK_Type is defined in lpc_types.h, and included in lpc17xx_uart.h so should be defined, I'm not sure how the way you are building is causing is to be undeclared.

I'm going to assume you have resolved or moved on to a new project by this point and close the issue.