Cryptocell and usb

I was building the "console" sample code found in zephyr for my custom nrf52840 board and I managed to get it to work. But as soon as cryptocell gets enabled, it doesn't work anymore.

Q1:  Why doesn't the devicetree find "nordic,cryptocell"? I get a warning like this: Unknown node type "nordic,cryptocell"

- This also applies to nrf52840 Dongle and DK.

Q2: Cryptocell is enabled by default in nrf52840 devicetree which gets applied to all the boards (like nrf52840dongle and nrf52840dk and my custom board which uses nrf52840dongle as template). But this breaks the usb communication with the "console" sample on my custom board (It does build though).

- I can't test it with other boards since I only have nrf52dk and it doesn't support usb.

- I'm flashing it through mcuboot so I don't have access to debugger and I'm scared to use the nrf52dk as debugger since it already has bricked 3/5 devices.

Q3: The acl node has also a warning: Address range collides with flash-controller@4001e000 (both start at 0x4001e000)

- But it still works with it enabled.

I'm running Manjaro kde with linux66 kernel, v2.6.1 toolchain with v2.6.1 SDK installed through vscode extension.

This is the configuration which works:

And prj.conf:

CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Testing"
CONFIG_USB_DEVICE_PID=0x0851
CONFIG_USB_DEVICE_VID=0x884E
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n

CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_LINE_CTRL=y

 
And board defconfig:
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_NRF52840_CUSTOM=y

# ??????
CONFIG_BOARD_ENABLE_DCDC=n

# 32K clock
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y

# Enable MPU
CONFIG_ARM_MPU=y

# enable GPIO
CONFIG_GPIO=y

