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.

  • Resolved

Starterware/AM3359: Building Bootloader for AM335x mcspi using pdk_am335x_1_0_5

Intellectual 510 points

Replies: 11

Views: 8375

Part Number: AM3359

Tool/software: Starterware

Hello,

I am trying to build the bootloader bootloader_boot_mcspi_a8host_release_ti.bin using the given project at "C:\ti\pdk_am335x_1_0_5\packages\ti\starterware\bootloader\ccs".

I imported all the dependent projects and built the libboard_boot.a, libsoc_boot.a and libdal.a as it was not able to find these libraries. I was getting an error during linking

 "section `.stack' will not fit in region `OCMCRAM' region `OCMCRAM' overflowed by 42xxx bytes. Then I reduced the STACKSIZE under GNU Linker->Symbols to 0xC000.

This solved the build problem but it is generating a bootloader image of 1gb which is not correct.

Also  the "bootloader_boot_mcspi_a8host_release.out" file is 177kb in size as compared 51kb (compared from C:\ti\pdk_am335x_1_0_5\packages\ti\starterware\binary\bootloader\bin\am335x-evm\gcc).

I checked the user guide on building bootloader but it is not specific about the configuration. E.g. it says "Set build configuration for dependant projects as "FixedPoint". Libraries generated with other configurations won't link with bootloader application because of "Floating Point suppport" mismatch."  What does it mean? Where do I need to change this?

GNU compiler flags set:

-mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -mfpu=neon -mlong-calls -DBOOT_MCSPI -DAM335X_FAMILY_BUILD -Dam3359 -I"C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include" -I"../../src/am335x/" -I"../../include/" -I"../../../examples/gpio/" -I"../../../include/" -I"../../../include/am335x/" -I"../../../include/utils/" -I"../../../include/hw/" -I"../../../device/" -O2 -funsigned-char -ffunction-sections -fdata-sections -Wall

GNU linker flags set:

-mcpu=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -mfpu=neon -DBOOT_MCSPI -DAM335X_FAMILY_BUILD -Dam3359 -O2 -funsigned-char -ffunction-sections -fdata-sections -Wall -Wl,-Map,"../../../binary/bootloader/bin/am335x-evm/ccs/bootloader_boot_mcspi_a8host_release.map" --entry Entry -Wl,--gc-sections -L"../../../binary/dal/lib/am335x-evm/a8/ccs/am335x_release/" -L"../../../binary/device/lib/am335x-evm/a8/ccs/am335x_release/" -L"../../../binary/board/lib/am335x-evm/a8/ccs/am335x_boot_release/" -L"../../../binary/utils/lib/am335x-evm/a8/ccs/am335x_release/" -L"../../../binary/soc/lib/am335x-evm/a8/ccs/am335x_boot_release/" -Wl,--defsym,STACKSIZE=0xC000 -Wl,--defsym,HEAPSIZE=0x400

These are my settings for building the bootloader.

