Arduino Nano 33 BLE sense rev2 serial Monitor in zephyr envirnoment

Hi, after uploading a Zephyr project (like the "Hello World" example), I couldn't see the device in the serial monitor. i add the below commend in overlay file also but still nothing is happening i read some document says the uart stack is not enabled in the arduino board after uploading the sample code but after enabling that also same issue i am getting. 

Board: Arduino Nano 33 BLE sense Rev2 (which has nRF52840 microcontroller in it)
Platform : nrF connect sdk in vs code and zephyr environment both i tried

overlay file:

&usbd {
status = "okay";
cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM";
};
};

Need to see the serial monitor in zephyr environment using Arduino Nano33 BLE sense rev 2 board.
  • Hello,

    Sorry for the late reply. 

    Try looking at the overlay files for the nrf52840dongle_nrf52840. Particularly, the sample:

    NCS\nrf\samples\bluetooth\llpm\

    And it's nrf52840dongle_nrf52840.conf and nrf52840dongle_nrf52840.overlay files.

    Best regards,

    Edvin

  • Hello,

    I saw your private message, where you asked why I mentioned the nRF52840 Dongle.

    Sorry if I was not specific. 

    The reason I mentioned the nRF52840 dongle board files (nrf52840dongle_nrf52840), is that this board, like the board that you mention, use the nRF's USB peripheral, instead of the typical UART -> Debugger -> computer, that is used in the normal DevKits.

    So the llpm sample that I mentioned in my previous reply shows how you can set up the dongle, using the nrf52840dongle_nrf52840.conf and .overlay file to redirect the console to the USB. 

    What you want to do is to create similar files, just named according to the board that you build for, to redirect your console to the USB peripheral.

    Best regards,

    Edvin

  • Hi,

    I have two questions.

    1. Is there anything that i should particularly change for my nano 33 board like usb pid like that? or just need to add the configuration and overlay file in the hello world built project for nano BLE33?

    2. I saw one more example which is console , that one also has the similar conf and overlay file, my doupt in that is inside the chosen @cdc_acm_uart0 is there rght,

    when i check the reference its entering into the node that we created &zephyr_udc0, but after built the application which is the sample console i check the dts of the application , this is for nano_33_ble_sense board




    nrf52840 dongle built dts file is this:


    so i changed in the overlay file into &uart0, so i am getting this error

    devicetree error: Label 'uart0' appears on /soc/uart@40002000 and on /soc/usbd@40027000/uart0
    CMake Error at /home/ebi777/ncs/v2.9.0/zephyr/cmake/modules/dts.cmake:295 (execute_process):
    execute_process failed command indexes:

    1: "Child return code: 1"

    Call Stack (most recent call first):
    /home/ebi777/ncs/v2.9.0/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
    /home/ebi777/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    /home/ebi777/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:4 (find_package)


    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
    CMake configure failed for Zephyr project: console

    Location: /home/ebi777/console
    Call Stack (most recent call first):
    cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
    cmake/modules/sysbuild_default.cmake:20 (include)
    /home/ebi777/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
    /home/ebi777/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    /home/ebi777/ncs/v2.9.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
    template/CMakeLists.txt:10 (find_package)


    -- Configuring incomplete, errors occurred!
    See also "/home/ebi777/console/build/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: /home/ebi777/ncs/toolchains/b77d8c1312/usr/local/bin/cmake -DWEST_PYTHON=/home/ebi777/ncs/toolchains/b77d8c1312/usr/local/bin/python3.12 -B/home/ebi777/console/build -GNinja -DBOARD=arduino_nano_33_ble/nrf52840/sense -DNCS_TOOLCHAIN_VERSION=NONE -S/home/ebi777/ncs/v2.9.0/zephyr/share/sysbuild -DAPP_DIR:PATH=/home/ebi777/console

    is this the right process or need to approach in a different way?

    Regards,
    Ebi

  • Hello Ebi,

    I don't have access to the same HW that you are testing, but based on the schematics that I found here, it looks like there is no UART->USB device on this board. This is something we have on our nRF52840 DKs. The debugger reads all UART messages, and translates this to USB, which is why you can see UART messages on the computer (computers typically don't have UART peripherals).

    The reason I mentioned the nRF52840 dongle in the first place, is that this doesn't have a debugger, so when you build e.g. the hello world sample for our dongle, nrf52840dongle_nrf52840, it has devicetree settings that will forward the console directly to the nRF's own USB peripheral. 

    This doesn't seem to be the case for the arduino nano 33 ble sense board files. I tried adjusting the behavior with the attached application:

    1526.hello_world.zip

    Note the boards\arduino_nano_33_ble_sense.overlay file, where I just copied parts of the nrf52840dongle_nrf52840.dts file. This way it will adapt this behavior without changing the board file in your SDK directly.

    Also, note that I enabled the USB_CDC in the prj.conf.

    Again, I don't have the arduino board to test on, but I tried to build it for the nrf52840dongle_nrf52840 as well, and flashed it, and I can see the "hello world" messages via the USB CDC in a terminal.

    Give it a go, and let me know if it doesn't work.

    Best regards,

    Edvin

  • Hello Edvin,

    Thank you for sending it, but unfortunately it doesn't work after uploading i can see for a sec after that it vanished, i attached the ss for your referenc:


    I don't understand how this Arduino ide programs works after uploading it i can see the serial but cant debug beacuse it doesnt comes with debugger and in zephyr environment do we need to add customize board for making it wokr.. or should we need to by the external debugger or something for serial to see the serial output in zephyr environment?

    Regards,
    Ebineser

Related