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.

Load application via EMAC

Other Parts Discussed in Thread: TMS320C6678

I want to  load my application via EMAC, it works ok when the application is small ,and the code is put into L2SRAM,

when the application is too large,the code is put  into DDR , I can not load it into DDR via EMAC,  maybe because the DDR is not intial ,but i don't know how to solve the problem.

  • Your assumption is correct.  DDR does not come up initialized, you'd need to initialize the DDR prior to writing data to the DDR.  You can do this with a small boot code that loads into L2, initializes the DDR, and the re-enter the EMAC boot routine.

    Best Regards,
    Chad

  •  Chad ,Thank you for you answer!

    but how can I re-enter the EMAC boot routine ? The boot mode have been set to be I2C before, Is it can be reset to be EMAC by softwore ?

  • One way to do that is after your DDR configuration, the code should change the DEVSTAT to the value for ethernet boot and also move the program counter to boot re-entry. the boot re-entry addres is 0x20b00008.

    Hope this helps.

    Thanks,

    Arun.

  • Thank you for you reply, the address for DEVSTAT is 0x02620020 and its value can be changed easy.I have read TMS320C6678 datasheet , but I can not find the address for Program counter, how can I change Program counter's value to be re-entry addres (0x20b00008) .

  • Just do far call.

    You may define symbol at .cmd file or define function variable at code an assign its value at run time befor call;

  • How to define a symbol at cmd,?

    the symbol should be assigned address than I want to jump to,is not it ? How can I assign address for the symbol ??

     

  • hello,I did  as you said , the code is following,the problem is

    (1) I can not  capture bootp pakage on my wireshark.(when I set the switch to be EMAC boot mode and I can capture bootp pakage )

    I have checked  DEVSTAT value, it is same with the value when my bord work in EMAC boot  as I set via switch,and also when I connect the core0 via emulater ,the information is that the boot mode is 2 (EMAC mode),so the boot mode is correct.

    (2)I read the bootloader user guid, the boot rom address is 0x20b00000 , so have try to change the re-entry addres to be 0x20b00000, can not capture bootp pakage yet.

    is that means my program did not execute Reboot ?

    what is the problem may be ?

        platform_init_flags     init_flags;
        platform_init_config    init_config;
        unsigned int            corenum ;

        void (*jump)(void) = (void (*)(void)) (0x20b00008);  
        corenum = CSL_chipReadReg(CSL_CHIP_DNUM);
        switch(corenum)
       {
       case 0 :
        {
                // Initialize main Platform lib
      memset(&init_config, 0, sizeof(platform_init_config));
      memset(&init_flags, 1, sizeof(platform_init_flags));
      if (platform_init(&init_flags, &init_config) != Platform_EOK)
      {
       printf ("Platform init failed!\n");
       print_platform_errno();
       return;
      }
      platform_uart_init();
      platform_uart_set_baudrate(BOOT_UART_BAUDRATE);

      CSL_BootCfgUnlockKicker();
      for(j= 0;j<1024;j++)
      DDR[8*j+0]= 0x00000000;
     
         *(unsigned int *)(DEVSTAT_ADDRESS) = 0x00001C85;
         jump();

        }
        break;

     

  • hello,I want to initializes the DDR, and then re-enter the EMAC boot routine.
    the code is following,the problem is

    (1) I can not  capture bootp pakage on my wireshark.(when I set the switch to be EMAC boot mode and I can capture bootp pakage )

    I have checked  DEVSTAT value, it is same with the value when my bord work in EMAC boot  as I set via switch,and also when I connect the core0 via emulater ,the information is that the boot mode is 2 (EMAC mode),so the boot mode is correct.

    (2)I read the bootloader user guid, the boot rom address is 0x20b00000 , so have try to change the re-entry addres to be 0x20b00000, can not capture bootp pakage yet.

    is that means my program did not execute Reboot ?

    what is the problem may be ?

        platform_init_flags     init_flags;
        platform_init_config    init_config;
        unsigned int            corenum ;

        void (*jump)(void) = (void (*)(void)) (0x20b00008);  
        corenum = CSL_chipReadReg(CSL_CHIP_DNUM);
        switch(corenum)
       {
       case 0 :
        {
                // Initialize main Platform lib
      memset(&init_config, 0, sizeof(platform_init_config));
      memset(&init_flags, 1, sizeof(platform_init_flags));
      if (platform_init(&init_flags, &init_config) != Platform_EOK)
      {
       printf ("Platform init failed!\n");
       print_platform_errno();
       return;
      }
      platform_uart_init();
      platform_uart_set_baudrate(BOOT_UART_BAUDRATE);

      CSL_BootCfgUnlockKicker();
      for(j= 0;j<1024;j++)
      DDR[8*j+0]= 0x00000000;
     
         *(unsigned int *)(DEVSTAT_ADDRESS) = 0x00001C85;
         jump();

        }
        break