assignment of member 'port' in read-only object

Dear, I defined Port1 pins as in attached overlay file. The binding of pins is done as in lcd.h attached file. When, build is started, the error written in title is displayed and build failed. Please guide, how to fix this issue.

Gulzar Singh

 6888.nrf5340dk_nrf5340_cpuapp.overlay5383.lcd.h   

Parents
  • Hi Gulzar,

    Could you kindly change the "tasks" option in the output to "output" and share the messages that appear there?

    Regards,

    Priyanka

  • Hello Priyanka, here is the attached image of OUTPUT. A well, I uploading the main.c, lcd,h, lcd.c and overlay file  6114.nrf5340dk_nrf5340_cpuapp.overlay

    3487.lcd.h  

  • Hi Gulzar,

    As you can observe on line 263, 264 and 265 in main.c, you have added the statements to include the .c files. Since the lcd, delay and msg are custom files that you create for your project, the Icd.h, delay.h and msg.h should be included inside the .c versions of these files.

    Also, lcd.c , delay.c and msg.c should be called inside CMakeLists.txt inside your project folder.

    A detailed way of creating a custom application is mentioned in the GitHub page of one of my colleagues.. Kindly take a look.

    Regards,

    Priyanka

  • Dear Priyanka, I am just new to Nordic. Please, give example to include overlay, .h and .c files in CMakeLists.txt ..I tried that way also, the error is shown in atached image. The CMakeLists.txt also shown on roght side in the image.

Reply
  • Dear Priyanka, I am just new to Nordic. Please, give example to include overlay, .h and .c files in CMakeLists.txt ..I tried that way also, the error is shown in atached image. The CMakeLists.txt also shown on roght side in the image.

Children
  • Hi Gulzar,

    You should mention only the .c files in the CMakeLists.txt file.

    The .h files are to be included in the .c files.

    And only the .h files are to be included in the main.c file.

    Kindly go through the Guide to Github that I mentioned previously. It is clearly mentioned there how to include all these files and you will get a definite idea.

    You can also refer this guide for beginners.

    Regards,

    Priyanka

  • Dear PY, I tried by including .h in .c files rather than in CMakeLists.txt, but in both cases same error ..varible .. incomplete ... also see next error is related to SPEC_DT ..... ?

  • Hi Gulzar,

    After you do all the necessary changes mentioned, then could you copy the messages that occur in your output tab into a file and attach it here?

    Regards,

    Priyanka

  • Hi PY, I have done all the changes. The erros and warinings are shown in attached iamge. The project Zip file also attached. I am using SES and nRF1.71.

            7658.button.rar 

  • Hi Gulzar,

    I will look into this and get back to you soon.

    Regards,

    Priyanka