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.

About TMDXICE3359 NOR Boot

Guru 15520 points
Other Parts Discussed in Thread: SYSBIOS

Hi,

I have question about TMDXICE3359 board and ISDK.

I'm using ICE and trying to boot from NOR Flash.
It seems that NOR bootloader is working but the application never executed.

I wrote NOR BootLoader to 0x0800_0000 and application to 0x0801_0000 of NOR Flash.
The application is i2c_led sample from ISDK.
There was no prebuild i2c_led sample for NOR boot, so I re-build the project.
I only setup Post Build Script parameter from CCS as follow:

"${IA_SDK_HOME}/tools/post_build/post_build.bat" "${CCS_INSTALL_ROOT}"
"${CG_TOOL_ROOT}" "${PWD}" "${ProjName}" "${IA_SDK_HOME}\tools\isdk_image\"
"1" "2" "0x08010000" "0x08010000"

Am I mistaken something or is there anything else to setup?
Please give me an advise.

best regard,
g.f.

  • g.f,

    Application execution from NOR flash on ICE board is not straight forward. Because of some pinmux restrictions, only 128K of NOR flash can be accessed at a time. We use GPIO pins as address pins for accessing other NOR flash sectors.

    I need more info inorder to answer your question.

    1. Which ISDK version are you using
    2. To which NOR sector (sector number entered while while NOR flasher is executed) you are flashing the i2c_led binary.
    3. What is the size of your binary

    As a quick step, you build the application with the following post build script.

    "${IA_SDK_HOME}/tools/post_build/post_build.bat" "${CCS_INSTALL_ROOT}"
    "${CG_TOOL_ROOT}" "${PWD}" "${ProjName}" "${IA_SDK_HOME}\tools\isdk_image\"
    "1" "2"  "0x08020000" "0x08020010"

    And then flash the application to NOR flash sector 2. This should execute the application from NOR flash.


    Regards,

    Shahid


  • Hi, Shahid

    Thank you for the response.
    And I'm so sorry that my response was so late.

    I'm using ISDK v1.0.0.6.
    The led binary size is 101KB and I was flashing it to Sector 1 of NOR.

    I build the program with post build script which you wrote,
    and flashed to sector2 but the led application didn't run.

    Do I need to modify something in the led program, like am335x.cmd file ?

    best regards,
    g.f.

  • Hi g.f

    have you erased the application which is flashed to sector 1 earlier ? If not, please erase sector 1 to 3 using NOR Flasher and flash your new application once again.

    If this doesn't help, please share you map file here.

    Regards,

    Shahid

  • Hi, Shahid

    Thank you for the response.
    I erased sector 1 to 3 and flashed led application to sector 2,
    but so far it still didn't run.

    I will share my map file, please check the file.

    best regards,
    g.f.

  • Hi g.f,

    Your application is built to be executed from DDR, not from NOR. You need to build your application for NOR. to do this, you need to modify you linker command file and .cfg file.

    Basically, you need to tell the linker to allocate you application sections to NOR. Attaching a linker command file which will do the job.

    
    MEMORY
    {
    	/* 16 bytes reserved for application header */
        NOR_1 (RX) : org = 0x08010010, len = 0xFFF0
    	NOR_2 (RX) : org = 0x08020010, len = 0x1FFF0
    	NOR_3 (RX) : org = 0x08040000, len = 0x20000
    }
    
    
    SECTIONS
    {
    	.init: { boot*(.text)} load > 0x08020010
    	.text: load >> NOR_2
        .cinit: load > NOR_2
        .init_array: load > NOR_2
        .const: load >> NOR_2
        .vecs: load >> NOR_2
    }
    
    	
    
    
    

    Also, you need to modify your .cfg file to exclude those sections by the default linker command file. Simply add the below given code to your .cfg file.

    ///////////////////////////////////////////////////////////////////////////////////////

    /* Begin: Force application to run from internal memory */

    var memmap = Program.cpu.memoryMap;
    var SRAM_HI = null;
        
     // Find SRAM_HI in memory map
     for (var i=0; i < memmap.length; i++) {
       if (memmap[i].name == "SRAM_HI") {
         SRAM_HI = memmap[i];
       }
     }
     
     // Place the MMU table in the SRAM_HI memory segment if it exists
     if (SRAM_HI != null) {
       sectionName = "ti.sysbios.family.arm.a8.mmuTableSection";
       Program.sectMap[sectionName] = new Program.SectionSpec();
       Program.sectMap[sectionName].type = "NOINIT";
       Program.sectMap[sectionName].loadSegment = "SRAM_HI";
       sectionName = ".bss";
       Program.sectMap[sectionName] = new Program.SectionSpec();
       Program.sectMap[sectionName].loadSegment = "SRAM_HI";
       sectionName = ".rodata";
       Program.sectMap[sectionName] = new Program.SectionSpec();
       Program.sectMap[sectionName].loadSegment = "SRAM_HI";
       sectionName = ".neardata";
       Program.sectMap[sectionName] = new Program.SectionSpec();
       Program.sectMap[sectionName].loadSegment = "SRAM_HI";
       sectionName = ".stack";
       Program.sectMap[sectionName] = new Program.SectionSpec();
       Program.sectMap[sectionName].loadSegment = "SRAM_HI";
       sectionName = ".data";
       Program.sectMap[sectionName] = new Program.SectionSpec();
       Program.sectMap[sectionName].loadSegment = "SRAM_HI";  
     }

    /* End: Force application to run from internal memory */
    Program.sectionsExclude = "^\\.text|^\\.cinit|^\\.init_array|^\\.const|^\\.vecs";

    //////////////////////////////////////////////////////////////////////////////

    Regards,

    Shahid

  • Hi, Shahid

    Thank you for the response and the detail.

    I allocated my application sections to NOR and modify the .cfg file with the
    code which you show. But, it's still didn't run.
    I will attach my map file again.

    By the way, which NOR Writer and Bootloader for NOR are you using?
    I'm using following Writer and Bootloader:
    NOR Writer : Prebuild which is inside the ISDK "tool" file.
    Bootloader : Prebuild which is inside the Prebuild ISDK v1.0.0.6

    I want to check my ICE board are fine or not.
    Could you share your bootloader and led app binary file?

    best regards,
    g.f.

  • Hi g.f,

    Map file looks to be fine. Ideally, you should be able to execute this application from NOR flash if you have proper bootloader and app in NOR flash.

    NOR flasher and Bootloader from 1.0.0.6 should work fine. They are tested.

    One question, have you connected the boot Jumpers properly on ICE? It is the J10 pins on ICE. Please see Getting started guide for details.If this is not set, NOR booting will not work. If you have connected this and still NOR app is not running, then we need to do some debugging here.

    Please do the following.

    • Put hardware break points on the following memory locations. 0x402f0400 , 0x08000000  from CCS
    • Do a System reset from CCS
    • See where is the execution halted. If execution is halted at 0x402f0400 , SPI flash bootloader is loaded. Otherwise if the execution is halted at 0x08000000, NOR bootloader is loaded. If the execution not halted at any of the two above, this means that there are not proper bootloaders in SPI and NOR.
    • If the execution is halted at 0x08000000, Then have two more hardware break points at  0x08010010 and 0x08020010. Then resume execution (F8).
    • See if the execution halted again. If is is halted at 0x08010010 this means that there is an application at NOR sector 1( which we are not expecting) If the execution is halted at 0x08020010 this means your application is detected by bootloader. If execution isnot halted at all, this means that bootloader could not find a valid application in any of the NOR sectors. 

    Regards,

    Shahid

  • Hi, Shahid

    Thank you for the response.

    Yes, I connected the boot jumper properly.
    I checked the SYSBOOT register from CCS, it was set to NOR Boot.

    I'm going to start some debugging which you introduced to me.

    best regards,
    g.f.

  • Hi, Shahid

    Sorry, my response was taking a time.

    I debug and the result was as following:

    First put hardware break point on the 0x402f0400 and 0x08000000.
    ->Execution was halted at 0x08000000, so NOR Bootloader was loaded.

    Then I put hardware break point on the 0x08010010 and 0x08020010.
    ->Execution was halted at 0x08020010, so the application was detected by bootloader

    Then I continue execution and the program counter jump to the 0x0002000c.
    The led never lights up.

    If you have led app binary file, could you share the file?
    By the way my ICE board revision is v1.0A, which board revision are you using?

    best regards,
    g.f.

  • hi g.f

    I believe the issue is mmu state.

    Can you see if mmu is disabled in .cfg file ? mmu need to be disabled by default for NOR app to work.

    Basically, you should have a line as given below. If not present, add this line to .cfg file and try again.

    Mmu.enableMMU = false;

    One more thing, you need to add the NOR memory into mmu page table.Please add below given line to application mmu ( applMmuEntries) structure.

    {(void*)0x08000000,(void*)0x08000000,0,1},  //NOR - Non bufferable| Cacheable

    There is another thread which discusses the same issue. - http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/255942.aspx

    Regards,

    Shahid

  • Hi Shahid,

    Thank you for quick response.

    I will check and try it.

    best regards,
    g.f.

  • Hi Shahid,

    Thank you so much.
    LED application are running successfully!
    It was MMU setup as you suggested to me.

    best regards,
    g.f.