CFB config issue NCS V2.0.0

Hi,

I am trying to compile the cfb sample as provided in v2.0.0. 

/opt/nordic/ncs/v2.0.0/zephyr/samples/subsys/display/cfb

my overlay file is as follows

/ {
        chosen {
                zephyr,display = &dummy_dc;
        };

        dummy_dc: dummy_dc {
                compatible = "zephyr,dummy-dc";
                label = "DISPLAY";
                height = <240>;
                width = <320>;
        };
};

&pinctrl {
	uart0_default_alt: uart0_default_alt {
		group0 {
			psels = <NRF_PSEL(UART_TX, 0, 24)>, <NRF_PSEL(UART_RX, 0, 22)>;
		};
	};

	uart0_sleep_alt: uart0_sleep_alt {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 24)>, <NRF_PSEL(UART_RX, 0, 22)>;
			low-power-enable;
		};
	};

	i2c1_default_alt: i2c1_default_alt {
       		group2 {
          		psels = <NRF_PSEL(TWIM_SDA, 0, 17)>,
                  		<NRF_PSEL(TWIM_SCL, 0, 20)>;
       			};
    		};
};

&uart0 {
	pinctrl-0 = <&uart0_default_alt>;
	pinctrl-1 = <&uart0_sleep_alt>;	
	pinctrl-names = "default", "sleep";
	compatible = "nordic,nrf-uart";
	current-speed = <115200>;
	status = "okay";
};

&i2c1 {
    status = "okay";
    compatible = "nordic,nrf-twim";
    pinctrl-0 = <&i2c1_default_alt>;
    pinctrl-names = "default", "sleep";
    clock-frequency = <I2C_BITRATE_STANDARD>;  

	ssd1306@3c {
      	compatible = "solomon,ssd1306fb";
        	reg = <0x3c>;
        	label = "SSD1306";
        	height = <32>;
        	width  = <128>;
        	segment-offset  = <0>;
        	page-offset     = <0>;
        	display-offset  = <0>;
        	multiplex-ratio = <31>;
        	prechargep      = <0xD1>;
        	segment-remap;
        	com-invdir;
        	com-sequential;
    	};

};

&i2c1 {
/delete-property/sda-gpios;
/delete-property/scl-gpios;
};

and my prj file

# General config
CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n
CONFIG_ASSERT=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_NEWLIB_LIBC=y
CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_GETCHAR=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_CONSOLE=y

CONFIG_CPLUSPLUS=y
CONFIG_LOG=y
CONFIG_SHELL=y
CONFIG_REBOOT=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_UART_CONSOLE=y

CONFIG_GPIO=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y

CONFIG_PINCTRL=y
CONFIG_PM_DEVICE=y

CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_SENSOR=y

CONFIG_BOOT_BANNER=n

CONFIG_DISPLAY=y
CONFIG_CHARACTER_FRAMEBUFFER=y
CONFIG_SHELL=y
CONFIG_CHARACTER_FRAMEBUFFER_SHELL=y
CONFIG_SSD1306=y
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_CFB_LOG_LEVEL_DBG=y

When I try to build, I get the following error ,

[0/1] Re-running CMake...
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb
-- Using NCS Toolchain 2.0.0 for building. (/opt/nordic/ncs/toolchains/v2.0.0/cmake)
-- Cache files will be written to: /Users/Watt/Library/Caches/zephyr
-- Zephyr version: 3.0.99 (/opt/nordic/ncs/v2.0.0/zephyr)
-- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
-- Board: nrf52840dongle_nrf52840
-- Found host-tools: zephyr 0.14.1 (/Users/Watt/zephyr-sdk-0.14.1)
-- Found dtc: /opt/nordic/ncs/toolchains/v2.0.0/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
-- Found toolchain: zephyr 0.14.1 (/Users/Watt/zephyr-sdk-0.14.1)
-- Found BOARD.dts: /opt/nordic/ncs/v2.0.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
-- Found devicetree overlay: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/nrf52840dongle_nrf52840.overlay
-- Generated zephyr.dts: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/dts.cmake
Parsing /opt/nordic/ncs/v2.0.0/zephyr/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.0.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
Merged configuration '/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/prj.conf'
No change to configuration in '/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/.config'
No change to Kconfig header in '/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/include/generated/autoconf.h'
CMake Warning at /opt/nordic/ncs/v2.0.0/zephyr/subsys/random/CMakeLists.txt:11 (message):
  

      Warning: CONFIG_TEST_RANDOM_GENERATOR is not a truly random generator.
      This capability is not secure and it is provided for testing purposes only.
      Use it carefully.


CMake Warning at /opt/nordic/ncs/v2.0.0/zephyr/CMakeLists.txt:1803 (message):
  __ASSERT() statements are globally ENABLED


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build
[1/1] cd /Users/Watt/Documents/ZEPHYR_...ncs/v2.0.0/zephyr/cmake/pristine.cmake
Loading Zephyr default modules (Zephyr base).
-- Application: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb
-- Using NCS Toolchain 2.0.0 for building. (/opt/nordic/ncs/toolchains/v2.0.0/cmake)
-- Found Python3: /opt/nordic/ncs/toolchains/v2.0.0/bin/python3 (found suitable exact version "3.9.6") found components: Interpreter 
-- Cache files will be written to: /Users/Watt/Library/Caches/zephyr
-- Zephyr version: 3.0.99 (/opt/nordic/ncs/v2.0.0/zephyr)
-- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
-- Board: nrf52840dongle_nrf52840
-- Found host-tools: zephyr 0.14.1 (/Users/Watt/zephyr-sdk-0.14.1)
-- Found dtc: /opt/nordic/ncs/toolchains/v2.0.0/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
-- Found toolchain: zephyr 0.14.1 (/Users/Watt/zephyr-sdk-0.14.1)
-- Found BOARD.dts: /opt/nordic/ncs/v2.0.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
-- Found devicetree overlay: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/nrf52840dongle_nrf52840.overlay
-- Generated zephyr.dts: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/dts.cmake
Parsing /opt/nordic/ncs/v2.0.0/zephyr/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.0.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
Merged configuration '/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/prj.conf'
Configuration saved to '/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/.config'
Kconfig header saved to '/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- The ASM compiler identification is GNU
-- Found assembler: /Users/Watt/zephyr-sdk-0.14.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
CMake Warning at /opt/nordic/ncs/v2.0.0/zephyr/subsys/random/CMakeLists.txt:11 (message):
  

      Warning: CONFIG_TEST_RANDOM_GENERATOR is not a truly random generator.
      This capability is not secure and it is provided for testing purposes only.
      Use it carefully.


