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

Trying to add uart functionality to the dimming example

Currently I am trying to add uart functionality to the dimming client from the mesh dimming example, but I just can never seem to get it to compile. I can confirm my uart code works and compiled as I have used it in the nrf5sdk and compiles fine there. I put the code from my project in the nrf5sdk into the files uarte_link.h and uarte_link.c and add it to the dimming client in the nrf5sdk for mesh example and suddenly I just cannot get it to compile no matter what I try

Here are the exact steps that I have done:

1. Added my own file uarte_link.c file to the project

2. Then I tried compiling and get "app_uart.h not found error". To solve this I added the folder that contains this file in my user include directories

3. Tried compiling again, this time i get errors: "undefined reference to app_uart_init" and "undefined reference to "app_uart_get"

4. I realized i needed to add the corresponding source files, so I added the following to my project: "app_fifo.c, app_uart.c, app_uart_fifo.c, nrf_drv_uart.c, nrfx_uarte.c, retarget.c"

5. Compiling after this gives me these errors in nrf_drv_uart.h:

error: unknown type name ‘nrf_uarte_baudrate_t’
error: unknown type name ‘nrf_uarte_error_mask_t’
error: unknown type name ‘nrf_uarte_hwfc_t’
error: unknown type name ‘nrf_uarte_parity_t’
error: unknown type name ‘nrf_uarte_task_t’
error: unknown type name ‘nrf_uarte_event_t’

6. I figured the problem might be in my sdk_config.h file. I set NRFX_UART_ENABLED and NRFX_UARTE_ENABLED. I also add APP_FIFO_ENABLED and APP_UART_ENABLED and set them to 1 in app_config.h since I noticed those settings were set in my original uart code from the other SDK but were not defined in the sdk_config.h. I try compiling again, and I get the same error as above

7. Then at this point I try a bunch of other random stuff including anything I would think would be dependent and screwing around with a lot of settings in general, but to no luck. This is when I got extremely frustrated with the sdk after spending hours on this

I hope someone can help, since I have grown too frustrated at hunting through the SDK to find the files I need. This has overall given me a negative opinion Nordic's SDK organization which is a shame since I found actual programming itself to be relatively straightforward

Parents
  • Hi, 

    What version of nRF5 SDK for Mesh are you using? Have a look at this doc: Adding files in SES. 

    Regards,

    Amamda 

  • Sorry for the late reply. I am using the the nRF5 SDK 17.0.2 and the nRF5 SDK for Mesh V5.0.0 (I believe those are the latest versions). I have set up my environment as described in the docs (so both the 17.0.2 and Mesh SDK are in the same root folder). I use segger embedded studio to write and build applications.

    The link you sent is exactly how i add my files - manually add the source files and adding the necessary include paths in common->preprocessors->user include directories

    I guess to clarify my problem - basically in this case I am having trouble identifying all the dependencies required for uart from the 17.0.2 nRF5 SDK to add to the current Mesh example, and have tried all the above steps as described in my initial post.

Reply
  • Sorry for the late reply. I am using the the nRF5 SDK 17.0.2 and the nRF5 SDK for Mesh V5.0.0 (I believe those are the latest versions). I have set up my environment as described in the docs (so both the 17.0.2 and Mesh SDK are in the same root folder). I use segger embedded studio to write and build applications.

    The link you sent is exactly how i add my files - manually add the source files and adding the necessary include paths in common->preprocessors->user include directories

    I guess to clarify my problem - basically in this case I am having trouble identifying all the dependencies required for uart from the 17.0.2 nRF5 SDK to add to the current Mesh example, and have tried all the above steps as described in my initial post.

Children
No Data
Related