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.

Some clarification regarding after loading code into C2000

Other Parts Discussed in Thread: CONTROLSUITE

Hi guys,

After trying out  the example from ControlSUITE into my F28027 via XDS100, we all understood that the code is loaded into the chip when we press "Debug" and "Play".

But I found out that the chip doesn't work if it's disconnected from the emulator. So does that mean it only can work within a USB-connected environment? Can it work like a PIC? After programming a PIC, disconnecting the board from the programmer still renders the PIC working with a separate supply, but is it also the case with C2000s?

After disconnecting the C2000 from my emulator, it resets into this mode like it's not programmed. Please help me guys. 

Thanks.

  • Abdul,

    Which projects are you running in controlSUITE?

    In many different projects, there are two build option configurations.  One that allows you to fully run from RAM (sometimes running only from RAM is preferred when debugging). Then there is a second configuration, that allows much of the program to run from FLASH, places the variables in RAM, and sometimes puts some key speed-critical code to run from RAM (but is loaded from FLASH at run-time).  This second configuration would run directly at start up without a need for an emulator.

    If you right-click on the project name, from the Project Window in CCS, click Configurations and then choose the configuration with FLASH in the title (if one exists).  This will allow you to build and run a project like you want to do. 


    Thank you,
    Brett

  • Hi Brett, the example I'm using is Example_2802xGpioToggle.c. 

    Brett Larimore said:
    If you right-click on the project name, from the Project Window in CCS, click Configurations and then choose the configuration with FLASH in the title (if one exists).  This will allow you to build and run a project like you want to do.  

    So this is what I did:

    1. 

      

    2. 

    But as you can see, there are no Flash options. Perhaps I'm doing it wrongly?

    Thanks for your time Brett.

  • Abdul,

    This project (and other projects found in \controlSUITE\device_support\f2802x\v128\DSP2802x_examples_ccsv4) does not have the flash build configuration option that I mentioned.  In order to make these projects "run from FLASH" you'll need to do some editing of the project.  I would recommend following the instructions found in page 21 of the header file quick start guide:
    C:\TI\controlSUITE\device_support\f2802x\v129\doccontrolSUITE_DSP2802x_HeaderFiles_Quickstart_Readme.pdf

    (for other forum viewers: a similar strategy is used for F28x example sets found in the device_support folder)

    The projects I mentioned that can be easily switched by changing the build configuration can be found at:
    C:\TI\controlSUITE\development_kits\Piccolo controlSTICK\
    (you could use these as an example for how to modify your GpioToggle example project if you have trouble)


    Thank you,
    Brett

  • Thank you Brett. These things have such detail to it that it'll be very difficult to manage without a pro here. 

    I'll get back to this post if there are any other questions.

  • okay, with respect to the Header Files Quickstart Manual:

    Number 1: Done

    Number 2: Regarding the password, i think it's not necessary isn't it?

    Number 3: This is where I'm a bit baffled. Do I copy this: 

    /********************************************************************
    * DSP2802x_common\include\DSP2802x_Examples.h
    ********************************************************************/
    MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
    
    

    Into the h file or the c file? And where should it be pasted? Under main or the define part?

    If it is the h file, which h file should be targeted? Because there are several h files, which is shown here:

    
    
    
    

    I'm sorry for the triviality here, I'm really new to all this.

    Thanks Brett.

  • err do I have to create a new thread because I verified an answer in this post?

    Sorry for the inconvenience.

  • Abdul,

    No, you don't need to repost.  I just haven't gotten around to it.

    The MemCopy function should be put near the beginning of main().  InitFlash() should get called shortly after that.

    I would recommend taking a look at one of the projects found at the following to get an idea of the flow.  Note that the flow is slightly different from the flow in the example you're working with.
    C:\TI\controlSUITE\development_kits\Piccolo controlSTICK\Timer - BlinkingLED\


    Thank you,
    Brett

  • Brett,

    1) I added this to the code (just after main):

    MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
    extern Uint16 RamfuncsLoadStart;
    extern Uint16 RamfuncsLoadEnd;
    extern Uint16 RamfuncsRunStart;
    InitFlash();

    but I haven't compiled it yet because I haven't got it all yet, and I really couldn't find out (yet). Is this correct?

    2) I don't understand step 3(e) from the manual: 

    e. Modify the code to call the example MemCopy function for each section that needs to
    be copied from flash to SARAM.
    /********************************************************************
    * DSP2802x_examples_ccsv4\flash_f28027 source file
    ********************************************************************/
    MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);

    Can you explain that one?

    3) As for step 5, I completely don't have any idea how to "Set the required jumpers for “boot to Flash” mode." Please clear this one too.

    4) As for my previous post, is Step 2 of the manual (password setting) necessary?

    Just so that you know, once I successfully figure all of this out, I'm going to make an article and a video tutorial to set XDS100s up according to this settings. :)

    For now, you just have to bear with me. Thank you very much for your patience.

  • 1) Again I'd recommend taking a look at the project I mentioned.  The extern's you show will need to be placed prior to main (they are definitions).

    2)  The idea is that you may have various noncontiguous program memory sections which need to be placed from Flash to Ram at run-time.  This is merely stating that if you have multiple noncontiguous sections, you'll need to do this for each section.  If you're following the example you'll only have the one which spans from RamfuncsLoadStart to RamfuncsLoadEnd as specified in the example's .cmd file

    3) The status of GPIO34 and TDO set the boot setting for the chip (ie which peripheral will we boot from).  To boot from FLASH on the F28027 cCARD you'll need to make both sub-switches in SW1 (on the cCARD) are set to ON.

    4)  Password is needed to protect your code from hackers once your project is productized.  You won't need security, so you won't need a password.  Leave it at the default password (which is no password).


    Thank you,
    Brett

  • 1. Well, I did take a look into it but I haven't grasped the way it's oriented. Maybe I need more time.

    2,3 & 4: Thank you for all the info Brett. Will get back to this post soon, God-willing.

    Thanks.

  • Brett,

    It seems that I could just load the ControlStick's BlinkingLED code via the XDS100 anyway, and it lighted up. The only thing is that when I  powered up my F28027 board (3V3 and GND only) and here's the schematic: 6457.Schematic of F28027 (SEED-M2802X V1.0).pdf

    But it doesn't run as it would be connected to the emulator. 

    Do I need to pull up/pull down any other pin?

    Thanks.

  • Abdul,

    I am not sure of your question, can you clarify?


    Thank you,
    Brett

  • From what I understood, Flash programming means that after loading the code into the F28027, the uC can run without the need to be connected to an XDS100 isn't it? So the uC will start its operation whenever we provide a supply to the F28027, isn't it?

    The F28027 board I had is currently programmed via the Flash programming (After importing the code, I pressed Debug+Play). This is shown via an LED connected to one of the GPIO.

    Then I disconnected the F28027 board, and supplied the Vcc with respect to GND (regulated) with 3V. But the board didn't turn up the LED though. So suppose do I need to pull up or pull down any of the JTAG pins on the F28027? Or are there any pins on the F28027 which needs to be pulled down/up? 

    Thank you for your time Brett.

  • Abdul,

    Yes.  Yes.

    No, you shouldn't need to do anything to the JTAG. 

    ---

    Can you check if R9 is populated on the controlSTICK?  If it is can you try removing it? 

    From pg 7 of the "controlSTICK Examples Overview.pdf" guide:
    NOTE: By default the microcontroller is set to boot from SCI. To allow the controlSTICK to
    automatically boot and run from FLASH when the controlSTICK is powered on, remove
    resistor R9 on the controlSTICK.

    Let me know if this resolves things.


    Thank you,
    Brett

  • Brett,

    Sorry for all the inconvenience. According to the schematic (it's not a ControlSTICK though, it's actually a SEED-F28027) I needed to supply 5V to the N/C of the JTAG. I found this out after checking every pin though. It's working now. I'll write-up an article regarding this so that others may just use the guide. It blinks beautifully like a PIC.

    Thank you very much, Brett.