CMake Warning at /opt/nordic/ncs/v2.0.0/zephyr/CMakeLists.txt:1803 (message):
  __ASSERT() statements are globally ENABLED


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build
Make Complete

/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build
[1/203] Preparing syscall dependency handling

[2/203] Generating include/generated/version.h
-- Zephyr version: 3.0.99 (/opt/nordic/ncs/v2.0.0/zephyr), build: v3.0.99-ncs1
[193/203] Linking CXX executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/zephyr_pre0.map 
: && ccache /Users/Watt/zephyr-sdk-0.14.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++   zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -fuse-ld=bfd  -Wl,-T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr/zephyr_pre0.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/newlib/liblib__libc__newlib.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/boards/arm/nrf52840dongle_nrf52840/libboards__arm__nrf52840dongle_nrf52840.a  zephyr/subsys/random/libsubsys__random.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/display/libdrivers__display.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/i2c/libdrivers__i2c.a  zephyr/drivers/sensor/libdrivers__sensor.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a  modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L"/Users/Watt/zephyr-sdk-0.14.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/thumb/v7e-m/nofp"  -L/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  -no-pie  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -lm  -Wl,-lc  -L"/Users/Watt/zephyr-sdk-0.14.1/arm-zephyr-eabi/arm-zephyr-eabi"/lib/thumb/v7e-m/nofp  -u_printf_float  -Wl,-lgcc  -lc  -specs=nano.specs  /opt/nordic/ncs/v2.0.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/soft-float/no-interrupts/libnrf_cc310_platform_0.9.14.a  -lc && cd /Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/build/zephyr && /usr/local/Cellar/cmake/3.23.2/bin/cmake -E echo
/Users/Watt/zephyr-sdk-0.14.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(main.c.obj): in function `main':
/Users/Watt/Documents/ZEPHYR_Code/nRF52840_Dongle/New_Code/cfb/src/main.c:73: undefined reference to `__device_dts_ord_3'
/Users/Watt/zephyr-sdk-0.14.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/libzephyr.a(cfb_shell.c.obj): in function `cmd_init':
/opt/nordic/ncs/v2.0.0/zephyr/subsys/fb/cfb_shell.c:428: undefined reference to `__device_dts_ord_3'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Parsing image file.
ERROR: The file specified could not be found.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.

Thanks in advance

Rod

  • Sorry, just realised my overlay file had some old code in it.

    I have updated it to this..

    / {
            chosen {
    		zephyr,display = &ssd1306;
            };
    };
    
    &pinctrl {
    	uart0_default_alt: uart0_default_alt {
    		group0 {
    			psels = <NRF_PSEL(UART_TX, 0, 24)>, <NRF_PSEL(UART_RX, 0, 22)>;
    		};
    	};
    
    	uart0_sleep_alt: uart0_sleep_alt {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 24)>, <NRF_PSEL(UART_RX, 0, 22)>;
    			low-power-enable;
    		};
    	};
    
    	i2c1_default_alt: i2c1_default_alt {
           		group2 {
              		psels = <NRF_PSEL(TWIM_SDA, 0, 17)>,
                      		<NRF_PSEL(TWIM_SCL, 0, 20)>;
           			};
        		};
    };
    
    &uart0 {
    	pinctrl-0 = <&uart0_default_alt>;
    	pinctrl-1 = <&uart0_sleep_alt>;	
    	pinctrl-names = "default", "sleep";
    
    	compatible = "nordic,nrf-uart";
    	current-speed = <115200>;
    	status = "okay";
    };
    
    &i2c1 {
        status = "okay";
        compatible = "nordic,nrf-twim";
        pinctrl-0 = <&i2c1_default_alt>;
        pinctrl-names = "default", "sleep";
        clock-frequency = <I2C_BITRATE_STANDARD>;  
    
    	ssd1306: ssd1306@3c {
          	compatible = "solomon,ssd1306fb";
            	reg = <0x3c>;
            	label = "SSD1306";
            	height = <32>;
            	width  = <128>;
            	segment-offset  = <0>;
            	page-offset     = <0>;
            	display-offset  = <0>;
            	multiplex-ratio = <31>;
            	prechargep      = <0xD1>;
            	segment-remap;
            	com-invdir;
            	com-sequential;
        	};
    
    };
    
    
    &i2c1 {
    /delete-property/sda-gpios;
    /delete-property/scl-gpios;
    };
    
    &adc {
    	status = "ok";
    };
    

    This allows the code to build, but am now seeing thus error

    <err> i2c_nrfx_twim: Need to use concatenation buffer and provided size is insufficient (1 + 512 > 16). Adjust the zephyr,concat-buf-size property in the "I2C_1" node.

    Rod

  • Ok, I got it, I has missed the in my overlay file

    zephyr,concat-buf-size = <520>;

Related