PWM problem

Hello,

I want to use PWM pins by Adafruit in my BBB but I have got some problems. Below some info about my soft:

root@beaglebone:~# cat /etc/dogtag
BeagleBoard.org Debian Image 2018-06-17
root@beaglebone:~# cat /etc/debian_version
9.5
root@beaglebone:~# uname -a
Linux beaglebone 4.14.49-ti-r54 #1 SMP PREEMPT Fri Jun 15 22:14:13 UTC 2018 armv7l GNU/Linux
root@beaglebone:~# pip install Adafruit_BBIO
Requirement already satisfied: Adafruit_BBIO in /usr/local/lib/python2.7/dist-packages/Adafruit_BBIO-1.0.10-py2.7-linux-armv7l.egg

root@beaglebone:~# cat /sys/devices/platform/bone_capemgr/slots
 0: PF----  -1 
 1: PF----  -1 
 2: PF----  -1 
 3: PF----  -1 

when I want 
 install bb-cape-overlays  I get:

root@beaglebone:~# sudo apt update ; sudo apt install bb-cape-overlays
Ign:1 http://deb.debian.org/debian stretch InRelease
Hit:2 http://deb.debian.org/debian stretch-updates InRelease
Get:3 http://deb.debian.org/debian-security stretch/updates InRelease [94.3 kB]                  
Hit:4 http://deb.debian.org/debian stretch Release                                                      
Get:5 http://repos.rcn-ee.com/debian stretch InRelease [3058 B]            
Get:7 http://repos.rcn-ee.com/debian stretch/main armhf Packages [683 kB]                                
Fetched 781 kB in 25s (30.7 kB/s)                                                                        
Reading package lists... Done
Building dependency tree       
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
bb-cape-overlays is already the newest version (4.4.20180914.0-0rcnee0~stretch+20180914).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 ti-opencl : Depends: libtiopencl1 (= 01.01.15.03-git20180817.2-0rcnee4~stretch+20180817) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

dmesg

