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.

InstaSPIN questions about running labs on flash memory and creating a custom application

Other Parts Discussed in Thread: MOTORWARE, DRV8312

Hi,

I am new to InstaSPIN and I have two questions about the software.

1. I am following the labs to learn about InstaSPIN. During using DRV8312EVM with a PM motor at proj_lab02d, I changed the project configuration from 'Released' to 'Flash' to test run the lab from the flash memory. Compile and link finished with no error. But it did not go through the debug process, and CCS showed an error message (error -1142). Am I missing anything for running the code from the flash memory?

2. At the page 57 of the InstaSPIN user;s guide (SPRUHJ1C), it was recommended to create a motorware-like folder structure and use it if I want a custom project. But user's guide does not explain the way how to create and setup the new project. Can anyone give me more detailed step-by-step instruction to begin a custom project at the motorware environment or to copy one of the sample labs and use it as the beginning point of the custom project?

Thank you for your help in advance.

  • 1. it will run as is if you are still connecting to JTAG.  If you have your code so you don't want JTAG access you will have to change SW3 on the controlCARD to off

    SW3:

    TRST/ ISO SCI communication signal enables

    Position 1:

    ON -

    TRST signal from ISO JTAG circuit will be connected to F2806x.

    Needed during JTAG debug using ISO JTAG.

    OFF -

    TRST signal from ISO JTAG circuit will NOT be connected to

    F2806x. Needed when the application is running from flash at power up

    without the JTAG connections.

     

    2. Yes, agree it isn't completely clear. There are several options. The key is that you want your project to be portable to any version of MotorWare so that you can stay on a release, or migrate quickly to a new one.

    On page 57 the recommendation is to make a new structure // to motorware install and at the same folder level.  I actually find this difficult, because all of the linked resources in a project are based on a self referencing to their location. So if you start a new \mymotorware\ folder just for your project and main.c you will have to go change every reference to MW_INSTALL_DR.

    I think this is the easiest way.
    Take the example of wanting to base your project on InstaSPIN-FOC proj_lab10a using DRV8312 and F2806xF

    1.  In your most recent version of MotorWare, create a new solutions folder
    sw\solutions\myinstaspin_foc

    2. copy the appropriate paths / create same folde structure  from  \instaspin_foc

    3. copy boards\drv8312kit_revD\f28x\f2806xF\src\user.h

    4. copy instaspin_foc\boards\drv8312kit_revD\f28x\f2806xF\projects\ccs5\proj_lab10a  and rename to
    myinstaspin_foc\boards\drv8312kit_revD\f28x\f2806xF\projects\ccs5\my_lab10a

    4b.   Open   \my_lab10a\.project     file in text editor and
    Find: proj_lab
    Replace: my_lab 
    Find: instaspin_foc
    Replace: myinstaspin_foc
    Save

    5. copy these files from      instaspin_foc\src\    to   myinstaspin_foc\src\ 
    ctrl.c
    ctrl.h
    main.h
    user.c
    proj_lab10a.c --> rename to my_lab10a.c  [fixed typo on 4/17/14]
    proj_lab10a.js --> rename to my_lab10a.js [fixed typo on 4/17/14]

    You should end up with a folder structure like this:

     

    6. You can now import, build, compile, and run
    sw\solutions\myinstaspin_foc\boards\drv8312kit_revD\f28x\f2806xF\projects\ccs5\my_lab10a

    7.  When MotorWare has an update you can simply copy over your
    "myinstaspin_foc" folder

    and you will want to use a program like Beyond Compare to see if there were any updates to the
    sw\solutions\instaspin_foc\src\
    ctrl.c
    ctrl.h
    main.h
    user.c
    proj_lab10a.c

    that you would want to incorporate into myinstaspin_foc

    8. When you build your own hardware you simply create
    myinstaspin_foc\boards\myboard_revA

    copy over the files from
    myinstaspin_foc\boards\drv8312kit_revD

    and then you will have to add in your own hal.c and hal.h from
    sw\modules\hal\boards\drv8312kit_revD\f28x\f2806x\src

    to
    sw\modules\hal\boards\myboard_revA\f28x\f2806x\src

    or, to keep everything portable in your
    sw\solutions\myinstaspin_foc

    you may want to move your hal files to
    sw\solutions\myinstaspin_foc\boards\myboard_revA\f28x\f2806xF\src

    in either case you will need to update your .project file
    Find: MW_INSTALL_DIR/sw/modules/hal/boards/drv8312kit_revD/f28x/f2806x/src/hal.c
    Replace: MW_INSTALL_DIR/sw/solutions/myinstaspin_foc/boards/myboard_revA/f28x/f2806xF/src/hal.c

     

  • Chris,

    Thank you very much for your detailed explanation. I could make my custom project and it is working now.

    As for the question 1, can I connect the DRV8312EVM to the JTAG emulator when I choose to run from flash memory? I think that your answer implies that I can't.

  • You CAN connect JTAG when running from flash, using default switch settings. 

  • Chris,

    I still cannot run the software from the Flash.

    When I choose 'Release' configuration as 'Active', the sample project proj_lab02d works as explained in instaspin_labs.pdf. This is very good...

    After I chose 'Flash' configuration as active, rebuilt the project, and pressed debug icon, CCS5 erased the flash memory, downloaded the program and stopped at the beginning of main() function.

    Then I pressed the run button (green triangle icon with a yellow bar). At this point, I expected to see the red LED blink on the CPU card but it didn't happen. Instead, a new tab with the title '0x3ff4fa' was created in CCS5.

    By pressing the 'View Disassembly,,,' button in the tab, a disassembly window was opened and there I was a ESTOP0 instruction at the address 0x3ff4fa. This is the end of the story.

    I want to run the project from the internal flash in CCS5 debug. How can I do it?

  • I just ran from flash on proj_lab10 (project I had open) using 28069M without problems. 

    I'll try 2d next week.

  • I uninstalled and erased all previous TI software tools from my computer and reinstalled most updated softwares. Then the pro_labs began working with both configurations. My computer setup was the problem...

    Thank you very much for your great support.

  • One detail, looks like you don't want the letters "proj" in step 5:
    proj_lab10a.c --> rename to my_lab10a.c
    proj_lab10a.js --> rename to my_lab10a.js

    It seemed like CCS wants consistency of project folder name (under ccs5 directory) and c-file

  • Good catch on my TYPO in step 5.  I acutually did name them my_lab10 as you noted is necessary (and as the Step #4 shows to do find/replace for).

    I will fix that in the original post for posterity.