I encounter an "undefined reference to `__device_dts_ord_152'" error when attempting to incorporate the peripheral_uart demo code into my customized application. Can you please assist me in resolving this issue?

I'm encountering difficulties while integrating the logic from the peripheral_uart into my customized application. To showcase the problem, I've created a brief video available at this link: https://youtube.com/live/h0GjFsJRF_0

It appears that I may have overlooked certain configurations within the .prj file, KConfig, or device tree. I would greatly appreciate your assistance in troubleshooting this issue.

  • Hello,

    I didn't actually try to run the sample. I just compiled it. Just checking by the tickets, but I am at home now, and I don't have any nRF5340 DKs available here. I can look into it on Monday. 

    What function is it that returns -5? bt_enable() or adv_start()?

    Oh, and I realized I can just watch your video. Here we go.

    FYI: If it doesn't detect the DK, you can hover over the "Connected devices" tab in the bottom left, and a refresh button will appear:

    Alternatively, if anything else hangs, you can press ctrl + shift + p, and type "reload window", hit enter, and it will restart all the plugins for you. I use it if the navigation stops working from time to time. 

    The reason the logger doesn't work is because of this part in your prj.conf:

    # Config logger
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_PRINTK=n

    It will not work to log over UART, because the UART is controlled by your application. Hence, the log module is set to use the RTT backend. You can monitor it using either a separate RTT terminal, such as Segger RTT Viewer, and you probably have it installed if you have NCS and VS Code up and running. 

    The setup should look something like this:

    Note that you need to reconnect to the device every time you re-flash the firmware. This is because of the nature of how RTT works. In Segger's RTT viewer, just hit F2 and enter, and it will re-load the log buffers.

    Alternatively, you can use the RTT viewer in nRF Connect for VS Code:

    This also needs to be re-connected on every re-flash.

    I tried dissecting your application, removing all the PWM, I2C, SPI etc, in order to only test the BLE part of it without having to write an nRF52840dk overlay file, but when I did so, everything worked well (advertising, that is). I will have to test it on an nRF5340DK on Monday. Would it be possible to (unless you did it already) upload the latest application you are using on Github?

    And just to be sure, what version of the DK are you using? I couldn't tell from your video. It should say e.g. 2.0.0 on a big white sticker close to the programmer USB port on the DK. Just so that I can test it on the same version that you are using.

    Best regards,

    Edvin

  • Thank you for responding quickly. To tackle the issue, I've been working on it by using the peripheral_uart example. My plan is to integrate the pwm, spi, and i2c drivers into it. Up until now, I have successfully implemented the bi-directional BLE and 4-channel PWM. I will soon work on incorporating the spi and i2c drivers. I will update you on my progress and share the code on GitHub.

  • Try removing 
    CONFIG_BT_EXT_ADV=y

    Unless you intentionally added it there. It is perfectly fine to do so, but it requires some extra configurations for your network core.

    Best regards,

    Edvin

  • I got everything working now. Thank you so much for your help. The github code is now at : https://github.com/antshiv/BLEDroneCode

Related