root@beaglebone:~# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.49-ti-r54 (root@b2-am57xx-beagle-x15-2gb) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP PREEMPT Fri Jun 15 22:14:13 UTC 2018
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black
[    0.000000] Memory policy: Data cache writeback
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 48 MiB at 0x9c800000
[    0.000000] On node 0 totalpages: 130560
[    0.000000] free_area_init_node: node 0, pgdat c15ed380, node_mem_map df961000
[    0.000000]   Normal zone: 1148 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 130560 pages, LIFO batch:31
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] random: get_random_bytes called from start_kernel+0xac/0x460 with crng_init=0
[    0.000000] percpu: Embedded 18 pages/cpu @df928000 s41548 r8192 d23988 u73728
[    0.000000] pcpu-alloc: s41548 r8192 d23988 u73728 alloc=18*4096
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129412
[    0.000000] Kernel command line: console=tty0 console=ttyO0,115200n8 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 440724K/522240K available (13312K kernel code, 1168K rwdata, 4372K rodata, 1024K init, 673K bss, 32364K reserved, 49152K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xe0000000 - 0xff800000   ( 504 MB)
                   lowmem  : 0xc0000000 - 0xdfe00000   ( 510 MB)
                   pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
                   modules : 0xbf000000 - 0xbfe00000   (  14 MB)
                     .text : 0xc0008000 - 0xc0e00000   (14304 kB)
                     .init : 0xc1400000 - 0xc1500000   (1024 kB)
                     .data : 0xc1500000 - 0xc16241a8   (1169 kB)
                      .bss : 0xc162ec1c - 0xc16d709c   ( 674 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 42794 entries in 126 pages
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] 	RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[    0.000000] 	Tasks RCU enabled.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000016] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000035] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000044] OMAP clocksource: timer1 at 24000000 Hz
[    0.000750] timer_probe: no matching timers found
[    0.000971] Console: colour dummy device 80x30
[    0.001014] console [tty0] enabled
[    0.001037] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.001041] This ensures that you still see kernel messages. Please
[    0.001045] update your kernel commandline.
[    0.001070] Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
[    0.046949] pid_max: default: 32768 minimum: 301
[    0.047225] Security Framework initialized
[    0.047240] Yama: becoming mindful.
[    0.047280] AppArmor: AppArmor disabled by boot time parameter
[    0.047472] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.047485] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.048493] CPU: Testing write buffer coherency: ok
[    0.049003] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.063063] Setting up static identity map for 0x80100000 - 0x80100060
[    0.070976] Hierarchical SRCU implementation.
[    0.082098] EFI services will not be available.
[    0.086980] smp: Bringing up secondary CPUs ...
[    0.086996] smp: Brought up 1 node, 1 CPU
[    0.087006] SMP: Total of 1 processors activated (995.32 BogoMIPS).
[    0.087013] CPU: All CPU(s) started in SVC mode.
[    0.088590] devtmpfs: initialized
[    0.103363] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.103867] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.103893] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.107907] xor: measuring software checksum speed
[    0.147017]    arm4regs  :  1217.000 MB/sec
[    0.186950]    8regs     :  1091.000 MB/sec
[    0.226949]    32regs    :  1088.000 MB/sec
[    0.266949]    neon      :  1665.000 MB/sec
[    0.266956] xor: using function: neon (1665.000 MB/sec)
[    0.266974] pinctrl core: initialized pinctrl subsystem
[    0.267770] DMI not present or invalid.
[    0.268217] NET: Registered protocol family 16
[    0.272106] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.298638] omap_hwmod: debugss: _wait_target_disable failed
[    0.351509] cpuidle: using governor menu
[    0.357418] OMAP GPIO hardware version 0.1
[    0.371209] No ATAGs?
[    0.371230] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.371599] omap4_sram_init:Unable to allocate sram needed to handle errata I688
[    0.371611] omap4_sram_init:Unable to get sram pool needed to handle errata I688
[    0.467006] raid6: neonx2   gen()  1883 MB/s
[    0.534982] raid6: neonx2   xor()  1497 MB/s
[    0.534990] raid6: using algorithm neonx2 gen() 1883 MB/s
[    0.534996] raid6: .... xor() 1497 MB/s, rmw enabled
[    0.535002] raid6: using neon recovery algorithm
[    0.542382] edma 49000000.edma: TI EDMA DMA engine driver
[    0.545637] SCSI subsystem initialized
[    0.547150] libata version 3.00 loaded.
[    0.547441] usbcore: registered new interface driver usbfs
[    0.547498] usbcore: registered new interface driver hub
[    0.547617] usbcore: registered new device driver usb
[    0.548200] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[    0.549657] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    0.549932] media: Linux media interface: v0.10
[    0.549992] Linux video capture interface: v2.00
[    0.550140] pps_core: LinuxPPS API ver. 1 registered

Hello,
I want to use PWM pins by Adafruit in my BBB but I have got some problems. Below some info about my soft:

root@beaglebone:~# cat /etc/dogtag
BeagleBoard.org Debian Image 2018-06-17
root@beaglebone:~# cat /etc/debian_version
9.5
root@beaglebone:~# uname -a
Linux beaglebone 4.14.49-ti-r54 #1 SMP PREEMPT Fri Jun 15 22:14:13 UTC 2018 armv7l GNU/Linux
root@beaglebone:~# pip install Adafruit_BBIO
Requirement already satisfied: Adafruit_BBIO in /usr/local/lib/python2.7/dist-packages/Adafruit_BBIO-1.0.10-py2.7-linux-armv7l.egg

This is actually pre-installed. :wink:

root@beaglebone:~# cat /sys/devices/platform/bone_capemgr/slots
0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1

You have an old version of u-boot in the eMMC:

Please run this script to help verify where it's located so we can remove it..

sudo /opt/scripts/tools/version.sh

