0

I am trying to shut down the UART when the Raspbian is booting and use its pins as GPIO-s.(Raspbian was installed with NOOBS.) I followed the instructions described here. I downloaded the .cts file at the bottom of the describtion, and removed the UART pins from the configuration, so they will be configured by default as input. (I have Raspberry PI 2 rev v1, so I modified the consistent part of the file.) After that I made the dt-blob.bin file in the boot folder with dtc.

The problem is, that this file will be ignored, there are no changes in the pin configuration at boot time. It is strange, that I don't have to overwrite a file in the boot folder, the dt-blob.bin will newly created. How can I tell the system, that it should use this configuration file?

Milan Tenk
  • 103
  • 1
  • 4
  • You can write a small C code as per mentioned in this thread : https://www.raspberrypi.org/forums/viewtopic.php?t=95302&p=763047 and call it ASAP like in init.d to change behaviour of those pins. But again, it will take some time say, 5 seconds if not more. – dhruvvyas90 Oct 12 '15 at 10:47
  • Unfortunatelly this is not suitable for me, I have two relays on the GPIOs, so I need these pins from the beginning as GPIOs pulled down to 0V. – Milan Tenk Oct 12 '15 at 12:22
  • Well, in that case, I suggest you to change GPIO pins or use custom kernel for this functionality like joan mentioned. – dhruvvyas90 Oct 12 '15 at 12:24

2 Answers2

0

Just use the pre-defined blob by adding the following to /boot/config.txt

dtparam=uart0=off

I do not see any possible gain in writing your own, it will not be executed any earlier.


EDITED TO ADD

This setting seems to have no effect on my B+. I have no idea what it actually does.

joan
  • 71,024
  • 5
  • 73
  • 106
  • I added the line to the config.txt, but the TXD and RXD pins are still on 3.3V when the PI starts. After a few seconds the TXD goes low, but RXD remains 3.3V. Can I achive that both of them will be 0V from the beginning? – Milan Tenk Oct 12 '15 at 08:35
  • They will be pulled low at power-on. Unfortunately the boot loader will set them as ALT0 (UART mode) as it decompresses the Linux kernel. That would account for both lines going high. You will have to build your own kernel if you want to prevent that behaviour. I don't know what happens after that. I had assumed that setting would do what you want, but I have just tried and it does not do what I expected. It has no effect on my B+. – joan Oct 12 '15 at 09:41
0

You might have the problem where the wrong partition is mounted as /boot:

What do you see when you list the files (e.g. $ ls /boot) ?

Mircea Baja
  • 171
  • 6
  • You are right, I put it the file on the wrong partition. After placing the dt-blob.bin file on the recovery partition, it finally works perfectly. – Milan Tenk Oct 16 '15 at 21:23