Sample code not available for selected part

Hello Team,

We are currently working with the nRF54L05 and using the nRF Connect SDK. We have successfully evaluated basic BLE peripheral samples on the EVK.

For our application, we require sample implementations of the ADC and Timer. However, we found that the existing samples are not compatible with the nRF54L05.

Could you please guide us on how to use the Timer and ADC with this platform?

Thank you.

  • Hello,

    For our application, we require sample implementations of the ADC and Timer. However, we found that the existing samples are not compatible with the nRF54L05.

    Which samples have you tried so far?

    Did you create board overlays to enable the ADC and timer peripherals?

    Best regards,

    Maria

  • Hello,

    Maria Gilje said:
    Which samples have you tried so far?

    I have tried the following examples for ADC:

    1. ADC Sample sequence sample

    2. ADC device-tree driver sample

    3. nrfx_saadc simple blocking sample

    4. nrfx_saadc advanced non-blocking sample

    The following samples for Timers:

    1. nrfx_timer timer example

    2. nrfx_timer counter mode example

    When I tried to Add Build Configuration, I could not find the nrf54l05 option on compatible boards.

    Maria Gilje said:
    Did you create board overlays to enable the ADC and timer peripherals?

    No, I am new to the nrf Connect SDK and did not find much information on creating overlays on DevAcademy. Can you please provide the details on how to create board overlays to enable the ADC and timer peripherals?

  • Hello,

    payalD said:
    No, I am new to the nrf Connect SDK and did not find much information on creating overlays on DevAcademy. Can you please provide the details on how to create board overlays to enable the ADC and timer peripherals?

    Many of the exercises include adding a board overlay. The lesson which is very relevant for you is the ADC lesson in the nRF Connect SDK Intermediate course.

    payalD said:
    When I tried to Add Build Configuration, I could not find the nrf54l05 option on compatible boards.

    You can still select the nRF54L05 as a target if you change the filter to show all boards or Nordic SoCs.

    Make sure that you have created a board overlay file before building.

    I did a short trial with the ADC devicetree driver sample where I copied the board overlay for the nRF54L15 and renamed it to fit the nRF54L05. This resulted in a successful build.

    Best regards,

    Maria

  • Hello,

    I am trying to configure the Timer to trigger every 1 millisecond. I referred to the ADC lesson from the course you mentioned above. Code is getting compiled but the timer is not triggered every 1 millisecond as expected. Below is the code snippet. 

    #include <nrfx_timer.h>
    
    #define TIMER_INSTANCE_NUMBER   22
    #define TIME_TO_WAIT_MS         1
    
    const nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(TIMER_INSTANCE_NUMBER);
    nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(1000);
    volatile unsigned long sys_tick = 0;
    nrfx_err_t status;
    
    static void timer_handler(nrf_timer_event_t event_type, void * p_context)
    {
        if(event_type == NRF_TIMER_EVENT_COMPARE0)
        {
            sys_tick++;
        }
    }
    
    void init_timer(void)
    {
        printk("tmr_init\r\n");
        status = nrfx_timer_init(&timer_instance, &config, timer_handler);
        NRFX_ASSERT(status == NRFX_SUCCESS);
    
        nrfx_timer_clear(&timer_instance);
    
        /* Creating variable desired_ticks to store the output of nrfx_timer_ms_to_ticks function */
        uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&timer_instance, TIME_TO_WAIT_MS);
    
        nrfx_timer_extended_compare(&timer_instance, NRF_TIMER_CC_CHANNEL0, timer_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);
    
        nrfx_timer_enable(&timer_instance);
    }
    
    void get_sysTicks(void)
    {
        printk("%d\r\n",sys_tick);
    }

    As per my understanding if the timer is triggered every 1 millisec value of sys_tick should increase accordingly. I am checking the value of sys_tick continuously, but its value is 0.

    I have created the overlay for the timer.

    &timer22 {
    	status = "okay";
    };

    Please guide me. Am I missing any configuration?

    Thank you.

  • You do not seem to be enabling the interrupts for your callback to be called. Try to enable it and see if that works.

    void init_timer(void)
    {
        printk("tmr_init\r\n");
    
        nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(NRF_TIMER_FREQ_1MHz);
    
        status = nrfx_timer_init(&timer_instance, &config, timer_handler);
        NRFX_ASSERT(status == NRFX_SUCCESS);
    
        nrfx_timer_clear(&timer_instance);
    
        uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&timer_instance, TIME_TO_WAIT_MS);
        printk("ticks: %u\r\n", timer_ticks);  // Minimal debug print
    
        nrfx_timer_extended_compare(&timer_instance, NRF_TIMER_CC_CHANNEL0, timer_ticks,
                                    NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false);
    
        nrfx_timer_int_enable(&timer_instance, NRF_TIMER_INT_COMPARE0_MASK);
        nrfx_timer_enable(&timer_instance);
    }

Related