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.

Linux/AM5728: Enable UART

Part Number: AM5728
Other Parts Discussed in Thread: BEAGLEBOARD-X15, PMP

Tool/software: Linux

Hi,

I have done the following to enable the uart ports:

- Decompile /boot/dtbs/4.14.79-ti-r84.1/am57xx-beagle-x15-revc.dtb into a .dts

- Edit the status field to "okay" of the following ports:

serial@4806a000 {
   compatible = "ti,dra742-uart", "ti,omap4-uart";
   reg = <0x4806a000 0x100>;
   interrupts-extended = <0x1 0x0 0x43 0x4>;
   ti,hwmods = "uart1";
   clock-frequency = <0x2dc6c00>;
   status = "okay";
   dmas = <0xb3 0x31 0xb3 0x32>;
   dma-names = "tx", "rx";
   phandle = <0x1a7>;
  };

  serial@4806c000 {
   compatible = "ti,dra742-uart", "ti,omap4-uart";
   reg = <0x4806c000 0x100>;
   interrupts = <0x0 0x44 0x4>;
   ti,hwmods = "uart2";
   clock-frequency = <0x2dc6c00>;
   status = "okay";
   dmas = <0xb3 0x33 0xb3 0x34>;
   dma-names = "tx", "rx";
   phandle = <0x1a8>;
  };

- Recompile the dts to dtb.

Now I can see how uart 0 and 1 have a ttyO0 and ttyO1 in /dev/ and the following information is shown when I run cat /proc/tty/driver/serial:

0: uart:8250 mmio:0x4806A000 irq:45 tx:0 rx:0 DSR                               
1: uart:8250 mmio:0x4806C000 irq:46 tx:0 rx:0 DSR                               
2: uart:8250 mmio:0x48020000 irq:47 tx:193 rx:0 RTS|DTR|DSR                     
3: uart:unknown port:00000000 irq:0                                             
4: uart:unknown port:00000000 irq:0                                             
5: uart:unknown port:00000000 irq:0                                             

However, if we probe the pins corresponding to those uart we don't see data going through when it is sent.

What else do we need to do to enable UARTs ?