Regards,

Thanks for reply :slight_smile:

I am using rev B with 2GB eMMC. Now I am using the newest version boot from SD card.

Info from version.sh:

debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh
[sudo] password for debian:
git:/opt/scripts/:[d837f2b02f44fabe16353fd1226bb1f64e847c93]
eeprom:[A335BNLT00A53002BBBK9610]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-06-17]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
kernel:[4.14.49-ti-r54]
nodejs:[v6.14.4]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.4.20180914.0-0rcnee0~stretch+20180914]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[roboticscape]:[0.4.4-git20180608.0-0rcnee0~stretch+20180609]:[GOT_REPLACED_BY_NEXT]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=tty0 console=ttyO0,115200n8 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.075942] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 1.077153] gpio-of-helper ocp:cape-universal: ready
END

THX,
KS

Humm, looks like i need fix my logic, it didn't find the MLO file in p1:

[ 1.348526] mmcblk1: mmc1:0001 MMC02G 1.79 GiB
[ 1.348957] mmcblk1boot0: mmc1:0001 MMC02G partition 1 1.00 MiB
[ 1.349358] mmcblk1boot1: mmc1:0001 MMC02G partition 2 1.00 MiB
[ 1.349736] mmcblk1rpmb: mmc1:0001 MMC02G partition 3 128 KiB
[ 1.351791] mmcblk1: p1 p2

But otherwise, this 'should' fix it..

sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

and reboot..

Background, we moved overlays from the kernel to u-boot, thus a
"recent" u-boot must be present for this to work properly, in your
case, you have an old version of u-boot, we couldn't even detect..

Do you remember what version was installed the eMMC? Then i can work
on patching my version.sh script..

Regards,

Hi,
on the eMMc I have installed this one:
https://debian.beagleboard.org/images/BBB-eMMC-flasher-debian-7.5-2014-05-14-2gb.img.xz

Becouse I didn’t find any newer for 2gb version. It will be easy to come bac this changes? :slight_smile:
sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

Becouse when I last time use it I need to reflash board :stuck_out_tongue_winking_eye:

I used this and BBB don’t want to boot after reboot;/ so the same situation like yesterday with this comand. Without card the same. Pressing boot buton didnt help. Hmm…

I used this and BBB don't want to boot after reboot;/ so the same situation like yesterday with this comand. Without card the same. Pressing boot buton didnt help. Hmm...

Hi,
on the eMMc I have installed this one:
https://debian.beagleboard.org/images/BBB-eMMC-flasher-debian-7.5-2014-05-14-2gb.img.xz
Becouse I didn't find any newer for 2gb version. It will be easy to come bac this changes? :slight_smile:
sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

Thanks, flashing and old A5A now..

Becouse when I last time use it I need to reflash board :stuck_out_tongue_winking_eye:

Yeah, if it's from 2014, there's a good chance it won't auto boot the
microSD, just too old of a version of u-boot..

Yes, there is a limited number of images that will fit in the 2GB
eMMC.. Best bet is just the console one, or just use a big microSD
card.

Regards,

Ok, so what should I do? Reflash emmc to old one once again? When I was testing yesterday after reflashing the pwm was working on this old soft but probably it will be better if i can use new version of soft.

Okay the reporting is fixed:

bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot
2018.09-00002-g0b54a51eee]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot
2014.04-00014-g47880f5]:[location: fatfs /boot/uboot/MLO]

Ok, so what should I do? Reflash emmc to old one once again? When I was testing yesterday after reflashing the pwm was working on this old soft but probably it will be better if i can use new version of soft.

It's up to you.. but i'd just run:

sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

and utilze the new microSD image.

Regards,

Ok,
so first of all I need to run the BBB from emmc? So I need reflash this bootloader, yes?
After that I need download new version of image from side, load on sd card and now using: sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100 shoudl help?
Or I need making another changes in different place of code? Because now I am little confused.
KS

