continuous sampling stopped example: saadc_advanced_non_blocking_internal_timer

Hello folks,

aim of my task is to transfer ADC data through USB from my nrf5340DK to my windows PC, so I can use this data to controll some python game.

SDK: nrf2.6.2

toolchain: v2.6.2

I evaluated the example "saadc_advanced_non_blocking_internal_timer" and changed the saadc_handler() function, especially the "case NRFX_SAADC_EVT_BUF_REQ:" , so its continuously sampling the ADC channel. Problem was, that 

[00:13:02.882,751] <inf> NRFX_EXAMPLE: 300

--- 76 messages dropped ---

[00:13:02.891,448] <inf> NRFX_EXAMPLE: 302

--- 76 messages dropped ---

[00:13:02.900,146] <inf> NRFX_EXAMPLE: 302

Messages were dropped, so I want to implement the

USB CDC ACM Sample Application example
its for the sdk v2.5.1, but without adjusting its running fine in my build v2.6.1.
The problem I encounter, when I adjust the prj.conf for the USB implementation like
#project configuration
CONFIG_GPIO=n
CONFIG_NRFX_GPIOTE0=y
CONFIG_NRFX_SAADC=y

#usb cobfiguration
CONFIG_USB_DEVICE_STACK=y            # Enables the USB device stack
# Sets the product name
CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM sample"
#ProductID the following line is not allowed to make comments after ID "Remove the Inline Comment"
CONFIG_USB_DEVICE_PID=0x0001    
CONFIG_SERIAL=y                      # Enables UART support
CONFIG_UART_INTERRUPT_DRIVEN=y       # Enables interrupt-driven UART (needed for USB CDC ACM)
CONFIG_UART_LINE_CTRL=y              # Enables line control for UART (needed for DTR detection)

#logging through zephyr
CONFIG_DEBUG=y               # Enable debug symbols
CONFIG_LOG_MODE_IMMEDIATE=y  # Ensure logs are flushed immediately for debugging.
CONFIG_LOG_BACKEND_UART=y    # Logs will output to UART or RTT (depends on your setup).
my familiar irq sequence for the SAADC sampling differes. I ad this image, so it easier to see
irq sequence from the saadc
The last interrupt with event mask = 3, should be = 2 and I dont know why. Afterwards its executing the Saadc_event_handle() and the 
m_cb.buffer_secondary.p_buffer = 0x0 <_vector_table>
so it points to null.
I tried to increase the priority from the saadc to 2
nrfx_saadc_init(2);
My USB implementation works and I can see the device in the Settings - Bluetooth & other Devices properly. When I comment out the init from the USB in my main.c , still persists the error and not continuously sampling. 
When I comment out the added prj.conf configuration for the USB, its sampling continuously again.
Doese someone have any clue why this is happening?
Many thanks in advance,
Christoph 

 

Related