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.

CCSv6 JTAG debugging U-Boot on custom AM3351 board

Other Parts Discussed in Thread: AM3351

Good afternoon,

I'm trying to debug the SPL and u-boot files on my custom AM3351 board using an XDS200 debugger and CCSv6 (SDK v3.00.00.04). I've followed the tutorial located below, and I've been able to load the SPL code and symbols and step through the code:

http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_uboot_linux_debug_with_ccsv5_sdk7

However, on a first attempt the program hangs on line 408 in the s_init() function in board.c, while trying to initialize the RTC32K. I'm not using the RTC input and have RTC_XTALIN connected to ground. Is this why my program hangs on this line?

#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)

/* Enable RTC32K clock */
rtc32k_enable();
#endif

What is the best practice to change settings for my board configuration? Are there specific headers or config files which I should modify in order to port the SPL and u-boot code to my custom AM3351 board? Is there another option while building u-boot to specify an AM3351 processor? It seems that the am335x_evm_config is only designed for the EVM, EVM-SK, and BeagleBone.

http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User%27s_Guide#General_Information

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_evm_config

BoardConfig targetconfig file (under include/configs/)
AM335x EVM, AM335x EVM-SK, Beaglebone White/Black am335x_evm_config am335x_evm.h
AM43xx ePOS EVM / GP EVM / EVM-SK am43xx_evm_config am43xx_evm.h
am57xx GP EVM am57xx_evm_config am57x_evm.h
DRA7xx EVM (J6, J6Eco) dra7xx_evm_config dra7xx_evm.h

Second, I'm able to advance the SPL program by commenting line 408 in board.c (and therefore not enabling the RTC32K), but next the program hangs on line 116 in the function setup_dplls() in the file clock.c

do_setup_dpll(&dpll_ddr_regs, params);

I haven't done anything yet to configure my DDR memory, as I didn't believe this was necessary to complete the SPL code. Please let me know if this could be related to my board configuration or DDR memory settings.

I'm new to the Sitara processor family and your help is very much appreciated!

Best regards,

