• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » a field updater that programs flash- I am totally desperate!
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • a field updater that programs flash- I am totally desperate!

    a field updater that programs flash- I am totally desperate!

    • Yona Cohen
      Posted by Yona Cohen
      on Apr 30 2012 04:10 AM
      Prodigy230 points

      Hi all,

      I am sure one of you has written a field updater that programs flash and my questions are probably very trivial to you... but I am totally desperate!

      I am working on a field updater on c2808. Our application runs on flash. The board is connected to PC via USB serial convertor and read by MCU via SCIa.

      The way it should work is:

      1. Get command to enter update mode.

      2. Copy flash API and update code to RAM

      3. Start c2000 programmer on PC

      4. Get program update via SCI

      5. (this does not work yet…) copy data to correct locations

      6. Restart (run usual boot, hopefully I did not change that code…)

       

      I got through the autobaud, reading key value and reading the data from host.

      Her are my problems.

      1. I thought I will get the data in the format of size, address, data (based on http://www.ti.com/lit/ug/spru722c/spru722c.pdf) . But I get only 5 blocks of data:

                                                               i.      addr 0 size 2

                                                             ii.      addr 0x003FA000 size 2702

                                                            iii.      addr 0x00000002 size 54

                                                           iv.      addr 0x003FB128 size 276

                                                             v.      addr 0x00000038 size 30

      None of these are on Flash

      Here is a clip from the map file

                  FLASHD                  003e8000   00004000  000009d2  RWIX

                  FLASHC                  003ec000   00004000  00003521  RWIX

                  FLASHA                  003f4000   00003f80  00000347  RWIX

                  FLASHB                  003f0000   00004000  00000000  RWIX

                 

      1. Also the C2000 programmer seems to have a protocol that I do not know. It seems to be waiting for some response I do not know what for. Also when it runs with the original bootloader it has all kinds of different info I do not know what and when I need to send (like identifier, flash API version and updates on stages in flsh burning) Any one know the c2000 programmer protocol?
      2. Then I had the idea to not use the c2000 programmer but transmit a file over terminal. I created a file with the  hex2000.exe MyFile.out -boot -gpio8 –a. So far I can get this to work, is this good practice? Is this what is done? Will I see the flash address and data there. I tried to understand the hex file (opened with hex reader but could not really understand:

      ...AA 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3F 00 F6 7F 03 00 ..3E 00 A2 89 A9 28 02 03 06 00 ..66 00 3F 00 AC 42 FF FF 40 95 00 00 00 00 FE FF 42 95 00 00 00 00 00 00 ..FE FF 44 95 00 00 00 00 00 00 FE FF 36 95 00 00 1A F5 3E 00 FE FF 38 95 ..00 00 1A F5 3E

      If this is size so what is size 00..? 0r address ..3E00A2?

       

       Am I missing something (seems like a lot) ?any ideas and comments are VERY welcome

      Thanks a lot for the help,

      Yona

      Oops, I see this comes up as a discussion, no idea how it happened and no idea how to change to a question…

      C2000 programmer C2000™ flash
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Apr 30 2012 17:43 PM
      Expert7420 points

      Yona Cohen

      5. (this does not work yet…) copy data to correct locations

      did you try checking with codeskin team (C2000Prog) on why it doesn;t work for the device? if the device is supported or not? Did you try SDFlash?

      if you don't want to use c2000prog, then you will have to build your own application try reading http://www.ti.com/litv/pdf/spraaq2 and apply it for your device as needed.The hex format you show above is the format that device bootROM expects the data to be in. On chip bootloaders only program RAM they don't program flash.

       

      Best Regards

      Santosh

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yona Cohen
      Posted by Yona Cohen
      on May 01 2012 06:24 AM
      Prodigy230 points

       Hi Santosh

      Thanks for your response.

      I did contact Codeskin and waiting for reply from them.

      Just to make it clear, I did not change the boot code that comes on chip. When I set GPIO34 to zero and start bootload it works fine (with the TI boot and c200prog). But I need a field updater and can not set GPIO34 to 0.

      I am not sure I understand what you mean about the hex file.

      I will try to use the SD flash, but is there code that works with it? What is it's protocol when transmitting to flash?

      Thanks again,

      Bets regards,

      Yona

      flash SCI sdflash Bootload c2808 cprog2000
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on May 01 2012 09:59 AM
      Expert7420 points

      Yona,

      I think I understand now, you are trying to get data from c2000Prog (from PC) to device which is running your own update application. I was under the impression that you want to get C2000Prog working with ROM code on device.

      neways, looks like the code in your map file is different from what your program (on device) decodes it to be after receiving the data from SCI via C2000Prog, right? Can you clarify and resend the details clearly of what your code decodes the map to be and what your memory map file says it to be?

       

      Best Regards

      santosh

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • jason wiseman
      Posted by jason wiseman
      on May 01 2012 10:37 AM
      Intellectual570 points

      I have done this before;

      If you reconfigure the device back into the boot up state, drive GPIO34 low (as a digout) and jump to the start of the boot ROM, you can fool the ROM into SCI boot mode and then connect with C2prog.

      The serial port need to be set back EXACTLY the same way as bootup or it will not work. 

      I recommend getting a copy of the source code for the boot ROM. 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yona Cohen
      Posted by Yona Cohen
      on May 02 2012 01:10 AM
      Prodigy230 points

      I think you are suggesting the best solution for me, but how do I jump back to boot code?

      Also if I do this why do I need a copy of the boot ROM and in any case how can I get a copy of this code?

      Thanks so much,

      Yona

      Bootloader c2808
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yona Cohen
      Posted by Yona Cohen
      on May 02 2012 06:10 AM
      Prodigy230 points

      Hi Jason,

      I tried a few things to go back to boot Rom.

      First I set GPIO34 to zero in code: GpioDataRegs.GPBCLEAR.bit.GPIO34 = 1; (what does digout mean?)

      Then I tried to cause SW reset by setting WD to zero:

      I did this based on http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/p/21505/99477.aspx#99477 and http://www.ti.com/lit/ug/spru712g/spru712g.pdf  but the MCU did not reset and also I am not sure doing this wouldn't Set GPIO34 back to 1.

       I also tried to call the InitBoot but this will not pass linkage as the code is not part of my project.

      What is the way to cause a jump to the InitBoot

      Thanks

      Yona

      bootloader assembly watchdog
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • jason wiseman
      Posted by jason wiseman
      on May 02 2012 08:57 AM
      Intellectual570 points

      I dont think the reset will work.

      Drive GPIO34 low, then cleanup the SCI port to the same condition as boot. Then jump to the start of the Boot ROM.

      The bootROM code should be in ControlSuite. The vector you need to jump to should be in there somewhere.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yona Cohen
      Posted by Yona Cohen
      on May 16 2012 01:42 AM
      Prodigy230 points

      Just incase anyone looks at this and would like to know the "how to do"  this.

      It seems like the code to go back to bootloader should be:

      const unsigned long int OperEntryPoint = (unsigned long int)0x3FFFC0; // Entry point address

      and then to jump to the address:

      ((void (*)())(unsigned long)OperEntryPoint )(); // Calling to this as to a function...

      But setting GPIO34 to zero this way does not work:

      GpioDataRegs.GPBCLEAR.bit.GPIO34 = 1;

      but if I set it by hardware it does work…

      bootloader
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • jason wiseman
      Posted by jason wiseman
      on May 24 2012 08:05 AM
      Intellectual570 points

      Make sure GPIO34 is configured as an output. Verifiy the pin gets pulled low.

      The other trick is to make sure the UART is in the same condition as bootup, otherwise the SCIBOOT option wont work. 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • TuanHo
      Posted by TuanHo
      on Jun 11 2012 12:55 PM
      Prodigy180 points

      Jason,

      I did look at the code, it specifically programs the GPIO34 for input so if you configure the pin for output it will be reconfigured for input.

      Also, SCI-A is initialized in SCI_Boot() so I don't think to re-initialize it first.

      I wonder how you got it to work. It seems the only way is to bring out GPIO34 and bring it low (assumed normally pulled-up).

      // Set DIR for BOOT Select
      GpioCtrlRegs.GPADIR.bit.GPIO18 = 0;
      GpioCtrlRegs.GPADIR.bit.GPIO29 = 0;
      GpioCtrlRegs.GPBDIR.bit.GPIO34 = 0;

      EDIS;
      // Form BootMode from BOOT select pins
      BootMode = GpioDataRegs.GPADAT.bit.GPIO18 << 2;
      BootMode |= GpioDataRegs.GPADAT.bit.GPIO29 << 1;
      BootMode |= GpioDataRegs.GPBDAT.bit.GPIO34;

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • jason wiseman
      Posted by jason wiseman
      on Jun 11 2012 13:18 PM
      Intellectual570 points

      Tuan,

      The boot ROM does as little as possible. The part boots up with the IO in the default configuration as from power-up.

      It does not change this unless it needs too. 

      When working with the 2802x boot rom, I noticed that it does not change GPIO34 from the default (input).

      So if you configure it as an output and drive it low (confirm this with a scope or something) and jump to the start of the boot ROM, it should select the SCI boot (provided the other pins are OK).  BTW this will not work with a JTAG connected; you would need to set breakpoints and cheat the bootup sequence to get this to work.

      If you can get the boot rom to run and select the SCI boot, you can then break in with a JTAG (hot plug) and using the ROM symbols, see where the programs is stuck.

      The SCI will need to be configured in pristine power up condition (all REGs at power-up default) to get the baud rate to lock ect... 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use