[ALL] Debian 9 (Stretch) now out


#21

OK. Just tried this.

  1. Renamed /lib/firmware/BB-W1-P8.1-00A0.dtbo to /lib/firmware/BB-W1-P8-00A0.dtbo
  2. Changed /boot/uEnv.tx to remove absolute uboot_overlay definition.
    #uboot_overlay_addr3=/lib/firmware/BB-W1-P8.11-00A0.dtbo

Boot now reports this:
BeagleBone: cape eeprom: i2c_probe: 0x57: 1-P8,-00A0.dtbo [0x79b8def]

One-Wire no longer functions.


#22

This seems to fix it.

https://paste.debian.net/1005574/

Model: BeagleBone:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57: /lib/firmware/BB-W1-P8.11-00A0.dtbo [0x956174f]

board_name=[A335BONE] ...

uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: unable to find [mmc 0:1 /lib/firmware/BB-W1-P8.11-00A0.dtbo]...
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ...
695 bytes read in 375 ms (1000 Bytes/s)
uboot_overlays: [uboot_detected_capes=BB-W1-P8.11,] ...

I’ll have a pre-built version of u-boot for testing in a little bit…

Regards,


#23

Quick watch out here!
in the distribution you linked me to the /lib/firmware folder has this file.
/lib/firmware/M-BB-OSD3358-SM-RED-00A0.dtbo
That breaks your 40 character cape_overlay[40] size

/* /lib/firmware/BB-CAPE-DISP-CT4-00A0.dtbo */
/* 14 + 16 + 1 + 4 + 5 = 40 */
char cape_overlay[40];
  • char cape_header_verify[16];
  • char cape_header_offset=0;
    char cape_overlay_pass_to_kernel[18];
    const char s[2] = “.”;
    char *token;

John


#24

Hi John,

Correct, that one is a special case, and I broke the 40 character rule (and maybe went crazy) to make sure no one tried using it.

It’s for a specific board, and u-boot will load it based on board eeprom, but it’s not something for an end user to use…

I have a version of the bootloader i’d like you test:

sudo /opt/scripts/tools/developers/update_bootloader.sh --beta

it should say: (r9)


-----------------------------
log: dd if=/tmp/tmp.dItslPuFrd/dl/MLO-am335x_evm-v2018.01-r9 of=/dev/mmcblk0 seek=1 bs=128k
log: dd if=/tmp/tmp.dItslPuFrd/dl/u-boot-am335x_evm-v2018.01-r9.img of=/dev/mmcblk0 seek=1 bs=384k

Are you 100% sure, on selecting [am335x_evm] (y/n)?

Please retest with the lcd and the one-wire, i’m pretty sure it’s safe in my local testing…

Regards,


#25

Close but not quite.

Board: BeagleBone Black
not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone: cape eeprom: i2c_probe: 0x54: /lib/firmware/BB-BONE-LCD4-01.-00A1.dtbo [0xafde47f]
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57: W1-P8.11BB-W1-P8.11BB-W1-P8.11,-00A0.dtbo [0x2ccd6cf]
Net: eth0: MII MODE
c


#26

Thanks for testing.

sudo /opt/scripts/tools/developers/update_bootloader.sh

Will re-set it to “r8”…

It looks like i didn’t clear the array between the 4 eeprom loops, and also broke the first read.

I’ll take a look at this tonight, all my LCD’s are at home, and i have a proto-cape programmed with your eeprom for testing…

Regards,


#27

Will do. Setting the uEnv.txt overlay did make the w1_slave work again but the strings are really messed up. What’s the equivalent of cat $SLOTS now?

My client’s engineers are in Baltimore and have left for the day so I had a break to do some of this testing.

I’d still like to get rid of the:
[* ] A stop job is running for Session 1 of user debian (13s / 1min 30s)

A google search of this issue has a number of different solutions all with the appearance of being shots in the dark. Do this 40 times and an hour labour has been lost.


#28

