[U-Boot] Can't change stdout variable from code (read only variable) [u-boot 2019.07]

RIDET Aurelien aurelien.ridet at preciamolen.fr
Thu Jul 18 15:11:04 UTC 2019


Dear all,

When in 2016.11, I had a working function that switched stdout to either console (serial) or display (vga) depending of a gpio.
This code broke when upgrading to u-boot 2019.07 because stdout is now a read only variable, and is stuck on serial.

I searched around the code, and can't find how this particular variable is read-only, and not other.
The failing test is in nvedit.c file, function _do_env_set line 290 : hsearch_r(e, ENTER, &ep, &env_htab, env_flag);
as env_set fail with error 22 (EINVAL), and the only occurrence of it in hsearch_r is line 408, I get that there is something related to a callback that goes wrong (maybe it is the check if the variable can be written?) but as I don't understand how the callback is associated with this variable and where it is defined, I don't understand the code.

I searched how env_htab is set because the variable stdout with the attribute read only seems to be set inside it, but I didn't find how it works.

I then searched over the internet, and found something related to ACL, but don't understand how it is currently integrated and how variables are defined.

I finally found multiples files in my build directory with predefined variable, but never with an attribute that said this one is read/write, and this one is read-only.

How can I change this variable programmatically (change the read-only attribute)?

Any help is welcome.

Best regards,
Aurélien RIDET.


More information about the U-Boot mailing list