General issues with overlays (ie, thingy53 board selected after build configuration nrf5340dk, is this normal?)

I am working through setting up device overlays and am struggling a bit. In some part because I can't find consistency in naming or location or anything. My goal is to set up i2s and use it. 

For example I went to kconfig and selected i2s to enable it, then went and found that in zephyr.dts, the i2s was disabled. I would have expected an error in the build if that were the case.

From a search it looks like this will require an overlay, which makes sense. I went to check where to stick this and found that my boards/ directory was populated entirely with incorrect board names, ie thingy53_nrf5340_cpuapp_ns.overlay, when I selected nrf5340dk_nrf5340_app as the board in the build configuration. Is this expected or normal?...

I thought to check against an install of the excellently detailed nrf_audio example. Unfortunately if you go into kconfig for that, i2s is disabled entirely, but the i2s in the overlay is "okay"! 

Does anyone have a concise checklist for what needs to happen to enable i2s, select the pins, and use it? I am about to just go dig into the registers themselves and give that a shot, it is at least very consistently documented in the 5340 peripheral guide...

  • Hi Alex,

    aorion said:
    I can understand the frustration. I feel like I am working from basic principles here

    Hey, don't feel bad. I too couldn't make any heads or tails out of this before I ask people who know. From what people tell me, a lot of them also share the experience. It is quite a complicated thing to get into.

    I should have told you that we have this DevAcademy site in my earlier replies. Sorry about that.
    This site has a tutorial course to get you accustomed to the nRF Connect SDK. Here is a link to the that course: https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/

    aorion said:

    I actually re-created the project several times. I only see the build (and boards) folder after creating a build config. For example my i2s_example project, I have not created a build config since I just wanted the reference. It looks like this

    I am using PC, Windows 10, and I installed everything using the getting started guide (ie, Toolchain -> Install -> Run VS Code). VS Code is 1.72.2. I am running the peripheral_uart sample using the nrf5340 DK as a base.

    Unfortunately, I cannot reproduce your observation with both NCS v1.9.1 and NCS v2.1.0.
    For both versions, I see the "boards" folder appear right away, containing the overlay files for the Thingy53.
    This is also the expectation, as it is how the sample is setup.

    What version are you using?
    Also, please check your <Build Config Folder>/CMakeCache.txt, search for DTC_OVERLAY_FILE, and see if your nrf5340 DK build configuration actually picks up the Thingy53 overlay file like you fear.

    aorion said:
    (which btw, i2s_example is not the same, i2s_example is apparently outdated in several respects)

    I can't comment on this. I initially looked at the I2S Example as well, but upon seeing just short note referring to the LiteX VexRiscv I moved away from it, since I feel it might not be meant for nRF DKs.

    aorion said:
    selecting I2S bus in kconfig and rebuilding does not add CONFIG_I2S to my prj.conf

    Have you clicked on the "Save to File" button?
    Clicking "Save" only save the change to the <Build Config Folder>/zephyr/.config file. It will still affect your final build output, just not the prj.conf file.
    To save the changes to prj.conf to use across all build configurations, you need to use the "Save to File" button.

    aorion said:
    In addition I needed to add CONFIG_I2S_NRFX as well. Once I did that, it compiled just fine.

    Are we still talking about the I2S Echo sample, unmodified? Or did you add some custom behavior? I compiled the I2S Echo sample just fine using the configuration as is.

    aorion said:
    In addition the device tree binding is outdated. 

    Could you please elaborate on this?


    All in all, I feel like we are moving in a good direction, yes?
    You might feel like saving time by just pushing forward now, but I still recommend taking a step back and go over these resources first.
    - DevAcademy course mentioned above for some warm-up. 
    - Working with nRF53 articles. The nRF5340 is a dual core chip and as such it is somewhat more complex for development.

    Best regards,

    Hieu

  • Hi,


    Sorry for the delay, just wanted to say thanks for the resources, those are a good reference. Generally I have been going through the zephyr documentation, the sample projects, etc. which has some of the same material but is, like you said, not all for the same board, and some of it was outdated. 

    The reason I posted originally is because I was (still am...) seeing legitimately confusing results from setup and kconfig operations with regards to what boards are referenced. Since the actual issues were unrelated and the project still seems to be compiling and running OK, I verified the answer and will continue to reference those pages. 

    Thanks,

    -Alex

  • Hi Alex,

    No worries. I am unfamiliar with I2S specifically so I cannot give any advice about it.

    DeviceTree should be somewhat more straightforward than Kconfig. I hope you have understood it now.

    Kconfig can be complicated and confusing. There is one more resource I would like to recommend:
    Build System (CMake) — Zephyr Project Documentation (nordicsemi.com)

    If you ever have any further trouble, Kconfig or things just not working like it should, please feel free to open another Q&A. The community and we at Nordic will be sure to help you :D

    Best regards,

    Hieu

Related