Device Tree for SPI0 not loading during Beaglebone Black Boots up - beagleboneblack

I am presently using Debian GNU/Linux 7.9 (wheezy) [Kernel version 3.8.13-bone70] on the BBB. Everything works fine until I reboot the BBB. Before rebooting, I do the following to verify If the SPI0 is enabled.
root#beaglebone:/sys/devices/bone_capemgr.9# echo ADAFRUIT-SPI0 > slots
root#beaglebone:/sys/devices/bone_capemgr.9# cat slots
0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
**8: ff:P-O-L Override Board Name,00A0,Override Manuf,ADAFRUIT-SPI0**
The 8th slot is loaded with SPI 0
root#beaglebone:~# ls -al /dev/spidev*
crw-rw---T 1 root spi 153, 0 Feb 14 05:53 /dev/spidev1.0
Its showing spidev1.0, so its fine
root#beaglebone:~# cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups
group: spi0_pins_s0
pin 84 (44e10950),
pin 85 (44e10954),
pin 86 (44e10958),
Its showing the SPI pins.
root#beaglebone:~# sudo nano /boot/uEnv.txt
I opened the uEnv.txt file and added this line, so that the SPI0 DT will load during system boot up
optargs=capemgr.enable_partno=ADAFRUIT-SPI0
Problem: Why isn't my SPI0 DT being loaded during system boot up?, after a reboot I did the first three steps mentioned above to check, but noticed that the DT fails to load after rebooting. why is this happening?

After a while of researching, I got the solution for this. Sadly, entering "optargs=capemgr.enable_partno=ADAFRUIT-SPI0" in the uEnv.txt does not load the device tress during system boot up.
One solution I found was to include line "echo ADAFRUIT-SPI0 > /sys/devices/bone_capemgr.9/slots" in /etc/rc.local as mentioned here!.
Another solution is also simple, just include the line "CAPE=ADAFRUIT-SP0" in /etc/default/capemgr file. Then reboot and all should work fine.

Related

NodeMCU ESP8266 cannot upload sketch - timeout error

