malformed line in Kconfig

I want to use a switch in the overlay file, like:

#if defined(CONDIG_USE_UART_MODBUS)
	&uart1 {
		compatible = "nordic,nrf-uarte";
		status = "okay";
		current-speed = <9600>;
		pinctrl-0 = <&uart1_mod_default>;
		pinctrl-1 = <&uart1_mod_sleep>;
		pinctrl-names = "default", "sleep";
	
		modbus0 {
			compatible = "zephyr,modbus-serial";
			status = "okay";
			de-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
		};
	};
	/* End of The MODBUS handling stuff.*/
#endif

To do so, I try to add a config statement in a custom KConfig file. (mp_Kconfig.conf):

config USE_UART_MODBUS
   bool
   default y

Adding the file to the build configuration under "Extra KConfig Fragments".
I can see that the file is merged, but it keeps complaining about malformed lines.
I tried spaced instead of tab, removed newline characters at the end, but no result.
We are working under Windows
Any hints how to solve this?

Bob

Parents Reply
  • Hi!

    This definition should not be in the <name>.conf but in a file "Kconfig" instead. Then you can use the "CONFIG_USE_UART_MODBUS" in any <name>.conf file which you adds to the project as a extra Kconfig fragments. 

    So you should rename the file mp_Kconfig.conf to Kconfig, then the default setting will be picked up. So no need to add to the build configuration then. If you want to change the default setting you need to add it in a .conf file to change it. 

Children
Related