Change GPIO startup state

Post Reply
Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Change GPIO startup state

Unread post by Idan_VT » Wed Jan 17, 2018 6:10 pm

Hi guys,
I have ODROID-XU4 with shifter shield and I want to change the default startup state of the GPIO pins.

I want some of them to start on output mode and low voltage, It is possible?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Wed Jan 17, 2018 6:17 pm

Refer this link to check the initial level of the Shifter Shield GPIOs.
https://wiki.odroid.com/odroid-xu4/hard ... eld_40_pin
Since most of them are input, adding a pull-down resistor will meet your requirement probably.

You need to change the DeviceTree and other GPIO settings in bootloader and kernel GPIO drivers if you really want to change the default mode/level.
Which pins do you want to change to output-low?
Why do you need output-low pins?

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Wed Jan 17, 2018 7:33 pm

Thank you for your replay, I referred to the link you sent and my gpio readall command show different results.
Webp.net-resizeimage.jpg
Webp.net-resizeimage.jpg (414.22 KiB) Viewed 5949 times
Almost all pins are set to IN and v 1 and only one pin (GPIO 25) is set to output but v 1.

I need this to signal other system that odroid is up and ready to use so in my code I want to set the pin to high for signal the other system that odroid is ready.

the other system can and will read the pin even when odroid is turned on/off so that pin most start as low and switch to high when ready.
Let say for now I'm only want to change GPIO 25 default voltage to low.

I'm using ubuntu mate 16.04 LTS and Kernel Linux 4.9.44-54

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Wed Jan 17, 2018 11:48 pm

Update the Kernel to 4.14.13 first. You can find a update guide in this link.
viewtopic.php?f=52&t=28895

Once you add following two lines in /etc/modprobe.d/blacklist-odroid.conf and reboot, you will see different initial level.

Code: Select all

blacklist spi_s3c64xx
blacklist spidev
Try it and reboot and check lsmod output.

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Thu Jan 18, 2018 4:18 pm

Thanks.

Upgrade instructions:

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt install xserver-xorg-video-armsoc ffmpeg
sudo apt install linux-image-xu3
sync
sudo reboot

do I need linux-image-xu4 or something else?
do I need to download something or those lines are enough?
I guess my data will not be erase, right?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Thu Jan 18, 2018 5:42 pm

XU3, XU4, HC1 and HC2 share the same Linux Kernel image.
So you had to install "linux-image-xu3".
Above steps are enough and data will not be erased.
But please backup your data first just as a backup since few people had a file system corruption problem while updating.

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Thu Jan 18, 2018 6:36 pm

