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.

TMS320C6748: Issues when writing AIS on a NOR flash memory with the Serial Boot and Flash Loading Utility

Part Number: TMS320C6748
Other Parts Discussed in Thread: OMAP-L138

 

Hi,

We are using the Serial Boot and Flash Loading Utility (sft) in order to, via the UART, write an AIS in a NOR flash memory so we can boot from it later.

Here is the process we are following with the result we get:

As you can see is the CFI Query what is supposed to be failing, thus the NOR_open() function fails too.

The points is that we are monitoring the communication between the DSP and the NOR (by reading the EMIF buses with a digital analyzer) and apparently the NOR is answering the CFI Query properly, but the code used by the SFT to check it seem to be expecting another answer because keeps querying the CFI in 8 and 16 bits mode until it stops and indicates a failure.


Could you tell us where could we find the code used by the SFT to write on the NOR (in the StarterWare we only found the NAND_writer and the SPI_writer) and/or what is the NOR supposed to be answering so the DSP start to write on it?

Do you have any clue of what is going on?

Thanks in advance,

Juan

 

  • Juan Encinas said:
    Could you tell us where could we find the code used by the SFT to write on the NOR

    OMAP-L138_FlashAndBootUtils_2_40\Common\drivers\src\nor.c

    Juan Encinas said:
    Do you have any clue of what is going on?

    Check the NOR_open() function from the file above.  You can see that the call to LOCAL_flashQueryCFI() is failing. That function is defined in the same file and it describes that there are 6 possible configurations.  It appears to be looking for the NOR to return 'Q', 'R', 'Y'.  In the screenshot you shared, I could see the 'Q' (0x51), though it stopped after that.  Did it possibly succeed in any of the other queries?  You could probably add some more DEBUG_printString entries in that function if you wanted to have a better understanding of what was happening from the processor perspective, e.g. you could output the value of some of those variables being used for the loop, etc.

  • Adding to what Brad provided...

    processors.wiki.ti.com/.../OMAP-L1x_Debug_Gel_Files
    can be used to debug boot issues

    processors.wiki.ti.com/.../Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138
    - The latest source code and binaries can be download from here (sourceforge.net/.../)
    - Then the norwriter source is under OMAP-L138_FlashAndBootUtils_2_40.tar.gz\OMAP-L138_FlashAndBootUtils_2_40.tar\OMAP-L138_FlashAndBootUtils_2_40\OMAP-L138\CCS\NORWriter\src\norwriter.c

    Refer to similar E2E posts:
    e2e.ti.com/.../660385

    -Mark
  • Hi,

    Thank you both for the quick answer, we are having troubles trying to debug the initial problem.

    We are trying to place some DEBUG_printString to debug the issue but when we run the OMAP-L138's makefile we get a linking error:

    As you can see the C6000 compiler can't find libc.a eventhogh we wrote the proper location and name.

    Do you know where could be the problem?

    PD: Here i upload the makefile in case you needed

    3010.makefile.txt
    ###########################################################################
    #                                                                         #
    #   Copyright (C) 2012 Texas Instruments Incorporated                     #
    #     http://www.ti.com/                                                  #
    #                                                                         #
    ###########################################################################
    
    
    
    #############################################################################
    #                                                                           #
    #  Redistribution and use in source and binary forms, with or without       #
    #  modification, are permitted provided that the following conditions       #
    #  are met:                                                                 #
    #                                                                           #
    #    Redistributions of source code must retain the above copyright         #
    #    notice, this list of conditions and the following disclaimer.          #
    #                                                                           #
    #    Redistributions in binary form must reproduce the above copyright      #
    #    notice, this list of conditions and the following disclaimer in the    #
    #    documentation and/or other materials provided with the                 #
    #    distribution.                                                          #
    #                                                                           #
    #    Neither the name of Texas Instruments Incorporated nor the names of    #
    #    its contributors may be used to endorse or promote products derived    #
    #    from this software without specific prior written permission.          #
    #                                                                           #
    #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      #
    #  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        #
    #  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    #
    #  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT     #
    #  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,    #
    #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT         #
    #  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,    #
    #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY    #
    #  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT      #
    #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE    #
    #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     #
    #                                                                           #
    #############################################################################
    #############################################################
    # Makefile for TI Serial Flash Target (SFT) project.        #
    #   Generates the binary SFT file that is intended to be    #
    #   executed on the device for writing the flash storage.   #
    #############################################################
    #
    
    # CROSSCOMPILE definition for entire tree
    include ../../../../Common/build.mak
    include ../../../device.mak
    
    PROGRAM:=sft
    SOURCES=$(PROGRAM).c device.c uartboot.c device_uart.c uart.c debug.c util.c
    
    CFLAGS_DSP=-c -g -DUBL_$(FLASHTYPE) -D$(DEVICETYPE) -I=../../../Common/include -I=../../../../Common/include -I=../../../../Common/arch/c6000/include -I=../../../../Common/$(PROGRAM)/include -I=../../../../Common/ubl/include -I=../../../../Common/drivers/include -I=../../../../Common/gnu/include -DAIS_RBL
    CFLAGS_GCC=-DUBL_$(FLASHTYPE) -D$(DEVICETYPE) -I../../../Common/include -I../../../../Common/include -I../../../../Common/arch/c6000/include -I../../../../Common/$(PROGRAM)/include -I../../../../Common/ubl/include -I../../../../Common/drivers/include -I../../../../Common/gnu/include -DAIS_RBL
    
    LNKFLAGS_DSP=-z -c -estart -a -w -x  --search_path=$(DSP_LIB_PATH)
    LNKFLAGS_GCC=-Wl,-T$(LINKERSCRIPT) -nostdlib 
    AFLAGS=
    
    ifeq ($(FLASHTYPE),NAND)
      SOURCES+= async_mem.c device_async_mem.c nand.c device_nand.c
    endif
    ifeq ($(FLASHTYPE),NOR)
      SOURCES+= async_mem.c device_async_mem.c nor.c
    endif
    ifeq ($(FLASHTYPE),SDMMC)
      SOURCES+= sdmmc.c
    endif
    ifeq ($(FLASHTYPE),ONENAND)
      SOURCES+= async_mem.c device_async_mem.c onenand.c
    endif
    ifeq ($(FLASHTYPE),I2C_MEM)
      SOURCES+= i2c.c i2c_mem.c device_i2c.c
    endif
    ifeq ($(FLASHTYPE),SPI_MEM)
      SOURCES+= spi.c spi_mem.c device_spi.c
    endif
    
    ifeq ($(DEVICETYPE),OMAPL138)
      CC=$(CROSSCOMPILE)gcc
      SOURCES+= start.asm
      CFLAGS = $(CFLAGS_GCC) -c -Os -Wall -ffreestanding -DUBL_$(FLASHTYPE) -D$(DEVICETYPE) -o $@   
      LNKFLAGS = $(LNKFLAGS_GCC) -o $@ $(LINKERSCRIPT) $(OBJECTS)
      LINKERSCRIPT:=../ARM_$(PROGRAM).lds
      AFLAGS = -x assembler
    endif
    ifeq ($(DEVICETYPE),AM1808)
      CC=$(CROSSCOMPILE)gcc
      SOURCES+= start.asm
      CFLAGS = $(CFLAGS_GCC) -c -Os -Wall -ffreestanding -DUBL_$(FLASHTYPE) -D$(DEVICETYPE) -o $@   
      LNKFLAGS = $(LNKFLAGS_GCC) -o $@ $(LINKERSCRIPT) $(OBJECTS)
      LINKERSCRIPT:=../ARM_$(PROGRAM).lds
      AFLAGS = -x assembler
    endif
    ifeq ($(DEVICETYPE),AM1810)
      CC=$(CROSSCOMPILE)gcc
      SOURCES+= start.asm
      CFLAGS = $(CFLAGS_GCC) -c -Os -Wall -ffreestanding -DUBL_$(FLASHTYPE) -D$(DEVICETYPE) -o $@   
      LNKFLAGS = $(LNKFLAGS_GCC) -o $@ $(LINKERSCRIPT) $(OBJECTS)
      LINKERSCRIPT:=../ARM_$(PROGRAM).lds
      AFLAGS = -x assembler
    endif
    ifeq ($(DEVICETYPE),OMAPL138_LCDK)
      CC=$(CROSSCOMPILE)gcc
      SOURCES+= start.asm
      CFLAGS = $(CFLAGS_GCC) -c -Os -Wall -ffreestanding -DUBL_$(FLASHTYPE) -D$(DEVICETYPE) -o $@   
      LNKFLAGS = $(LNKFLAGS_GCC) -o $@ $(LINKERSCRIPT) $(OBJECTS)
      LINKERSCRIPT:=../ARM_$(PROGRAM).lds
      AFLAGS = -x assembler
    endif
    ifeq ($(DEVICETYPE),C6748)
      CC=$(DSP_CROSSCOMPILE)cl6x
      SOURCES+= start_c674x.asm
      CFLAGS = $(CFLAGS_DSP) -ms3 -mo -mv6740 --obj_extension=$(DEVICETYPE)_$(FLASHTYPE).obj
      LNKFLAGS = $(LNKFLAGS_DSP) -o=$@ $(LINKERSCRIPT) $(OBJECTS) --library=libc.a
      LINKERSCRIPT:=../DSP_$(PROGRAM).cmd
    endif
    ifeq ($(DEVICETYPE),C6748_LCDK)
      CC=$(DSP_CROSSCOMPILE)cl6x
      SOURCES+= start_c674x.asm
      CFLAGS = $(CFLAGS_DSP) -ms3 -mo -mv6740 --obj_extension=$(DEVICETYPE)_$(FLASHTYPE).obj
      LNKFLAGS = $(LNKFLAGS_DSP) -o=$@ $(LINKERSCRIPT) $(OBJECTS) --library=libc.a
      LINKERSCRIPT:=../DSP_$(PROGRAM).cmd
    endif
    ifeq ($(DEVICETYPE),C6746)
      CC=$(DSP_CROSSCOMPILE)cl6x
      SOURCES+= start_c674x.asm
      CFLAGS = $(CFLAGS_DSP) -ms3 -mo -mv6740 --obj_extension=$(DEVICETYPE)_$(FLASHTYPE).obj
      LNKFLAGS = $(LNKFLAGS_DSP) -o=$@ $(LINKERSCRIPT) $(OBJECTS) --library=libc.a
      LINKERSCRIPT:=../DSP_$(PROGRAM).cmd
    endif
    
    OBJECTS:=$(patsubst %.c,%.$(DEVICETYPE)_$(FLASHTYPE).obj,$(SOURCES))
    OBJECTS:=$(patsubst %.asm,%.$(DEVICETYPE)_$(FLASHTYPE).obj,$(OBJECTS))
    EXECUTABLE:=../$(PROGRAM)_$(DEVICETYPE)_$(FLASHTYPE).out
    AIS_OUTPUT:=$(patsubst %.out,%.bin,$(EXECUTABLE))
    
    HEX_AIS_PATH:=../../AISUtils/
    HEX_AIS_EXECUTABLE:=$(HEX_AIS_PATH)/HexAIS_$(DEVSTRING).exe
    HEX_AIS_INI:=../$(PROGRAM)_hexais.ini
    
    
    all: $(AIS_OUTPUT) $(LINKERSCRIPT) makefile
    
    .PHONY : clean objclean
    clean:
    		-rm -f -v $(OBJECTS) $(EXECUTABLE) $(AIS_OUTPUT)
    
    objclean:
    		-rm -f -v $(OBJECTS)
    
    $(HEX_AIS_EXECUTABLE):
    		make -C $(HEX_AIS_PATH)/HexAIS all
            
    $(AIS_OUTPUT):$(EXECUTABLE) $(HEX_AIS_EXECUTABLE)
    ifeq ($(shell uname),Linux)
    		mono $(HEX_AIS_EXECUTABLE) -ini $(HEX_AIS_INI) -o $@ $< 
    else
    		$(HEX_AIS_EXECUTABLE) -ini $(HEX_AIS_INI) -o $@ $< 
    endif
    
    $(EXECUTABLE): $(OBJECTS)
    		$(CC) $(LNKFLAGS)
    
    %.$(DEVICETYPE)_$(FLASHTYPE).obj : %.asm
    		$(CC) $(CFLAGS) $(AFLAGS) $<
        
    %.$(DEVICETYPE)_$(FLASHTYPE).obj : %.c
    		$(CC) $(CFLAGS) $< 
    
    vpath %.h ../../../Common/include:../../../../Common/include:../../../../Common/arch/arm926ejs/include:../../../../Common/$(PROGRAM)/include:../../../../Common/ubl/include:../../../../Common/gnu/include:../../../../Common/drivers/include
    vpath %.c ../../../Common/src:../../../../Common/src:../../../../Common/arch/arm926ejs/src:../../../../Common/$(PROGRAM)/src:../../../../Common/ubl/src:../../../../Common/gnu/src:../../../../Common/drivers/src
    vpath %.asm ../../../../Common/arch/arm926ejs:../../../../Common/arch/c6000
    

    Thanks in advance,

    Juan

  • I'm assuming this has nothing to do with adding the print statements, right?  In other words, I assume you couldn't rebuild the utility even before making a change.

    Your screenshot indicates you're using codegen 7.3.0.  You should definitely not be using that version of the compiler.  At a minimum, you should update to 7.3.23, though I would recommend updating to 7.4.24.  You can download codegen tools from here:

    http://software-dl.ti.com/codegen/non-esd/downloads/download.htm

    Maybe something is wrong with your installation, or perhaps that version is so old that we didn't support the index library (libc.a) back then.  I have 7.4.24 installed and can confirm that it has the libc.a file, so that is what I recommend.

  • Yeah, you are right. We are still having issues when trying to rebuild the utility.

    I have installed the versión 7.4.24 as you've recomended and i'm still getting the same error:

    I'm trying to rebuild in Windows 10 using cygwin as you suggest in http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138.

    Do you have another suggestions in order to solve this issue? Or do you need more information about other aspects?

    Best regards,

    Juan

  • I'm wondering if the spaces in your path are causing an issue. I recommend copying some of your directories to somewhere like C:\ti for now to get rid of spaces and see if that fixes things.
  • Nevermind on the spaces. I just deliberately introduced a space and it worked fine. The real issue is your use of the cygwin path. Despite the fact you're building from a cygwin command line, the c6000 compiler doesn't seem to understand that path.

    The way I configured my paths was simply by opening up OMAP-L138_FlashAndBootUtils_2_40\Common\build.mak and editing the variables ARM_TOOLS_PATH and DSP_TOOLS_PATH. The DSP_TOOLS_PATH is where I deliberately added a space (and renamed the directory correspondingly):

    DSP_TOOLS_PATH?=C:\\TI\\'ti-cgt-c6000 7.4.24'\\

    Here's the corresponding output:

    C:\\TI\\'ti-cgt-c6000 7.4.24'\\bin\\cl6x -z -c -estart -a -w -x --search_path=C:\\TI\\'ti-cgt-c6000 7.4.24'\\lib\\ -o=../ubl_C6748_LCDK_SPI_MEM.out ../DSP_ubl.cmd ubl.C6748_LCDK_SPI_MEM.obj device.C6748_LCDK_SPI_MEM.obj uartboot.C6748_LCDK_SPI_MEM.obj device_uart.C6748_LCDK_SPI_MEM.obj uart.C6748_LCDK_SPI_MEM.obj debug.C6748_LCDK_SPI_MEM.obj util.C6748_LCDK_SPI_MEM.obj spi.C6748_LCDK_SPI_MEM.obj spi_mem.C6748_LCDK_SPI_MEM.obj device_spi.C6748_LCDK_SPI_MEM.obj spi_memboot.C6748_LCDK_SPI_MEM.obj start_c674x.C6748_LCDK_SPI_MEM.obj pru.C6748_LCDK_SPI_MEM.obj --library=libc.a
    <Linking>
    warning: entry-point symbol other than "_c_int00" specified: "start"
    ../../AISUtils//HexAIS_OMAP-L138.exe -ini ../ubl_hexais.ini -o ../ubl_C6748_LCDK_SPI_MEM.bin ../ubl_C6748_LCDK_SPI_MEM.out

    So you can see this syntax works properly. When I set DSP_TOOLS_PATH to use a cygwin path I get the same error as you were seeing (i.e. libc.a not found).

    So with this change you should be able to rebuild the library with some additional print statements integrated, and that will hopefully help you to understand the real issue you're debugging!

    Best regards,
    Brad
  • That worked!!!

    Thank you helping Brad.

    Best Regards,

    Juan

  • Did you already figure out the original NOR issue? Hopefully the additional print statements helped.