This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DSP_PRESENT Macro Disabled in nrf5340_network.h file

Hi,

My observations:
DSP_PRESENT Macro is enabled in nrf51.h , nrf52.h, nrf5340_application.h files in v1.5.0\modules\hal\nordic\nrfx\mdk path
As shown below: 
#define __DSP_PRESENT 1 /*!< DSP present or not

DSP_[RESENT Macro is disabled in nrf5340_network.h file in v1.5.0\modules\hal\nordic\nrfx\mdk
As shown below:
#define __DSP_PRESENT 0 /*!< DSP present or not

I have used nrf5340_network.h file in my application. The below error is occured during compilation code which is generated from core_cm33.h
#error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"

I think so, because of disabled  __DSP_PRESENT Macro.

May I know why it is disabled in nrf5340_network.h file and why it is enabled in nrf51.h, nrf52.h and nrf5340_application.h files.

Thanks & Regards,

Srinivas Rao.

Parents
  • Hi!

    The nRF5340 network core does not have a DSP, hence it's not enabled either. You can find the supported modules in the product specification.

    Best regards,
    Carl Richard

  • Hi ,

    I am using AES (Advanced Encryption Standard) Module. AES related structure defined in nrf5340_network.h file only.

    please check below code snippet for your information.

    /**
    * @brief AES CCM mode encryption (CCM_NS)
    */

    typedef struct { /*!< (@ 0x4100E000) CCM_NS Structure */
    __OM uint32_t TASKS_KSGEN; /*!< (@ 0x00000000) Start generation of keystream. This operation
    will stop by itself when completed. */
    __OM uint32_t TASKS_CRYPT; /*!< (@ 0x00000004) Start encryption/decryption. This operation will
    stop by itself when completed. */
    __OM uint32_t TASKS_STOP; /*!< (@ 0x00000008) Stop encryption/decryption */
    __OM uint32_t TASKS_RATEOVERRIDE; /*!< (@ 0x0000000C) Override DATARATE setting in MODE register with
    the contents of the RATEOVERRIDE register
    for any ongoing encryption/decryption */
    __IM uint32_t RESERVED[28];
    __IOM uint32_t SUBSCRIBE_KSGEN; /*!< (@ 0x00000080) Subscribe configuration for task KSGEN */
    __IOM uint32_t SUBSCRIBE_CRYPT; /*!< (@ 0x00000084) Subscribe configuration for task CRYPT */
    __IOM uint32_t SUBSCRIBE_STOP; /*!< (@ 0x00000088) Subscribe configuration for task STOP */
    __IOM uint32_t SUBSCRIBE_RATEOVERRIDE; /*!< (@ 0x0000008C) Subscribe configuration for task RATEOVERRIDE */
    __IM uint32_t RESERVED1[28];
    __IOM uint32_t EVENTS_ENDKSGEN; /*!< (@ 0x00000100) Keystream generation complete */
    __IOM uint32_t EVENTS_ENDCRYPT; /*!< (@ 0x00000104) Encrypt/decrypt complete */
    __IOM uint32_t EVENTS_ERROR; /*!< (@ 0x00000108) Deprecated register - CCM error event */
    __IM uint32_t RESERVED2[29];
    __IOM uint32_t PUBLISH_ENDKSGEN; /*!< (@ 0x00000180) Publish configuration for event ENDKSGEN */
    __IOM uint32_t PUBLISH_ENDCRYPT; /*!< (@ 0x00000184) Publish configuration for event ENDCRYPT */
    __IOM uint32_t PUBLISH_ERROR; /*!< (@ 0x00000188) Deprecated register - Publish configuration for
    event ERROR */
    __IM uint32_t RESERVED3[29];
    __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts between local events and tasks */
    __IM uint32_t RESERVED4[64];
    __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Enable interrupt */
    __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Disable interrupt */
    __IM uint32_t RESERVED5[61];
    __IM uint32_t MICSTATUS; /*!< (@ 0x00000400) MIC check result */
    __IM uint32_t RESERVED6[63];
    __IOM uint32_t ENABLE; /*!< (@ 0x00000500) Enable */
    __IOM uint32_t MODE; /*!< (@ 0x00000504) Operation mode */
    __IOM uint32_t CNFPTR; /*!< (@ 0x00000508) Pointer to data structure holding the AES key
    and the NONCE vector */
    __IOM uint32_t INPTR; /*!< (@ 0x0000050C) Input pointer */
    __IOM uint32_t OUTPTR; /*!< (@ 0x00000510) Output pointer */
    __IOM uint32_t SCRATCHPTR; /*!< (@ 0x00000514) Pointer to data area used for temporary storage */
    __IOM uint32_t MAXPACKETSIZE; /*!< (@ 0x00000518) Length of keystream generated when MODE.LENGTH
    = Extended */
    __IOM uint32_t RATEOVERRIDE; /*!< (@ 0x0000051C) Data rate override setting. */
    __IOM uint32_t HEADERMASK; /*!< (@ 0x00000520) Header (S0) mask. */
    } NRF_CCM_Type; /*!< Size = 1316 (0x524) */

    Regards,

    Srinivas.

Reply
  • Hi ,

    I am using AES (Advanced Encryption Standard) Module. AES related structure defined in nrf5340_network.h file only.

    please check below code snippet for your information.

    /**
    * @brief AES CCM mode encryption (CCM_NS)
    */

    typedef struct { /*!< (@ 0x4100E000) CCM_NS Structure */
    __OM uint32_t TASKS_KSGEN; /*!< (@ 0x00000000) Start generation of keystream. This operation
    will stop by itself when completed. */
    __OM uint32_t TASKS_CRYPT; /*!< (@ 0x00000004) Start encryption/decryption. This operation will
    stop by itself when completed. */
    __OM uint32_t TASKS_STOP; /*!< (@ 0x00000008) Stop encryption/decryption */
    __OM uint32_t TASKS_RATEOVERRIDE; /*!< (@ 0x0000000C) Override DATARATE setting in MODE register with
    the contents of the RATEOVERRIDE register
    for any ongoing encryption/decryption */
    __IM uint32_t RESERVED[28];
    __IOM uint32_t SUBSCRIBE_KSGEN; /*!< (@ 0x00000080) Subscribe configuration for task KSGEN */
    __IOM uint32_t SUBSCRIBE_CRYPT; /*!< (@ 0x00000084) Subscribe configuration for task CRYPT */
    __IOM uint32_t SUBSCRIBE_STOP; /*!< (@ 0x00000088) Subscribe configuration for task STOP */
    __IOM uint32_t SUBSCRIBE_RATEOVERRIDE; /*!< (@ 0x0000008C) Subscribe configuration for task RATEOVERRIDE */
    __IM uint32_t RESERVED1[28];
    __IOM uint32_t EVENTS_ENDKSGEN; /*!< (@ 0x00000100) Keystream generation complete */
    __IOM uint32_t EVENTS_ENDCRYPT; /*!< (@ 0x00000104) Encrypt/decrypt complete */
    __IOM uint32_t EVENTS_ERROR; /*!< (@ 0x00000108) Deprecated register - CCM error event */
    __IM uint32_t RESERVED2[29];
    __IOM uint32_t PUBLISH_ENDKSGEN; /*!< (@ 0x00000180) Publish configuration for event ENDKSGEN */
    __IOM uint32_t PUBLISH_ENDCRYPT; /*!< (@ 0x00000184) Publish configuration for event ENDCRYPT */
    __IOM uint32_t PUBLISH_ERROR; /*!< (@ 0x00000188) Deprecated register - Publish configuration for
    event ERROR */
    __IM uint32_t RESERVED3[29];
    __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts between local events and tasks */
    __IM uint32_t RESERVED4[64];
    __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Enable interrupt */
    __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Disable interrupt */
    __IM uint32_t RESERVED5[61];
    __IM uint32_t MICSTATUS; /*!< (@ 0x00000400) MIC check result */
    __IM uint32_t RESERVED6[63];
    __IOM uint32_t ENABLE; /*!< (@ 0x00000500) Enable */
    __IOM uint32_t MODE; /*!< (@ 0x00000504) Operation mode */
    __IOM uint32_t CNFPTR; /*!< (@ 0x00000508) Pointer to data structure holding the AES key
    and the NONCE vector */
    __IOM uint32_t INPTR; /*!< (@ 0x0000050C) Input pointer */
    __IOM uint32_t OUTPTR; /*!< (@ 0x00000510) Output pointer */
    __IOM uint32_t SCRATCHPTR; /*!< (@ 0x00000514) Pointer to data area used for temporary storage */
    __IOM uint32_t MAXPACKETSIZE; /*!< (@ 0x00000518) Length of keystream generated when MODE.LENGTH
    = Extended */
    __IOM uint32_t RATEOVERRIDE; /*!< (@ 0x0000051C) Data rate override setting. */
    __IOM uint32_t HEADERMASK; /*!< (@ 0x00000520) Header (S0) mask. */
    } NRF_CCM_Type; /*!< Size = 1316 (0x524) */

    Regards,

    Srinivas.

Children
  • Hi again!

    It's correct that the CCM module is only present in the network core. It is a standalone peripheral and does not need DSP support if that what's you are wondering about. Could you please elaborate on your issue?

    Best regards,
    Carl Richard

  • Hi, 

    If __DSP_PRESENT is not enabled in nrf5340_network.h file . we are getting compilation error because as per showing below snippet code  in core_cm33.h file, enter into highlighted else condition .

    #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U)
    #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U)
    #define __DSP_USED 1U
    #else
    #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"
    #define __DSP_USED 0U
    #endif
    #else
    #define __DSP_USED 0U
    #endif

    Regards,

    Srinivas

  • Hi again!

    It seems like the compiler is trying to generate the DSP instructions, even though it's not present. This is likely due to your project configuration.

    Could you share your application here? Especially prj.conf and main.

    Best regards,
    Carl Richard

  • Hi ,

    please check below configuration 

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y

    # General configuration
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    #CONFIG_FLASH=y
    CONFIG_FLASH_MAP=y
    CONFIG_FCB=y
    CONFIG_SETTINGS=y
    CONFIG_HWINFO=y
    CONFIG_LOG=y
    CONFIG_LOG_PRINTK=y

    CONFIG_DK_LIBRARY=y
    CONFIG_BT_MESH_DK_PROV=y

    # Bluetooth configuration
    CONFIG_BT=y
    CONFIG_BT_COMPANY_ID=0x0059
    CONFIG_BT_DEVICE_NAME="Mesh Light"
    CONFIG_BT_L2CAP_RX_MTU=69
    CONFIG_BT_L2CAP_TX_MTU=69
    CONFIG_BT_L2CAP_TX_BUF_COUNT=8
    CONFIG_BT_LL_SW_SPLIT=y
    CONFIG_BT_OBSERVER=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_SETTINGS=y
    CONFIG_BT_TINYCRYPT_ECC=y

    # Disable unused Bluetooth features
    CONFIG_BT_CTLR_DUP_FILTER_LEN=0
    CONFIG_BT_CTLR_LE_ENC=n
    CONFIG_BT_DATA_LEN_UPDATE=n
    CONFIG_BT_PHY_UPDATE=n
    CONFIG_BT_CTLR_CHAN_SEL_2=n
    CONFIG_BT_CTLR_MIN_USED_CHAN=n
    CONFIG_BT_CTLR_PRIVACY=n

    # Bluetooth mesh configuration
    CONFIG_BT_MESH=y
    CONFIG_BT_MESH_RELAY=y
    CONFIG_BT_MESH_FRIEND=y
    CONFIG_BT_MESH_ADV_BUF_COUNT=13
    CONFIG_BT_MESH_TX_SEG_MAX=10
    CONFIG_BT_MESH_PB_GATT=y
    CONFIG_BT_MESH_GATT_PROXY=y

    # Bluetooth mesh models
    CONFIG_BT_MESH_ONOFF_SRV=y

    # FLASH INTEGRATION
    CONFIG_STDOUT_CONSOLE=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y
    CONFIG_CPLUSPLUS=y
    CONFIG_LIB_CPLUSPLUS=y

    Regards,

    Srinivas

  • I can't see anything obvious here. Is this configuration only for the network core?

    Are you trying to use the DSP directly or does error surface when you try to use the AES CCM?

    Best regards,
    Carl Richard

Related