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

Error with prf/nrfx_prs.h file

Hi. I'm using nRF52832 (SDK 15.0.0)

Recently, I'm merging UART and twi sensor examples and I have this kind of error.

This above capture is about twi sensor. I have " 'prs/nrfx_prs.h' not found " error, but I can compile without any error. ( in nrfx_twim.c file )

However when I merge with UART example I have same " 'prs/nrfx_prs.h' not found " error and also compile error. Like below capture.

I added nrfx_prs.h file into my UART example. So I really can't understand why this happens.

Please help!

Thanks

  • Hello,

    Regarding the first screenshot, that is just Keil being buggy sometimes. If it says that it can't find the file, but you can compile, then you can ignore it. The compiler can find the file, it is just Keil that bugs out sometimes. In those cases, you can ignore it. In my Keil window, I usually have this behavior.

     

    As for the other screenshot, that gives a compiling error:

    I see that you have moved the nrfx_twim.c file from it's original location in the SDK (into ...\extra\nrfx_twim.c). That is ok, but then you have to include the path to the nrfx_prs.h. 

    The reason for why it works without moving this file is because in the SDK, the nrfx_twim.c is located in

    SDK\modules\nrfx\drivers\src

    while the nrfx_prs.h is located in

    SDK\modules\nrfx\drivers\src\prs\

    On line 51 in nrfx_twim.c the include state describes the path to the file, so the compiler understands where to look. Since it is not in the same relative path, it will not find it. 

     

    Either include the file like this:

    #include "nrfx_prs.h", and include the path to the file in your project settings ->C/C++-> Include paths

    or

    #include "prs/nrfx_prs.h" and copy the file into a folder inside "extra" called "prs".

     

     

    Best regards,

    Edvin

  • Thank you for detailed reply. I'm new to Keil, so I didn't know that bugs.

    You are right. I moved C file and it causes problem.

    I solved the problem now. Thanks!!

  • Hi,

    Can you please tell me, I am also facing same issue. 

    Thanks

Related