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
  • This wasn't the error you got exactly but may be what's up. Does it work if you add a prompt to the bool, like:

    config USE_UART_MODBUS
       bool "y if using uart modbus"
       default y

    According to the Linux docs on Kconfig:

    Every menu entry can have at most one prompt, which is used to display to the user. Optionally dependencies only for this prompt can be added with “if”. If a prompt is not present, the config option is a non-visible symbol, meaning its value cannot be directly changed by the user (such as altering the value in .config) and the option will not appear in any config menus. Its value can only be set via “default” and “select” (see below).

    So at least not giving it a prompt lets it not show in menuconfig and makes that config not user-definable. That may be bubbling up into the error you're getting because it otherwise seems like it should be fine IMO.

Reply
  • This wasn't the error you got exactly but may be what's up. Does it work if you add a prompt to the bool, like:

    config USE_UART_MODBUS
       bool "y if using uart modbus"
       default y

    According to the Linux docs on Kconfig:

    Every menu entry can have at most one prompt, which is used to display to the user. Optionally dependencies only for this prompt can be added with “if”. If a prompt is not present, the config option is a non-visible symbol, meaning its value cannot be directly changed by the user (such as altering the value in .config) and the option will not appear in any config menus. Its value can only be set via “default” and “select” (see below).

    So at least not giving it a prompt lets it not show in menuconfig and makes that config not user-definable. That may be bubbling up into the error you're getting because it otherwise seems like it should be fine IMO.

Children
No Data
Related