This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

adding SPI to ble_app_uart

im using Feather EVM. im using the app_ble_uart . after i added SPI to the project i dont get any errors but the code does not run (goes to main) and when i press run it goes into hard fault.

the SPI is enabled. 

Parents
  • Feather EVM

    You mean this: https://www.adafruit.com/product/3406

    Have you tried using the SPI on its own - without BLE ?

    Have you used the debugger to see what's causing the Hard Fault?

    Have you enabled the debug logs for information on what's causing the crash?

  • You mean this: https://www.adafruit.com/product/3406 - yes

    Have you tried using the SPI on its own - without BLE ? - yes

    Have you used the debugger to see what's causing the Hard Fault? - im using IAR debugger

    Have you enabled the debug logs for information on what's causing the crash? - how do i do that ?

  • Did you check the call-stack when debugging, to see what is running before the hardfault occurs? Do you have anything connected to the UART pins? If they are left floating, errors will be detected on the RX-line, which will result in an error code and leave the application in the error handler.

  • i have no need for physical uart pins, i only use it for the ble communication. i am trying to disable it with no success.call-stack is:
    app_error_fault_handler()
    app_error_handler_bare(uint32_t error_code = ?)
    uart_event_handle(app_uart_evt_t * p_event = ?)
    uart_event_handler(struct <Unnamed 41> * p_event = ?, void * p_context = ?)
    uart_evt_handler(nrfx_uart_event_t const * p_event = ?, void * p_context = ?)
    uarte_irq_handler(NRF_UARTE_Type * p_uarte = 0x40002000, uarte_control_block_t * p_cb = m_cb (0x20003DE0))
    <Exception frame>
    [nrfx_coredep_delay_us::delay_machine_code + 0]

  • This looks like it is caused by errors on the UART HW. Try commenting out/remove call to uart_init() in main, this is what initializes the UART peripheral. You will also have to remove calls to app_uart_put() in nus_data_handler(), as calling this when the app_uart library is not initialized will cause errors.

  • thaks

    i did it but now in nrf_drv_uart.h , im getting :

    Building configuration: ble_app_uart_pca10040_s132 - nrf52832_xxaa
    Updating build tree...
    app_uart_fifo.c
    Error[Pe020]: identifier "nrf_uarte_baudrate_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 122
    Error[Pe020]: identifier "nrf_uarte_error_mask_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 127
    Error[Pe020]: identifier "nrf_uarte_hwfc_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 130
    Error[Pe020]: identifier "nrf_uarte_parity_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 133
    Error[Pe020]: identifier "nrf_uarte_task_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 134
    Error[Pe020]: identifier "nrf_uarte_event_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 135
    Error[Pe020]: identifier "NRF_UARTE_PSEL_DISCONNECTED" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\components\libraries\uart\app_uart_fifo.c 151
    Error[Pe020]: identifier "NRF_UARTE_HWFC_DISABLED" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\components\libraries\uart\app_uart_fifo.c 154
    Error[Pe020]: identifier "NRF_UARTE_HWFC_ENABLED" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\components\libraries\uart\app_uart_fifo.c 154
    Error[Pe020]: identifier "NRF_UARTE_PARITY_INCLUDED" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\components\libraries\uart\app_uart_fifo.c 156
    Error[Pe020]: identifier "NRF_UARTE_PARITY_EXCLUDED" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\components\libraries\uart\app_uart_fifo.c 156
    Error while running C/C++ Compiler
    main.c
    nrf_drv_uart.c
    Error[Pe020]: identifier "nrf_uarte_baudrate_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 122
    Error[Pe020]: identifier "nrf_uarte_error_mask_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 127
    Error[Pe020]: identifier "nrf_uarte_hwfc_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 130
    Error[Pe020]: identifier "nrf_uarte_parity_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 133
    Error[Pe020]: identifier "nrf_uarte_task_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 134
    Error[Pe020]: identifier "nrf_uarte_event_t" is undefined D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.h 135
    Error[Pe550]: variable "config" was set but never used D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.c 124
    Error[Pe550]: variable "m_handlers" was set but never used D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.c 49
    Error[Pe550]: variable "m_contexts" was set but never used D:\Documents\Projects\work facilitation\Miter sow\C ble_app org + spi\integration\nrfx\legacy\nrf_drv_uart.c 50
    Error while running C/C++ Compiler

    Total number of errors: 20
    Total number of warnings: 0

  • You must have made more changes than the ones I suggested to get those errors. Did you modify sdk_config.h or remove some includes/source files?

Reply Children
Related