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.

Reg. running the code from flash in CCS!

Other Parts Discussed in Thread: TMS320F2812

Just a small querry before I put a code into the flash. Say, I have written code and cmd file to run a code from flash. It gets build successfully. I burned the .out file into the flash using CCS On-chip flash programmer. It gets burned into the flash successfully. now, how do I run the code?(As we click "run" in CCS3 in case we boot from H0 RAM) Either through reset/poweron. But I dont have reset button on my eZDSPF2812 board. Also, when I power off and again power on my eZDSP board, I dont see any desired waveform on the PWM o/ps.

  • Hi Bhushan,

    You code which runs at run-time from CCS using the .out file is customized to run at run-time only. To run the code from flash at reset/power-on, this code must be transformed into a bootable code before burning the code into the FLASH using the Flash programmer. This bootable code will then configure the processor to run with the flash code at power-on. Besides, you may have to convert the .out file into the .bin file before burning into the flash, but mainly it has to be bootable to get the desired behaviour.

    Regards,

    Sid

  • Bushan,

    it is simpler than Sid described.

    Once you have programmed your code into FLASH (assuming all secitons, such as .text, .cinit etc have been allocated to FLASH- don't forget the "codestart" section), the code is ready to run from RESET. The C2000 uses some GPIOs to select the "Boot-Options". If you set these GPIOs to "Boot from FLASH", then all you need to start your code is a proper RESET. If you are still connected to CCS; just do a "Reset CPU" followed by "Run". If you unplug CCS and power down your board, after a re-power on the DSP directly branches from the Boot-ROM code to FLASH.

    Regards

     

     

     

     

     

  • Hi Frank,

    C2000 does have this option for GPIOs. But does TMS320F2812 on eZDSPF2812 which Bhushan has have the same options? And "assuming all secitons, such as .text, .cinit etc have been allocated to FLASH" - isnt it the same as making the code bootable? I mean, is there anything different that is to be done?

    Regards,

    Sid

  • Sid,

    the 2812 eZdsp has jumpers to set the GPIO-pins for the Boot-mode (see page 2-16 of the eZdsp tech ref.). If you set JP7 to 1, the FLASH Boot mode is selected. THe DSP will then branch from BOOT-ROM directly into address 0x3F 7FF6 (the "FLASH entry point"). All you need to do is to place a valid instruction (a long branch to the beginning of you code) into this address. You don't have to make your code "bootable", whatever this means - just place your non-volatile sections into  FLASH - that's it. There is an application note ("Running an application from FLASH"- I don't have the literature number right now), which explains the details, including the reduction of FLASH - waitstates.

    Regards

     

     

     

     

  • Thanks Frank,

    For referring me to the appropriate documents. I shall have a look at them.

    Regards,

    Sid

  • Thanks sid and Frank for such a valuable info.

    Yes, I have my code bootable i,e, configured to boot from flash (all the jumpers settings done and linker modified as per flash). I build the project using CCS, and burn the .out file into the flash using on-chip flash programmer tool, available in CCS.

    Now I just wanted to know, how to run code independently, independent of CCS i.e either a reset or power on.

    I dont have reset button, so atleast on POWER ON, I should get the code running, without any command from CCS (e.g. reset, run etc)

    But, I am not getting the o/p's say, a PWM waveform on CRO.

    I think, I have done some coding mistake, in setting the register bits. Let me examine.

  • Bhushan,

    Did you get your code working from FLASH and how ?

     

  • Hi sunil

    I am using f28335 ccs 3.3 and bios 5.33.06  @150MHZ  with flash wait state 5,5,8. i am running motor control code from ti (VECTOR CONTROL) with some customization at application level only. I can see my PWM running from Flash once its downloaded to flash from ccs after hitting the run button. But as soon as i do POWER ON RESET my pwm wont come out. my code also work ok with RAM even after POR.

    If i comment the Park and inverse park calculation function call  in pwm ISR  i get 50% pwm output on scope. this shows that there is some thing wrong with park calculation once they go into flash and power on reset is done. then instead of orginal park calculation funciton i have called my own function which is just a copy of park calculation function but 2 lines are commented that is calculation of cosine and sin , again it gives pwm output 50%(.of course it is ok just for testing as long as motor is not running you have to calculate park with sin and cosine calculation of angle for running motor from pwm .) . what i studied is that sin and cosine use iqmath look table stored in  boot rom i dont know if it has to do any thing with POR.    

    Please help me to solve this

    Shakeel