Chris

  • I will ask the software team to look at this. They will respond here.
  • Hi Chris,

    However, on a first attempt the program hangs on line 408 in the s_init() function in board.c, while trying to initialize the RTC32K. I'm not using the RTC input and have RTC_XTALIN connected to ground. Is this why my program hangs on this line?

    This shouldn't be a problem for booting the board.

    What is the best practice to change settings for my board configuration? Are there specific headers or config files which I should modify in order to port the SPL and u-boot code to my custom AM3351 board? Is there another option while building u-boot to specify an AM3351 processor? It seems that the am335x_evm_config is only designed for the EVM, EVM-SK, and BeagleBone.

    The main thing is to configure your DDR settings correctly. U-boot should already have the dpll settings. As AM3351 is part of AM335x family, the configuration file you should use is am335x_evm.h; you could enable/disable the needed peripherals in it to match your custom board.

    Do you have any debug output on the serial console? Can you share it?

    If no messages are displayed on the serial terminal, then perhaps your u-boot is failing to configure the DDR. In that case you need to change the bellow sources:
    arch/arm/cpu/armv7/am33xx/ddr.c
    arch/arm/cpu/armv7/am33xx/emif4.c

    You could use the following wiki for tuning the emif registers:
    processors.wiki.ti.com/.../AM335x_EMIF_Configuration_tips

    Hope this is of use.

    Best Regards,
    Yordan
  • Hi Yordan,

    Thank you for your quick reply. I'll look into updating the source files as you recommended. On another note, are the Sitara Linux u-boot porting labs at the following address still relevant for v3.00.00 of the TI processor SDK?

    http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_UBoot_Board_Port

    Is there an updated lab guide for u-boot porting?

    Thanks again,

    Chris

  • Hi Yordan,

    I looked at the source files you recommended and the EMIF instructions, but it is still not clear how to configure the DDR. The registers and settings described in the EMIF configuration tips do not correspond to any macros in the following source files

    arch/arm/cpu/armv7/am33xx/ddr.c
    arch/arm/cpu/armv7/am33xx/emif4.c

    For instance, the EMIF document

    processors.wiki.ti.com/.../AM335x_EMIF_Configuration_tips

    describes REG_SDRAM_TYPE should be configured to 2 or 3 depending on DDR2 or DDR3 memory types, but there is no macro REG_SDRAM_TYPE in any of the project files. I found the definition of the different types in emif.h

    /* SDRAM TYPE */
    #define EMIF_SDRAM_TYPE_DDR2 0x2
    #define EMIF_SDRAM_TYPE_DDR3 0x3
    #define EMIF_SDRAM_TYPE_LPDDR2 0x4

    but not where the correct type is selected for the SPL code. How should I interpret the EMIF instructions in the context of the SPL and u-boot code?

    Thank you again for your support!

    Best regards,
    Chris
  • Good morning TI community,

    Please see my earlier post and let me know if you have any suggestions. I don't see any clear way to port SPL and u-boot code to my custom AM3351 processor using DDR2 memory. In particular, I review the files suggested by Yordan,

    arch/arm/cpu/armv7/am33xx/ddr.c
    arch/arm/cpu/armv7/am33xx/emif4.c

    and there is no clearly defined SDRAM_TYPE in these files. Please let me know if you have any suggestions for porting SPL and u-boot code to a custom AM3351 processor using DDR2 memory.

    Thanks,
    Chris
  • Hi Chris,

    Sorry for the late reply.

    In the latest ti release the definitions are done in board.c & ddr_defs.h (my mistake), ddr.c & emif4.c apply the values defined in the board file & configure the clocks.

    The main thing is to use the timings calculated by AM335x DDR Calculation tool. You should add those values in the ddr_data ddr2_data in board.c (definitions are done in arch/arm/include/asm/arch-am33xx/ddr_defs.h).

    Best Regards,
    Yordan
  • Hi Yordan,

    That response was very helpful. I configured the DDR memory with the tool that you recommended and updated the ddr_defs.h macros. I'm now able to successfully setup dplls.

    do_setup_dpll(&dpll_ddr_regs, params);

    However, next the program crashes in the function enable_board_pin_mux(), when trying to determine the board type. Specifically, it crashes consistently inside the board_is_idk() function in the board.h function.

    static inline int board_is_idk(void)
    {
    return !strncmp(board_ti_get_config(), "SKU#02", 6);
    }

    I'm not configuring the EEPROM at this point, so could this be causing the problem? Perhaps the board_ti_get_config() function is returning a NULL pointer?

    Please let me know what you suggest in the case of unconfigured EEPROM (or if that is not allowed).

    Thank you again for your support!

    Best regards,
    Chris
  • Hi Yordan,

    It looks like the folks in this thread experienced the same problem, and it can be attributed to the board_ti_get_config() function returning NULL. Brad created the following patch to fix this bug

    e2e.ti.com/.../1988726

    diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h
    index 9776df7..d29158c 100644
    --- a/board/ti/am335x/board.h
    +++ b/board/ti/am335x/board.h
    @@ -33,7 +33,10 @@ static inline int board_is_evm_sk(void)

    static inline int board_is_idk(void)
    {
    - return !strncmp(board_ti_get_config(), "SKU#02", 6);
    + if ( board_ti_get_config() )
    + return !strncmp(board_ti_get_config(), "SKU#02", 6);
    + else
    + return 0;
    }

    Next, the function enable_board_pin_mux() steps through all the board checks, and fails to find with a board/pinmux match and outputs "Unknown board, cannot configure pinmux." How do I configure u-boot to use my custom pin settings? I have the source files auto-generated by TI's Pin Mux tool but I'm not certain how they should be used at this stage.

    Thanks,
    Chris
  • Hi Chris,

    The enable_board_pin_mux ends with the following:
    configure_module_pin_mux(spi0_pin_mux);
    } else {
    puts("Unknown board, cannot configure pinmux.");
    hang();
    }

    Try the following:
    1. Either modify the board/ti/common/board_detect.c & board_detect.h by hardcoding the TI_EEPROM_HEADER_MAGIC to match any of the AM335x boards & add your custom pinmux settings in that part of the board checks in enable_board_pin_mux()
    2. Remove all board checks & just add your specific pinmux settings
    3. Add your custom pinmux in the last else statement in enable_board_pin_mux(), instead of the:
    puts("Unknown board, cannot configure pinmux.");
    hang();
    code.

    Hope this helps.

    Best Regards,
    Yordan
  • Thank you again for your support.

    With these changes, I'm able to finish stepping through the SPL code and see the output message

    U-Boot SPL 2016.05-00230-g120a8a3-dirty (Oct 15 2016 - 13:51:48)
    Timed out in wait_for_event: status=0000
    Check if pads/pull-ups of bus 0 are properly configured
    Timed out in wait_for_event: status=0000
    Check if pads/pull-ups of bus 0 are properly configured
    SPL: failed to boot from all boot devices
    ### ERROR ### Please RESET the board ###

    Is there any way to confirm that the DDR memory settings are working properly? I'm now running into problems loading u-boot but I'll post this question in a separate thread.

    Thanks again!
    Chris