Reading USB registers directly on a Nordic nRF5340 DK

Hi everyone,

We are using the NCS 2.4.2 and the development board nRF5340 DK. We would like to read USB register as shown in the datasheet of this board (Attach this info), specifically REGISTER

And I have coded the following: 

/*
 * Copyright (c) 2018 Phytec Messtechnik GmbH
 *
 * SPDX-License-Identifier: Apache-2.0
 */


#include <logging/log.h>
#include <stdint.h>

LOG_MODULE_REGISTER(main);

// Define the USB peripheral base address
#define USB_BASE_ADDR 0x50037000

// Define USB register offsets
#define EVENTS_USBDETECTED_OFFSET 0x100

void main(void)
{
        volatile uint32_t *usb_base = (uint32_t *)USB_BASE_ADDR;

        // Read USB control register.
        uint32_t event_usb_detected = usb_base[EVENTS_USBDETECTED_OFFSET];

        if(event_usb_detected == 1){
          LOG_INF("USB EVENT detected");

        }

        // Do something with the register values.

        
}

With this error, titled as "missing expression":

C:\ncs\v1.7.0\toolchain\opt/bin/arm-none-eabi-gcc -DBUILD_VERSION=v2.6.99-ncs1 
-DEXT_API_MAGIC=0x281ee6de,0xb845acea,13570 -DFIRMWARE_INFO_MAGIC=0x281ee6de,0x8fcebb4c,13570 -DKERNEL 
-DNRF5340_XXAA_APPLICATION -DNRF_TRUSTZONE_NONSECURE -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 
-D__PROGRAM_START -D__ZEPHYR__=1 -I../../../../../kernel/include -I../../../../../arch/arm/include 
-I../../../../../include -Izephyr/include/generated -I../../../../../soc/arm/nordic_nrf/nrf53 
-IC:/ncs/v1.7.0/nrf/include -IC:/ncs/v1.7.0/modules/hal/cmsis/CMSIS/Core/Include 
-IC:/ncs/v1.7.0/modules/hal/nordic/nrfx -IC:/ncs/v1.7.0/modules/hal/nordic/nrfx/drivers/include 
-IC:/ncs/v1.7.0/modules/hal/nordic/nrfx/mdk -I../../../../../modules/hal_nordic/nrfx/. -isystem 
../../../../../lib/libc/minimal/include -isystem 
c:/ncs/v1.7.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem 
c:/ncs/v1.7.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -Os -imacros 
C:/ncs/v1.7.0/zephyr/samples/subsys/usb/hid/build_nrf5340dk_nrf5340_cpuapp_ns/zephyr/include/generated/autoconf.h 
-ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs 
-imacros C:/ncs/v1.7.0/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security 
-Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined 
-Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables 
-fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop 
-fmacro-prefix-map=C:/ncs/v1.7.0/zephyr/samples/subsys/usb/hid=CMAKE_SOURCE_DIR 
-fmacro-prefix-map=C:/ncs/v1.7.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v1.7.0=WEST_TOPDIR 
-ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MF 
C:/ncs/v1.7.0/zephyr/samples/subsys/usb/hid/build_nrf5340dk_nrf5340_cpuapp_ns/zephyr\CMakeFiles\zephyr.dir\misc\generated\configs.c.obj.d 
-fno-diagnostics-show-caret -o zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj -c zephyr/misc/generated/configs.c

Related