We don’t have a direct replacement for slots, anything detected by U-Boot we are trying to pass thru the cmdline, you can see this earlier:

debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1
root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait uboot_detected_capes=BB-W1-P8,
coherent_pool=1M net.ifnames=0 quiet]
uboot_detected_capes=BB-W1-P8,

Everything else thru the report of “version.sh”…

There was a project a few years back to store and save U-Boot’s console output and have us retrieve it in the kernel user-space log. With that we could re-create a more accurate “slots” file, but that project died after one RFC…

Regards,


#29

Robert,
Did you manage to acquire the EEROM information with embedded ‘.’ yet?
Thanks
John


#30

Hi John,

I think i have it working…

BeagleBone Black:
debug: process_cape_part_number:[BB-BONE-LCD7-01]
debug: process_cape_part_number:[42422D424F4E452D4C4344372D3031]
BeagleBone: cape eeprom: i2c_probe: 0x54: /lib/firmware/BB-BONE-LCD7-01-00A3.dtbo [0xfc93c8f]
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
debug: process_cape_part_number:[BB-W1-P8.11]
debug: process_cape_part_number:[42422D57312D50382E3131]
BeagleBone: cape eeprom: i2c_probe: 0x57: /lib/firmware/BB-W1-P8.11-00A0.dtbo [0x956174f]
uboot_overlays: loading /lib/firmware/BB-BONE-LCD7-01-00A3.dtbo ...
5778 bytes read in 115 ms (48.8 KiB/s)
uboot_overlays: unable to find [mmc 0:1 /lib/firmware/BB-W1-P8.11-00A0.dtbo]...
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ...
1105 bytes read in 396 ms (2 KiB/s)
uboot_overlays: [uboot_detected_capes=BB-BONE-LCD7-01,BB-W1-P8.11,] ...

I’m going to push to the builder momentary…

edit: patch pushed: https://github.com/RobertCNelson/Bootloader-Builder/commit/4beb45c3a212f9181a0d4c01d97de89e38a7282a
waiting for builder to build all…

edit2: it’s now out in the beta option:

I have a version of the bootloader i’d like you test:

sudo /opt/scripts/tools/developers/update_bootloader.sh --beta

it should say: (r10)

-----------------------------
log: dd if=/tmp/tmp.dItslPuFrd/dl/MLO-am335x_evm-v2018.01-r10 of=/dev/mmcblk0 seek=1 bs=128k
log: dd if=/tmp/tmp.dItslPuFrd/dl/u-boot-am335x_evm-v2018.01-r10.img of=/dev/mmcblk0 seek=1 bs=384k

Are you 100% sure, on selecting [am335x_evm] (y/n)?

Regards,


#31

Robert,
Looks like r10 is working.
I ran the python program and it queries and displays the DS1822 One Wire data.

But I’m not sure if this is an error or not.
Below the boot information after logging in as root I ran.
/opt/scripts/tools/version.sh

And unlike the last time, it’s not showing the BB-W1-P8.11

Here’s the boot info.

U-Boot SPL 2018.01-00002-gc5e9672877 (Jan 17 2018 - 16:18:36)
Trying to boot from MMC1

