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.

BeagleBone Black, Can't switch U-Boot to use UART4

Hi all,

I am trying to switch my U-boot console to use UARTO4, rather than UARTO0, so that I can use UARTO4 to issue custom U-boot boot options. I downloaded U-boot source code from here and wrote a custom config file, and then rebuilt the project. Per this including patches. 

eewiki.net/.../BeagleBone+Black

Here's my config file:

CONFIG_ARM=y
CONFIG_TARGET_AM335X_EVM=y
CONFIG_SPL=y
CONFIG_SPL_STACK_R=y
CONFIG_SPL_STACK_R_ADDR=0x82000000
CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT, SERIAL5 = 4, CONS_INDEX = 4"
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_SETEXPR is not set
CONFIG_SPI_FLASH=y

I also updated the uEnv.txt and DEFAULT_LINUX_BOOT_ENV in "/include/configs/am335x_evm.h" such that my default console is:

console=ttyO4,115200n8

Each time, I have dragged the generated MLO, u-boot.img, u-boot.cfg, u-boot.bin. When I connect to the serial port, I can see the normal Linux stuff coming from /dev/ttyo4 pins, but when I go to restart Linux, I see the system reboot messages, and then I loose the serial stream until the Kernel itself is booting up, I am not presented with the option to enter the U-boot console, and I don't see any messages about the U-boot at all. Using the same U-boot files, if I view the output from /dev/ttyo0, I see the restart messages, but I see also see message from U-Boot and I see the option to enter the U-boot console.

I found this post, which seems to address the same problem I am having. I tried implement these fixes without much luck. Doesn't seem relevant to the current release of U-boot, which doesn't have a pll.c file and a def.config file.

(http://e2e.ti.com/support/arm/sitara_arm/f/791/p/264125/923544)

So is there a solution that is similar to this, but for newer versions of U-boot that don't include def.config file and pll.c?

  • So I think the issue here is it was falling back on the bootloader on onboard flash. Overwriting the boot partition on the onboard flash, and moving over my custom bootloader now has some debug messages that I put in my custom bootloader displaying on startup. I still don't have UART4 working, but I think I can get this working by generating a new flat device tree that has UART4 configured in it, that way the hardware will be available at bootup time.
  • Hi,

    I will forward this to the SW team.
  • Hi,

    Make sure that your board.c file has the proper pinmux settings.

    Also change the SERIALx & CONS_INDEX=x to match your use case.

    Best Regards,
    Yordan
  • Yordan,

    Thanks for your response!

    Here are my PinMux settings from board/ti/amm335x/mux.c, which is called in board.c:

    static struct module_pin_mux uart4_pin_mux[] = {
    {OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */
    {OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)}, /* UART4_TXD */
    {-1},
    };

    This looks right to me? 

    Also I added some debug statements in the serial-uclass.c. In serial_find_console_or_panic(), I am falling into the following conditional (below). Hitting this conditional seems to indicate that I am not finding UART4 in the FDT (flattened device tree). Do I need to rebuild the device tree binary so it has UART4 available. My understanding however was that this is more of a Linux kernel type thing, and wouldn't be relevant to configuring the board until the kernel is loaded?

    if (!SPL_BUILD || !OF_CONTROL || !gd->fdt_blob) {
    /*
    * Try to use CONFIG_CONS_INDEX if available (it is numbered
    * from 1!).
    *
    * Failing that, get the device with sequence number 0, or in
    * extremis just the first serial device we can find. But we
    * insist on having a console (even if it is silent).
    */
    #ifdef CONFIG_CONS_INDEX
    #define INDEX (CONFIG_CONS_INDEX - 1)
    #else
    #define INDEX 0
    #endif
    if (!uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, &dev) ||
    !uclass_get_device(UCLASS_SERIAL, INDEX, &dev) ||
    (!uclass_first_device(UCLASS_SERIAL, &dev) && dev)) {
    gd->cur_serial_dev = dev;
    fdtblobFailure = 1;
    return;
    }
    #undef INDEX
    }

    Looks

  • Hi, 

    Maxwell Bezold said:

    Here are my PinMux settings from board/ti/amm335x/mux.c, which is called in board.c:

    static struct module_pin_mux uart4_pin_mux[] = {
    {OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */
    {OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)}, /* UART4_TXD */
    {-1},
    };

    This looks right to me? 

    Pinmuxes seem OK. You mux UART4_RXD to gpmc_wait0 => ball T17 (zcz package) & UART4_TXD to gpmc_wpm => ball U17 (zcz package). 

    Maxwell Bezold said:
    Do I need to rebuild the device tree binary so it has UART4 available. My understanding however was that this is more of a Linux kernel type thing, and wouldn't be relevant to configuring the board until the kernel is loaded?

    No this is not needed for u-boot stage. DTS is loaded by u-boot, but it is used by the kernel to further configure your device. So in order to configure UAR4 in u-boot you DO NOT need DTS.  Try adding 

       am335x_evm:SERIAL4,CONS_INDEX=4

    for am335x_boneblack in boards.cfg file. The line should look something like: 
     Active  arm         armv7          am33xx      ti              am335x              am335x_boneblack   

     am335x_evm:SERIAL4,CONS_INDEX=4,EMMC_BOOT                                                                                         Tom Rini <trini@ti.com>

    And then rebuild your u-boot. 

    Best Regards, 

    Yordan

  • I am not seeing the boards.cfg file in the repo I am working with, which I got here: http://git.ti.com/ti-u-boot. Is there an alternative repo I should be working out of? I did try to add it to the am335x_boneblack_defconfig file though: CONFIG_SYS_EXTRA_OPTIONS="SERIAL4, CONS_INDEX = 4, EMMC_BOOT"
  • Hi,

    I am referring to the u-boot provided with latest TI SDK: software-dl.ti.com/.../index_FDS.html

    Best Regards,
    Yordan
  • Hi Yordan, 

    That worked. I used the SDK code, "software-dl.ti.com/.../index_FDS.html"  reconfigured the boards.cfg file entry to be:

    Active arm armv7 am33xx ti am335x am335x_boneblack am335x_evm:SERIAL5,CONS_INDEX=5,EMMC_BOOT Tom Rini <trini@ti.com>

    Then at the command line (NOTE I used the Linaro Cross Compiler):

    export CC=/usr/bin/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- ;make ARCH=arm CROSS_COMPILE=${CC} distclean ; make ARCH=arm CROSS_COMPILE=${CC} am335x_boneblack_config ; make ARCH=arm CROSS_COMPILE=${CC}

    And that totally worked! I am now seeing serial on UART4. Thanks again for your help!

  • To get UART4, with the code I used, I had to make SERIAL5,CONS_INDEX=5
  • Hi,

    I am glad to hear that you solved your issue, and thanks for posting the details here.

    Best Regards,
    Yordan