This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358: PCM1864 support

Part Number: AM3358
Other Parts Discussed in Thread: PCM1864, PCM5102

I am trying to interface an I2S pcm1864 with BeagleBone Green. I followed the article (http://www.ti.com/lit/an/sprac97/sprac97.pdf), but I am not shure how to update kernel and modules on device. I followed this article http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components_Kernel_Users_Guide.html but any pcm devices is not revelead after "dmesg | grep pcm".

  • Hi Marcin,

    I see you are using AM335x TI PSDK Linux v6.00 (kernel v4.19.38), but I am not sure if this SDK can be used on BeagleBone Green board by default. In the below page we have support  for BeagleBone Black board, but not for BeagleBone Green.

    Are you able to run the default/pre-built images (SPL/MLO, u-boot, kernel, DTB, rootfs) on BeagleBone Green successful? Could you please provide the full boot up console log with default images?

    Then can you provide your modified DTS file(s) for review? BeagleBone Green DTS fiels are located at:

    linux-4.19.38/arch/arm/boot/dts/am335x-bonegreen.dts

    linux-4.19.38/arch/arm/boot/dts/am335x-bonegreen-common.dtsi

    linux-4.19.38/arch/arm/boot/dts/am335x-bone-common.dtsi

    Regards,
    Pavel

  • My device is BeagleBone green wireless.

    How to properly replace kernel and devices tree in /boot?

    Now I just replace existing kernel Image and devices tree and install modules and this are my logs from bb green:

    U-Boot SPL 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500)
    Trying to boot from MMC2
    Loading Environment from EXT4... ** File not found /boot/uboot.env **

    ** Unable to read "/boot/uboot.env" from mmc0:1 **


    U-Boot 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500), Build: jenkins- github_Bootloader-Builder-65

    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 external warm reset has occurred.
    Reset Source: Power-on reset has occurred.
    RTC 32KCLK Source: External.
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from EXT4... ** File not found /boot/uboot.env **

    ** Unable to read "/boot/uboot.env" from mmc0:1 **
    Board: BeagleBone Black
    <ethaddr> not set. Validating first E-fuse MAC
    BeagleBone Black:
    Model: SeeedStudio BeagleBone Green Wireless:
    BeagleBone: cape eeprom: i2c_probe: 0x54:
    BeagleBone: cape eeprom: i2c_probe: 0x55:
    BeagleBone: cape eeprom: i2c_probe: 0x56:
    BeagleBone: cape eeprom: i2c_probe: 0x57:
    Net: eth0: MII MODE
    Could not get PHY for cpsw: addr 0
    cpsw, usb_ether
    Press SPACE to abort autoboot in 2 seconds
    board_name=[A335BNLT] ...
    board_rev=[GW1A] ...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    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
    2299 bytes read in 17 ms (131.8 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.14.108-ti-r113 ...
    9929216 bytes read in 638 ms (14.8 MiB/s)
    debug: [enable_uboot_overlays=1] ...
    debug: [enable_uboot_cape_universal=1] ...
    debug: [uboot_base_dtb_univ=am335x-bonegreen-wireless-uboot-univ.dtb] ...
    uboot_overlays: [uboot_base_dtb=am335x-bonegreen-wireless-uboot-univ.dtb] ...
    uboot_overlays: Switching too: dtb=am335x-bonegreen-wireless-uboot-univ.dtb ...
    loading /boot/dtbs/4.14.108-ti-r113/am335x-bonegreen-wireless-uboot-univ.dtb ...
    37437 bytes read in 47 ms (777.3 KiB/s)
    uboot_overlays: [fdt_buffer=0x60000] ...
    uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ...
    1606 bytes read in 79 ms (19.5 KiB/s)
    failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
    base fdt does did not have a /__symbols__ node
    make sure you've compiled with -@
    uboot_overlays: loading /lib/firmware/BB-BBGW-WL1835-00A0.dtbo ...
    4935 bytes read in 190 ms (24.4 KiB/s)
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
    base fdt does did not have a /__symbols__ node
    make sure you've compiled with -@
    uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ...
    867 bytes read in 106 ms (7.8 KiB/s)
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
    base fdt does did not have a /__symbols__ node
    make sure you've compiled with -@
    uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo ...
    3675 bytes read in 164 ms (21.5 KiB/s)
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
    base fdt does did not have a /__symbols__ node
    make sure you've compiled with -@
    loading /boot/initrd.img-4.14.108-ti-r113 ...
    4696518 bytes read in 309 ms (14.5 MiB/s)
    debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mm cblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 rng_core.defa ult_quality=100 quiet] ...
    debug: [bootz 0x82000000 0x88080000:47a9c6 88000000] ...
    ERROR: Did not find a cmdline Flattened Device Tree
    Could not find a valid device tree
    ** Invalid partition 2 **
    ** Invalid partition 3 **
    ** Invalid partition 4 **
    ** Invalid partition 5 **
    ** Invalid partition 6 **
    ** Invalid partition 7 **
    switch to partitions #0, OK
    mmc1(part 0) is current device
    Scanning mmc 1: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
    mmc1(part 0) 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
    2042 bytes read in 6 ms (332 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.14.71-ti-r80 ...
    4088320 bytes read in 264 ms (14.8 MiB/s)
    debug: [enable_uboot_overlays=1] ...
    debug: [enable_uboot_cape_universal=1] ...
    debug: [uboot_base_dtb_univ=am335x-bonegreen-wireless-uboot-univ.dtb] ...
    uboot_overlays: [uboot_base_dtb=am335x-bonegreen-wireless-uboot-univ.dtb] ...
    uboot_overlays: Switching too: dtb=am335x-bonegreen-wireless-uboot-univ.dtb ...
    loading /boot/dtbs/4.14.71-ti-r80/am335x-bonegreen-wireless-uboot-univ.dtb ...
    156290 bytes read in 147 ms (1 MiB/s)
    uboot_overlays: [fdt_buffer=0x60000] ...
    uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ...
    1440 bytes read in 102 ms (13.7 KiB/s)
    uboot_overlays: loading /lib/firmware/BB-BBGW-WL1835-00A0.dtbo ...
    4839 bytes read in 61 ms (77.1 KiB/s)
    uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ...
    711 bytes read in 19 ms (36.1 KiB/s)
    uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo ...
    3513 bytes read in 111 ms (30.3 KiB/s)
    loading /boot/initrd.img-4.14.71-ti-r80 ...
    4530240 bytes read in 293 ms (14.7 MiB/s)
    debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mm cblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] ...
    debug: [bootz 0x82000000 0x88080000:452040 88000000] ...
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Ramdisk to 8fbad000, end 8ffff040 ... OK
    reserving fdt memory region: addr=88000000 size=87000
    Loading Device Tree to 8fb23000, end 8fbacfff ... OK

    Starting kernel ...

    [ 0.000759] timer_probe: no matching timers found
    [ 0.000981] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [ 0.000990] This ensures that you still see kernel messages. Please
    [ 0.000996] update your kernel commandline.
    [ 0.124410] omap_hwmod: emif: no dt node
    [ 0.802885] omap_voltage_late_init: Voltage driver support not added
    [FAILED] Failed to start Load Kernel Modules.
    See 'systemctl status systemd-modules-load.service' for details.
    [DEPEND] Dependency failed for robotcontrol.
    [ OK ] Started Create Static Device Nodes in /dev.
    [ OK ] Started File System Check Daemon to report status.
    Starting udev Kernel Device Manager...
    Starting Apply Kernel Variables...
    Mounting Configuration File System...
    [ OK ] Started File System Check on Root Device.
    Starting Remount Root and Kernel File Systems...
    [ OK ] Mounted Configuration File System.
    [ OK ] Started Apply Kernel Variables.
    [ OK ] Started Remount Root and Kernel File Systems.
    Starting udev Coldplug all Devices...
    Starting Load/Save Random Seed...
    [ OK ] Started udev Kernel Device Manager.
    [ OK ] Started Journal Service.
    Starting Flush Journal to Persistent Storage...
    [ OK ] Started Load/Save Random Seed.
    [ OK ] Started Flush Journal to Persistent Storage.
    [ OK ] Started Set the console keyboard layout.
    [ OK ] Reached target Local File Systems (Pre).
    [ OK ] Reached target Local File Systems.
    Starting Raise network interfaces...
    Starting Set console font and keymap...
    Starting Create Volatile Files and Directories...
    [ OK ] Started Set console font and keymap.
    [ OK ] Started Create Volatile Files and Directories.
    [ OK ] Started Entropy daemon using the HAVEGE algorithm.
    Starting Update UTMP about System Boot/Shutdown...
    Starting Network Time Synchronization...
    [ OK ] Started Update UTMP about System Boot/Shutdown.
    [ OK ] Started Network Time Synchronization.
    [ OK ] Reached target System Time Synchronized.
    [ OK ] Started Raise network interfaces.
    [ OK ] Found device /dev/ttyS0.
    [ OK ] Started udev Coldplug all Devices.
    [ OK ] Reached target System Initialization.
    [ OK ] Listening on node-red.socket.
    [ OK ] Listening on cloud9.socket.
    [ OK ] Started Daily Cleanup of Temporary Directories.
    [ OK ] Listening on D-Bus System Message Bus Socket.
    [ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
    [ OK ] Listening on bonescript.socket.
    [ OK ] Reached target Sockets.
    [ OK ] Reached target Basic System.
    Starting Restore /etc/resolv.conf i…fore the ppp link was shut down...
    Starting Avahi mDNS/DNS-SD Stack...
    Starting Login Service...
    [ OK ] Started Regular background program processing daemon.
    Starting BB WL18xx wlan0 Service...
    Starting LSB: Start busybox udhcpd at boot time...
    Starting Generic Board Startup...
    [ OK ] Started Bonescript autorun.
    [ OK ] Started D-Bus System Message Bus.
    [ OK ] Started Avahi mDNS/DNS-SD Stack.
    Starting Connection service...
    Starting LSB: Start daemon at boot time...
    Starting System Logging Service...
    [ OK ] Started Daily apt download activities.
    [ OK ] Started Deferred execution scheduler.
    Starting LSB: Load kernel modules needed to enable cpufreq scaling...
    Starting rc_battery_monitor...
    [ OK ] Started Daily apt upgrade and clean activities.
    [ OK ] Reached target Timers.
    [ OK ] Started Restore /etc/resolv.conf if…before the ppp link was shut down.
    [ OK ] Started rc_battery_monitor.
    [ OK ] Started System Logging Service.
    [ OK ] Started LSB: Start busybox udhcpd at boot time.
    [ OK ] Started LSB: Start daemon at boot time.
    [ OK ] Started LSB: Load kernel modules needed to enable cpufreq scaling.
    [ OK ] Started Connection service.
    [ OK ] Started Login Service.
    Starting Hostname Service...
    Starting WPA supplicant...
    [ OK ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
    Starting LSB: set CPUFreq kernel parameters...
    [ OK ] Started WPA supplicant.
    [ OK ] Reached target Network.
    [ OK ] Reached target Network is Online.
    Starting LSB: Advanced IEEE 802.11 management daemon...
    Starting The Apache HTTP Server...
    Starting OpenBSD Secure Shell server...
    Starting Permit User Sessions...
    [ OK ] Started LSB: set CPUFreq kernel parameters.
    [ OK ] Started LSB: Advanced IEEE 802.11 management daemon.
    [ OK ] Started Permit User Sessions.
    [ OK ] Started Hostname Service.
    [ OK ] Started Serial Getty on ttyS0.
    [ OK ] Started Getty on tty1.
    [ OK ] Started OpenBSD Secure Shell server.
    [ OK ] Started The Apache HTTP Server.

    Debian GNU/Linux 9 beaglebone ttyS0

  • Marcin Rosiek said:
    My device is BeagleBone green wireless.

    Then you need to use below DTS files:

    linux-4.19.38/arch/arm/boot/dts/am335x-bonegreen-wireless.dts

    linux-4.19.38/arch/arm/boot/dts/am335x-bonegreen-common.dtsi

    linux-4.19.38/arch/arm/boot/dts/am335x-bone-common.dtsi

    Marcin Rosiek said:
    How to properly replace kernel and devices tree in /boot?

    You can use below script to create SD bootable card with pre-built (default) images.

    ti-processor-sdk-linux-am335x-evm-06.00.00.07/bin/create-sdcard.sh


    Marcin Rosiek said:
    U-Boot SPL 2018.09

    Marcin Rosiek said:
    U-Boot 2018.09-00002-g0b54a51eee

    TI PSDK Linux comes with u-boot-2019.01

    ti-processor-sdk-linux-am335x-evm-06.00.00.07/board-support/u-boot-2019.01+gitAUTOINC+8b90adfb16-g8b90adfb16

    Marcin Rosiek said:
    Debian GNU/Linux 9 beaglebone ttyS0

    Seems you are using Debian Linux. Note that Debian Linux is supported in BeagleBone Black Support Community:

    TI PSDK Linux comes with Arago Linux.

    Regards,
    Pavel

  • Can you describe me step by step how to create custom zImage, uImage and create bootlable  sdcard with them?

    I'm trying to run pcm5102 on beaglebone green for couple of days but without any progress

  • Marcin,

    For how to create custom kernel image (zImage) with PSDK Linux, refer to below user guide:

    Then you can manually copy this zImage to your SD card rootfs/boot/ directory or use the create-sdcard.sh with custom images option.

    Regards,
    Pavel

  • after creating I got error while booting and system starts from emmc

    btrfs_read_superblock: invalid checksum at superblock mirror 0
    btrfs_read_superblock: invalid checksum at superblock mirror 1
    btrfs_read_superblock: No valid BTRFS superblock found!
    ** Unrecognized filesystem type **

    the zImage and dtb file are in /boot

  • Marcin,

    You need to boot from MMC/SD card. You need first create this card with create-sdcard.sh.

    You can also boot from eMMC, but you need first flash this eMMC with your custom images.

    Regards,
    Pavel

  • Finally I enabled the PCM sound card with bcm1864 on i2s but I can't get working all 4 channel for recording and only recording with 96khz mono is ok.

    If I want to record 10s audio with 48khz, arecord is working only 5s and creating file with 0.5x speed. 

    In the case of trying record stereo  arecord is creating multiple file  of size 44B and never finishing recording.

    the result of /opt/scripts/tools/version.sh:

    eeprom:[A335BNLTBWA51719EW000513]
    dogtag:[BeagleBoard.org Debian Image 2017-03-19]
    bootloader:[/dev/mmcblk1]:[U-Boot 2017.03-00002-gd12b1519b4]
    kernel:[4.19.73-ti-rt-r27]
    nodejs:[v4.8.0]
    device-tree-override:[dtb=am335x-boneblack-wireless.dtb]

    bcm1864 i2c configuration:

    i2cset -r -y 2 0x4a 0x01 0x40
    i2cset -r -y 2 0x4a 0x02 0x40
    i2cset -r -y 2 0x4a 0x03 0x40
    i2cset -r -y 2 0x4a 0x04 0x40
    i2cset -r -y 2 0x4a 0x00 0xfe
    i2cset -r -y 2 0x4a 0x06 0x41
    i2cset -r -y 2 0x4a 0x07 0x41
    i2cset -r -y 2 0x4a 0x08 0x44
    i2cset -r -y 2 0x4a 0x09 0x44
    i2cset -r -y 2 0x4a 0x20 0x11
    i2cset -r -y 2 0x4a 0x0b 0xcc

  • Marcin,

    Glad to see you were able to get PCM working.

    If you have new issue with audio multichannel, I would suggest you to open new e2e thread, create proper subject for your new issue.

    Regards,
    Pavel