Booting Discovery Kit from SD card and applying device tree overlays #461
-
Hi,
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Hi @NavadeepGaneshU it sounds like you programmed the GPIO example into the eNVM? This has probably overwritten the HSS which is used as a boot loader for Linux. Can you try reprogramming the discovery kit reference design using FPExpress (this includes the HSS) and see if that helps your issue. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response @hughbreslin. Yes, I was doing that with the GPIO example and after programming the .job file from the reference design example, it worked out. |
Beta Was this translation helpful? Give feedback.
-
No problem :) Ok cool I'm glad thats working! In our current device tree we haven't enabled the GPIOs yet (it will be done in a future release) but they are connected in the reference design. The easiest way to enable and control them is using a device tree overlay. I have attached a sample to do this: gpio_overlay_src.zip. You'll need to extract the zip file, GitHub doesn't let me share the source directly. You should get 'gpio_overlay_src.dtso' I used SCP to transfer this to my kit over ethernet. If you do this you can use the following steps to apply it:
This then enables the GPIO. To control it I use libgpiod. For example:
GPIO17 is LED1 which you can see in the overlay file connected to MSS GPIO2 :) I hope this helps. In the future release you will only need the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the detailed explanation. "Ask Hugh" is a pretty great phrase. Now I can use python script to toggle and control them in any order. Adding onto this, I tried extending the device-tree overlay for I2C. Knowing there is libi2cd present and I am seeing
but the device i2c peripheral doesn't seem to appear under |
Beta Was this translation helpful? Give feedback.
-
Haha great 👍 if you want you can add a script to automatically apply the overlay at boot so you don’t have to do it manually as well on each startup :) Looking at what you shared for I2C, MSS I2C_0 is enabled on the kit. I had a look at our base device tree entry here and I can see a few differences:
I’ll be able to try it out tomorrow but I’d say get most of it lined up (and marked enabled!) and fingers crossed it should work :) |
Beta Was this translation helpful? Give feedback.
-
Hey @NavadeepGaneshU I tried out the following:
And I can see I2C-0 show up in /dev/i2c* :) I don't have anything to test it with but hopefully this is enough to get you on the right track. I got the clock value from the mpfs-clock.h file. This thread has actually been quite useful and has gone beyond the scope a bit but could be a useful discussion item so its more public. I'll get it converted over :) |
Beta Was this translation helpful? Give feedback.
-
Thanks for following up @hughbreslin. The device gets added to the |
Beta Was this translation helpful? Give feedback.
No problem :) Ok cool I'm glad thats working! In our current device tree we haven't enabled the GPIOs yet (it will be done in a future release) but they are connected in the reference design. The easiest way to enable and control them is using a device tree overlay.
I have attached a sample to do this: gpio_overlay_src.zip. You'll need to extract the zip file, GitHub doesn't let me share the source directly. You should get 'gpio_overlay_src.dtso'
I used SCP to transfer this to my kit over ethernet. If you do this you can use the following steps to apply it:
dtc gpio_overlay_src.dtso -o gpio_overlay_src.dtbo
- there might be some warnings, thats ok