U-Boot 2018.01-00002-gc5e9672877 (Jan 17 2018 - 16:18:36 -0600), Build: jenkins-github_Bootloader-Builder-29

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc’
No match for driver 'omap_hsmmc’
Some drivers were not found
Reset Source: Global warm SW reset has occurred.
Reset Source: Power-on reset has occurred.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Board: BeagleBone Black
not set. Validating first E-fuse MAC
BeagleBone Black:
debug: process_cape_part_number:[BB-BONE-LCD4-01]
debug: process_cape_part_number:[42422D424F4E452D4C4344342D3031]
BeagleBone: cape eeprom: i2c_probe: 0x54: /lib/firmware/BB-BONE-LCD4-01-00A1.dtbo [0xfe93c1f]
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
debug: process_cape_part_number:[BB-W1-P8.11]
debug: process_cape_part_number:[42422D57312D50382E3131]
BeagleBone: cape eeprom: i2c_probe: 0x57: /lib/firmware/BB-W1-P8.11-00A0.dtbo [0x956174f]
Net: eth0: MII MODE
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] …
board_rev=[00C0] …
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Bad device 0:2 0x82000000 **
** Bad device 0:2 0x82000000 **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1…
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt …
Checking for: /boot.scr …
Checking for: /boot/boot.scr …
Checking for: /boot/uEnv.txt …
gpio: pin 55 (gpio 55) value is 1
2069 bytes read in 45 ms (43.9 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt…
gpio: pin 56 (gpio 56) value is 1
Running uname_boot …
loading /boot/vmlinuz-4.9.76-ti-r91 …
9961280 bytes read in 665 ms (14.3 MiB/s)
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot.dtb] …
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot.dtb …
loading /boot/dtbs/4.9.76-ti-r91/am335x-boneblack-uboot.dtb …
61174 bytes read in 53 ms (1.1 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] …
uboot_overlays: loading /lib/firmware/BB-BONE-LCD4-01-00A1.dtbo …
5778 bytes read in 313 ms (17.6 KiB/s)
uboot_overlays: loading /lib/firmware/BB-W1-P8.11-00A0.dtbo …
974 bytes read in 677 ms (1000 Bytes/s)
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo …
1105 bytes read in 626 ms (1000 Bytes/s)
uboot_overlays: loading /lib/firmware/AM335X-PRU-UIO-00A0.dtbo …
853 bytes read in 386 ms (2 KiB/s)
uboot_overlays: [uboot_detected_capes=BB-BONE-LCD4-01,BB-W1-P8.11,] …
uboot_overlays: cape universal disabled, external cape enabled or detected…
loading /boot/initrd.img-4.9.76-ti-r91 …
6269510 bytes read in 434 ms (13.8 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait uboot_detected_capes=BB-BONE-LCD4-01,BB-W1-P8.11, coherent_pool=1M net.ifnames=0 quiet] …
debug: [bootz 0x82000000 0x88080000:5faa46 88000000] …

Flattened Device Tree blob at 88000000

Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8fa05000, end 8ffffa46 … OK
reserving fdt memory region: addr=88000000 size=71000
Loading Device Tree to 8f991000, end 8fa04fff … OK

Starting kernel …

[ 0.000950] clocksource_probe: no matching clocksources found
[ 1.390528] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 1.683838] omap_voltage_late_init: Voltage driver support not added
[ 1.690970] PM: Cannot get wkup_m3_ipc handle
[ 1.796948] PM: Cannot get wkup_m3_ipc handle

Debian GNU/Linux 9 beaglebone ttyS0

BeagleBoard.org Debian Image 2018-01-14

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

Last login: Tue Jan 16 22:03:52 UTC 2018 on ttyS0
Linux beaglebone 4.9.76-ti-r91 #1 SMP PREEMPT Fri Jan 12 00:09:08 UTC 2018 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@beaglebone:~# /opt/scripts/tools/version.sh
git:/opt/scripts/:[b372df3221bb67a9a09c6b89df5110ca32a9e482]
eeprom:[A335BNLT00C02716BBBK0E8D]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-01-14]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.01-00002-gc5e9672877]
kernel:[4.9.76-ti-r91]
nodejs:[v6.12.3]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20180104.0-0rcnee1~stretch+20180104]
pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee2~stretch+20180104]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~stretch+20170830]
dmesg | grep pinctrl-single
[ 1.384539] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
END
root@beaglebone:~#


#32

