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.

C6748 NAND flash issue

Other Parts Discussed in Thread: OMAP-L138

Hi,
I followed all the instructions described in How to Flash Face detect demo on EVMC6748 (processors.wiki.ti.com/.../BIOS_C6SDK_2.0_User_Guide ) Of course I used my AISGen file name and my com port. Everything went just fine, the sfh_OMAP-L138.exe programmed the APP file into the flash. But after I set the DISP switches in LCDKC6748 to boot from the NAND flash memory (and cycled the power) nothing happened. My APP did not run.
I am just guessing why. The only thing what I can imagine is that I needed a lot of RAM memory so my far is set to SHDSPL2RAM in the CMD file:

.far           >  SHDSPL2RAM


That means – I guess – the entry point of the APP is different than .far would be set to SHRAM. If found the entry point in the release directory MAP file. It is

ENTRY POINT SYMBOL: "_c_int00"  address: 8000b4a0

I thought I would try to override the Entry point from the default value to 0x8000b4a0 but when I did it in AISGen then I dropped an error message:
“Cannot specify an entry point without at least one binary file.”
Do you have any idea what’s wrong?
Changing the entry point is a bad idea?
How can run my APP after power on automatically in LCDKC6748 dev. kit?
Thanks

  • Hi LouisB,

    Have you changed the facedetect demo code ?
    Able to flash and run the demo code on C6748LCDK board ?

    Why did you change the entry point ?

    Please, try to flash and boot the pre-built binaries or own built demo w/o changing the code.
  • Hi Titus S.

    Thanks for the reply.

    Of course I burned my own APP into the flash. I am sorry if it was not too clear in my post. I have not tried to burn the “face-detect” demo APP yet. I do not need it. It does not help on me if I can burn the “face-detect” demo APP into the NAND flash.

    I could not change the entry point. But, when I generated binary file with AISGEN I noticed that the entry point in AISGEN is different from my entry point I found in the MAP file and In CSS6 disassembly window...

    What I need is to burn my APP into the flash and run it when I turn on the power of the LCDK (without the JTAG Emulator, CCS6 and a commputer).

    Thanks,

    Louis

  • Hi LouisB,

    Ohh, I thought that you were trying to work with face detect demo code.

    What kind of code are you working ?

    is starterware or CSL or any 'C' code ?

    You can refer to the following TI wiki and attachment code that I flashed into NAND & worked.

    C6748_LCDK_LED.tar.gz

  • Hi TitusS,

    Thanks for the answer.

    Yes, I am using StarterWare with LDCKC6748 dev. kit. I created an extender card with a 24-bit, 4 channel ADC + some front end amplifiers on it. The code measures the phase difference between two sinusoidal signals which have the same frequency and amplitude.

    Thanks for the links but I am using LCDKC6748 development kit not OMAP-138. It seems to me you both links based on OMAP-L138 dev. kit. However I found an interesting note about using the DSP L2 RAM 0x11800000 (what I am using). The Boot Images for OMAP-138 wiki document has a note for StarterWare users:

    Use the "Configure PSC" function of AISGen to enable the DSP LPSC (PSC0,#15). If the DSP megamodule is in reset, the L2 RAM will not be accessible so the section loads will fail.

    So I checked the “Configure PSC” check box in AIESGen tool and added “15” into the PSC tab, Enable LPSC Text Box. But it did not help. I am very beginner with the AIESGen tool so would please look over my AISGen.cfg file what I am using, maybe something is wrong in it. Thanks!

    Boot Mode=NAND Flash
    Boot Speed=115200
    Flash Width=1
    Flash Timing=3ffffffd
    Configure Peripheral=False
    Configure PLL0=True
    Configure SDRAM=False
    Configure PLL1=True
    Configure DDR2=True
    Configure LPSC=True
    Configure Pinmux=False
    Enable CRC=False
    Specify Entrypoint=False
    Enable Sequential Read=False
    Use 4.5 Clock Divider=False
    Use DDR2 Direct Clock=False
    Use mDDR=False
    Use DuplicateMddrSetting=False
    ROM ID=3
    Device Type=1
    Input Clock Speed=24
    Clock Type=0
    PLL0 Pre Divider=1
    PLL0 Multiplier=25
    PLL0 Post Divider=2
    PLL0 Div1=1
    PLL0 Div3=5
    PLL0 Div7=12
    PLL1 Multiplier=25
    PLL1 Post Divider=2
    PLL1 Div1=1
    PLL1 Div2=2
    PLL1 Div3=3
    Entrypoint=c1080000
    SDRAM SDBCR=0
    SDRAM SDTMR=0
    SDRAM SDRSRPDEXIT=0
    SDRAM SDRCR=0
    DDR2 PHY=c5
    DDR2 SDCR=134832
    DDR2 SDCR2=0
    DDR2 SDTIMR=264a3209
    DDR2 SDTIMR2=3c14c722
    DDR2 SDRCR=492
    LPSC0 Enable=15+
    LPSC0 Disable=
    LPSC0 SyncRst=
    LPSC1 Enable=13+
    LPSC1 Disable=
    LPSC1 SyncRst=
    Pinmux=
    App File String=C:\ti\AISgen_d800k008_Install_v1.13\AISgen for D800K008\APP bin files\BrickExt.out
    AIS File Name=C:\ti\AISgen_d800k008_Install_v1.13\AISgen for D800K008\APP bin files\BrickExt.bin
    

  • Hi,

    Please post the screenshots of the AIS gen tool , sfh uitlity e.t.c ... sot that we will look into the commands/ settings you used for flashing.

    Hope you already seen these WIKI pages which talk about flashing the binaries into flash memories and followed it correctly.

    http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138

    http://processors.wiki.ti.com/index.php/OMAPL138_StarterWare_Booting_And_Flashing#How_to_flash_and_boot_the_sample_DSP_starterware_app_on_OMAPL138_LCDK_board

    PS: Though these links denotes OMPLA138 LCDK, it is applicable for C6748 LCDK and C6748 EVM too; provided that the target name would be C6748LCDK or C6748EVM)

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------

  • Thanks for the suggestions.

    But! Both suggested wiki ducuments want to boot the LCDKC6748 from SPI0 serial flash. The LCDKC6748 can not be booted from SPI flash, only from NAND16 flash or MMC/SD0 card and UART2.

    I wrote a document what I attached. In this document I tried to present how I tried to program/boot from the flash. Please read it and comment it.

    Thanks,

    Louis

    3858.BootLoader questions.pdf

  • Hi Shankari,
    Good news. The issue is solved. When I turn the power on my APP runs just fine.
    The processors.wiki.ti.com/.../OMAPL138_StarterWare_Booting_And_Flashing wiki document helped me out because it explained how to modify the ENTRY_POIINT of the application (which was my original question why I started this topic).

    1. I needed to import bootloader project from the [StarterWarePath]\build\c674x\cgt_ccs\c6748\lcdkC6748\bootloader folder into the CSS6

      Note: After importing I got tons of errors/warnings. I needed to fix the missing libs and include references. It did not take more than 15 minutes…
    2. I compiled my application (Release)
    3. I needed to copy out the Entry Point address from [APP_NAME].map file, line#7:
      ENTRY POINT SYMBOL: "_c_int00"  address: 8000b4a0
    4. I opened the bl_main.c file from the bootloader application.
    5. I had to find the following definition:
      unsigned int DspEntryPoint = 0;  // !!!!! Entry point is null?

      And changed to:

      unsigned int DspEntryPoint = 0x8000b4a0;
    6. Then I compiled the bootloader and use the boot.out file as I described in the “BootLoader question.pdf” file in my previous post.


    Finally the question is still a question: Why the AISGen does not allow me to enter the new entry point address? It has an entry box for that but if I change the entry point address then it does not create the bin file and drops the following error message: “Cannot specify an entrypoint without at least one binary file.”

    Thanks Shankari for your suggestions. Without these I could not burn my APP into the NAND flash within a single week (5 days) In other words, with 35 year HW & SW practice with –at least - 11 different CPUs (None of those was from TI), I needed 5 days from my life to start the application I wrote when I power up the development kit. It is so simple. Hey TI? Don’t you think you should do something with this to make it simpler?
    Best regards,
    Louis

  • Hi All,
    I am sorry but it does not work. I had a lucky situation yesterday and I thought the flashing and booting worked. I tried to repeat the procedure today afternoon but my APP does not run. The procedure: (my app name is BrickExt)

    1. I created BrickExt.bin:
       out2rprc.exe BrickExt.out BrickExt.bin
    2. I used the AISGen for NAND, 16-bit, DSP chip. I used the “1348.C6748_LCDK_AISGen_Config.cfg” config file what Rahul suggested in another topic of this forum. The “entryPoint” and “DSPEntryPoint” were set back to their original value to 0 in bl_main.c. I created the “boot.ais”.
    3. I turned OFF the power and removed the emulator.
    4. I switched the SW2 and 4 to ON, SW1 and 3 to OFF and turned the power ON.
    5. I erased the flash:
      sfh_OMAP-L138.exe -erase -targetType C6748_LCDK -flashType NAND -p COM7
    6. 6. I burned the UBL and DSP images with this command:
      sfh_OMAP-L138.exe -flash boot.ais BrickExt.bin -targetType C6748_LCDK -flashType NAND -p COM7
      
    7. I turned the power OFF and switched the DIP SW2,3 and 4 to ON and SW1 to OFF.
    8. I started the TeraTerm emulator on COM7, 115300 baud
    9. I turned the power ON
    10. Nothing happened except the “StarterWare C6748 Boot Loader…” appeared in TeraTerm emulator continuously.

    I tried this procedure 100++ times. Form the TeraTerm output I think the bootloader always restarts. Is it the Watchdog Timer? The other funny observation that there is no “Jumping to StarterWare Application...” log in the terminal screen, nor Flash error messages.
    Well I am lost. I do not know how did it work yesterday. Can anybody help?
    Thanks
    Louis
    PS: I tried to print out my log messages with 

    UARTprintf(“Entry point = %x\r\n\n”, entryPoint);

    but the UARTprintf) function does nothing. It does not print any character to the terminal screen…

  • I take it you have successfully run you code from CCS via JTAG and now want to run standalone from flash. Execution from CCS does a lot of initialization that needs to be ported to your code

    1) GEL script. Move initialization from here to first thing in main(). The GEL script is in "C" so it is fairly easy to move. Move one line at time and test run from CCS. Continue until nothing left in the GEL script. Some of the GEL script init could be handled in AIS but I suggest just porting all it over. I have found AIS just needs to setup clocks and DDR if your program lives there.

    2) Compile with --rom_model rather than --ram_model. This ensures you global variables are intialized by compiler generated code that runs before main(). Otherwise, CCS/JTAG initializes it. That won't work with standalone.

    3) You should not need to use the StarterWare Boot Loader, out2rprc, etc. I have boot directly into my StarterWare Application. The StarterWare Boot Loader does not really gain you much. If it had some sort of flash programming feature, it would handy to updating. Last I checked it did not.

    4) Test with a simple "Hello World" project first. Change the linker cmd script to put it all in L2 or L3 RAM so that you don't need to configure AIS for DDR init.
  • Hi Norman,
    Thanks for the suggestions. Yes, I would like to run my program from flash. I read tons of TI documents and topics in this forum about how to flash and run an APP but there were very confusing.

    1) GEL script. I could not find any GEL script in my project. I found the [ccsv6InstallDir]\ccs_base\emulation\boards\lcdkc6748\gel\C6748_LCDK.gel file. Do you mean that I have to move the whole content of that GEL file (including functions and macros) into main()? How should I execute these functions and which one?

    2) ROM model. Do you mean link (not compile) it with“--rom_model”? If so then, yes, it is linked with “--rom_model”. This is the default setting in my CCS6. (I did not set the linker to use the “--rom_model” flag.)

    3) BoolLoader. Okay, I am happy if I do not have to use the bootloader but how do you boot directly into your StarterWare app?


    4) “Hello World APP”: Yes, I am experimenting with a simple LED blinking project. Yes, the APP runs from SHRAM.

    Why it is so complicated to burn a flash with my APP and run the APP from the flash, not RAM?
    Thanks for your help!
    Best regards,
    Louis

  • CCS projects automatically points to installed GEL scripts. On my machine, I have two:
    C6748_StarterWare_1_20_04_01\tools\gel\C6748_LCDK.gel
    or here:
    ccsv5\ccs_base\emulation\boards\lcdkc6748\gelC6748_LCDK.gel
    They are both the same. Copy one out into your project and modify the project to use the local GEL script. CCS sets the GEL location somewhere in the target config.

    The root of the initialization code is OnTargetConnect(). You can use GEL_TextOut() to print out messages to your CCS console to check your work. The default GEL script initializes everything. You can try reducing the init to save boot time and power.

    Alternative is to port over the GEL initialization to AISGEN. Quickly and simpler. However the GEL script may do things that the AISGEN does not support. Don't ever lose the AISGEN config file. I am not fond of code being split, hidden or auto-magically happening. A lot of TI stuff is that way.

    Since you have a JTAG debugger, I would suggest using the TI NAND writer. It is included in TI's PSP package and also available here:
    sourceforge.net/.../dvflashutils
    It has projects for both ARM and DSP. I've personnally use the DSP SPI version. I haven't had to use the NAND version. The serial programmer might be faster but it is a lot more complicated.

    On my system, the ROM Bootloader loads my StarterWare App directly. The StarterWare APP (.out) is passed through AISGEN to get a AIS file (.bin). That AIS file (.bin) is programmed to offset 0 of your flash.
  • Hi Norman,

    I think the GEL file (and functions) can only be used in debug mode. The GEL file really looks like a C code file but I think CSS6 interprets it in debug mode. You can call any GEL_xxx() function from any input field which accepts a variable name. If you import a GEL file to your project and you try to call the OnTargetConneccted() event handler function then it will cause a “Function declared implicitly” error when you compile it, because it does not have prototype.

    The target configuration does not have option to include the GEL file because the GEL file is a macro like thing. The functions which has “hotmenu” return value(? is this really a return value?) appear in the Tools menu if you are in debug mode and belong to the menu item defined with say menuitem "C6748 Memory Map".

    Porting the GEL file To AISGen is a real possibility but it seems to me too complicated thing...

    The NAND writer is a CSS6 project. I do not see how I could use it for writing my app code to the flash but it might work.

    You mentioned that your APP code (*.out) file is passed through AISGen. Well as far as I know the AISGen is for creating binary version of the User BootLoader app (the UBL) not for generating the binary DSP APP code for *.out file. TI has a dedicated CMD app for this: out2rprc.exe.

    Thanks for your suggestions but I do not see how I could use them. Anyway I appreciate your help.
    Best regards,
    Louis

  • The functionality of AISGEN is not specific to bootloaders. It converts a executable (.out) into a AISGEN command file (.bin). The ".out" file is not strictly binary code. It contains symbols, sections, constructors, debug info, etc that is used by CCS. AISGEN parses all that to create a series of commands that replicate how CCS loads a ".out" onto a target. Not all target configuration is in the ".out" file. The rest is in the GEL script. For that, the AISGEN command set allows HW configuration and it enter manually into the AISGEN dialog windows.

    The GEL script can't be imported wholesale into a project. I had to move one line at a time from the ".gel" to a ".c" file. As you noticed it does contains menu item definitions. The OnTargetConnect() does get run on target connect and it does run all that initialization "macro" code.

    If the NAND Flash Writer project is anything like the SPI Flash Writer, it will prompt you in the CCS console window for a file type (AIS, u-boot, other, etc) and file name on the host. Most amazing is that the file is sent over JTAG from the Host to the Target. The file is then programmed into Flash by target code.
  • Thanks for info. The “OMAP-L138_FlashAndBootUtils_2_40” contains a lot of projects, files, compiled programs, but I could not find any readme.txt or any documentation how to use it. Would you please explain how can I import the NAND Writer project (and which one) into CSS6 (for LCDKC7648)?

    Meanwhile I tried to import the ..\OMAP-L138_FlashAndBootUtils_2_40\OMAP-L138\CCS\NANDWriter\NANDWriter_DSP.pjt project file (as legacy CCS project) into my CSS6. I have a couple errors.

    • It is a CSS 2.0 project. It was converted to CSS6. I had to remove a couple of includes from project properties/Include options because include paths were not found.
    • The “Build variable C6000_CSL_CG_ROOT could not be resolved”. I ignored this warning.
    • The “Function LOCAL_getOPP was declared but never referenced” in device.c. I commented it out.
    • I changed the NANDWIDTH to 16 bit. (LCDKC6748 has 16-bit NAND falsh chip)

    Is this the right NAND Writer project for me?
    Thanks,
    Louis

  • The one you found at OMAP-L138\CCS\NANDWriter\NANDWriter_DSP.* should be the one for the C6748. With the SPI Flash Writer and CCSv5 (never upgraded to v6), I must have had to do the same sort of work-arounds to get it to compiler. Long ago forgotten about all that. I ended up starting with an empty CCSv5 C6748 project and collecting all the source files into one directory.

    Looking back at this thread, I think all the parts are already there.
    1) Using CCS, build your app "your_app.out"
    2) Using AISGEN,
    load LCDK_AISGen_Config.cfg
    with DSP Application File = "your_app.out"
    with AIS Output File = "your_app.bin"
    3) Program AIS "your_app.bin" using sfh_OMAP-L138.exe
    sfh_OMAP-L138.exe -erase -targetType C6748 -p COM7 -flashType NAND
    sfh_OMAP-L138.exe -flash -targetType C6748 -p COM7 -flashType NAND -flash_noubl your_app.bin
    or
    nandwriter.c project

    Reference:
    processors.wiki.ti.com/.../C6748_Development_Kit_(LCDK)
    See section: Procedure to Flash and boot the LCDK

    In theory, LCDK_AISGen_Config.cfg covers the GEL script initialization. No need to bother with the GEL script port. Sorry about that. I worked with very early AISGEN and C6748 silicon that had less AIS features.
  • Noticed that C6748 should be C6748_LCDK.
    sfh_OMAP-L138.exe -erase -targetType C6748_LCDK -p COM7 -flashType NAND
    sfh_OMAP-L138.exe -flash -targetType C6748_LCDK -p COM7 -flashType NAND -flash_noubl your_app.bin
    The sfh code appears to use the targetType to select which sft image to load.
  • Hi Norman,
    After executing the above procedure (+ DIP switch setting) nothing happens. My app does not start, the bootloader is continuously prints the “StarterWare C6748 Boot Loader” to the USB COM port. Sorry.

    But! I successfully programmed my APP with NADWRITER.c!!! But when you enter the path of app.bin it should be a simple path, like C:\Temp\[yourAppName].bin. The NANDWRITER does not like the spaces if file path.
    So the working procedure is:

    1. Compile your app ([yourAppName].out) in CSS6.
    2. Use AISGen
      1. Load LCDK_AISGen_Config.cfg
      2. Make sure that Device Type is d800k008 and DSP, the Boot mode = NAND Flash, In the Flash tab the Data width = 16-bit
      3. DSP App File = [yourAppName].out
      4. AIS Output File [yourAppName].bin
      5. Click Generate AIS
      6. Copy the [yourAppName].bin into C:\Temp\[yourAppName].bin
    3. Connect the JTAG Emulator to the LCDK dev. kit
    4. Turn OFF DIP SWITCHES 1, 2, 3, 4 (Not sure that this step is necessary)
    5. Turn on the LCDK kit.
    6. Start CSS6
    7. Debug the Nandwriter project. (You need to import it first see my last post about it)
    8. Run the Nandwriter project.
      1. Press “y” and Enter in console window when it asks for erasing the flash. Wait 2-3 seconds.
      2. Enter the path to C:\Temp\[yourAppName].bin in Console window and press Enter
      3. Wait a bit. It will list the block and page numbers which were programmed.
    9. Close the debug mode in CCS6
    10. Turn off the LCDK kit.
    11. Disconnect the JTAG Emulator.
    12. Set DIP Switches 2, 3, 4 = ON (leave the SW1 in OFF state).
    13. Turn the power ON. Your app should run.

    Thanks Norman for helping me out! This Nandwriter project was a good idea.
    Best regards,
    Louis

  • The output of “StarterWare C6748 Boot Loader” would suggest that the StarterWare boot.bin was programmed into NAND rather than [yourAppName].bin. Maybe sft failed and an old boot.bin remained in NAND. Never liked the sft utility for it's complexity. A lot can go wrong.

    I would suggest avoiding the StarterWare bootloader for now. Or any bootloader. Unless you want field updating.

    Thanks for posting detailed steps to your solution. It will help others. Please mark your thread as verified.
  • Hi LouisB,

    Sorry for the inconvenience.

    Sounds good.
    Thanks for your detailed explanations with steps.
    Actually we have captured "starterware flashing and booting" steps in TI wiki and some of new members are struggling to make it work like you :-( , so we will update these (NAND writer) steps in wiki too.
    Overall, you succeed with NAND writer tool. :-)

    Hi Norman,
    Your help is very much appreciated.
    Thank you.
  • Thanks for your help Norman and Titus.

    I would like to ask Texas Instruments to think about implementing the "flashing" function as a GEL function or any other way. The NANDWriter.c project is unnecessarily complicated, but it is a nice starting point for that function. I used many other vendors chips an and IDE and I can tell you that all the IDEs had a Program Flash button...

    Louis

  • Hi LouisB,
    Sure.
    Thanks for your suggestion.
  • Dear Norman,

    I am also trying to boot the C6748 LCDK (it is the new revision board without the finger print reader, revision number not stated).

    I am using the NANDWritter application to load the boot.ais (made from boot.out).

    The NANDWritter shows "success", but I only see 0xFFFF on the memory browser for the NAND CS3 (0x62000000).

    When I power cycle the board, the CPU is still running the L2 ROM code and stays IDLE in address 0x00712148, which means that it did not find my code in NAND.

    Do you have any idea what  the problem is? The GENAIS and Dip Switches are correct.

    I guess that you are familiar with the issue that the new C6748 LCDK boards did not boot according to the quick start guide, but I think that this is not a NAND flash issue, but a software bug in the demo code (the demo code was written for the Logic PD boards).

    Please note that I WAS ABLE TO BOOT FROM SD using similar tools.

    Thanks,

    Avi Tal.

  • Hi Avi,

    Which NAND writer do you use?

    Take "NAND writer" from the C6748 starterware package. "~\ti\C6748_StarterWare_1_20_04_01\tools\flash_writer\src"
  • Hi,
    This seems to be for AM335 and not C6748 LCDK.
    I modified the code to fit C6748, but it does not work.
    I used C:\Program Files (x86)\Texas Instruments\c6sdk_02_00_00_00\tools\OMAP-L138_FlashAndBootUtils_2_36\OMAP-L138\CCS\NANDWriter before I tried your suggestion.
    Thanks,
    Avi.

  • I guess that you are familiar with the issue that the new C6748 LCDK boards did not boot according to the quick start guide, but I think that this is not a NAND flash issue, but a software bug in the demo code (the demo code was written for the Logic PD boards).

    If you are using C6748 LCDK board, you don't want to use boot.out (starterware bootloader) and you can run the DSP app directly.

    You have to use only C6748 LCDK board based code and not LogicPD EVM board code.
    Use the following GPIO example, built and convert into AIS then flash.
    C:\ti\C6748_StarterWare_1_20_04_01\examples\lcdkC6748\gpio

    Definitely it work for you as it worked for me.
  • Hi Titus,

    I did that. It does not work. It only works from micro SD.

    What do you use for programming the NAND?
    When I power cycle the board, the CPU is still running the L2 ROM code and stays IDLE in address 0x00712148, which means that it did not find my code in NAND.

    Are you are familiar with the issue that the new C6748 LCDK boards did not boot according to the quick start guide?
    Can this be a NAND issue?

    Thanks,
    Avi.
  • Which RAM are using to run the code ?
    Can you please try internal RAM ?
    Modify the linker command file.
  • Hi Titus,

    I tried that.
    The code is not even loaded.
    When I power cycle the board, the CPU is still running the L2 ROM code and stays IDLE in address 0x00712148, which means that it did not find my code in NAND.
    Are you are familiar with the issue that the new C6748 LCDK boards did not boot according to the quick start guide?
    Can this be a NAND issue?

    Thanks,
    Avi.