This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to start Zephyr bootloader (MCUBOOT) without XTAL 32768Hz?

I have nrf52840 pcb without xTAL.

In this ticket ticket I have discused about start Zephyr project without XTAL onboard.

But now I faced with other issue to start mcuboot without XTAL

When XTAL is not installed on nrf52840 board - then after reset it does not run and wait for XTAL (as I understand)

If I include

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n

to bootloader\mcuboot\boot\zephyr\prf.conf

then I catch next error

1> FAILED: zephyr/zephyr_prebuilt.elf zephyr/zephyr_prebuilt.map 
1> cmd.exe /C "cd . && C:\Users\nrf\SES\v1.7.1\toolchain\opt\bin\arm-none-eabi-gcc.exe   zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj -o zephyr\zephyr_prebuilt.elf  -Wl,-T  zephyr/linker_zephyr_prebuilt.cmd  -Wl,-Map=D:/cal/reclouser/mcuboot/zephyr/zephyr_prebuilt.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a  zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/lib/posix/liblib__posix.a  zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/serial/libdrivers__serial.a  modules/nrf/lib/fprotect/lib..__nrf__lib__fprotect.a  modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a  modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a  modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  modules/segger/libmodules__segger.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -L"c:/users/nrf/ses/v1.7.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/thumb/v7e-m+fp/hard"  -LD:/cal/reclouser/mcuboot/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  C:/Users/nrf/SES/v1.7.1/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/hard-float/no-interrupts/libnrf_cc310_platform_0.9.11.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfpu=fpv4-sp-d16  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -no-pie  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  C:/Users/nrf/SES/v1.7.1/nrfxlib/crypto/nrf_cc310_bl/lib/cortex-m4/hard-float/no-interrupts/libnrf_cc310_bl_0.9.12.a && cmd.exe /C "cd /D D:\cal\reclouser\mcuboot\zephyr && C:\Users\nrf\SES\v1.7.1\toolchain\opt\bin\cmake.exe -E echo ""
1> c:/users/nrf/ses/v1.7.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_sem_give':
1> D:\cal\reclouser\mcuboot/zephyr/include/generated/syscalls/kernel.h:841: undefined reference to `z_impl_k_sem_give'
1> c:/users/nrf/ses/v1.7.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_sem_init':
1> D:\cal\reclouser\mcuboot/zephyr/include/generated/syscalls/kernel.h:810: undefined reference to `z_impl_k_sem_init'
1> c:/users/nrf/ses/v1.7.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_mutex_init':
1> D:\cal\reclouser\mcuboot/zephyr/include/generated/syscalls/kernel.h:708: undefined reference to `z_impl_k_mutex_init'
1> c:/users/nrf/ses/v1.7.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_mutex_lock':
1> D:\cal\reclouser\mcuboot/zephyr/include/generated/syscalls/kernel.h:724: undefined reference to `z_impl_k_mutex_lock'
1> c:/users/nrf/ses/v1.7.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_sem_take':
1> D:\cal\reclouser\mcuboot/zephyr/include/generated/syscalls/kernel.h:826: undefined reference to `z_impl_k_sem_take'
1> c:/users/nrf/ses/v1.7.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_mutex_unlock':
1> D:\cal\reclouser\mcuboot/zephyr/include/generated/syscalls/kernel.h:738: undefined reference to `z_impl_k_mutex_unlock'
1> collect2.exe: error: ld returned 1 exit status

I have made a big problem for me when I have not installed XTAL onboard, but it is too late. I have to start SMP server on notXTAL board.

Help me please

