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.

CCS/TMS320F28377S: Problem in running "usb_host_msc" from FLASH

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

I am running example "usb_host_msc" from RAM and it is running. 

But when I try to run it from FLASH it go in to illegal isr. I select FLASH from property-> general-> configuration->CPU1_FLASH-> SET_ACTIVE-> OK. 

I also try to put "_FLASH" in predefined symbol --but it is not working.

when I  run step by step debugging and I find out it is trapped in ISR after "USBHCDInit" function.

I want to use this code in to my project and it is running from FLASH. So please help ti solve this.

 

  • Hello,

    Can anyone help me
  • Hi, We will have an engineer look at this shortly.

    sal
  • Hi Sam,

    I am trying to debug this. Please expect a reply shortly.

    Regards
    Harshmeet
  • this is a bug in the example ??

    Or some problem with linker setting

  • any update...

    Thanks
  • Hi Sam,

    We have run this example from both RAM and flash and we experienced no issues. The FLASH build configuration worked perfectly. You should be able to just change the build configuration and it should work.

    Regards,
    sal
  • usb_host_msc.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    //###########################################################################
    //
    // FILE: usb_host_msc.c
    //
    // TITLE: Main routines for the USB Host MSC example.
    //
    //###########################################################################
    // $TI Release: F2837xS Support Library v210 $
    // $Release Date: Tue Nov 1 15:35:23 CDT 2016 $
    // $Copyright: Copyright (C) 2014-2016 Texas Instruments Incorporated -
    // http://www.ti.com/ ALL RIGHTS RESERVED $
    //###########################################################################
    //
    // Included Files
    //
    #include "F28x_Project.h"
    #include <stdint.h>
    #include <stdbool.h>
    #include <string.h>
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "inc/hw_ints.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/systick.h"
    #include "driverlib/uart.h"
    #include "driverlib/usb.h"
    #include "driverlib/usb_hal.h"
    #include "usblib/usblib.h"
    #include "usblib/usbmsc.h"
    #include "usblib/host/usbhost.h"
    #include "usblib/host/usbhmsc.h"
    #include "utils/cmdline.h"
    #include "utils/uartstdio.h"
    #include "third_party/fatfs/src/ff.h"
    //*****************************************************************************
    //
    //! \addtogroup cpu01_example_list
    //! <h1>USB Mass Storage Class Host (usb_host_msc)</h1>
    //!
    //! This example application demonstrates reading a file system from a USB mass
    //! storage class device. It makes use of FatFs, a FAT file system driver. It
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Please see the attachment (c file) and screen shot,

    This is my code, it is for TMS320F28377S, I use SCI C (gpio 89,90)  crystal freq is 10Mhz and some changes in peripheral clock.

    SysCtlClockSet(SYSCTL_OSCSRC_XTAL | SYSCTL_PLL_ENABLE | SYSCTL_IMULT(20) | SYSCTL_SYSDIV(2));
    SysCtlAuxClockSet(SYSCTL_OSCSRC_XTAL | SYSCTL_PLL_ENABLE | SYSCTL_IMULT(12) | SYSCTL_SYSDIV(2));

    Can you check and help me what is wrong

     


     

     

     


     

     

     

     

     

     

  • Hi,

    It appears you did everything you needed to convert to flash. I see you modified the divider for the Aux clock. This is good. It needs to run at 60MHz. 

    Why do not have the SYSCLK running at 200MHz? Why did you leave the divider at 2? The controlCard examples expect an XTAL of 20MHz, so you can drop the SYSCLK divider to 1.

    Are you getting any ocmmunication from the SCI? Have you confirmed this is running properly from RAM with this clocking and SCI configuration. What if yo uchange the divider of SYSCLK to 1 and have the device run at 200MHz, does that change anything?

    What are you seeing from the COM port?

    Regards,

    sal

  • 1. Why did you leave the divider at 2? The controlCard examples expect an XTAL of 20MHz, so you can drop the SYSCLK divider to 1----I tried this, but microcontroller not recognize the pen drive.

    One more chang I made is  "#define SYSTEM_CLOCK_SPEED      20000000", I not mentioned this in my previous post.  

    2. What if you uchange the divider of SYSCLK to 1 --Microcontroller not recognize the pen drive. Message are coming form serial port but when I try to give command like "help", microcontroller not respond.

    2. Why do not have the SYSCLK running at 200MHz? --I am working on motor control and this is the CPU frequency at which my project is running. And I can't change this.

    3. Have you confirmed this is running properly from RAM with this clocking and SCI configuration. --Yes, please see screenshot.

    But I not understand, If program is running from RAM then why it is not running from flash?.even when every thing is same.

  • hello
  • hello






    The change you made to the SYSTEM_CLOCK_SPEED should be consistent with what your actual SYSTEM CLOCK SPEED is, which is 100Mhz.

    I would first work to make sure you are getting correct communication via SCI from the device. Have you tried running the orginal example from flash. We have experienced this working.

    It is hard to say what your problem is, but I would follow these basic debugging steps going forward.
    1) get example as is running from RAM
    2) get examples as is running from flash( using FLASH configuration)
    3) begin to modify SYS CLK - incrementally make the changes you need so you can identify what you are doing to break the USB functionality.

    Hope this helps,
    sal
  • One more thing, In my circuit gpio 72,84 are high(factory
    default boot mode select pin ). Can both of them can cause problem?