BTW, for version.sh shouldn’t the [U-Boot 2018… have r10 in there? I don’t see anything that would give you a clue that I ran the --beta…


#33

Awesome glad it worked, i need to test a few other boards tomorrow then i’ll move it from beta to default…

version.sh use to dump the rX value, but unlike the “2018.01-00002-gc5e9672877” value it’s not at a fixed location and varies between compiles…

So i ripped it out.

Regards,


#34

Thank you for your help Robert.
Don’t know if you’ve tested this but since I have the capes I thought I might as well give them a try.

So I pulled my proto cape and the LCD4 and put in the Logic Supply CBB Serial cape which was found:

uboot_overlays: loading /lib/firmware/cape-CBB-Serial-r01.dtbo …
1703 bytes read in 185 ms (8.8 KiB/s)

Then a quick check to see if candump is installed.
root@beaglebone:/lib/firmware# which candump
/usr/bin/candump

And then set it up and check
root@beaglebone:/lib/firmware# ip link set can0 up type can bitrate 250000
root@beaglebone:/lib/firmware# candump -t A can0
(2018-01-18 02:55:47.176600) can0 729 [1] 7F
(2018-01-18 02:55:48.186637) can0 729 [1] 7F
(2018-01-18 02:55:49.196582) can0 729 [1] 7F

And there we go. CANopen network with a single node (0x29) showing heartbeats once per second that the node is in Pre_Op state.

Now with the previous slots drivers to use RS232 handshaking from the Logic Supply cape user manual

"Next you’ll need to apply the appropriate flow control Device Tree overlay. For UART2:
echo BB-UART2-RTSCTS > /sys/devices/bone_capemgr.*/slots

The UART2 can now use RTS/CTS handshaking."

The user manual also says this can be done with UART4 but there is no BB-UART4-RTSCTS-00A0-dtbo in /lib/firmware.

There is a BBB-UART4-RS485-00A0.dtbo which looks to be built from your driver here:

I’m guessing that by now the kernel probably has IOCtl flow control for RS485 enabled.

So the question is:
To enable RS485 is a change made in /boot/uEnv.txt so that we have:
uboot_overlay_addr0=/lib/firmware/BBB-UART4-RS485-00A0.dtbo

Then in Python for example:
import time, struct, fcntl, serial
uart4_file = '/dev/ttyO4’
baud = 115200
ser = serial.Serial(uart4_file, baud)
fd=ser.fileno()
serial_rs485 = struct.pack(‘hhhhhhhh’, 1, 0, 0, 0, 0, 0, 0, 0)
fcntl.ioctl(fd,0x542F,serial_rs485)
while True:
ser.write(“Testing”)
time.sleep(1)

If you want I’ll do some testing with this.
Cheers
John


#35

Hi Robert,
Well crap! The BB-UART4-RS485 dts doesn’t match the hardware for the Logic Supply RS485 cape. There is a jumper for selecting DE_/RE to be either GPIO1_16 (P9.15) or UART4_RTS (P8.33) while the dts file references
"P9.27", // uart4_de/re

I suppose the driver was configured for some other RS485 cape?

This dts file referenced in an earlier posting was last changed by you on 27JAN18.
Perhaps what should happen is the file be updated to have a link or at least a description for which cape it was intended. Perhaps that should become standard practice? A list of compatible capes?

This python code runs but I don’t see UART4 RTS move from 0V probably because the driver hasn’t captured that pin.

!/usr/bin/python

import time, struct, fcntl, serial
uart4_file = '/dev/ttyO4’
baud = 9600
ser = serial.Serial(uart4_file, baud)
fd=ser.fileno()
serial_rs485 = struct.pack(‘hhhhhhhh’,1,0,0,0,0,0,0,0)
fcntl.ioctl(fd,0x542F,serial_rs485)
while True:
print(“Writing to RS485 port”)
ser.write(“Testing”)
time.sleep(1)

Anyway a lot of rambling here and I’ve not even started yet on the Digikey 1471-1429-ND MIKROE-1857 CLICK Expansion cape although that looks easier.


#36

Hi Robert,
Going to simplify this a bit.

Stock cape_CBB_Serial_r01 as enumerated from the EEROM on the cape. Still running your latest beta r10.

Jumpers set for RS485, DE_/RE jumper set to P9_15

Scope Trace 1,2 are on RS485 across 120 Ohm resistor (UART4)
Scope Trace 3 is P9_15
Scope Trace 4 is P8_33 (aka UART4_RTS)

Python code:
# !/usr/bin/python

import time, struct, fcntl, serial
import Adafruit_BBIO.GPIO as GPIO
GPIO.setup("P9_15",GPIO.OUT)

uart4_file = '/dev/ttyO4'
baud = 9600
ser = serial.Serial(uart4_file, baud)
fd=ser.fileno()
serial_rs485 = struct.pack('hhhhhhhh',1,0,0,0,0,0,0,0)
fcntl.ioctl(fd,0x542F,serial_rs485)
while True:
  GPIO.output("P9_15", GPIO.HIGH)
  print("Writing to RS485 port")
  ser.write("Testing\n")
  time.sleep(0.010)
  GPIO.output("P9_15", GPIO.LOW)
  time.sleep(0.990)

From what I can see the P8_33 UART4_RTS signal is captured by the HDMI which is why it’s probably not working.

With the new device structure how do I get this IOctrl to work so the RTS signal properly goes high during transmission and returns to low after the last character has left the UART shift register. (on other processors an TSR Empty status).


#37

Disable the hdmi with:

disable_uboot_overlay_video=1

For rs485, i believe you need to use these bindings:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/serial/serial.txt?h=v4.15-rc8

		cts-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
		rts-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;

You might also have to switch back to the omap_serial driver. Getting generic rs485 controls into the generic 8250 serial driver has been a long term nightmare…

Regards,


#38

Hi Robert,
I totally get that it’s hard.
For DMX512A light show as the master it’s not a big deal since it’s transmit only.
If the Beagle were running as a DMX512A slave then it’s receive only.
For MODBUS we’re now in a different world where the DE_/RE line should go low after the last stop bit of the last character. Easy to do on a PIC16/18 dsPIC, PIC32, 9S12 etc…

I’ll do some more research and get back to you.
Thanks
John


#39

Fascinating.

With
disable_uboot_overlay_video=1

root@beaglebone:/sys/class/gpio# ls
export gpio12 gpio13 gpiochip0 gpiochip32 gpiochip64 gpiochip96 unexport

But add in this to temporarily disable the cape_CBB_Serial
disable_uboot_overlay_addr0=1

and gpio9 shows up which makes sense since it’s tied to RTS with the cape.

root@beaglebone:/sys/class/gpio# ls
export gpio115 gpio20 gpio4 gpio50 gpio69 gpio76 gpio87 unexport
gpio10 gpio116 gpio22 gpio44 gpio51 gpio7 gpio77 gpio88
gpio11 gpio117 gpio23 gpio45 gpio60 gpio70 gpio78 gpio89
gpio110 gpio12 gpio26 gpio46 gpio61 gpio71 gpio79 gpio9
gpio111 gpio13 gpio27 gpio47 gpio65 gpio72 gpio8 gpiochip0
gpio112 gpio14 gpio3 gpio48 gpio66 gpio73 gpio80 gpiochip32
gpio113 gpio15 gpio30 gpio49 gpio67 gpio74 gpio81 gpiochip64
gpio114 gpio2 gpio31 gpio5 gpio68 gpio75 gpio86 gpiochip96

And I can set the gpio9 on or off which enables or disables the RS485 DE_/RE so my hardware is working.

The dts file for this cape only shows 8 pins exclusive use in fragment @0.

My guess would be there’s far more going on under the covers for the serial port than the .dts file shows.

In either case, “P8_33” (gpio9) isn’t being controlled by the
fcntl.ioctl(fd,0x542F,serial_rs485)
At least with RS485. Don’t know if RTS/CTS are functional.

Was this even working in Jesse or Wheezy?
This is currently beyond my abilities.
John