Not sure how to set up a project.

I'm using the visual studio code extension and things work well. I am now trying to test a more complex project found here but when pressing build I get some very long errors that I think mainly have to do with `my_pwm0` not being found in the device tree. I can see that something with that name exists in `boards/arm/twv_pcb_0_6/twv_pcb_0_6.dts` and in other places but I'm not sure I know which one to select and where to place it during the build configuration. Does anyone know on how to test this project using the 52833 DK?

  • Hi,

    No I am not familiar with this project, and it doesn't seem to be made by someone from Nordic. So it might be that it needs something that was failed to be uploaded on github. 

    If something like "my_pwm0" is not being found it sounds like there is an overlay file missing. I see there is a referance to a node called my_pwm0 that I am not immediately seeing. Are you able to find it when searching through the project with ctrl+shift+F in VSC?

    I should also mention that the DevAcademy is great starting point if you haven't seen it allready.

    Regards,

    Elfving

  • Hi Elfving,

    Yes, it actually can be found inside the arm folder. I did the beginner course on dev academy, but now that I'm trying to do practical things on my own, I'm still a bit confused.

  • How to use pwm is gone through here in the intermediate course, having a look there might be better than using this project.

    greenleaf said:
    Yes, it actually can be found inside the arm folder.

    Ah I see. Sorry, I didnt check the board earlier. That node should be found. I tried building it myself now, and got some errors, but different ones than you.

    Did you use the cmake preset or just build for the board? Did you double check that the toolchain and NCS version used for the build was correct?

    Regards,

    Elfving

  • I see. I didn't do the Intermediate course yet. I wanted to jump to this project because it's very similar to what I wanted to do for my garden. But I want to use the DK instead of some custom board.

    I clicked "Add Build Configuration" just as in the tutorial of the beginner course. Selected the board, and left all the rest as default. That's why I was wondering if my mistake was maybe not setting up the "Extra Kconfig"!

    What errors did you have? For me the errors are really long, but sifting through them I think the underlying reason is the device tree. Maybe I was mistaken. I get:

    pwm.c:36:63: note: in expansion of macro 'NSLEEP'
       36 | static const struct gpio_dt_spec nsleep_io = GPIO_DT_SPEC_GET(NSLEEP, gpios);
       
       ...
       
    pwm.c:25:16: note: in expansion of macro 'DT_ALIAS'
       25 | #define NSLEEP DT_ALIAS(nsleep)
       
       ...
       
    pwm.c:36:46: note: in expansion of macro 'GPIO_DT_SPEC_GET'
       36 | static const struct gpio_dt_spec nsleep_io = GPIO_DT_SPEC_GET(NSLEEP, gpios);

    Even the `#error` in `adc.c` throws an error, even though using the same thing inside `main.c` causes no issue at all.

  • greenleaf said:
    What errors did you have?

    I'm building it for 2.6.1 here, but I don't think it should make too much of a difference. It seems I am getting this issue for some reason, not sure why.

    greenleaf said:
    I clicked "Add Build Configuration" just as in the tutorial of the beginner course. Selected the board, and left all the rest as default. That's why I was wondering if my mistake was maybe not setting up the "Extra Kconfig"!

    Could be. I see that it has a preset that comes with many configurations being set, I used those for my build. 

    Interestingly, when just building a default PWM sample for the board it works well. I would try contacting the guys who made this project, and otherwise try to build something from scratch with NCS.

    Regards,

    Elfving

Related