Academy's Bluetooth LE Fundamentals, Lesson6_Exercise1: Problems with #include errors during the build process.

I successfully completed the original Lesson6_Exercise1, where I used my nRF5340 DK to  run code found in lesson6/blefund_less6_exer1  to make it act as the "Nordic_Beacon" that is to advertise in a scannable, non-connectable mode its name and its manufacturer specific data - while I used my nRF52840 DK to run the sniffer firmware.

Subsequently, I wanted to make some changes in the main.c file of the original firmware obtained from sample: blefund_less6_exer1 to try and simplify the format of the manufacturer specific data - but without success.

When I tried to make another version of the build (build_1) of that sample, I saw a number of #include errors that I could not get rid of.

While investigating why there was a problem with accessing #include files, I found that the subdirectory \v2.2.0\zephyr\include had disappeared from the \v2.2.0\zephyr directory on my PC !!

So I decided to install the latest version of nRF Connect  SDK v2.3.0 in the new directory: c:\Nordic-230 , to replace my existing version of the nRF Connect SDK v2.2.0.

After I installed the latest version of nRF Connect SDK v2.3.0 , I verified that the #include files were present in the c:\Nordic-230\v2.3.0\zephyr\include directory.

I then tried to make another version of the build of the sample: lesson6/blefund_less6_exer1 , but the #include errors were still coming up as before.

So I tried to make another version of the build for another sample: bluetooth:observer but the following two #include errors came up again:

1. #include errors detected based on info provided by the configuration Provider setting. Squiggles are disabled for this translation unit [ln9, Col 1].

2. Cannot open source file "syscall_list.h" (dependency of C:\Nordic-230\v2.3.0\zephyr\samples\bluetooth\zephyr\bluetooth\bluetooth.h

as can be seen on the attached "Screenshot_1 on 19-May-2023".

And line 9 of the main.c file of the sample bluetooth:Observer reads as follows: #include <zephyr/bluetooth/bluetooth.h> as can be seen on the attached "Screenshot_1 on 19-May-2023".

I then verified the following:

1. There is no subdirectory: \bluetooth.h in the directory: C:\Nordic-230\v2.3.0\zephyr\samples\bluetooth\zephyr\bluetooth\ on my PC as can be seen on the attached "Screenshot_2 on 19-May-2023".

2. The subdirectory: \bluetooth.h is located in C:\Nordic-230\v2.3.0\zephyr\include\zephyr\bluetooth\bluetooth.h on my PC but it does not have a reference to the source file "syscall_list.h" as can be seen on the attached "Screenshot_3 on 19-May-2023".

How can these #include errors be eliminated?

JM

Screenshot_1 on 19-May-2023.docx

Screenshot_2 on 19-May-2023.docx

Screenshot_3 on 19-May-2023.docx

  • Hi JM, 

    Please clarify if you can build and run the examples ? 

    If you simply ignore the "Problem" would it still compile ? 

    Could you try the solution here: How to fix the error "Invalid type definition: Cannot set properties of null (setting 'name')"? 



    If it doesn't help my suggestion is to remove the SDK and try reinstall it. It may help fix the problem. 

    Note: You can add image directly to devzone, you don't need to paste it in .docx document

  • Hi Hung,

    I tried the recommended solution on: How to fix the error "Invalid type definition" - and it worked. The error: "Invalid type definition" no longer comes up on my PC.

    However, my previously reported problems with #include errors came up again.

    So, I took the following steps to try and eliminate them:

    1. I re-installed the SDK v2.3.0 in a new folder c:\Nordic-230-bis\ on my PC

    2. I double-checked that the include files are located in the directory: c:\Nordic-230-bis\zephyr\include

    3. I double-checked that the nrfxlib folder was located in the directory: c:\Nordic-230-bis\v2.3.0\nrfxlib  and that it was not empty.

    4. I made sure to tell Visual Studio Code to use the correct toolchain folder after re-installing the SDK v2.3.0 in a new directory.

    However, despite taking the above mentioned steps, the #include errors are coming up again on my PC, when I try to build the sample: blefund_less2_exer2_solution, as can be seen on the attached file. 

    The following #include errors are reported on the attached file:

    1. #include errors detected.

    2. Cannot open source file "syscall_list.h" (dependency of C:\Nordic-230-bis\v2.3.0\zephyr\samples\bluetooth\zephyr\kernel.h)

    3. Cannot open source file "syscalls/log_msg.h" (dependency of C:\Nordic-230-bis\v2.3.0\zephyr\samples\bluetooth\zephyr\logging\log.h)

    I  verified the following:

    1. There is no subdirectory: \zephyr\kernel.h in the directory: C:\Nordic-230-bis\v2.3.0\zephyr\samples\bluetooth on my PC.

    2. The subdirectory: \zephyr\kernel.h is located in C:\Nordic-230-bis\v2.3.0\zephyr\include directory on my PC.

    3. There is no subdirectory: \zephyr\logging\log.h  in the directory: C:\Nordic-230-bis\v2.3.0\zephyr\samples\bluetooth  on my PC.

    4. The subdirectory: \zephyr\logging\log.h is located in C:\Nordic-230-bis\v2.3.0\zephyr\include directory on my PC.

    How can these problems be resolved?

    JM

    Include errors for sample ble_less2_exer2_solution on 26-May-2023.docx

  • Hi JM, 

    Could you please try to test with the examples we have in the SDK, not the fundamental BLE course ? For example peripheral_uart and peripheral_lbs located in \nrf\samples\bluetooth 

    In your screenshot it's not the build log, have you tried to build ? 
    It should look like this: 

    You may want to try re-install Visual Studio Code and the nRF Connect extension. 

  • Hi Hung,

    I did test the example: peripheral_uart and the build process concluded without errors.

    I then tried again to build the sample: blefund_less2_exer2_solution and the build process concluded without errors.

    I then introduced some changes to the main.c of the sample blefund_less2_exer2_solutions and the include errors came up again.

    So I reversed the changes that I just introduced to the main.c of the sample: blefund_less2_exer2_solution and I tried to make another build of that sample but the include errors came up again (I attach a screenshot of these include errors).

    I then tried again to make another build of the sample: peripheral_uart (that was built without any problem 30 minutes earlier) but this time the include errors came up (I attach a screenshot of these include errors).

    It seems that by trying to make some changes to the main.c of the sample blefund_less2_exer2_solution, some serious and permanent corruption is introduced to the Visual Studio Code that results in include errors coming up for all samples, despite the fact that the changes that were  introduced to the main.c of the sample blefund_less2_exer2_solution were reversed by me.

    Are we not supposed to try to introduce any changes to the main.c files of the samples?

    JM

    Include erors when building sample blefund_less2_exer2_solution on 30-May-2023.docx

    Include errors when building sample peripheral UART 30-May-2023.docx

  • Hi, 

    Please show us the issue when you build the project, not when you just open the project. As I showed you in the last reply. 

Related