Build error for custom board file

Posted on
  • I'm getting these errors during my build:

    CC obj/targetlibs/nrf5x_15/components/libraries/atomic/nrf_atomic.o
    In file included from targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.c:41:0:
    targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:116:13: error: unknown type name 'nrf_uarte_baudrate_t'
         typedef nrf_uarte_baudrate_t        nrf_uart_baudrate_t;
                 ^
    targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:121:13: error: unknown type name 'nrf_uarte_error_mask_t'
         typedef nrf_uarte_error_mask_t      nrf_uart_error_mask_t;
                 ^
    targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:124:13: error: unknown type name 'nrf_uarte_hwfc_t'
         typedef nrf_uarte_hwfc_t            nrf_uart_hwfc_t;
                 ^
    targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:127:13: error: unknown type name 'nrf_uarte_parity_t'
         typedef nrf_uarte_parity_t          nrf_uart_parity_t;
                 ^
    targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:128:13: error: unknown type name 'nrf_uarte_task_t'
         typedef nrf_uarte_task_t            nrf_uart_task_t;
                 ^
    targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:129:13: error: unknown type name 'nrf_uarte_event_t'
         typedef nrf_uarte_event_t           nrf_uart_event_t;
                 ^
    

    Here is the relevant (Ihope) portion of my build file:

    info = {
     'name' : "QY03",
     'link' :  [ "https://www.kospet.com/products/kospet-magic-3" ],
     'espruino_page_link' : 'QY03',
     'default_console' : "EV_BLUETOOTH",
     'variables' : 14000-300, # How many variables are allocated for Espruino to use. RAM will be overflowed if this number is too high and code won't compile.
     #'bootloader' : 1,
     'binary_name' : 'e_%v.QY03.hex',
     'build' : {
       'optimizeflags' : '-Os',
       'libraries' : [
         'BLUETOOTH',
    #     'NET',
         'GRAPHICS',
         #'JIT',
    #     'NEOPIXEL'
       ],
       'makefile' : [
    #     'DEFINES += -DCONFIG_GPIO_AS_PINRESET', # Allow the reset pin to work
    #     'CFLAGS += -D__STARTUP_CLEAR_BSS -D__START=main',
    #     'LDFLAGS += -D__STARTUP_CLEAR_BSS -D__START=main -nostartfiles',
         'DEFINES += -DNRF_SDH_BLE_GATT_MAX_MTU_SIZE=131', #59 77 131 104
         'DEFINES += -DBLUETOOTH_NAME_PREFIX=\'"QY03"\'',
         'LDFLAGS += -Xlinker --defsym=LD_APP_RAM_BASE=0x2ec0',#2bf0 0x3058#37f8 0x3720
         'LDFLAGS += -Xlinker --defsym=LD_NOINIT_SIZE=0x1290',#2bf0 0x3058#37f8 0x3720
         'DFU_PRIVATE_KEY=targets/nrf5x_dfu/dfu_private_key.pem',
         'DFU_SETTINGS=--application-version 0xff --hw-version 52 --sd-req 0xa9,0xae,0xb6', [#S140](https://forum.espruino.com/search/?q=%23S140) 6.0.0
         'BOOTLOADER_SETTINGS_FAMILY=NRF52840',
         #'ESPR_BLUETOOTH_ANCS=1', # Enable ANCS (Apple notifications) support
    #     'BLACKLIST=boards/MAGIC3.blocklist', # force some stuff to be removed to save space
         'DEFINES += -DNRF_BL_DFU_INSECURE=1 -DNRF_BOOTLOADER_NO_WRITE_PROTECT=1  -DESPR_DCDC_ENABLE=1',
         'DEFINES += -DNO_DUMP_HARDWARE_INITIALISATION',
         'DEFINES += -DUSE_FONT_6X8 -DGRAPHICS_PALETTED_IMAGES ', #-DGRAPHICS_ANTIALIAS',
    #     'DEFINES += -DSAVE_ON_FLASH_SAVE -DSAVE_ON_FLASH_ERRORMSG -DSAVE_ON_FLASH_RANDOM -DSAVE_ON_FLASH_WAVEFORM -DSAVE_ON_FLASH_MATH -DSAVE_ON_FLASH_SWSERIAL -DSAVE_ON_FLASH_FFT -DSAVE_ON_FLASH_DUMP',
    #     'DEFINES+=-DDUMP_IGNORE_VARIABLES=\'"g\\0"\'',
         'DEFINES += -DFDS_VIRTUAL_PAGES=2', [#should](https://forum.espruino.com/search/?q=%23should) match fstorage_pages below
         'NRF_SDK15=1'
       ]
     }
    };
    
    save_code_pages = 132; #96;
    fstorage_pages = 10; # typically 2, 10 reduces risk of brick on first flash from stock FW
    chip = {
      'part' : "NRF52840",
      'family' : "NRF52",
      'package' : "QFN48",
      'ram' : 256,
      'flash' : 1024,
      'speed' : 64,
      'usart' : 0, #2
      'spi' : 2, #3
      'i2c' : 1, #2
      'adc' : 1,
      'dac' : 0,
      'saved_code' : {
      'address' : ((0xf8 - fstorage_pages - save_code_pages) * 4096), # Bootloader at 0xF8000
      'page_size' : 4096,
      'pages' : save_code_pages,
      'flash_available' : 1024 - ((0x26 + (0x100-0xf8) + fstorage_pages + save_code_pages)*4), # Softdevice uses 38 pages of flash (0x26000/0x100), bootloader 0x100-0xe0=0x20, FS 2, code 96. Each page is 4 kb.
    # TWO PAGES
      'address2' : 0x60000000, # put this in external spiflash (see below)
      'pages2' : 4096, # Entire 16MB (4096 pages of 4096) of external flash
    };
    devices = {
      'BTN1' : { 'pin' : 'D4', 'inverted': True, 'pinstate' : 'IN_PULLUP' },
    
      'SPIFLASH' : {
                'pin_cs' : 'D17',
                'pin_sck' : 'D19',
                'pin_mosi' : 'D20',
                'pin_miso' : 'D21',
                'pin_wp' : 'D22',
    #            'pin_hold' : 'D23',
                'pin_rst' : 'D23', # no reset but this is HOLD pin, we want it set to 1 like RST
                'size' : 16384*1024, # 16MB
                'memmap_base' : 0x60000000,
              },
    
    };
    

    Not sure why it's happening here and not in other builds (like BANGLEJS2)...?
    jv

  • I answer my own issue... sometimes just writing it out leads me to the answer..

    If I supply a usart=1 in the chip section, if compiles. Makes sense, but interesting you can't decline to have a usart.

  • it worked before, I definitely used it with Magic3, for now you can remove one line in NRF5X.make

    diff --git a/make/common/NRF5X.make b/make/common/NRF5X.make
    index 57205a178..19b06343c 100644
    --- a/make/common/NRF5X.make
    +++ b/make/common/NRF5X.make
    @@ -184,12 +184,13 @@ $(NRF5X_SDK_PATH)/modules/nrfx/drivers/src/nrfx_uarte.c \
     $(NRF5X_SDK_PATH)/integration/nrfx/legacy/nrf_drv_ppi.c \
     $(NRF5X_SDK_PATH)/integration/nrfx/legacy/nrf_drv_rng.c \
     $(NRF5X_SDK_PATH)/integration/nrfx/legacy/nrf_drv_twi.c \
    -$(NRF5X_SDK_PATH)/integration/nrfx/legacy/nrf_drv_uart.c \
     $(NRF5X_SDK_PATH)/integration/nrfx/legacy/nrf_drv_spi.c \
     $(NRF5X_SDK_PATH)/components/libraries/atomic/nrf_atomic.c \
     $(NRF5X_SDK_PATH)/components/libraries/atomic_flags/nrf_atflags.c \
    
  • Yes, I had a 2v10 version that built fine, just wanted to update it. I'm OK with defining a usart for now, but thanks. You wouldn't even recognize my (first) QY03 now.. i removed the LCD and ran a breakout from the FPC, so it's running an EPD screen now.

  • Thanks! Interesting this fails now and now before, and it's in the HAL...

    I guess somehow we need to disable NRF_UART completely if we're not asking for uart functionality?

  • I tried

    'DEFINES += -DUART_ENABLED=0 -DUART0_ENABLED=0 -DNRFX_UART_ENABLED=0 -DNRFX_UARTE_ENABLED=0',
    

    but it did not help, the $(NRF5X_SDK_PATH)/integration/nrfx/legacy/nrf_drv_uart.c and .h file have no checks in them and always evaluate something, I think typedefs in header file in the #else part is the issue

    typedef nrf_uarte_baudrate_t        nrf_uart_baudrate_t;
    typedef nrf_uarte_error_mask_t      nrf_uart_error_mask_t; 
    typedef nrf_uarte_hwfc_t            nrf_uart_hwfc_t; 
    typedef nrf_uarte_parity_t          nrf_uart_parity_t;  
    typedef nrf_uarte_task_t            nrf_uart_task_t;
    typedef nrf_uarte_event_t           nrf_uart_event_t;                                                                 
    
  • So I guess this is specifically an SDK15 thing? I guess we could hack around it by adding typedef bool nrf_uart_baudrate_t/etc if there's no UART?

  • I guess it was working before you added BANGLE2 and uart driver source into SDK15 makefiles (becasue of GPS)?
    But OTOH SDK15 builds were there before BANGLE2 including serial - maybe the legacy driver was not there?

  • I think some hack similar to I2C slave - remove source from list in makefile if UART_COUNT<1 but with i2c there is easy check for some i2c slave #define

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Build error for custom board file

Posted by Avatar for yngv126399 @yngv126399

Actions