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

Errors when modifying the UART/serial port emulation project to run in a serialized connection

Hi,

I have built the example hrs_uart project and it works fine when I load the image into a pair of OCA10040 demo boards, one as application board and the other as connectivity board.

I am trying to modify the UART/serial emulation project to run in the same way.

I copied the hrs_uart folder to the UART/serial folder.  in the sdk_config.h file I enabled the nus service and disabled the hrs services.

it was built OK. However, when I run it, It had a fatal error.

I debugged it and found that the function call nrfx_uarte_init returned with an error code 8.

please help on this issue

Parents Reply Children
  • Hi Vidar,

    I just used a PCA10056 to replace the application board PCA10040. This nRF52840 should have two uart ports on the chip.

    However, still it can be built, when run, it stops with that error code 8. As you suggested, it could  be an issue when initialize the UART.

    I checked the code and see these,

    in app_uart.c:  

    static nrf_drv_uart_t app_uart_inst = NRF_DRV_UART_INSTANCE(APP_UART_DRIVER_INSTANCE);

    in sdk_config.h:

    #define APP_UART_DRIVER_INSTANCE  0

    in ser_phy_uart.c:

    static const nrf_drv_uart_t m_uart = NRF_DRV_UART_INSTANCE(0);

    It seems they are trying to initialize with the same ID.

    I have no clue to configure the SDK for these two UARTs. 

    Thank you for your help!

  • Hi,

    Please try to set UART1_ENABLED and APP_UART_DRIVER_INSTANCE to '1' in your sdk_config.h header. That should make it so that app_uart library uses UARTE1 instead of UARTE0 which is being used for the serialization transport.

  • Hi,

    It works now. 

    I compared the projects with/without serialization and I couldn't find the defined macro to enable the serialization library. Any information on this?

    Thank you for your help

  • Hi,

    We have not implemented macros to enable serialization. It's the inclusion of the serialization libraries and the globally defined 'SVCALL_AS_NORMAL_FUNCTION' flag in that makes a project a "serialization" project.

    An idea could be make multiple build configurations (like 'Debug' and 'Release') in case you want support serialization and no serialization within the Same segger project

Related