Thank you.

  • You need to configure pin-muxing. For AM57xx, pin muxing should be performed in u-boot MLO. I recommend using the PinMux tool:

    dev.ti.com/.../app.html

    There's a link to a tutorial in the upper right corner if you've never used it before. Once you're done you will download the genericFileFormatIOdelay.txt and genericFileFormatPadConf.txt files from the utility. There's a perl script that is then used to convert those files into the proper format for use in u-boot. The process is described in this app note:

    IODELAY Application Note for AM57xx Devices
    www.ti.com/.../sprac44

    The output of the perl script will be integrated into the mux_data.h file that is part of your u-boot board data.

    Best regards,
    Brad
  • Hi Brad,

    Thanks for the quick answer. 

    We have used the PinMux tool and we obtained the iodelay and padconf files. I have converted them with the perl script. Now, how exactly do I merge the outputs with the existing mux_data.h? Should I replace the whole pad_conf_entry core_padconf_array_essential_x15 and iodelay_cfg_entry iodelay_cfg_array_x15_sr1_1 structs with the data from padconf and iodelay respectively? Or should I just add/modify the lines which are different?

    After that, I compiled u-boot. How do I correctly replace the MLO and u-boot on the SD-card?. I did the following and now the system is unreachable by serial or Ethernet:

    sudo dd if=./u-boot/MLO of=/dev/mmcblk0 count=2 seek=1 bs=128k

    sudo dd if=./u-boot/u-boot.img of=/dev/mmcblk0 count=4 seek=1 bs=384k
    Thank you
    Best regards
    Pedro
  • Pedro Henriquez said:
    We have used the PinMux tool and we obtained the iodelay and padconf files. I have converted them with the perl script. Now, how exactly do I merge the outputs with the existing mux_data.h? Should I replace the whole pad_conf_entry core_padconf_array_essential_x15 and iodelay_cfg_entry iodelay_cfg_array_x15_sr1_1 structs with the data from padconf and iodelay respectively? Or should I just add/modify the lines which are different?

    The _sr1_1 string in the structure name is referring to silicon revision 1.1 (i.e. old version).  Unless you are using a board from years ago, I would expect it to be silicon revision 2.0.  The reason there are so many different structures is because the MLO being built as part of the SDK supports a number of different boards (AM572x EVM, AM572x IDK, AM571x IDK).  You'll see in the board.c file that there are checks to see which board is being used and then associated structure is then utilized to configure the I/Os.

    It is best to replace the entire structure using the output from the PinMux tool.  So first you should download the *.pinmux file for the EVM:

    https://e2e.ti.com/support/processors/f/791/p/625545/2306168#2306168

    Then you should open with the PinMux Tool and make your changes.  You can then generate the associated structures for mux_data.h.

    Pedro Henriquez said:
    After that, I compiled u-boot. How do I correctly replace the MLO and u-boot on the SD-card?.

    MLO resides in a FAT partition, so you should be able to put the card into your computer and just copy/paste your new MLO over the top of the old one (i.e. replace the old one).

  • Thanks for the files, those will be very useful for testing and debugging.
    I cannot see a FAT partition in my SD card, it seems that there is only one partition mmcblk0p1
  • If you download and install Processor SDK Linux, there's a script in the "bin" directory called create-sdcard.sh that you should use to make your card. It will ask if you want 2 or 3 partitions. Choose 2. It will also ask whether to install the default binaries or something else. Use the default binaries for starters. You can manually overwrite stuff later.
  • I downloaded Processor SDK Linux, I used create-sdcard.sh to make a default sd-card with 2 partitions. It worked and Arago Project booted. However, when I tried to create the custom sd card with Ubuntu 18.04 the system didn't boot. I used the same boot partition as the default and got the rest of the files from an image of Ubuntu-18.04.1-console-armhf-2018-09-11. What step am I doing wrong?

    Thank you very much for your help

  • In these forums we can help you use the TI SDK. Ubuntu is community supported so you would need to go to another forum, IRC channel, etc. for help. What is it that you're trying to do on your board? Perhaps you can just do it using the TI SDK.
  • I have tried a simple example using only the TI SDK and the board still doesn't boot after pinmux. Below I describe the steps I followed:

    1.- Created SD card with 2 partitions using TI script create-sdcard.sh. The sd card was created with the pre-built images from SDK. The card boots properly and the Arago project logo is shown in the serial console.

    2.- Used TI pinmux tool to export  genericFileFormatIOdelay.txt and genericFileFormatPadConf.txt from am5728_gp_evm.pinmux.

    3.- Converted those files using am57xx_generate_pin_config_data.pl and merged the contents to mux_data.h

    4.- Compiled u-boot using the mux_data.h

    5.- Copied new MLO and uboot.img into boot partition of the sd card.

    6.- Tried to boot Arago project, however I got the following outputs in the serial console and the default Debian from the eMMC was booted instead:

    U-Boot SPL 2017.01-00359-g590c7d7fe1-dirty (Jan 11 2019 - 13:51:59)
    DRA752-GP ES2.0
    Trying to boot from MMC1
    reading uboot.env

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

    Using default environment                                                                             

    reading u-boot.img
                                                               
    reading u-boot.img
                                                               
    reading u-boot.img
                                                               
    reading u-boot.img

                                                                                   
    U-Boot 2017.01-00359-g590c7d7fe1-dirty (Jan 11 2019 - 13:51:59 +0000)                                                                           

    CPU  : DRA752-GP ES2.0
                                                           
    Model: TI AM5728 BeagleBoard-X15
                                                 
    Board: BeagleBoard X15 REV C.00
                                                  
    DRAM:  2 GiB
                                                                     
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
                                            
    reading uboot.env

                                                                                                                                              
    ** Unable to read "uboot.env" from mmc0:1 **
                                     
    Using default environment

                                                                                                                                   
    setup_board_eeprom_env: beagle_x15_revc
                                          
    SCSI:  SATA link 0 timeout.
                                                      
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
                        
    flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
                
    scanning bus for devices...
                                                      
    Found 0 device(s).
                                                               
    Net:   <ethaddr> not set. Validating first E-fuse MAC
                            
    cpsw
                                                                             
    Press SPACE to abort autoboot in 2 seconds
                                       
    usb_boot is currently disabled
                                                   
    scsi_boot is currently disabled
                                                  
    switch to partitions #0, OK
                                                      
    mmc0 is current device
                                                           
    Scanning mmc device 0
                                                            
    Checking for: /uEnv.txt ...
                                                      
    reading /uEnv.txt
                                                                
    1490 bytes read in 3 ms (484.4 KiB/s)
                                            
    Loaded environment from /uEnv.txt
                                                
    Checking if uenvcmd is set ...
                                                   
    Running uenvcmd ...
                                                              
    reading .psdk_setup
                                                              
    1 bytes read in 2 ms (0 Bytes/s)
                                                 
    Already setup.
                                                                   
    Checking for: /boot/uEnv.txt ...
                                                 
    ** 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 device 1
                                                            
    Checking for: /uEnv.txt ...
                                                      
    Checking for: /boot/uEnv.txt ...
                                                 
    391 bytes read in 5 ms (76.2 KiB/s)
                                              
    Loaded environment from /boot/uEnv.txt
                                           
    Checking if uname_r is set in /boot/uEnv.txt ...
                                 
    debug: [uname_r=4.9.35-ti-r44] ...
                                               
    loading /boot/vmlinuz-4.9.35-ti-r44 ...
                                          
    9531632 bytes read in 123 ms (73.9 MiB/s)
                                        
    loading /boot/dtbs/4.9.35-ti-r44/am57xx-beagle-x15-revc.dtb ...
                  
    152797 bytes read in 28 ms (5.2 MiB/s)
                                           
    loading /boot/initrd.img-4.9.35-ti-r44 ...
                                       
    5891388 bytes read in 77 ms (73 MiB/s)
                                           
    debug: [console=ttyO2,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait c
    oherent_pool=1M net.ifnames=0 quiet] ...
                                         
    debug: [bootz 0x82000000 0x88080000:59e53c 0x88000000] ...
                       
    ## Flattened Device Tree blob at 88000000
                                        
       Booting using the fdt blob at 0x88000000
                                      
       Loading Ramdisk to 8fa61000, end 8ffff53c ... OK
                              
       Loading Device Tree to 8fa38000, end 8fa604dc ... OK

                                                                                                   
    Starting kernel ...
                                                                                                                                     
    [    0.071815] /cpus/cpu@0 missing clock-frequency property
                      
    [    0.071839] /cpus/cpu@1 missing clock-frequency property
                      
    [    3.370775] dra7-pcie 51000000.pcie: phy link never came up
                   
    [    3.589926] omap_hsmmc 4809c000.mmc: no pinctrl state for sdr104 mode
         
    [    3.596420] omap_hsmmc 4809c000.mmc: no pinctrl state for ddr50 mode
          
    [    3.602815] omap_hsmmc 4809c000.mmc: no pinctrl state for sdr50 mode
          
    [    3.609212] omap_hsmmc 4809c000.mmc: no pinctrl state for sdr25 mode
          
    [    3.615606] omap_hsmmc 4809c000.mmc: no pinctrl state for sdr12 mode
          
    [    3.621997] omap_hsmmc 4809c000.mmc: no pinctrl state for hs mode
             
    [    3.667502] omap_hsmmc 480b4000.mmc: no pinctrl state for sdr25 mode
          
    [    3.683137] omap_hsmmc 480b4000.mmc: no pinctrl state for sdr12 mode
          
    [    3.692240] omap_hsmmc 480b4000.mmc: no pinctrl state for ddr_1_8v mode
       
    [    3.698911] omap_hsmmc 480b4000.mmc: no pinctrl state for hs mode
             
    [    3.705054] omap_hsmmc 480b4000.mmc: no pinctrl state for hs200_1_8v mode
     
    [    3.759723] omap_voltage_late_init: Voltage driver support not added
          
    [    7.279070] remoteproc remoteproc0: request_firmware failed: -2
               
    [   11.894403] vgaarb: this pci device is not a vga device
                       
    [   11.928818] vgaarb: this pci device is not a vga device
                                      

    Debian GNU/Linux 9 BeagleBoard-X15 ttyS2

  • Hi,

    I solved it following these steps:

    1.- TI Pinmux tool: Enable UARTS

    2.- Convert the Pinmux output and merge it to mux_data.h

    3.- Recompile U-boot with the new mux_data.h

    4.-Create an SD card using the new MLO and u-boot.img following some instructions from: https://www.digikey.com/eewiki/display/linuxonarm/BeagleBoard-X15#BeagleBoard-X15-Ubuntu18.04LTS

    Regards

  • Thanks for the update. I’m glad to hear you have it working now. Thanks for sharing your procedure with the community.