Parents
  • Hi,

     

    This driver requires the use of multithreading, which enables certain kernel APIs. Could you try adding this to the mcuboot configuration?

    CONFIG_MULTITHREADING=y

     

    Kind regards,

    Håkon

  • Thanks you a lot!!!!

    You save me!!!

    CONFIG_BOARD_ENABLE_DCDC=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_MULTITHREADING=y

    I included this in bootloader\mcuboot\boot\zephyr\prf.conf

    and now it works!!!

    There is one more issue. I use PPI for ADC and GPIO pending. When I connect and then disconnect - nrf52840 not advertise until reset the SoC.

            IRQ_CONNECT(DT_IRQN(DT_NODELABEL(adc)),
    		    DT_IRQ(DT_NODELABEL(adc), priority),
    		    nrfx_saadc_irq_handler, NULL, 0);
    
            adc_configure();
            ppi_init();
            timer_init();
    
            IRQ_CONNECT(DT_IRQN(DT_NODELABEL(gpiote)),
    		    DT_IRQ(DT_NODELABEL(gpiote), priority),
    		    nrfx_isr, nrfx_gpiote_irq_handler, 0);
    		    
            nrfx_gpiote_init(NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY);
    
        nrf_gpio_cfg_output(DO_OUTPUT_0); 
        nrf_gpio_cfg_output(DO_OUTPUT_1);
        nrf_gpio_cfg_output(DO_OUTPUT_2); 
        nrf_gpio_cfg_output(DO_OUTPUT_3);
        nrf_gpio_cfg_output(DO_OUTPUT_4); 
        nrf_gpio_cfg_output(DO_OUTPUT_5);
        nrf_gpio_cfg_output(DO_OUTPUT_6); 
        nrf_gpio_cfg_output(DO_OUTPUT_7);
        nrf_gpio_cfg_output(LED_PIN_G); 
    
        nrf_gpio_cfg_input(DI_INPUT_0, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_1, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_2, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_3, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_4, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_5, NRF_GPIO_PIN_PULLUP);  
        nrf_gpio_cfg_input(DI_INPUT_6, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_7, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_8, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_9, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_10, NRF_GPIO_PIN_PULLUP); 									
    
        nrfx_gpiote_in_config_t cfg_wdt = NRFX_GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
        cfg_wdt.pull = NRF_GPIO_PIN_PULLDOWN;
        nrfx_gpiote_in_init(TIM_WAKE, &cfg_wdt, evt_handler1);
        nrfx_gpiote_in_event_enable(TIM_WAKE, true);
    
        nrfx_gpiote_in_config_t inConfig = NRFX_GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);		
        inConfig.pull = NRF_GPIO_PIN_PULLUP;					
    
        nrfx_gpiote_in_config_t rtcConfig = NRFX_GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);		
        rtcConfig.pull  = NRF_GPIO_PIN_PULLUP;			
    
        nrfx_gpiote_in_init(RTC_PIN,     &rtcConfig,  evt_handler2);
    
        nrfx_gpiote_in_event_enable(RTC_PIN,     true);
        
        
        
        

    P.S. Do I have to create a new ticket?

Reply
  • Thanks you a lot!!!!

    You save me!!!

    CONFIG_BOARD_ENABLE_DCDC=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_MULTITHREADING=y

    I included this in bootloader\mcuboot\boot\zephyr\prf.conf

    and now it works!!!

    There is one more issue. I use PPI for ADC and GPIO pending. When I connect and then disconnect - nrf52840 not advertise until reset the SoC.

            IRQ_CONNECT(DT_IRQN(DT_NODELABEL(adc)),
    		    DT_IRQ(DT_NODELABEL(adc), priority),
    		    nrfx_saadc_irq_handler, NULL, 0);
    
            adc_configure();
            ppi_init();
            timer_init();
    
            IRQ_CONNECT(DT_IRQN(DT_NODELABEL(gpiote)),
    		    DT_IRQ(DT_NODELABEL(gpiote), priority),
    		    nrfx_isr, nrfx_gpiote_irq_handler, 0);
    		    
            nrfx_gpiote_init(NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY);
    
        nrf_gpio_cfg_output(DO_OUTPUT_0); 
        nrf_gpio_cfg_output(DO_OUTPUT_1);
        nrf_gpio_cfg_output(DO_OUTPUT_2); 
        nrf_gpio_cfg_output(DO_OUTPUT_3);
        nrf_gpio_cfg_output(DO_OUTPUT_4); 
        nrf_gpio_cfg_output(DO_OUTPUT_5);
        nrf_gpio_cfg_output(DO_OUTPUT_6); 
        nrf_gpio_cfg_output(DO_OUTPUT_7);
        nrf_gpio_cfg_output(LED_PIN_G); 
    
        nrf_gpio_cfg_input(DI_INPUT_0, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_1, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_2, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_3, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_4, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_5, NRF_GPIO_PIN_PULLUP);  
        nrf_gpio_cfg_input(DI_INPUT_6, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_7, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_8, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_9, NRF_GPIO_PIN_PULLUP); 
        nrf_gpio_cfg_input(DI_INPUT_10, NRF_GPIO_PIN_PULLUP); 									
    
        nrfx_gpiote_in_config_t cfg_wdt = NRFX_GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
        cfg_wdt.pull = NRF_GPIO_PIN_PULLDOWN;
        nrfx_gpiote_in_init(TIM_WAKE, &cfg_wdt, evt_handler1);
        nrfx_gpiote_in_event_enable(TIM_WAKE, true);
    
        nrfx_gpiote_in_config_t inConfig = NRFX_GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);		
        inConfig.pull = NRF_GPIO_PIN_PULLUP;					
    
        nrfx_gpiote_in_config_t rtcConfig = NRFX_GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);		
        rtcConfig.pull  = NRF_GPIO_PIN_PULLUP;			
    
        nrfx_gpiote_in_init(RTC_PIN,     &rtcConfig,  evt_handler2);
    
        nrfx_gpiote_in_event_enable(RTC_PIN,     true);
        
        
        
        

    P.S. Do I have to create a new ticket?

Children
No Data
Related