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

How to Add a UART feature to sdk_config.h of ble_app_hrs ?

Hello.

I am evaluating with nRF52833 DK board.  I checked both peripheral/uart and ble_peripheral/ble_app_hrs.

Examples work each well on nRF52833 DK.  I want to add the UART function to ble_app_hrs.

I do the follow steps:

1) Modified the source code - add a UART initialize code, include files and a test code.

2) Add the existed files: nRF_Libraries/app_fifo.c ... include other files.

3) Insert the include folders in the common options.

4) Add the below code to sdk_config.h.

// <q> APP_FIFO_ENABLED  - app_fifo - Software FIFO implementation
 

#ifndef APP_FIFO_ENABLED
#define APP_FIFO_ENABLED 1
#endif

// <e> APP_UART_ENABLED - app_uart - UART driver
//==========================================================
#ifndef APP_UART_ENABLED
#define APP_UART_ENABLED 1
#endif
// <o> APP_UART_DRIVER_INSTANCE  - UART instance used
 
// <0=> 0 

#ifndef APP_UART_DRIVER_INSTANCE
#define APP_UART_DRIVER_INSTANCE 0
#endif

// </e>

Anyway, The compile succeeded. 

I have a question on step 4. I added the upper boxed code manually.

How to insert the defined code automatically or smarter?

How to know the relative feature? or How to get sdk_config.h include all feature?

In the beginning, I missed a APP_FIFO_ENABLED part in sdk_config.h.

I fixed it in while compiling, after show the error message.

Please give a advice to me.

Regards,

HyunSuk Lee

Parents Reply Children
  • hello,

    Thanks for your reply.  But I'm a beginner of Nordic Product and sorry to say the follow message.

    Please show the example, where is the link for the defined code part of sdk_config.h for UART?

    I look at the nRF Connect SDK for UART, where is the content about APP_FIFO_ENABLED and APP_UART_ENABLED? 


    Additionally, I added UART function to ble_app_hrs project. it compiled successfuly.

    But, it get a error report with RTT.

    00> <debug> app: EC=0
    00> 
    00> <error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at C:\ShareVM\Nordic\nRF5_SDK_17.0.0_9d13099\components\libraries\log\src\nrf_log_backend_uart.c:67
    00> 
    00> PC at: 0x0003256F
    00> 
    00> <error> app: End of error report
    00> 


    I solved the error report of UART from link .

    Please check the upper question.

Related