Ok, I upgrade my kernel to 4.14.13 and lsmod return the expected result
But gpio readall return all GPIO pins are IN but initial level set to high not as mention in the documentation that it should be set to low. (GPIO #25 is now IN)
Screenshot.png
Screenshot.png (151.28 KiB) Viewed 5909 times
Can I change the initial level to low?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Thu Jan 18, 2018 7:08 pm

GPIO #25 (Pin #26) should be input(hi-Z) as you saw.
So you can change it to output-low with your software.
If you need a low-level on input pin, you have to add a pull-down resistor.
But the pull-down resistor must be 50Kohm or higher as described in the WiKi page.
https://wiki.odroid.com/accessory/add-o ... ift_shield

If you really want to change the bootloader, you have to learn how to build the u-boot first,
https://wiki.odroid.com/odroid-xu4/soft ... t_mainline

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Thu Jan 18, 2018 7:16 pm

In the documentation u posted earlier the all pins initial level should be low, It means with a pull-down resistor? or It is a mistake on the documentation?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Thu Jan 18, 2018 7:33 pm

I mentioned "input" mode not "input-low" on this post.
viewtopic.php?f=97&t=29587#p211628
The initial level is effective only when IO mode is output.
AFAIK, there is no "input-low" in the world.
Can you image "input-high" or "input-low"?

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Thu Jan 18, 2018 7:48 pm

Well, you right, I guess all I want is to have 0V on some gpio pin when odroid is turn on and switch to 5v when my software is ready.
For that I need to start on output mode and low voltage.
You mention earlier "DeviceTree and other GPIO settings in bootloader and kernel GPIO drivers" - there is any guide I can follow to know what to change? I'm sure it will be useful information for many odroid users.

And in the other hand I'll check the pull-down resistor option.

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Tue Feb 20, 2018 11:57 pm

I'm getting 5V in all gpio pins after reboot.
How it is possible? wiringpi readall return that all pins are on mode IN and v = 1.
It's doesn't make sense, why IN mode return 5V ?
I even tried to connect pull-down resistor (grater then 50Kohm) and still I have 5V.

Do you have any idea?
there is any guide I can config the kernel for getting 0V when system is up?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Wed Feb 21, 2018 3:07 pm

Remove the shifter-shield and check the voltage level of the 30pin header on XU4.
If they are Hi-Z input, check the level-shifter IC specification whether it has internal pull-up or not.
http://www.ti.com/lit/ds/symlink/txs0108e.pdf

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Wed Feb 21, 2018 4:49 pm

odroid wrote:GPIO #25 (Pin #26) should be input(hi-Z) as you saw.
So you can change it to output-low with your software.
If you need a low-level on input pin, you have to add a pull-down resistor.
But the pull-down resistor must be 50Kohm or higher as described in the WiKi page.
https://wiki.odroid.com/accessory/add-o ... ift_shield

If you really want to change the bootloader, you have to learn how to build the u-boot first,
https://wiki.odroid.com/odroid-xu4/soft ... t_mainline



Can you tell me please which file I should edit for changing the gpio initial state from this U-boot?
https://github.com/hardkernel/u-boot/tr ... 7.05/board

I found this forum discussion: viewtopic.php?f=112&t=17170
But I cant find "odroidc.c" in this U-boot version.

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Wed Feb 21, 2018 6:04 pm

Did you check the voltage level without the shifter-shield?

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Wed Feb 21, 2018 6:51 pm

You are right, after removing the shifter-shield the voltage level was 0V.
In the documentation you sent:
Output voltage range
– Use the supply voltage of the device that the TXS0108E device is driving to determine the output voltage
range.
– The TXS0108E device has smart internal pull-up resistors. External pull-up resistors can be added to
reduce the total RC of a signal trace if necessary.
• An external pull-down resistor decreases the output VOH and VOL. Use Equation 1 to calculate the VOH as a
result of an external pull-down resistor.
But I already tried to connect pull-down resistor and It didn't worked.
Do you have another idea?
If the only option is edit the U-boot to be out and low I need a little guide which file I need to edit.

Thank you.

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Thu Feb 22, 2018 9:39 am

We will add a pull-down resistor(50KOhm~) to reproduce the issue.

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Thu Feb 22, 2018 4:34 pm

thanks for helping me.
In the meantime do you know which file I need to edit in the U-boot?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Tue Feb 27, 2018 1:49 pm

We could reproduce the issue. :o
Give us a few days to prepare a solution for you.

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Tue Feb 27, 2018 11:40 pm

Ok , thank you.

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Mon Mar 12, 2018 10:46 am

Give us a couple of more days because we had some internal urgent issues.
Sorry for the delay.

Edit.
bootloader modification: branch odroidxu4-v2017.05
https://github.com/hardkernel/u-boot/tr ... 4-v2017.05

Refer "odroid_gpio_init" function in uboot/board/samsung/common/odroid_misc.c
gpio definintion could be found in uboot/arch/arm/mach-exynos/include/gpio.h (exynos5422 portion)

Example) To change GPIO 25(GPX2.1) (Pin#24 on 30pin header) to Input/Pull-Down mode.
Add following lines to odroid_gpio_init function in odroid_misc.c

Code: Select all

if (gpio_request(EXYNOS5420_GPIO_X21, "Test"))
   goto err;
gpio_set_pull(EXYNOS5420_GPIO_X21, S5P_GPIO_PULL_DOWN);
gpio_direction_input(EXYNOS5420_GPIO_X21);
If you need output-low mode,

Code: Select all

if (gpio_request(EXYNOS5420_GPIO_X21, "Test"))
   goto err;
gpio_set_pull(EXYNOS5420_GPIO_X21, S5P_GPIO_PULL_NONE);
gpio_direction_output(EXYNOS5420_GPIO_X21, 0);
If you have no experience of u-boot development, try this instruction on your Linux PC.
https://wiki.odroid.com/odroid-xu4/soft ... t_mainline

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Mon Mar 12, 2018 4:48 pm

Thank you for your answer.

I could not find the uboot/arch/arm/mach-exynos/include/gpio.h (exynos5422 portion) (Do I really need this? because as far as I know the only file I need to edit is uboot/board/samsung/common/odroid_misc.c

By you example you wrote "To change GPIO 25(GPX2.1) (Pin#24 on 30pin header) to Input/Pull-Down mode"
you choose to edit the enum/define EXYNOS5420_GPIO_X21.

the connection I found is that gpio 25 is GPX2.1 and the enum/define is EXYNOS5420_GPIO_X21.
So if I want to change GPIO 24(GPX2.0 ) (Pin#26 on 30pin header) to Input/Pull-Down mode.
I need to add the following line:

Code: Select all

if (gpio_request(EXYNOS5420_GPIO_X20, "Test"))
   goto err;
gpio_set_pull(EXYNOS5420_GPIO_X20, S5P_GPIO_PULL_NONE);
gpio_direction_output(EXYNOS5420_GPIO_X20, 0);
and use EXYNOS5420_GPIO_X20 enum/define

Is that correct?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Mon Mar 12, 2018 5:31 pm

Sorry for the confusion caused.
In gpio.h file, there is no 5422 definition. 5422 and 5420 are sharing the same GPIO block and we've used 5420.

If you use EXYNOS5420_GPIO_X20, you have to control GPX2.0 port and it is mapped to the pin number 26(export number 24) on the 30pin header.

If you want to set the default value to input/pull down,
gpio_set_pull function must have S5P_GPIO_PULL_DOWN parameter instead of S5P_GPIO_PULL_NONE.
And "gpio_direction_output" have to be changed to "gpio_direction_input".

Code: Select all

if (gpio_request(EXYNOS5420_GPIO_X20, "Test"))
  goto err;
gpio_set_pull(EXYNOS5420_GPIO_X20, S5P_GPIO_PULL_DOWN);
gpio_direction_input(EXYNOS5420_GPIO_X20);
Please don't confuse between the exported GPIO number and the physical pin number.
https://wiki.odroid.com/odroid-xu4/hard ... _2x15_pins

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Mon Mar 12, 2018 8:24 pm

After compile the u-boot, I have u-boot-dtb.bin.

I want to update u-boot from the odroid.

so I want to use this method:

Code: Select all

Updating from Linux
You also can update U-boot from Linux with dd command. After building U-boot, copy u-boot-dtb.bin into your ODROID-XU3/4. Then do the command below in order to flash your U-boot image to MicroSD.

$ sudo dd if=u-boot-dtb.bin of=<device/path/of/your/card> seek=63
$ sudo sync
Can you help me with the "<device/path/of/your/card>" ?
I'm using emmc

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Mon Mar 12, 2018 10:35 pm

It must be done on your Linux PC, instead of XU4.

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Mon Mar 12, 2018 11:03 pm

The Toolchain and the Checkout & compile I done on my linux pc.

but the Installation I want to use Updating from Linux method.

the steps are:

Code: Select all

You also can update U-boot from Linux with dd command. After building U-boot, copy u-boot-dtb.bin into your ODROID-XU3/4. Then do the command below in order to flash your U-boot image to MicroSD. 
so I need to copy u-boot-dtb.bin into your ODROID-XU3/4 .
so I put the u-boot-dtb.bin on the odroid desktop.

Now from where I need to run:

Code: Select all

$ sudo dd if=u-boot-dtb.bin of=<device/path/of/your/card> seek=63
$ sudo sync
From my linux pc? how? how do I need to connect it to the odroid?
I'm missing something because I thought I need to run this commends from the odroid.
Can you give me little more information of how doing this?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Tue Mar 13, 2018 11:51 am

You need a USB card reader to connect the SD card to your Linux PC.
You have to be very careful when you try to find the SD card mount point under /dev/sd*.
Otherwise, your PC boot sector will be corrupted by ODROID bootloader and it will be a big disaster.

https://wiki.odroid.com/odroid-xu4/soft ... stallation

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Tue Mar 13, 2018 4:12 pm

Can I do this with USB emmc card reader?
When I plug USB emmc card reader I have 2 option under /dev/sd*
1.boot
2.rootfs

I tried to write the command into the first option (boot) and my odroid isn't startup anymore (Dont worry I have backup)
So I recovery my data again and tried to write the command into the rootfs, My odroid startup but still I cant see any different in the GPIO status.

my droid_gpio_init function looks like this:

Code: Select all

static void odroid_gpio_init(void)
{
	/* Power control button pin */
	if (gpio_request(GPIO_POWER_BT, "Power BT"))
		goto err;
	gpio_set_pull(GPIO_POWER_BT, S5P_GPIO_PULL_NONE);
	gpio_direction_input(GPIO_POWER_BT);

	/* FAN Full Enable */
	if (gpio_request(GPIO_FAN_CTL, "FAN Ctrl"))
		goto err;
	gpio_set_pull(GPIO_FAN_CTL, S5P_GPIO_PULL_NONE);
	gpio_direction_output(GPIO_FAN_CTL, 1);

	/* LCD PWM Port High */
	if (gpio_request(GPIO_LCD_PWM, "LCD PWM"))
		goto err;
	gpio_set_pull(GPIO_LCD_PWM, S5P_GPIO_PULL_NONE);
	gpio_direction_output(GPIO_LCD_PWM, 1);

	if (gpio_request(EXYNOS5420_GPIO_X21, "Test"))
	   goto err;
	gpio_set_pull(EXYNOS5420_GPIO_X21, S5P_GPIO_PULL_NONE);
	gpio_direction_output(EXYNOS5420_GPIO_X21, 0);

	return;
err:
	printf("%s : GPIO Control error!\n", __func__);
}


So I expected to have GPIO 25(GPX2.1) (Pin#24 on 30pin header) set to output with 0V.
there is another file I need to edit before compiling the u-boot?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Tue Mar 13, 2018 4:35 pm

I thought you used an SD card.
I will check how to write the bootloader into the eMMC hidden boot block.

Do you have a USB-UART kit?

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Tue Mar 13, 2018 4:54 pm

Yes I have a USB-UART kit

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Tue Mar 13, 2018 5:53 pm

We've added a couple of more information to the WiKi page for eMMC users.
https://wiki.odroid.com/odroid-xu4/soft ... mmand_line

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Thu Mar 15, 2018 4:52 pm

Hi,
I have a strange behavior,

I update the u-boot binary successfully, GPIO 25(GPX2.1) (Pin#24 on 30pin header) is now set as output as expected.
But when noting is connected to the GPIO 25(GPX2.1) (Pin#24 on 30pin header) , gpio readall command return 0 in GPIO 25(GPX2.1) (Pin#24 on 30pin header) (as expected) but when I connect multimeter to that pin , gpio readall command return 1 and I have 5V in this pin.

So I wanted to have output-low mode in GPIO 25(GPX2.1) (Pin#24 on 30pin header) and when the multimeter is connected I'm getting output-high mode


my droid_gpio_init function looks like this:

Code: Select all

static void odroid_gpio_init(void)
{
   /* Power control button pin */
   if (gpio_request(GPIO_POWER_BT, "Power BT"))
      goto err;
   gpio_set_pull(GPIO_POWER_BT, S5P_GPIO_PULL_NONE);
   gpio_direction_input(GPIO_POWER_BT);

   /* FAN Full Enable */
   if (gpio_request(GPIO_FAN_CTL, "FAN Ctrl"))
      goto err;
   gpio_set_pull(GPIO_FAN_CTL, S5P_GPIO_PULL_NONE);
   gpio_direction_output(GPIO_FAN_CTL, 1);

   /* LCD PWM Port High */
   if (gpio_request(GPIO_LCD_PWM, "LCD PWM"))
      goto err;
   gpio_set_pull(GPIO_LCD_PWM, S5P_GPIO_PULL_NONE);
   gpio_direction_output(GPIO_LCD_PWM, 1);

   if (gpio_request(EXYNOS5420_GPIO_X21, "Test"))
      goto err;
   gpio_set_pull(EXYNOS5420_GPIO_X21, S5P_GPIO_PULL_NONE);
   gpio_direction_output(EXYNOS5420_GPIO_X21, 0);

   return;
BTW in https://wiki.odroid.com/odroid-xu4/soft ... mmand_line you need to add '/' to step 5 (/dev/mmcblk0boot0)

should be:
dd if=/media/boot/u-boot-dtb.bin of=/dev/mmcblk0boot0 bs=512 seek=62

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Thu Mar 15, 2018 7:12 pm

Good to hear you successfully compile and install your own u-boot.
I think you might need to configure the pin direction and level again with your Wiringpi program before running "gpio readall" command since Kernel GPIO initialization code was not modified.

BTW, I've added '/' to step 5. Thank you for the correction.

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Thu Mar 15, 2018 9:29 pm

But my target was to have output-low and I'm getting output-high when something is connected to this pin.

I dont want to have 5V when system is up and change it to output-high just when my software is ready.

But now when I connect multimeter to the gpio I'm getting output-high after reboot, Its not what I expected when I compile the kernel.

leave wiringPi aside, After reboot the actually value in GPIO 25(GPX2.1) (Pin#24 on 30pin header) is 5V when tested with multimeter.

Do I need to compile the kernel too?
If I do, which file do I need to edit?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Thu Mar 15, 2018 10:18 pm

Can you post "gpio readall" output again with modified u-boot?
We will try to find a way.

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Thu Mar 15, 2018 10:33 pm

In this output I only turned odroid on

Code: Select all

odroid@odroid:~/Desktop$ gpio readall
 +------+-----+----------+------ Model ODROID-XU3/4 ------+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | Physical | V | Mode |   Name   | wPi | GPIO |
 +------+-----+----------+------+---+----++----+---+------+----------+-----+------+
 |      |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |      |
 |  209 |   8 | I2C1.SDA | ALT5 | 1 |  3 || 4  |   |      | 5V       |     |      |
 |  210 |   9 | I2C1.SCL | ALT5 | 1 |  5 || 6  |   |      | 0v       |     |      |
 |   18 |   7 | GPIO. 18 |   IN | 1 |  7 || 8  | 1 | ALT5 | UART0.TX | 15  |  172 |
 |      |     |       0v |      |   |  9 || 10 | 1 | ALT5 | UART0.RX | 16  |  171 |
 |  174 |   0 | GPIO.174 | ALT5 | 1 | 11 || 12 | 1 | ALT5 | GPIO.173 | 1   |  173 |
 |   21 |   2 | GPIO. 21 |   IN | 1 | 13 || 14 |   |      | 0v       |     |      |
 |   22 |   3 | GPIO. 22 |   IN | 1 | 15 || 16 | 1 | IN   | GPIO. 19 | 4   |  19  |
 |      |     |     3.3v |      |   | 17 || 18 | 1 | IN   | GPIO. 23 | 5   |  23  |
 |  192 |  12 |     MOSI |   IN | 1 | 19 || 20 |   |      | 0v       |     |      |
 |  191 |  13 |     MISO |   IN | 1 | 21 || 22 | 1 | IN   | GPIO. 24 | 6   |  24  |
 |  189 |  14 |     SCLK |   IN | 1 | 23 || 24 | 1 | IN   | CE0      | 10  |  190 |
 |      |     |       0v |      |   | 25 || 26 | 0 | OUT  | GPIO. 25 | 11  |  25  |
 |  187 |  30 | I2C5.SDA | ALT5 | 1 | 27 || 28 | 1 | ALT5 | I2C5.SCL | 31  |  188 |
 |   28 |  21 | GPIO. 28 |   IN | 1 | 29 || 30 |   |      | 0v       |     |      |
 |   30 |  22 | GPIO. 30 |   IN | 1 | 31 || 32 | 1 | IN   | GPIO. 29 | 26  |  29  |
 |   31 |  23 | GPIO. 31 |   IN | 1 | 33 || 34 |   |      | 0v       |     |      |
 |      |  24 | POWER ON |      |   | 35 || 36 | 1 | IN   | GPIO. 33 | 27  |  33  |
 |      |  25 |    AIN.0 |      |   | 37 || 38 |   |      | 1v8      | 28  |      |
 |      |     |       0v |      |   | 39 || 40 |   |      | AIN.3    | 29  |      |
 +------+-----+----------+------+---+----++----+---+------+----------+-----+------+
odroid@odroid:~/Desktop$ 
And this one I did the following steps

1.Turn off the odroid
2.connect gpio 25 and ground to multimeter
3.Turn on the odroid

multimeter show 5V

Code: Select all

odroid@odroid:~/Desktop$ gpio readall
 +------+-----+----------+------ Model ODROID-XU3/4 ------+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | Physical | V | Mode |   Name   | wPi | GPIO |
 +------+-----+----------+------+---+----++----+---+------+----------+-----+------+
 |      |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |      |
 |  209 |   8 | I2C1.SDA | ALT5 | 1 |  3 || 4  |   |      | 5V       |     |      |
 |  210 |   9 | I2C1.SCL | ALT5 | 1 |  5 || 6  |   |      | 0v       |     |      |
 |   18 |   7 | GPIO. 18 |   IN | 1 |  7 || 8  | 1 | ALT5 | UART0.TX | 15  |  172 |
 |      |     |       0v |      |   |  9 || 10 | 1 | ALT5 | UART0.RX | 16  |  171 |
 |  174 |   0 | GPIO.174 | ALT5 | 1 | 11 || 12 | 1 | ALT5 | GPIO.173 | 1   |  173 |
 |   21 |   2 | GPIO. 21 |   IN | 1 | 13 || 14 |   |      | 0v       |     |      |
 |   22 |   3 | GPIO. 22 |   IN | 1 | 15 || 16 | 1 | IN   | GPIO. 19 | 4   |  19  |
 |      |     |     3.3v |      |   | 17 || 18 | 1 | IN   | GPIO. 23 | 5   |  23  |
 |  192 |  12 |     MOSI |   IN | 1 | 19 || 20 |   |      | 0v       |     |      |
 |  191 |  13 |     MISO |   IN | 1 | 21 || 22 | 1 | IN   | GPIO. 24 | 6   |  24  |
 |  189 |  14 |     SCLK |   IN | 1 | 23 || 24 | 1 | IN   | CE0      | 10  |  190 |
 |      |     |       0v |      |   | 25 || 26 | 1 | OUT  | GPIO. 25 | 11  |  25  |
 |  187 |  30 | I2C5.SDA | ALT5 | 1 | 27 || 28 | 1 | ALT5 | I2C5.SCL | 31  |  188 |
 |   28 |  21 | GPIO. 28 |   IN | 1 | 29 || 30 |   |      | 0v       |     |      |
 |   30 |  22 | GPIO. 30 |   IN | 1 | 31 || 32 | 1 | IN   | GPIO. 29 | 26  |  29  |
 |   31 |  23 | GPIO. 31 |   IN | 1 | 33 || 34 |   |      | 0v       |     |      |
 |      |  24 | POWER ON |      |   | 35 || 36 | 1 | IN   | GPIO. 33 | 27  |  33  |
 |      |  25 |    AIN.0 |      |   | 37 || 38 |   |      | 1v8      | 28  |      |
 |      |     |       0v |      |   | 39 || 40 |   |      | AIN.3    | 29  |      |
 +------+-----+----------+------+---+----++----+---+------+----------+-----+------+
odroid@odroid:~/Desktop$ 

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Fri Mar 16, 2018 4:57 pm

I think the SPI device driver might change the GPIO settings because the driver uses gpx2.1(#25) as a Chip-Select function.

Check "lsmod" output again.
If you can find "spidev" and "spi_s3c64xx", add them into the driver blacklist file. /etc/modprobe.d/blacklist-odroid.conf

If it doesn't exist, we will try to find which portion of the Kernel source should be modified.

Idan_VT
Posts: 29
Joined: Wed Jan 17, 2018 5:46 pm
languages_spoken: english
ODROIDs: xu-4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by Idan_VT » Sun Mar 18, 2018 4:05 pm

No, I dont have spidev or spi_s3c64xx

Code: Select all

odroid@odroid:~/Desktop$ lsmod
Module                  Size  Used by
fuse                   86016  3
cpufreq_conservative    16384  0
cpufreq_userspace      16384  0
cpufreq_powersave      16384  0
joydev                 20480  0
exynos_gpiomem         16384  0
ipv6                  380928  62
uas                    20480  0

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Mon Mar 19, 2018 10:43 am

When we measured the voltage on GPIO 25(pin#24 on 30pin header) after booting with the updated u-boot, the level was zero.
Can you check the level without shifter-shield again?

Also check "cat /sys/kernel/debug/gpio" output to find what other driver use GPIO 25.
If nothing, export GPIO 25 and try to control it on the command line.

ajal
Posts: 3
Joined: Fri Apr 12, 2019 7:15 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by ajal » Fri Jun 07, 2019 10:43 pm

After running u-boot as mention in the above steps and setting gpio 25 as output-low mode and blacklisting "spidev" and "spi_s3c64xx" as above, I could make gpio 25 as low during startup.

PS: I use shifter shield.


Thank you for the explanation!

don444
Posts: 5
Joined: Wed Mar 18, 2020 8:05 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by don444 » Wed Mar 18, 2020 8:33 am

I have an Odroid XU4 that is running Ubuntu 18.04.3 LTS, booting in eMMC. Everything is beautiful, except this issue of several GPIO pins defaulting to output and driven high at bootup.

That is kind of a crazy thing, eh? Recipe for disaster. Would it have been really hard to set the kernel default to low on all pins at boot? Any device that is downstream-switched by an n-channel mosfet with the mosfet gate driven by a gpio pin goes full-on as soon as the computer starts booting up. If that device happens to be a PWM-controlled heater, its smoked before you get a chance to turn it off with software. WTF?

I have tried going thru the u-boot procedure here in order to change the default myself: https://wiki.odroid.com/odroid-xu4/soft ... t_mainline

I have tried 2 different computers both running Ubuntu 18.04 and neither one of them can get thru the above procedure without running into library problems during the 'make'. Since this u-boot process seems to be the only way to make the computer boot up safely, can it be updated to work with Ubuntu 18.04?

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Wed Mar 18, 2020 11:41 am

Show us the error messages you met when you followed the u-boot build instruction.

don444
Posts: 5
Joined: Wed Mar 18, 2020 8:05 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by don444 » Thu Mar 19, 2020 2:23 am

First computer tried: 64-bit laptop with Ubuntu 18.04 LTS:

$ arm-linux-gnueabihf-gcc -v
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.2/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.9-2014.09/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-plugin --enable-gold --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-mode=thumb --disable-multilib --with-float=hard
Thread model: posix
gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09)
$ cd u-boot
~/u-boot$ make odroid-xu4_defconfig
#
# configuration written to .config
#
~/u-boot$ make
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
CFG u-boot.cfg
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.2/cc1: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
scripts/Makefile.autoconf:79: recipe for target 'u-boot.cfg' failed
make[1]: *** [u-boot.cfg] Error 1
make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.


Second computer tried (didn't make it past this step): 64-bit workstation with Ubuntu 18.04.4 LTS:

$ arm-linux-gnueabihf-gcc -v
arm-linux-gnueabihf-gcc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

User avatar
odroid
Site Admin
Posts: 33686
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 511 times
Been thanked: 506 times
Contact:

Re: Change GPIO startup state

Unread post by odroid » Thu Mar 19, 2020 10:25 am

We will try the arm-gcc 4.9.2 on the latest Ubuntu 18.04.4 soon.

don444
Posts: 5
Joined: Wed Mar 18, 2020 8:05 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by don444 » Thu Mar 19, 2020 11:17 am

Thanks! I'm very impressed with the XU4; everything I'm doing is working great except for this.

User avatar
tony.hong
Posts: 83
Joined: Tue Jun 04, 2019 1:49 pm
languages_spoken: korean
ODROIDs: All
Location: korea
Has thanked: 22 times
Been thanked: 28 times
Contact:

Re: Change GPIO startup state

Unread post by tony.hong » Thu Mar 19, 2020 12:59 pm

How did you install 'arm-linux-gnueabihf-gcc'?

My desktop OS is Ubuntu18.04.4. I followed commands in https://wiki.odroid.com/odroid-xu4/soft ... t_mainline.

Code: Select all

arm-linux-gnueabihf-gcc -v                                                             
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.2/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.9-2014.09/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-plugin --enable-gold --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-mode=thumb --disable-multilib --with-float=hard
Thread model: posix
gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 
I don't have libgtk3-nocsd.so.0. And libstdc++.so.6 is included in gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux shown below.

Code: Select all

/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib/libstdc++.so.6
Remove /opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux and reinstall it.
Check for any error messages during installation.

don444
Posts: 5
Joined: Wed Mar 18, 2020 8:05 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by don444 » Fri Mar 20, 2020 10:27 am

I installed 'arm-linux-gnueabihf-gcc' exactly like you did, per the instructions: arm-linux-gnueabihf-gcc -v

I deleted the entire toolchains and u-boot folders on both computers, repeated the processes and got the same results as above (as expected).

The problem seems to be that these library filenames are already loaded by Ubuntu and running, and two versions of the exact same filename cannot be run simultaneously. Below is the output from 'locate' when I search both of the computers for the relevant files. As you can see, they are used in other locations:

First computer (very, very basic setup of 18.04 LTS)
$ locate libgtk3-nocsd.so.0
/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0

Second computer:
$ locate libstdc++.so.6
/opt/nvidia/nsight-systems/2019.5.2/host-linux-x64/libstdc++.so.6
/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib/libstdc++.so.6
/snap/core/8268/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core/8689/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core18/1668/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libstdc++.so.6

User avatar
tony.hong
Posts: 83
Joined: Tue Jun 04, 2019 1:49 pm
languages_spoken: korean
ODROIDs: All
Location: korea
Has thanked: 22 times
Been thanked: 28 times
Contact:

Re: Change GPIO startup state

Unread post by tony.hong » Fri Mar 20, 2020 2:14 pm

https://stackoverflow.com/questions/177 ... d/17723894

Code: Select all

ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
The above error seems due to LD_PRELOAD environment variable.
In .bashrc or .zshrc Etc., find export LD_PRELOAD=libgtk3-nocsd.so.0.

Unless ld path is changed by options, each ld finds the suitable libraries for itself.

My libstdc++.so.6 list is below.

Code: Select all

locate libstdc++.so.6
/home/hhk7734/flutter-engine/sdk/sysroot/usr/lib/aarch64-linux-gnu/libstdc++.so.6
/home/hhk7734/flutter-engine/sdk/sysroot/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.26
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/lib64/libstdc++.so.6
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/lib64/libstdc++.so.6.0.22
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/lib64/libstdc++.so.6.0.22-gdb.py
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/lib64/debug/libstdc++.so.6
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/lib64/debug/libstdc++.so.6.0.22
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc/lib/libstdc++.so.6
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc/lib/libstdc++.so.6.0.22
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc/lib/libstdc++.so.6.0.22-gdb.py
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc/lib/debug/libstdc++.so.6
/opt/toolchains/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc/lib/debug/libstdc++.so.6.0.22
/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib/libstdc++.so.6
/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib/libstdc++.so.6.0.20
/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib/libstdc++.so.6.0.20-gdb.py
/snap/android-studio/83/android-studio/bin/lldb/lib/libstdc++.so.6
/snap/android-studio/84/android-studio/bin/lldb/lib/libstdc++.so.6
/snap/core/8592/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core/8592/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
/snap/core/8592/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21-gdb.py
/snap/core/8689/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core/8689/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
/snap/core/8689/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21-gdb.py
/snap/core18/1650/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core18/1650/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
/snap/core18/1650/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25-gdb.py
/snap/core18/1668/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core18/1668/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
/snap/core18/1668/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25-gdb.py
/usr/arm-linux-gnueabihf/lib/libstdc++.so.6
/usr/arm-linux-gnueabihf/lib/libstdc++.so.6.0.25
/usr/lib/i386-linux-gnu/libstdc++.so.6
/usr/lib/i386-linux-gnu/libstdc++.so.6.0.25
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
/usr/lib32/libstdc++.so.6
/usr/lib32/libstdc++.so.6.0.25
/usr/libx32/libstdc++.so.6
/usr/libx32/libstdc++.so.6.0.25
/usr/share/gdb/auto-load/usr/arm-linux-gnueabihf/lib/libstdc++.so.6.0.25-gdb.py
/usr/share/gdb/auto-load/usr/lib/i386-linux-gnu/libstdc++.so.6.0.25-gdb.py
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25-gdb.py
/usr/share/gdb/auto-load/usr/lib32/libstdc++.so.6.0.25-gdb.py
/usr/share/gdb/auto-load/usr/libx32/libstdc++.so.6.0.25-gdb.py

don444
Posts: 5
Joined: Wed Mar 18, 2020 8:05 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Change GPIO startup state

Unread post by don444 » Sat Mar 21, 2020 3:40 am

The above error seems due to LD_PRELOAD environment variable.
In .bashrc or .zshrc Etc., find export LD_PRELOAD=libgtk3-nocsd.so.0.

The export statement does not exist in .bashrc. I have no .zshrc or .bash_profile files. So this is not the problem here.

I am focusing now on just the "second computer", trying to get past this error:

$ arm-linux-gnueabihf-gcc -v
arm-linux-gnueabihf-gcc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

I can clearly see the file: /opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib/libstdc++.so.6

I've tried several different ways of .bashrc lines, etc. Nothing seems to work. It's as if the wrong path to this library is linked into 'arm-linux-gnueabihf-gcc' and I cannot change it.

User avatar
tony.hong
Posts: 83
Joined: Tue Jun 04, 2019 1:49 pm
languages_spoken: korean
ODROIDs: All
Location: korea
Has thanked: 22 times
Been thanked: 28 times
Contact:

Re: Change GPIO startup state

Unread post by tony.hong » Wed Mar 25, 2020 10:31 am

I checked shared libraries.

Code: Select all

ldd /opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc
...
	libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7dd3000)
...
Try the below command.

Code: Select all

sudo apt-get install libc6-i386 lib32z1 lib32stdc++6

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 10 guests