**** BEGIN LOGGING AT Wed Oct 26 02:59:57 2022 Oct 26 06:18:53 Hi, I need help with beagle board, I am new to the community and I don't know how to program it I want a simple led blinking code can anyone please help me? I am using a beaglebone black board Oct 26 06:19:11 Before moving forward do I need to update its firmware? Oct 26 08:26:39 Nope Oct 26 08:26:49 you can probably connect to it through the IP Oct 26 08:27:12 I believe 192.168.7.2 if on USB or assigned by DHCP if on you lan Oct 26 08:27:31 From there you'll find tutos and can control a bit through Python and cloud9 Oct 26 08:27:53 You can also login with ssh and pass commands to GPIO or write a program too. Oct 26 08:28:56 they left Oct 26 08:34:48 Ok Oct 26 12:39:49 Hello, Oct 26 12:41:18 zmatt sorry I left, the last few days the internet company I use is giving me tons of problems and giving lot of instability. So I read the logs of yesterday, so you say to do what I want, it's not that hard? Oct 26 12:43:25 From what I could gather, I need to modify a few of the files that manage the booting process, but I am still in the process of identifying the files, what do I need to modify and how to modify them Oct 26 12:55:42 Guest6068: you're the pocketbeagle uart0 person? (picking a better name than "Guest" would be helpful) Oct 26 12:56:03 yeah, i am, I will change it Oct 26 12:56:11 I'm pretty sure only a single source file of u-boot needs to be modified, I mentioned which one in the irc log Oct 26 12:56:29 I don't think any DT modification is required Oct 26 12:56:46 hello Oct 26 12:56:49 lol Oct 26 12:57:17 that works I guess :D Oct 26 13:02:50 oh, it seemed you missed my reply... https://libera.irclog.whitequark.org/beagle/2022-10-26#1666785371-1666785389; Oct 26 13:03:29 yeah I missed between changing the names Oct 26 13:03:37 yeah, for future reference, you don't need to disconnect/reconnect to change name, you can use the /nick command instead Oct 26 13:03:52 oh ok Oct 26 13:04:47 didn't you say I need to reproduce the uboot? Oct 26 13:05:29 I mean, to build a modified version of the beagleboard.org u-boot you obviously need to be able to build an unmodified one in the first place Oct 26 13:05:57 I think rcn-ee has a guide for that somewhere but I don't remember where Oct 26 13:07:14 oh, he answered my answer about this problem in the forum, but he only said it was simple, just patch it and recompile and then didn't say anything more haha Oct 26 13:07:27 my question* Oct 26 13:07:49 I don't really have time to go digging myself right now, I'm at work Oct 26 13:08:36 ok, I understand Oct 26 13:08:57 don't want to cause any bother Oct 26 13:09:23 I am already immensely just to have someone paying attention to my dilemma Oct 26 13:28:05 immensely grateful* Oct 26 14:03:34 Blah! Oct 26 14:04:38 I just figured out what happened to all my work. It was a connection issue. So, it was a connection in my brain that needed to be made. Notes, remembering, or whatever, I had nothing. Now, back in it to win it! Oct 26 20:30:37 zmatt, is this the material you were talking about ?https://forum.digikey.com/t/debian-getting-started-with-the-pocketbeagle/567 Oct 26 21:23:09 uart0_person: not the specific page I was thinking of, but it does look like the instructions you need Oct 26 21:23:40 specifically the section on compiling u-boot Oct 26 21:24:18 So those are the guidelines to build a normal or default u-boot and kernel Oct 26 21:24:41 at which point do I need to change to either disable or change the serial console to another uart Oct 26 21:25:32 you just need a custom u-boot, nothing else Oct 26 21:26:05 and you'd patch u-boot just before the step of actually compiling Oct 26 21:27:12 that's the thing, I don't know what I need to customize to make the changes I wnat Oct 26 21:27:13 want Oct 26 21:28:36 uart0_person: https://libera.irclog.whitequark.org/beagle/2022-10-25#1666734124-1666734392; Oct 26 21:28:52 specifically "I think it may suffice to just replace occurrences of ttyS0 by ttyS1 in include/configs/am335x_evm.h" Oct 26 21:29:42 with that uart0 would already be enabled at boot or would i need to do something else? Oct 26 21:30:01 uart0 will still be configured by default but it wouldn't be used by anything Oct 26 21:30:32 assuming you've already done sudo systemctl disable serial-getty@ttyS0.service Oct 26 21:30:52 wait, new doubt Oct 26 21:31:06 (*uart0 will still be enabled and have its pins muxed by default) Oct 26 21:31:18 right now, I have pocketbeagle with a sd already flashed Oct 26 21:31:31 I thought if I followed the guide I would need to reflash it Oct 26 21:33:13 you don't follow the guide, you just follow the guide to build an u-boot and install that onto your existing image (and then hope it still works ;) ... do you have a debian host system (in a vm if need be) to build u-boot? Oct 26 21:33:41 yeah, I do Oct 26 21:34:59 Ok, I download the u-boot, do "I think it may suffice to just replace occurrences of ttyS0 by ttyS1 in include/configs/am335x_evm.h", build the u-boot, and do sudo systemctl disable serial-getty@ttyS0.service? Oct 26 21:34:59 ok, so you can also use that to make a backup of the first 4MB of your sd card (which is where u-boot lives) and install your new u-boot Oct 26 21:35:55 disabling serial-getty@ttyS0.service is something you need to do to prevent the kernel from spawning a getty there, it has nothing to do with u-boot Oct 26 21:36:03 ok Oct 26 21:36:45 shouldn't I also modify something in the kernel files? Since the UART index for Linux console is specified in U-Boot env 'bootargs Oct 26 21:36:51 once you disable that you can't use the serial port to login anymore, but you still get early boot messages Oct 26 21:37:33 u-boot tells the kernel what the console is, so changing u-boot suffices Oct 26 21:38:20 ok, how do you know exactly the file to make the changes? Oct 26 21:38:41 I do and I just told you Oct 26 21:38:47 10 minutes ago Oct 26 21:38:49 Is from experience? Is there a logic ?I spent the last few days trying to figure Oct 26 21:38:56 oh "how" Oct 26 21:39:05 I misread that as "do you know..." Oct 26 21:39:06 I have to stop sending messages one at time Oct 26 21:39:32 and send them together so this doesn't happen anymore Oct 26 21:39:49 I dunno, I just know a lot as a result of having been around and using beaglebones for quite a while ;) Oct 26 21:39:53 you're fine, I just misread it Oct 26 21:41:17 I checked the patch that's done on top of u-boot for beagleboard.org images since that includes customization of the default environment (which includes u-boot's boot scripts) Oct 26 21:41:42 so I could immediately see in which file that's done, since I do generally forget which file exactly that resides in Oct 26 21:42:18 It's that I am starting in this embedded area, and while researching I saw so many people saying a lot of command lines and knowing so many possible files to where the problem maybe, and I struggling with something so basic makes me think maybe I am too dumb for these things Oct 26 21:42:55 it just takes time and experience to absorb these random bits of arcane knowledge Oct 26 21:43:45 the main problem here is that (by unfortunately using the uart0 pins for your pcb) you painted yourself into a corner where you need some relatively obscure knowledge Oct 26 21:44:21 generally speaking people don't build a custom u-boot ;) Oct 26 21:44:27 got it Oct 26 21:45:36 what does "I checked the patch that's done on top of u-boot for beagleboard.org images since that includes customization of the default environment (which includes u-boot's boot scripts)" means? Oct 26 21:45:53 that the uboot already uses a patch that customizes the uboot for the specific board? Oct 26 21:48:44 brb Oct 26 22:03:03 uart0_person67: beagleboard.org images don't use mainline u-boot, they have some patches on top to provide some custom functionality for these images, e.g. for DT overlays and cape autodetection Oct 26 22:04:29 got it Oct 26 22:04:33 part of this is done by customizing u-boot's environment variables, which are used for its built-in shell which executes the boot script... that boot script is itself also stored in environment variables (since u-boot's shell doesn't really support shell functions) Oct 26 22:05:43 these environment variables (or at least their default values) are constructed in a header, which is the one you need to patch Oct 26 22:06:29 the one said right, this one include/configs/am335x_evm.h Oct 26 22:09:12 yeah Oct 26 22:17:13 ok, I make a backup of the u-boot already present in my pocket before anything; Oct 26 22:17:14 I download the u-boot, change the header to another uart; Oct 26 22:17:14 Do the steps to compile; Oct 26 22:17:15 and then install the compiled uboot to my pocket; Oct 26 22:17:15 Is that it? Oct 26 22:19:17 yeah, to backup it suffices to just backup the first 4 MB of the sd card... u-boot consists of two files: MLO and u-boot.img, the former is installed at sector offset 256 (i.e. 128K from the start of the disk) and the latter at sector offset 768 (i.e. 384K from the start of the disk) Oct 26 22:22:18 this backup Oct 26 22:22:21 oh it seems in this u-boot version the second file is named u-boot-dtb.img ... based on the instructions to install u-boot later on that forum page you linked Oct 26 22:23:09 ok Oct 26 22:23:20 dd if=DEVICE of=backup.img bs=4M count=1 Oct 26 22:23:27 (where DEVICE is the sd card) Oct 26 22:23:42 my god you already answered what I was going to ask Oct 26 22:24:01 of course you can alternatively make a backup of the whole card if you want to Oct 26 22:24:58 I use lsblk to figure out the name of the sd card, right? Oct 26 22:25:06 for example Oct 26 22:25:37 try to avoid accidently writing to the boot disk of your host machine ;) Oct 26 22:27:13 this mean the machine connected to pocket Oct 26 22:28:53 the machine you're using to backup and modify your sd card... which is presumably also the machine you're using to compile u-boot Oct 26 22:29:21 ok, that's what I thought Oct 26 22:29:49 sorry for the many questions, I prefer to be through so there aren't unknown variables Oct 26 22:34:40 I think for today my last question Oct 26 22:35:13 following the guide I sent, the steps for installing the uboot Oct 26 22:35:40 where they begin and where they end?I identified the part saying to install u boot and there are a few steps before this Oct 26 22:35:53 just the two dd commands Oct 26 22:36:16 sudo dd if=./u-boot/MLO of=${DISK} count=2 seek=1 bs=128k Oct 26 22:36:16 sudo dd if=./u-boot/u-boot-dtb.img of=${DISK} count=4 seek=1 bs=384k Oct 26 22:36:25 yeah those Oct 26 22:37:11 ok, I compile the custom uboot, it generates these two files Oct 26 22:37:14 (it looks like those commands assume you're in the parent dir of the u-boot source tree) Oct 26 22:37:20 i place them inside uboot Oct 26 22:37:26 and use these commands Oct 26 22:37:34 while at uboot Oct 26 22:38:04 "./u-boot/" here is the u-boot source/build tree, in which those files are generated when you perform the build Oct 26 22:38:21 so if you're already in that dir you can just use if=MLO and if=u-boot-dtb.img Oct 26 22:41:25 lets back up a bit. Oct 26 22:41:26 In my ubuntu machine, I download the uboot from the guide and then change that header file and then follow the steps to compile. Oct 26 22:41:26 before installing anything, I make a copy of the uboot inside my sd card somewhere. Oct 26 22:41:27 Then I replace the uboot folder in my pocket with the one I generated in my ubuntu machine? Oct 26 22:42:31 what u-boot folder? you just install those two files (produced by the u-boot build) using those two dd commands, that's it Oct 26 22:44:23 I feel I am mixing things up Oct 26 22:45:26 I am building the uboot outside the sd card Oct 26 22:45:51 in the ubuntu machine Oct 26 22:46:04 so i get those two files Oct 26 22:46:13 yes, and then you install them using those two dd commands Oct 26 22:46:30 (install them directly onto the sd card) Oct 26 22:46:33 don't i have to transfer them to sd card before? Oct 26 22:47:24 what would be the point of doing that? they don't need to be files on the sd card, they need to be installed in a very specific way outside the filesystem, which is what those dd commands do Oct 26 22:47:49 oh ok Oct 26 22:47:54 I didn't realize you could do that Oct 26 22:47:57 they're installed in the space between the partition table and the rootfs partition Oct 26 22:54:23 Hi, i am back, Oct 26 22:55:07 I didn't knwo you could install something into pocket beagle from a external machine Oct 26 22:55:14 that's why I was confused Oct 26 22:55:23 ehh, I'm assuming you have the sd card in your host machine of course Oct 26 22:55:31 for these steps Oct 26 22:55:35 not in the pocket beagle Oct 26 22:56:06 ok, understood Oct 26 22:56:15 otherwise making a backup is useless since you wouldn't be able to restore it if the pocketbeagle fails to boot :P Oct 26 22:57:03 ooooh, now I understand the backup commands too Oct 26 22:57:13 i thought you were making a copy inside the sd Oct 26 22:57:22 but it is also in the machine Oct 26 22:57:34 i waa thinking it didn't make sense Oct 26 22:57:49 hehe, hopefully now everything makes more sense Oct 26 22:57:55 yep Oct 26 22:58:51 ok, the sd is connected to ubuntu machine, I make the backup, but not all of the sd card Oct 26 22:59:11 i download the uboot, make the changes into header file Oct 26 22:59:12 I mean, feel free to backup the whole card if you want to Oct 26 22:59:27 compile Oct 26 23:00:00 and inside where the files are, i use the commands to install Oct 26 23:00:26 then i turn om the pocket and see if it boots Oct 26 23:00:35 on* Oct 26 23:01:21 if you're inside the directory where the files are (rather than the parent dir), be sure to change the dd commands accordingly (e.g. if=MLO instead of if=./u-boot/MLO) Oct 26 23:01:31 other than that, yep Oct 27 00:25:34 Hey guys. Sorry and not sorry about my odd presentation this morning. I am finally figuring out what it is that needs to take place for me to build an image. Phew. Oct 27 00:25:59 I lost it due to an old 'puter w/ random hardware. I just got it back! The old swing of things! Oct 27 00:26:37 FIY DIY! **** ENDING LOGGING AT Thu Oct 27 02:59:57 2022