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

CONFIG_ASSERT Cause Code to Crash

As a test of nrf9160 DK board, I am trying to read a voltage signal and report it to the nRF cloud.  My original plan is to change a bit of the Asset Tracking sample code and the add the reading of one ADC channel.   

The ADC reading code is basically copied from the Simon tutorial sample here:

https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-2-ncs-v1-4-0

Both the Asset Tracking code and tutorial code works fine by itself.  But combing the two code causes the system to crash.  

After a long frustration trial, I finally find the "CONFIG_ASSET=y" in the prj.conf cause the tutorial code to output this error message in the LTE Link Monitor and crash:

ASSERTION FAIL [((arch_is_in_isr() == 0) || ((timeout).ticks == (((k_timeout_t) {})).ticks))] @ WEST_TOPDIR/zephyr/kernel/sem.c:140

Any clues of how to fix this problem?   

Thanks

  • I tried to set CONFIG_ASSERT=y in the prj.conf of the ADC sample, and encountered the same issue as you.

    It seems like I made a mistake in the ADC code, by calling adc_sample inside the timer callback. Could you try the following main.c:

    #include <zephyr.h>
    #include <sys/printk.h>
    #include <drivers/pwm.h>
    
    #if defined(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP) ||  defined(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPPNS) || defined(CONFIG_BOARD_NRF9160DK_NRF9160NS) || defined(CONFIG_BOARD_NRF9160DK_NRF9160)
    
    /*ADC definitions and includes*/
    #include <hal/nrf_saadc.h>
    #define ADC_DEVICE_NAME DT_LABEL(DT_INST(0, nordic_nrf_saadc))
    #define ADC_RESOLUTION 10
    #define ADC_GAIN ADC_GAIN_1_6
    #define ADC_REFERENCE ADC_REF_INTERNAL
    #define ADC_ACQUISITION_TIME ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 10)
    #define ADC_1ST_CHANNEL_ID 0  
    #define ADC_1ST_CHANNEL_INPUT NRF_SAADC_INPUT_AIN0
    
    #define PWM_DEVICE_NAME DT_PROP(DT_NODELABEL(pwm0), label)
    #define PWM_CH0_PIN DT_PROP(DT_NODELABEL(pwm0), ch0_pin)
    
    #else
    #error "Choose supported board or add new board for the application"
    #endif
    
    #include <zephyr.h>
    #include <device.h>
    #include <drivers/gpio.h>
    #include <drivers/adc.h>
    #include <string.h>
    #include <drivers/pwm.h>
    
    #define PWM_MAX 253
    #define TIMER_INTERVAL_MSEC 200
    #define BUFFER_SIZE 1
    
    struct k_timer my_timer;
    const struct device *adc_dev;
    const struct device *pwm_dev;
    
    K_SEM_DEFINE(adc_sem, 0, 1);
    
    static const struct adc_channel_cfg m_1st_channel_cfg = {
    	.gain = ADC_GAIN,
    	.reference = ADC_REFERENCE,
    	.acquisition_time = ADC_ACQUISITION_TIME,
    	.channel_id = ADC_1ST_CHANNEL_ID,
    #if defined(CONFIG_ADC_CONFIGURABLE_INPUTS)
    	.input_positive = ADC_1ST_CHANNEL_INPUT,
    #endif
    };
    
    static s16_t m_sample_buffer[BUFFER_SIZE];
    
    static int adc_sample(void)
    {
    	int ret;
    	const struct adc_sequence sequence = {
    		.channels = BIT(ADC_1ST_CHANNEL_ID),
    		.buffer = m_sample_buffer,
    		.buffer_size = sizeof(m_sample_buffer),
    		.resolution = ADC_RESOLUTION,
    	};
    
    	if (!adc_dev) {
    		return -1;
    	}
    
    	ret = adc_read(adc_dev, &sequence);
    	if (ret) {
            printk("adc_read() failed with code %d\n", ret);
    	}
    	for (int i = 0; i < BUFFER_SIZE; i++) {
                    printk("ADC raw value: %d\n", m_sample_buffer[i]);
                    float val = ((float)PWM_MAX/(float)568)*(float)m_sample_buffer[i];
                    printk("Setting pulse to: %f\n", val);
                    pwm_pin_set_usec(pwm_dev, PWM_CH0_PIN , PWM_MAX, val, 0);
    	}
    
    	return ret;
    }
    
    void adc_sample_event(struct k_timer *timer_id){
        k_sem_give(&adc_sem);
        /*int err = adc_sample();
        if (err) {
            printk("Error in adc sampling: %d\n", err);
        }*/
    }
    
    void main(void)
    {
        int err;
        //PWM0 setup
        pwm_dev = device_get_binding(PWM_DEVICE_NAME);
        if (!pwm_dev) {
    	    printk("device_get_binding() PWM0 failed\n");
    	}
        //Timer setup
        k_timer_init(&my_timer, adc_sample_event, NULL);
        k_timer_start(&my_timer, K_MSEC(TIMER_INTERVAL_MSEC), K_MSEC(TIMER_INTERVAL_MSEC));
    
         
        //ADC0 setup
        adc_dev = device_get_binding(ADC_DEVICE_NAME);
    	if (!adc_dev) {
            printk("device_get_binding ADC_0 (=%s) failed\n", ADC_DEVICE_NAME);
        } 
        err = adc_channel_setup(adc_dev, &m_1st_channel_cfg);
        if (err) {
    	    printk("Error in adc setup: %d\n", err);
    	}
    
        #if defined(CONFIG_BOARD_NRF9160DK_NRF9160NS) ||  defined(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPPNS)
        NRF_SAADC_NS->TASKS_CALIBRATEOFFSET = 1;
        #elif defined(CONFIG_BOARD_NRF9160DK_NRF9160) || defined(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP)
        NRF_SAADC->TASKS_CALIBRATEOFFSET = 1;
        #else
        #error "Choose supported board or add new board for the application"
        #endif
        while(true){
            k_sem_take(&adc_sem, K_FOREVER);
            adc_sample();
        }
    }

    Maybe a better approach than using a semaphore is to offload the adc reading to a work queue. The Asset Tracker uses work queues a lot, so take a look at that to get an understanding how to implement it.

    I will do some more testing and update the tutorial soon.

    Best regards,

    Simon

  • Hi Simon,

    first of all great tutorial!! Tried the original way of the tutorial with my nrf5340-dk and newest sdk1.9.1 and the only thing I had to change for the PWM blink (without ADC) was the typedef from

    s16_t to int16_t  and everything worked. Befor I got support from Marte in 

    https://devzone.nordicsemi.com/f/nordic-q-a/86370/nrf-connect-sdk-tutorial---part-2-3-2-set-it-up---light_controller-not-working-vs-code

    The original ADC sample I mad changes same like before s16_t to int16_t  and 

    defined(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP_NS) // the _ line was missing from the board definition.
    Afterwards I got the build error
    > Executing task: nRF Connect: Generate config nrf5340dk_nrf5340_cpuapp for c:\my_projects\light_controller_copy <
    
    Building light_controller_copy
    west build --build-dir c:\my_projects\light_controller_copy\build c:\my_projects\light_controller_copy --pristine --board nrf5340dk_nrf5340_cpuapp -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y
    
    -- west build: generating a build system
    Including boilerplate (Zephyr base): C:/nordicsemi/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/my_projects/light_controller_copy
    -- Zephyr version: 2.7.99 (C:/nordicsemi/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: C:/nordicsemi/v1.9.1/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Cache files will be written to: C:/nordicsemi/v1.9.1/zephyr/.cache
    -- Found dtc: C:/nordicsemi/v1.9.1/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (c:/nordicsemi/v1.9.1/toolchain/opt)
    -- Found BOARD.dts: C:/nordicsemi/v1.9.1/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: C:/my_projects/light_controller_copy/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/my_projects/light_controller_copy/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/my_projects/light_controller_copy/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/my_projects/light_controller_copy/build/zephyr/dts.cmake
    Parsing C:/nordicsemi/v1.9.1/zephyr/Kconfig
    Loaded configuration 'C:/nordicsemi/v1.9.1/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'C:/my_projects/light_controller_copy/prj.conf'
    Merged configuration 'C:/my_projects/light_controller_copy/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/my_projects/light_controller_copy/build/zephyr/.config'
    Kconfig header saved to 'C:/my_projects/light_controller_copy/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/nordicsemi/v1.9.1/toolchain/opt/bin/arm-none-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/my_projects/light_controller_copy/build
    -- west build: building application
    [1/163] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
    [2/163] Generating include/generated/driver-validation.h
    [3/163] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
    [4/163] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
    [5/163] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
    [6/163] Generating include/generated/offsets.h
    [7/163] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
    [8/163] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
    [9/163] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
    [10/163] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
    [11/163] Generating linker_zephyr_pre0.cmd
    [12/163] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
    [13/163] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
    [14/163] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
    [15/163] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
    [16/163] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
    [17/163] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
    [18/163] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault_s.S.obj
    [19/163] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
    [20/163] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
    [21/163] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fpu.c.obj
    [22/163] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/irq_init.c.obj
    [23/163] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/reset.S.obj
    [24/163] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
    [25/163] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
    [26/163] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
    [27/163] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
    [28/163] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/CMakeFiles/arch__arm__core__aarch32__cortex_m__cmse.dir/arm_core_cmse.c.obj
    [29/163] Linking C static library zephyr\arch\arch\arm\core\aarch32\libarch__arm__core__aarch32.a
    [30/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/abort.c.obj
    [31/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/atoi.c.obj
    [32/163] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_core_mpu.c.obj
    [33/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtol.c.obj
    [34/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/bsearch.c.obj
    [35/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtoul.c.obj
    [36/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/malloc.c.obj
    [37/163] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\libarch__arm__core__aarch32__cortex_m.a
    [38/163] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_mpu.c.obj
    [39/163] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\cmse\libarch__arm__core__aarch32__cortex_m__cmse.a
    [40/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/qsort.c.obj
    [41/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/exit.c.obj
    [42/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strncasecmp.c.obj
    [43/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strstr.c.obj
    [44/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strspn.c.obj
    [45/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/string.c.obj
    [46/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/fprintf.c.obj
    [47/163] Linking C static library zephyr\arch\arch\arm\core\aarch32\mpu\libarch__arm__core__aarch32__mpu.a
    [48/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/time/gmtime.c.obj
    [49/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/sprintf.c.obj
    [50/163] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/stdout_console.c.obj
    [51/163] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/nanosleep.c.obj
    [52/163] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread_common.c.obj
    [53/163] Building C object zephyr/soc/arm/common/cortex_m/CMakeFiles/soc__arm__common__cortex_m.dir/arm_mpu_regions.c.obj
    [54/163] Building C object zephyr/drivers/adc/CMakeFiles/drivers__adc.dir/adc_common.c.obj
    [55/163] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj
    [56/163] Building C object zephyr/drivers/clock_control/CMakeFiles/drivers__clock_control.dir/clock_control_nrf.c.obj
    [57/163] Building C object zephyr/drivers/adc/CMakeFiles/drivers__adc.dir/adc_nrfx_saadc.c.obj
    [58/163] Building C object zephyr/drivers/console/CMakeFiles/drivers__console.dir/uart_console.c.obj
    [59/163] Building C object zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/sys_clock_init.c.obj
    [60/163] Linking C static library zephyr\lib\libc\minimal\liblib__libc__minimal.a
    [61/163] Linking C static library zephyr\lib\posix\liblib__posix.a
    [62/163] Linking C static library zephyr\soc\arm\common\cortex_m\libsoc__arm__common__cortex_m.a
    [63/163] Linking C static library zephyr\drivers\gpio\libdrivers__gpio.a
    [64/163] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
    [65/163] Linking C static library zephyr\drivers\clock_control\libdrivers__clock_control.a
    [66/163] Linking C static library zephyr\drivers\adc\libdrivers__adc.a
    [67/163] Linking C static library zephyr\drivers\console\libdrivers__console.a
    [68/163] Building C object zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/nrf_rtc_timer.c.obj
    [69/163] Building C object modules/nrf/drivers/hw_cc310/CMakeFiles/..__nrf__drivers__hw_cc310.dir/hw_cc310.c.obj
    [70/163] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/nordicsemi/v1.9.1/modules/hal/nordic/nrfx/mdk/system_nrf5340_application.c.obj
    [71/163] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/nordicsemi/v1.9.1/modules/hal/nordic/nrfx/helpers/nrfx_flag32_allocator.c.obj
    [72/163] Building C object modules/nrf/lib/fatal_error/CMakeFiles/..__nrf__lib__fatal_error.dir/fatal_error.c.obj
    [73/163] Linking C static library zephyr\drivers\serial\libdrivers__serial.a
    [74/163] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
    [75/163] Linking C static library zephyr\drivers\timer\libdrivers__timer.a
    [76/163] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/nordicsemi/v1.9.1/modules/hal/nordic/nrfx/drivers/src/nrfx_dppi.c.obj
    [77/163] Linking C static library modules\nrf\drivers\hw_cc310\lib..__nrf__drivers__hw_cc310.a
    [78/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
    [79/163] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/nordicsemi/v1.9.1/modules/hal/nordic/nrfx/drivers/src/nrfx_clock.c.obj
    [80/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
    [81/163] Linking C static library modules\nrf\lib\fatal_error\lib..__nrf__lib__fatal_error.a
    [82/163] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/nordicsemi/v1.9.1/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
    [83/163] Building C object CMakeFiles/app.dir/src/main.c.obj
    [84/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
    [85/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
    [86/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
    [87/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
    [88/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
    [89/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
    [90/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
    [91/163] Linking C static library modules\hal_nordic\nrfx\libmodules__hal_nordic__nrfx.a
    [92/163] Linking C static library app\libapp.a
    [93/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
    [94/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
    [95/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
    [96/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
    [97/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
    [98/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
    [99/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
    [100/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
    [101/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
    [102/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj
    [103/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
    [104/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
    [105/163] Building ASM object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj
    [106/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
    [107/163] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
    [108/163] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
    [109/163] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
    [110/163] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/nrf53/power.c.obj
    [111/163] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy/residency.c.obj
    [112/163] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/nrf53/soc.c.obj
    [113/163] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/debug/thread_info.c.obj
    [114/163] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
    [115/163] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
    [116/163] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/pm.c.obj
    [117/163] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/constraint.c.obj
    [118/163] Building C object zephyr/CMakeFiles/zephyr.dir/C_/nordicsemi/v1.9.1/nrfxlib/crypto/nrf_cc312_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj
    [119/163] Building C object zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj
    [120/163] Generating linker_zephyr_pre1.cmd
    [121/163] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
    [122/163] Building C object zephyr/CMakeFiles/zephyr.dir/C_/nordicsemi/v1.9.1/nrfxlib/crypto/nrf_cc312_platform/src/nrf_cc3xx_platform_mutex_zephyr.c.obj
    [123/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/system_work_q.c.obj
    [124/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/condvar.c.obj
    [125/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/xip.c.obj
    [126/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
    [127/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/main_weak.c.obj
    [128/163] Linking C static library zephyr\arch\common\libisr_tables.a
    [129/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/banner.c.obj
    [130/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/work.c.obj
    [131/163] Linking C static library zephyr\libzephyr.a
    FAILED: zephyr/libzephyr.a 
    cmd.exe /C "cd . && C:\nordicsemi\v1.9.1\toolchain\opt\bin\cmake.exe -E rm -f zephyr\libzephyr.a && C:\nordicsemi\v1.9.1\toolchain\opt\bin\arm-none-eabi-ar.exe qc zephyr\libzephyr.a  zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/nrf53/soc.c.obj zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/nrf53/power.c.obj zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj zephyr/CMakeFiles/zephyr.dir/subsys/debug/thread_info.c.obj zephyr/CMakeFiles/zephyr.dir/subsys/pm/pm.c.obj zephyr/CMakeFiles/zephyr.dir/subsys/pm/constraint.c.obj zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy/residency.c.obj zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj zephyr/CMakeFiles/zephyr.dir/C_/nordicsemi/v1.9.1/nrfxlib/crypto/nrf_cc312_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj zephyr/CMakeFiles/zephyr.dir/C_/nordicsemi/v1.9.1/nrfxlib/crypto/nrf_cc312_platform/src/nrf_cc3xx_platform_mutex_zephyr.c.obj && C:\nordicsemi\v1.9.1\toolchain\opt\bin\arm-none-eabi-ranlib.exe zephyr\libzephyr.a && cd ."
    C:\nordicsemi\v1.9.1\toolchain\opt\bin\arm-none-eabi-ranlib.exe: zephyr\libzephyr.a: Permission denied
    [132/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
    [133/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/kheap.c.obj
    [134/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/init.c.obj
    [135/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/version.c.obj
    [136/163] Linking C static library zephyr\arch\common\libarch__common.a
    [137/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/errno.c.obj
    [138/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/device.c.obj
    [139/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mem_slab.c.obj
    [140/163] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mailbox.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'c:\nordicsemi\v1.9.1\toolchain\opt\bin\cmake.EXE' --build 'c:\my_projects\light_controller_copy\build'
    The terminal process terminated with exit code: 1.
    
    Terminal will be reused by tasks, press any key to close it.
    So I went to the code from you above in this post, upload succesfully done but when I put some wire to ADC pin P0.04 A0 there is no change in Terminal output.
    I will continue with your mentioned "work queue " above, anyway would I like to light the LED by some potentiometer.
    Many thanks in advance and best regards,
    Christoph
  • Hi Christoph,

    Please create a new ticket with your issue. This ticket is almost a year old, and Simon is currently out of office.

    Best regards,

    Marte

Related