Ok, for now I have flashed board with Debian 7.5 (BeagleBone Black - 2GB eMMC) 2014-05-14
Than I remove card from BBB and install on the card: Debian 9.5 2018-08-30 4GB SD IoT
Flashing this distro probably will not be possible because of little space od eMMc. (I have tried it before)

Ond the SD card I need to change name of file to “uEnv.txt” to update the bootloader and after that I can use the newest distro. But what I need to do now to can use a PWM? If I use now: sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100
The BBB will not get up. Need I make another changes in files on SD or emmc?
I am very newbie in BBB and now I am little confused :slight_smile:
So tell me please step by step what should I do :slight_smile:
Thanks!

On Tue, 25 Sep 2018 08:36:10 +0200, Krzysztof ?mia?ek
<krzysztof.jan.smialek@gmail.com> declaimed
the following:

Ok,
so first of all I need to run the BBB from emmc? So I need reflash this
bootloader, yes?
After that I need download new version of image from side, load on sd card
and now using: sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100 shoudl
help?

  The dd command is used to ERASE the eMMC u-Boot. Without u-Boot on the
eMMC, the bootstrap sequence tries to load u-Boot from an SD card. If you
don't have an SD card installed for this, the board will not boot.

  The u-Boot in the 2GB image you are using to flash with is too old to
be used with newer OS variations (it expects the Linux kernel to load the
device tree, but new kernels expect u-Boot to load the device tree).

  Your choices (to me) appear to be to either run with a three year old,
unsupported, OS that fits in the eMMC; or run with an eMMC that has no
u-Boot and needs to have an SD card holding a more recent OS/u-Boot; OR
figure out how to take a recent IoT image and REMOVE enough stuff from it
to let it fit into the 2GB eMMC, and then flash the eMMC using this
stripped down image with a modern u-Boot.*

* I don't know enough about the flashing process to know if it is done on
a "by file" basis, or is done "by block". If the former, getting the used
space of the SD card down to around 1.5-1.8GB might be sufficient; if it is
by blocks, you'd have to somehow compress the SD card free space and shrink
the partition...
  Perhaps Mr. Nelson could chime in on this part of the mysterious BBB
flashing process?

* I don't know enough about the flashing process to know if it is done on
a "by file" basis, or is done "by block". If the former, getting the used
space of the SD card down to around 1.5-1.8GB might be sufficient; if it is
by blocks, you'd have to somehow compress the SD card free space and shrink
the partition...
        Perhaps Mr. Nelson could chime in on this part of the mysterious BBB
flashing process?

So it's just rsync that copes files, so when it error's out, it really
just error's out from lack of space..

One option, for the 2GB eMMC that I've slightly played with but
haven't tested in a flashing situation... Btrfs with compression..

With BTFS with lzo, cut down the iot image from 3.3G to 1.6-ishG...
Well somewhere around there, it's been a few months..

Regards,

Ok, for me it is not important to flash emmc. I can use system from card. And I want use this method. So, what should I do step by step? For this momet I have got old version on the emmc and ne we on sd card. If i remove card, BBB boot from emmc. If I insert card, BBB boot from sd card. But when I am using system form card there is problem with this PWM by adafruit in python. When I use this comand: sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100 after rebooting BBB dont get up. All leds are off. With card, without don’t matter. BBB is off.

wt., 25 wrz 2018, 17:27 użytkownik Robert Nelson <robertcnelson@gmail.com> napisał:

I’d erase the eMMC:

sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

Then utilize any image on the microSD…

Regards,

Stick this image on a microSD card:

https://rcn-ee.net/rootfs/bb.org/testing/2018-09-23/stretch-lxqt-2gb/BBB-blank-debian-9.5-lxqt-2gb-armhf-2018-09-23-2gb.img.xz

using your thumb nail hold the boot button.

Insert power

After the 4 leds come on, lift thumb nail..

Should flash the eMMC in 5-10 minutes.

Regards,