# Enable Zephyr application to be booted by MCUboot
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_DISABLE_FLASH_PATCH=y
Parents
  • Hi, 

    I would appreciate additional information and some clarifications.

    Do you use a custom board with nrf52840?

    I was building the "console" sample code found in zephyr for my custom nrf52840 board and I managed to get it to work. But as soon as cryptocell gets enabled, it doesn't work anymore.

    Which console sample did you use? Is it maybe console over USB?
    How did you enable CryptoCell?
    What happens when it does not work anymore, is there any error?

    Q1:  Why doesn't the devicetree find "nordic,cryptocell"? I get a warning like this: Unknown node type "nordic,cryptocell"

    Did you get this warning on your custom board? Have you tried on nrf52840-dk?
    "nordic,cryptocell" unknown type is probably related to some devicetree error. Can you show where and how you added "nordic,cryptocell" configuration?

    Q2: Cryptocell is enabled by default in nrf52840 devicetree which gets applied to all the boards (like nrf52840dongle and nrf52840dk and my custom board which uses nrf52840dongle as template). But this breaks the usb communication with the "console" sample on my custom board (It does build though).

    Can you provide information in which way is USB communication broken, what exactly happens?
    Is USB communication functional on nrf52840-dk board?

    Q3: The acl node has also a warning: Address range collides with flash-controller@4001e000 (both start at 0x4001e000)

    This also indicates devicetree configuration issue.

    But it still works with it enabled.

    Can you rephrase this - what works when what is enabled? Can you show what is enabled and what happens when it works?

    What is shown in provided screenshot?

    Best regards,
    Dejan

  • Hi,

    Do you use a custom board with nrf52840?

    Yes, my custom board has nrf52840.

    Which console sample did you use? Is it maybe console over USB?

    It was the USB subsys sample called "console"

    How did you enable CryptoCell?

    CryptoCell is enabled by default here.

    What happens when it does not work anymore, is there any error?

    It does build without any errors, but the usb does not get initialized or recognized by my PC. It's hard to say what happens there without debugger.

    Did you get this warning on your custom board? Have you tried on nrf52840-dk?
    "nordic,cryptocell" unknown type is probably related to some devicetree error. Can you show where and how you added "nordic,cryptocell" configuration?

    This warning is also shown in the nrf52840.dsti. Nrf52840-dk includes the same file. "nordic,cryptocell" is configured there and I only disabled it in my board files to make the usb code work.

    Can you provide information in which way is USB communication broken, what exactly happens?
    Is USB communication functional on nrf52840-dk board?

    The only way I know it's broken is that it no longer gets recognized as a usb serial device and it is not found with NRF Connect or any other serial terminal software. I do not have access to nrf52840-dk board.

    This also indicates devicetree configuration issue.

    This I already knew. The question was why? Both of the nodes have the default configuration that come with the SDK.

    Can you rephrase this - what works when what is enabled? Can you show what is enabled and what happens when it works?

    This sample code and other codes still work when acl is enabled regarding the warning.

    What is shown in provided screenshot?

    The device configuration part of the devicetree.

    BR

  • Hi,

    I have tested zephyr/samples/subsys/usb/console sample on nrf52840-dk. I have not seen devicetree errors such as "Unknown node type nordic,cryptocell" or "address range collision" but I had some difficulties accessing device after flashing.

    Do you have any development kit on which this problem is consistently reproducible? If you have, could you please provide all required steps to reproduce this issue?

    Best regards,
    Dejan

  • Hi,

    I reproduced the warning by:

    1. Installed fresh ubuntu 22.04 virtual machine

    2. Installed vscode

    3. Installed nrf extension pack for vscode

    4. Installed 2.6.1 toolchain and SDK from vscode extension

    5. Built the same console sample for nrf52840-dk

    6. Opened the devicetree for the build and saw the warnings

    As for the sample actually not working. I only have access to nrf52-dk and that doesn't support usb.

    What do you mean by difficulties accessing device? PC didn't recognize it as USB device? Did you try to disable the same modules as in the devicetree picture?

    BR

  • Hi,

    AintMina said:

    I reproduced the warning by:

    1. Installed fresh ubuntu 22.04 virtual machine

    2. Installed vscode

    3. Installed nrf extension pack for vscode

    4. Installed 2.6.1 toolchain and SDK from vscode extension

    5. Built the same console sample for nrf52840-dk

    6. Opened the devicetree for the build and saw the warnings

    Can you elaborate on step 6?

    AintMina said:
    What do you mean by difficulties accessing device? PC didn't recognize it as USB device? Did you try to disable the same modules as in the devicetree picture?

    Device could not be recognized as USB device. I have tested with cryptocell added to the app.overlay. Which modules specifically are you referring to and how did you disable them?

    Best regards,
    Dejan

  • Hi,

    Can you elaborate on step 6?

    By clicking "devicetree" button in the vscode extension.

    Device could not be recognized as USB device. I have tested with cryptocell added to the app.overlay. Which modules specifically are you referring to and how did you disable them?

    So you got the same type of error as I got. Did you manage to figure out why? Did you istall the SDK from vscode extension? Which repo did you use? I noticed that the zephyr and the nrf-zephyr differ and especially with cryptocell. All my methods are by using the vscode extension and to replicate these you should use it too.

    Why did you add cryptocell to app.overlay? It should have been enabled by default.

    The modules seen in the devicetree picture! Did uou use the vscode method or cli? You can disable them from the devicetree gui.

    BR

  • Hi,

    I have tested building part of the USB console sample in NCS v2.6.1 on nrf52840-dk. I have seen ACL, cryptocell, clock and power warnings. There were address collisions between ACL and flash-controller as well as between power and clock. Did you see the same warnings on nrf52840-dk?

    Q1:  Why doesn't the devicetree find "nordic,cryptocell"? I get a warning like this: Unknown node type "nordic,cryptocell"

    - This also applies to nrf52840 Dongle and DK.

    This can be fixed by adding following lines to the app.overlay file

    &cryptocell {
    	compatible = "arm,cryptocell-310";
    	status = "okay";
    };



    Q2: Cryptocell is enabled by default in nrf52840 devicetree which gets applied to all the boards (like nrf52840dongle and nrf52840dk and my custom board which uses nrf52840dongle as template). But this breaks the usb communication with the "console" sample on my custom board (It does build though).

    Is USB communication broken when you disable cryptocell in app.overlay?

    &cryptocell {
    	status = "disabled";
    };

    Q3: The acl node has also a warning: Address range collides with flash-controller@4001e000 (both start at 0x4001e000)

    - But it still works with it enabled.

    This is the same address collision warning that I have seen on the nrf52840-dk. Can you elaborate on "But it still works with it enabled"? 

    Best regards,
    Dejan

Reply
  • Hi,

    I have tested building part of the USB console sample in NCS v2.6.1 on nrf52840-dk. I have seen ACL, cryptocell, clock and power warnings. There were address collisions between ACL and flash-controller as well as between power and clock. Did you see the same warnings on nrf52840-dk?

    Q1:  Why doesn't the devicetree find "nordic,cryptocell"? I get a warning like this: Unknown node type "nordic,cryptocell"

    - This also applies to nrf52840 Dongle and DK.

    This can be fixed by adding following lines to the app.overlay file

    &cryptocell {
    	compatible = "arm,cryptocell-310";
    	status = "okay";
    };



    Q2: Cryptocell is enabled by default in nrf52840 devicetree which gets applied to all the boards (like nrf52840dongle and nrf52840dk and my custom board which uses nrf52840dongle as template). But this breaks the usb communication with the "console" sample on my custom board (It does build though).

    Is USB communication broken when you disable cryptocell in app.overlay?

    &cryptocell {
    	status = "disabled";
    };

    Q3: The acl node has also a warning: Address range collides with flash-controller@4001e000 (both start at 0x4001e000)

    - But it still works with it enabled.

    This is the same address collision warning that I have seen on the nrf52840-dk. Can you elaborate on "But it still works with it enabled"? 

    Best regards,
    Dejan

Children
No Data
Related