Using arduino-cli, the arduino-ide, or directly the esptool.py (from https://github.com/espressif/esptool) I obtain the following error when uploading a simple (correct) sketch.
x#y:~/blink$ ~/tools/arduino-cli upload -p /dev/ttyUSB0 --fqbn esp8266:esp8266:nodemcuv2
esptool.py v3.1
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____
Traceback (most recent call last):
File "/home/x/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py", line 66, in <module>
esptool.main(cmdline)
File "/home/x/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 4074, in main
esp = esp or get_default_connected_device(ser_list, port=args.port, connect_attempts=args.connect_attempts,
File "/home/x/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 121, in get_default_connected_device
_esp.connect(before, connect_attempts)
File "/home/x/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 639, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
Error during Upload: Failed uploading: uploading error: exit status 1
esptool.py v3.1
The problem was that my last apt upgrade updated the kernel from the 5.4.0-86-generic to 5.4.0-88-generic (I checked the update in /var/log/apt/history.log.1.gz). The driver CH341 in 5.4.0-88 is not working properly (the ESP I'm using require CH340G drivers). The solution is to go back to the 5.4.0-86 drivers and in the following I list what I've done.
disconnect any ESP or board connected to any USB. Then test that the CH341 module (which allows the serial communication with the EPS) is loaded. You can use this code to test the correct unload/load of the module in steps 2, 3.
x#y:~$ lsmod | egrep serial
usbserial 53248 2 cp210x,ch341
here is where modules of the current (5.4.0-88) and previous (5.4.0-86) kernel are
x#y:~$ ls -larh /lib/modules/
total 164K
drwxr-xr-x 6 root root 4,0K set 29 09:19 5.4.0-88-generic
drwxr-xr-x 6 root root 4,0K set 23 09:45 5.4.0-86-generic
[...]
unload current (5.4.0-88) CH341 module with the command
sudo rmmod /lib/modules/5.4.0-88-generic/kernel/drivers/usb/serial/ch341.ko
load previous (5.4.0-86) CH341 module with the command
sudo insmod /lib/modules/5.4.0-86-generic/kernel/drivers/usb/serial/ch341.ko
That's it :) You should now be able to upload a new sketch to your ESP8266.

uboot fails to execute load cmd from uboot.env

I am working with
U-boot v2021.10
BeagleBone Black rev C
I've created an uboot.env image with mkenvimage tool from file
loadfromsd=load mmc 0:1 0x82000000 /zImage; load mmc 0:1 0x88000000 /am335x-boneblack.dtb
set_bootargs=setenv bootargs console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
uenvcmd=setenv auotload no; run set_bootargs; run loadfromsd; printenv bootargs; bootz 0x82000000 - 0x88000000
The problem is in files loading to memory with load cmd in first line.
Full message from start is:
U-Boot SPL 2021.10 (Oct 14 2021 - 20:41:20 -0700)
Trying to boot from MMC1
U-Boot 2021.10 (Oct 14 2021 - 20:41:20 -0700)
CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM: 512 MiB
ti_sysc target-module#9000: failed to get fck clock
WDT: Started with servicing (60s timeout)
NAND: nand_base: timeout while waiting for chip to become ready
nand_base: No NAND device found
0 MiB
MMC: ti_sysc target-module#7000: failed to get fck clock
OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from FAT... OK
<ethaddr> not set. Validating first E-fuse MAC
Net: eth2: ethernet#4a100000, eth3: usb_ether
=> run uenvcmd
4295456 bytes read in 282 ms (14.5 MiB/s)
'ailed to load '/am335x-boneblack.dtb
bootargs=console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
Kernel image # 0x82000000 [ 0x000000 - 0x418b20 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
Actual error is
=> run uenvcmd
4295456 bytes read in 282 ms (14.5 MiB/s)
'ailed to load '/am335x-boneblack.dtb
P.S. My u-boot fails to recognize ${} substitutions properly, and usage of
console=ttyS0,115200n8
bootpartition=mmcblk0p2
set_bootargs=setenv bootargs console=${console} root=/dev/${bootpartition} rw rootfstype=ext4 rootwait
caused and error
syntax error:
rootfstype=ext4 rootwait0n8
this 0n8 was appended after rootwait and shouldn't be there. So I've written this "straight" file without variables.
Thanks to sawdust for info that carriage return character matters and overrides first letter of error msg - I've got an idea that it also matters for path to file in load cmd, and it matters.
If I use space+\r, NOT just \r - everything works fine.

Beaglebone Black doesn't boots up with the yocto-image

I am working on yocto-project to create images for BBB.I cloned the project git clone -b pyro git://git.yoctoproject.org/poky then initiated the build process. Baked it with bitbake core-image-sato and got the build directory with files.
I created 2 partitions on SD card with 64M for root and rest(15+GB) for boot.
Copied MLO and u-boot-beaglebone.img to the root partition.
Untared the core-image-sato-beaglebone.tar.bz2on root partition and then copied zImage-beaglebone.bin, zImage-am335x-bone.dtb, zImage-am335x-boneblack.dtb under boot partition.
When I tried to boot BBB found that u-boot expects uEnv.txt and get stuck there. The yocto build directory doesn't have any uEnv.txt, so how to write own uEnv.txt ? This is the u-boot prompt.
Hit any key to stop autoboot: 0
gpio: pin 53 (gpio 53) value is 1
mmc0 is current device
micro SD card found
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 0
reading uEnv.txt
** Unable to read file uEnv.txt **
gpio: pin 55 (gpio 55) value is 1
** File not found /boot/uImage **
U-Boot#
I added uEnv.txt in root partition with text as
mmcdev=0
mmcpart=1
bootpart=0:1
This time u-boot tries to read a uImage from /boot directory but I have zImage whats this conflict now? How should I resolve it?
SD/MMC found on device 0
reading uEnv.txt
32 bytes read in 4 ms (7.8 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
gpio: pin 55 (gpio 55) value is 1
reading /boot/uImage
** Unable to read file /boot/uImage **
U-Boot#
It seems that U-boot is not able to find the uEnv.txt file. Try these configurations. You might need to modify some of the configuration based on your environment.
sudo vim uEnv.txt
kernel_file=zImage
bootdir=/boot
mmcdev=0
mmcpart=2
loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}/${kernel_file}
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${bootdir}/${fdtfile}
console=ttyO0,115200n8
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc
mmcargs=setenv bootargs console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs}
uenvcmd=run loadzimage; run loadfdt; run mmcargs; bootz ${loadaddr} - ${fdtaddr}
Copy zImage and dtb to the boot partition :
sudo cp -v /<path_to_kernel>/arch/arm/boot/zImage <path_to_boot>/boot/
sudo cp -v /<path_to_kernel>/arch/arm/boot/dts/am335x-boneblack.dtb <path_to_boot>/boot/

Buildroot - RPI3 - Find the BCM43438 firmware to enable wireless

i'm a beginner.
i use a RPI3 and a buildroot build system and try to enable wireless.
I followed several links without success.
In particulary, i followed this link : https://delog.wordpress.com/2014/10/10/wireless-on-raspberry-pi-with-buildroot/
and verify my linux kernel wireless options are activated, but no results.
However, the options i used on the buildroot . config file seems to be good :
debian-host:/build/buildroot# egrep -i "wireless|wpa|80211" .config
# BR2_PACKAGE_WIRELESS_REGDB is not set
BR2_PACKAGE_WIRELESS_TOOLS=y
BR2_PACKAGE_WIRELESS_TOOLS_LIB=y
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
BR2_PACKAGE_WPA_SUPPLICANT_WIFI_DISPLAY=y
# BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING is not set
BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
BR2_PACKAGE_WPA_SUPPLICANT_EAP=y
BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT=y
BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG=y
BR2_PACKAGE_WPA_SUPPLICANT_WPS=y
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
# BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD is not set
# BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW is not set
BR2_PACKAGE_WPAN_TOOLS=y
I installed a minibian an another rpi3, i noticed a firmware was used and i installed it by a :
apt-get install firmware-brcm80211
If the firmware is not installed, I noticed that iwlist wlan0 scan have empty results. On my RPI3-buildroot-system, after booting, lsmod show no modules.
I need to load manually by modprobe or by /etc/modules. So i load the same modules used on minibian, so i did (i loaded bluetooth mods also)
uname -a
Linux pi3 4.9.13-rt12-v7 #1 SMP Mon Mar 20 14:04:21 CET 2017 armv7l GNU/Linux
pwd
/lib/modules/4.9.13-rt12-v7/kernel/drivers
find . -name "*brcm*.ko"
./net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
./net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko
modprobe 8192cu
modprobe brcmfmac
modprobe brcmutil
modprobe hci_uart
modprobe bnep
and the lsmod show :
lsmod
Module Size Used by Not tainted
8192cu 581125 0
hci_uart 19956 0
btbcm 7992 1 hci_uart
bnep 12051 0
bluetooth 364941 3 hci_uart,btbcm,bnep
brcmfmac 222136 0
brcmutil 9156 1 brcmfmac
cfg80211 543530 1 brcmfmac
rfkill 20944 2 bluetooth,cfg80211
ipv6 405794 18 [permanent]
but
iwlist wlan0 scan
wlan0 Interface doesn't support scanning.
I don't arrive to have the same result as my minibian distro with my apt-get ..
What is the way to retrieve the buildroot process to have the same result that on my minibian ?
I've forget something ?
Thanks for helping me.
When using make menuconfig, enable rpi-wifi-firmware under Target packages > Hardware handling > Firmware to include the firmware files.
For WiFi on the Raspberry Pi, you need to enable the following packages in your defconfig file :
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_RPI_WIFI_FIRMWARE=y
If you want to reference any other things, I have an older buildroot external tree here for the Raspberry Pi.

Xcode 4.2 doesn't output exit code?

Since updating to iOS 5 and Xcode 4.2, it appears that Xcode no longer prints "Program ended with exit code: #" on completion of a run. Has anyone else noticed this and is there any way to enable it again? I have an automated testing tool that relies on this output to determine if tests pass or not, so it would be very helpful to have it back.
UPDATE: I looked into this in more detail, and it seems to be a deeper problem. It appears that whenever I run an app, it crashes with a segmentation fault on exit. Sometimes this occurs just before the exit code is printed, sometimes right after, which is why the exit code message appears inconsistently. The seg fault message appears in the device's console, though there is nothing in the Xcode debug output.
I just noticed this too. It seems that in Xcode 4.1 (tty /dev/ttys000) gdb is started like this:
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys000
But in Xcode 4.2 - No tty /dev/ttys000:
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
To fix this you can do the following from a command line (Terminal.app/iTerm/etc):
echo 'tty /dev/ttys000' >> ~/.gdbinit
# Or, put it into the global gdb config:
# echo 'tty /dev/ttys000' >> /etc/gdb.conf
Then restart Xcode, and you have your exit code back!
Seems that Xcode 4.2's gdb wrapper has changed since 4.1
[ 13:29 Jonathan#MacBookPro / ]$ ls -l /Developer/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB
-rwxrwxr-x 1 root admin 351936 Sep 20 13:23 /Developer/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB
-rwxrwxr-x 1 root admin 353776 Oct 8 14:21 /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB
[ 13:33 Jonathan#MacBookPro / ]$ ls -l /Developer/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB
-rwxrwxr-x 1 root admin 1976144 Sep 20 13:23 /Developer/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB
-rwxrwxr-x 1 root admin 1948240 Oct 8 14:21 /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB

Resources