Can someone please share the process on how to build the bootloader?

  • Found the issue. There was a warning coming in the build console for multiple declaration of DDR0. Then checked the project and found that DDR0 is defined in AM335x.lds and starterware\examples\gcc\am335x_boot_ccs.lds
    I don't know why the am335x_boot_ccs.lds linker script is added in the project. So I removed it from GNU Linker ->Librarries->Linker command files.

    After this I am able to build the bootloader and bootloader_boot_mcspi_a8host_release_ti.bin is of 33kb which is acceptable bootloader size.
  • In reply to Mohit Kumar77:

    Hi,

    Is this query resolved, or do you need further assistance?

     

    Best Regards
    Biser
  • In reply to Biser Gatchev-XID:

    Hi Biser,
    Yes the basic problem of generating the bootloader binary from source code is solved. But I wanted to do the step by step execution of bootloader.

    I built the bootloader project in debug mode and able to do step-by-step execution using XDS100v2 usb debug. But after some time I start getting error :
    No source available for "0x8000000c"

    So I am not able to see the complete code flow of bootloader. It does the execution in sbl_main.c till the call to SBLPlatformConfig(). After this it gives me the above error and i am not able to check the code. Also I wanted to know how can I add application code here to see the complete code flow from bootloader to application. After this call of SBLPlatformConfig, it is expecting the application entry point. So how can I add the application SW project into debugging.

    regards
    Mohit
  • In reply to Mohit Kumar77:

    I have notified the RTOs team. They will respond here.

     

    Best Regards
    Biser
  • In reply to Mohit Kumar77:

    Hi Biser,
    Can you also share the procedure to build the bootloader? It seems that this image is not working for me even though the file size has reduced now. I would like to regenerate the bootloader image files that is currently provided by TI as pre-built binaries.

    regards
    Mohit
  • In reply to Mohit Kumar77:

    Mohit,

    The bootloader build is now makefile based in Processor SDK RTOS. You can build the MLO by going into pdk_am335x_x_x_x/packages and build using “gmake starterware_boot”

    Ensure that you setup the SDK build environment as described here, before you invoke the build:
    processors.wiki.ti.com/.../Processor_SDK_RTOS_Building_The_SDK

    Regards,
    Rahul

    --------------------------------------------------------------------------------------------------------------------------------------
    Please click the
    This resolved my issue button on this post if the responses on this E2E thread answers your question.
    --------------------------------------------------------------------------------------------------------------------------------------

     

  • In reply to Rahul Prabhu:

    Hello Rahul,
    I was able to build the bootloader using the makefile but for debugging purpose I wanted a CCS project.
    Is the CCS project of bootloader obsolete now?
    Can I create a CCS project of bootloader from the pdk starterware source? or it is not advised to use CCS for building bootloader?

    How can I use the binary generated from makefile build for single stepping debugging? I want to see the bootloader code flow.

    regards
    Mohit
  • In reply to Mohit Kumar77:

    Mohit,

    The SDK team is supporting CCS projects only for driver examples and all other libraries and boot related software is migrating to makefile based build in the SDK. You can create a CCS Project for this software by adding all relevant source files to CCS project and using the same compiler settings.

    If the intent is to debug the binary created by Makefile then, you can load the .out on the ARM core using an emulator and after the binary loads, CCS Editor will indicate that it can`t find the location of main. If CCS is unable to located the source then it provides the option to browse to the file path that has the main function. Then you can browse to the file that has the bootloader main function.

    Alternately you can add the PDk Packages to the source search path.

    Regards,
    Rahul

    --------------------------------------------------------------------------------------------------------------------------------------
    Please click the
    This resolved my issue button on this post if the responses on this E2E thread answers your question.
    --------------------------------------------------------------------------------------------------------------------------------------

     

  • In reply to Rahul Prabhu:

    When I am trying to load the bootloader_boot_mcspi_a8host_debug.out to board I am getting an error
    "CortxA8: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map."

    Any idea how this can be solved. I tried using the existing bootloader .out files (before I built the makefile) and I am still getting the same error.

    I am using AM3359 ICEv2 board. I see following entry in the map file for memory configuration.

    Memory Configuration

    Name Origin Length Attributes
    DDR0 0x80000000 0x10000000
    OCMCRAM 0x402f0400 0x0001fbff
    *default* 0x00000000 0xffffffff

    Linker script and memory map

    Is this correct? How can this issue be resolved?

    regards
    Mohit
  • In reply to Mohit Kumar77:

    Mohit,

    I checked internally and it seems that has issue has been observed before. It is unclear wheather the issue occurs because of GCC compiler generating compiler debug sections ata 0x00000000 or is it because of the MMU settings of the ARM applied by the bootloader that causes this error.

    Does the ARM go to main after the error occurs? The folks who encountered this issue mentioned the code ran fine even if the CCS loader reported errors loading the section did you try to run the .out after you loaded it. It may also help if you can provide the .map file for us to look at.

    Regards,
    Rahul

    --------------------------------------------------------------------------------------------------------------------------------------
    Please click the
    This resolved my issue button on this post if the responses on this E2E thread answers your question.
    --------------------------------------------------------------------------------------------------------------------------------------

     

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.