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.

F28335: SCI-A Boot Rom Programming

Other Parts Discussed in Thread: TMS320F28335, CONTROLSUITE, UNIFLASH

Hello,

I'm writing the Flash programming tool on host side to program the TMS320F28335 controller thorugh SCI-A option.

First I generate the hex file with hex2000.exe utility with SCI-A boot option.

Then i read the data from that hex file and send it to the F28335 controller (which is already set in the SCI-A boot mode option). 

I'm also receiving the bytes which i sent to F28335 controller.

Before doing the above steps i have two scenario's:

1. I erased the flash from SDFlash utility and then started my above programming steps, it seems that after power cycle the code is running.

2. I haven't erase the flash and started the my above programming steps. Here i see no code running after power cycle.

Hence I think I need to send the Flash erase command before programming and also verify option after programming. I searched the TI documents, there I didn't found any information on Erase algorithm and verify algorithm for F28335 controller.

Can you please tell me the algorithm for Erase and verify.

Best Regards,

Niraj Kumar Singh

  • Hi,

    I hope you've checked these docs:

    2742.Boot ROM.pdf

    3146.Flash Programming Solutions.pdf

    Regards,

    Gautam

  • Hello Gautam,

    Thansk for the support.

    I already checked those listed documents, but I can't find the algorithm that how to erase the F28335 thorugh SCI-A boot rom interface. 

    Niraj

  • Niraj,

    the boot ROM doesn't support flash Erase commands. When you download the program how do you get it to program flash? the program that you download includes flash API to program? if yes then can the program that you download erase the flash before it starts programming it?

     

    Best Regards

    Santosh

     

  • As per your suggestion i wrote the flash erase program, which is erasing the whole all sectors of F28335 controller (Sector A to sector H) and i compiled the above program with loading in SARAM option.


    Now I'm doing the follwoing steps but not able to succeed in flashing:

    1. Put the controller in SCI-A boot mode option.

    2. Load the Flash erase program (SCI-A formatted boot file generated from hex2000 utility (execute from SARAM option) through my SCI-A Programmer (written in Linux PowerPC).

    3. after loading, wait for erasing the flash with LED indication.

    4. Now restart the controller (manually) and keep it in SCI-A boot mode.

    5. Now start loading the actual application program (converted in SCI-A bootable format with hex2000 utility) with the same SCI-A programmer and monitor all the echoed data successfully.

    After completing, when i restart the controller, the application will not be executing and when i debug the controller with SARAM based application and checked the FLASH area is all erased still. So it seems that flashing is not executing successfully but when i load the SARAM executable application through the same SCI-A rpogrammer, then it is running perfectly.

     So what special care i need to take while flashing the program, is there any delay need to add after some bytes sent to the controller in SCI-A boot mode?


    I attached the hex format file, which i converted through the hex utility and then I filtered out the exact data from that hex file, which i will then send to the controller in SCI-A boot mode.

    Also the below command i have added in post build steps:

    C:\ti\ccsv5\tools\compiler\c2000_6.0.4\bin\hex2000.exe -i "${BuildArtifactFileName}" -o "${BuildArtifactFileBaseName}.hex" -boot -sci8

     

    download and rename the attached  file with .hex instead of .log

    :20000000AA08000000000000000000000000000000003300F6FF390033000487E0FF06C06A
    :20002000000000803300FFFF330000003300FF7F330000803200FFFF320000003200FF7F66
    :20004000320000803100FFFF310000003100FF7F310000803000FFFF300000003000FF7F22
    :200060003000FEFF58C10000F2853300FEFF5AC10000F2853300FEFF5CC1000000000000B4
    :0E008000FEFF5EC10000000000000000000056
    :20008E000306330000801B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E218
    :2000AE00BD0030E60006422916562576006F1B76F0FF00E2BD0030E60006422916562576CB
    :2000CE00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E652
    :2000EE000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B765E
    :20010E00F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E600064229A0
    :20012E0016562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD
    :20014E00BD0030E60006422916562576006F1B76F0FF00E2BD0030E600064229165625762A
    :20016E00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E6B1
    :20018E000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76BD
    :2001AE00F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E60006422900
    :2001CE0016562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E21D
    :2001EE00BD0030E60006422916562576006F1B76F0FF00E2BD0030E600064229165625768A
    :20020E00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E610
    :20022E000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B761C
    :20024E00F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E6000642295F
    :20026E0016562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E27C
    :20028E00BD0030E60006422916562576006F1B76F0FF00E2BD0030E60006422916562576E9
    :2002AE00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E670
    :2002CE000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B767C
    :2002EE00F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E600064229BF
    :20030E0016562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2DB
    :20032E00BD0030E60006422916562576006F1B76F0FF00E2BD0030E6000642291656257648
    :20034E00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E6CF
    :20036E000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76DB
    :20038E00F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E6000642291E
    :2003AE0016562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E23B
    :2003CE00BD0030E60006422916562576006F1B76F0FF00E2BD0030E60006422916562576A8
    :2003EE00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E62F
    :20040E000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B763A
    :20042E00F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E6000642297D
    :20044E0016562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E29A
    :20046E00BD0030E60006422916562576006F1B76F0FF00E2BD0030E6000642291656257607
    :20048E00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E68E
    :2004AE000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B769A
    :2004CE00F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E600064229DD
    :2004EE0016562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2FA
    :20050E00BD0030E60006422916562576006F1B76F0FF00E2BD0030E6000642291656257666
    :20052E00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E6ED
    :20054E000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F9
    :20056E00F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E6000642293C
    :20058E0016562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E259
    :2005AE00BD0030E60006422916562576006F1B76F0FF00E2BD0030E60006422916562576C6
    :2005CE00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E64D
    :2005EE000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B7659
    :20060E00F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E6000642299B
    :20062E0016562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2B8
    :20064E00BD0030E60006422916562576006F1B76F0FF00E2BD0030E6000642291656257625
    :20066E00006F1B76F0FF00E2BD0030E60006422916562576006F1B76F0FF00E2BD0030E6AC
    :20068E000006422916562576006F1B76F0FF00E2BD0030E60006422916562576006F1B76B8
    :2006AE00F0FF00E2BD0030E60006422916562576006F737629830A9A029B73763183737645
    :2006CE007F83060022761F76C001BF562555BF5625AA1A7669FF060022761F76C001BF56A2
    :2006EE0029681A7669FF060002FE429741961F76C00111CC0800C2FF02EC257611CC8001CA
    :20070E00C6FF05EC227611187FFE1A7621920F90415416EC2276111A4000419221CDF0FFAB
    :20072E000F90A8CA21961A7669FF73762983119201900152FDED22761118BFFF1A76429202
    :20074E00015203EC025209ED227611CD7FFE039086FFA8CA11961A764292035211ED22768C
    :20076E0011CC7FFEA91A0001119669FF20FFDA0540761B801F76C001111A80011A7682FEDD
    :20078E0069FF060022761F76C001BF561A01BF561B021F762C0035CCF8FF01503596341A6A
    :2007AE0004003418F7FF1F76C0011C1A080069FF787680001F76C0011C1A10001C1A0004A5
    :2007CE001C1A00081C1A20001C1A00011C1A00101C1A00201C1A00401C1A00801C18FBFF4A
    :2007EE001D1A01001D1A02001D1A04001D1A08001D1A10001D1A20001C1A04001D1A0004ED
    :20080E001D1A00081D1A00101D1A00201D1A00011D1A00021D1A00401D1A0080201A000113
    :20082E00201A0002201A0004201A0008201A0010201A00201A7669FF060002FE22761F761F
    :20084E002B002028FFFF2128FFFF2228FFFF2328FFFF2428FFFF2528FFFF2628FFFF272811
    :20086E00FFFF1A761F76FFCF38924196399241963A9241963B9241963C9241963D924196A4
    :20088E003E9241963F9241961F762B002F4003EE019A026F009A82FE69FF060073761683C5
    :2008AE00103B69FF73765485267600002F76000073767C8522761F763500338F9C850CA891
    :2008CE001A7669FF73769A84008F50C102E8A14702E8B01809E801207376D3841F763000D0
    :2008EE000428014022761F76BE011618CFFF1A1A04000918FF3F0B1A00801A76237601002F
    :20090E001F763300221A400010292029006F02FE41962576006F82FE69FF060002FE22762D
    :20092E001F7617CE3B921F762B0020961F7617CE3C921F762B0021961F7617CE3D921F764F
    :20094E002B0022961F7617CE3E921F762B0023961F7617CE3F921F762B0024961F7618CEA3
    :20096E0000921F762B0025961F7618CE01921F762B0026961F7618CE02921F762B00279646
    :20098E001A761F76FFCF38924196399241963A9241963B9241963C9241963D9241963E92B1
    :2009AE0041963F9241961F762B002F4003EE009A026F0A9A82FE69FF0600008F000C1F76BD
    :2009CE00050310A800021F7630000119021E062B072B041A1000041A200000021F760503DA
    :2009EE00121E008F080C00A8008F100C08A81F76300001190A1E1F76300000020119121EFB
    :200A0E001F7630000C1A10001F763000141A10001F7630000C1A20001F763000141A2000AC
    :200A2E001F7605030002021E0A1E060008FE03E2460103E2440042A8428A4406E41E428A92
    :200A4E004606F41EAFE24400AFE2460100E70800007788E60000007703E24800428AC48AEB
    :200A6E004806D41E428AC48AF42B428AC48AFC2B428AC48AE41A1000428AC48AE41A20004E
    :200A8E00428AC48AE41A0004428AC48AE41A0008428AC48AE41A0040428A0002D41E88FE6E
    :200AAE000600AD28000469FF1F5616561A5610E6000240291F76000002291B762276A92875
    :200ACE000487A828330001091B61F376048704290F6F009BA92401DF046C0429A82401DFC4
    :200AEE00A61EA1F78624A706A1810109A71EA92403635CFF043BA95901DF0900ECFF1A7611
    :200B0E00A928FFFFA828FFFF01090E61FF76FFFF066F01DFBDC3A71E673EBEC5A92401DFCF
    :200B2E00A82458FFF7607376B8857376D385103B1F7633002018FEFF222B242B262B282B3E
    :200B4E002A2B2C2B2E2B302B322B342B362B382B232B252B272B292B2B2B2D2B2F2B312BFF
    :200B6E00332B352B372B392B69FF06001F763300201A01002128FFFF102969FF060006FE80
    :200B8E00338F048644A8008F000D46A82276412B419280520D63448A84C444A8468AA9A849
    :200BAE000209461EC4C2410A41928052F5641A761F763300201A010086FE69FF06001B76D3
    :200BCE00F0FF00E2BD0030E600064229165601021F760503015612001F76BF010E1A0400FC
    :200BEE00071A00801F763300BF56210180E2BE00F1FF17760276A928FFFFAA28FFFFAB28C0
    :200C0E00FFFFA828FFFFAB0F04ED00D400BE096FAA28FFFFAB28FFFFA4A9C4880209A98ACD
    :200C2E00A69273760B8406000077006FBDB21F7605031AC5A959673E1F7605031EC5A7064B
    :200C4E0003ECA192673E1F7605031C0603ECA71E673E7376D185BE8B06001F76050318A8BC
    :200C6E0006001F7605031AA8060006001F562276C0B9292868001A7673000E85FFFFFFFF24
    :0C0C8E00FFFFFFFFFFFFFFFFFFFFFFFF66
    :0A0C9A0002003300F6FF7300F3853B
    :200CA4001F003200000022761F762A00001A010006CCFFF0A91A0005069606CCF0FF055032
    :200CC400069607CCE0FF08500796041AFF01051AFF011A7607F6007769FF06000119C356EB
    :040CE400FFFF060008
    :200CE800000133000486028333000283330002833300028333000283330002833300028359
    :200D08003300028333000283330002833300028333000283330002833300008033000A800B
    :200D28003300148033001E80330028803300328033003C80330046803300508033005A805B
    :200D48003300648033006E80330078803300828033008C80330096803300A0803300AA80BB
    :200D68003300B4803300BE803300C88033000C833300D2803300DC803300E6803300F08006
    :200D88003300FA803300048133000E81330018813300228133002C813300368133000C83F6
    :200DA80033000C833300408133004A813300548133005E81330068813300728133000C8359
    :200DC80033000C8333007C81330086813300908133009A813300A4813300AE8133000C83D1
    :200DE80033000C833300B8813300C28133000C8333000C8333000C8333000C8333000C837D
    :200E080033000C833300CC813300D6813300F4813300FE813300E0813300EA8133000C83B0
    :200E280033000C83330008823300128233001C82330026823300308233003A8233000C8322
    :200E480033000C833300448233004E8233000C8333000C83330058823300628233000C8362
    :200E680033000C8333006C82330076823300808233008A823300948233009E823300A882EF
    :200E88003300B28233000C8333000C8333000C8333000C8333000C8333000C8333000C8395
    :200EA80033000C8333000C8333000C8333000C8333000C8333000C8333000C8333000C831A
    :200EC80033000C833300BC823300C6823300D0823300DA823300E48233000C833300EE824A
    :080EE8003300F8823300000022
    :00000001FF
    

  • Niraj,

    can you explain the highlighted? do you mean if you send the flash_program_kernel_app second time via the SCI-A programmer it works or if you load it via JTAG it works but when you load it via the SCIA_Programmer it doesn't work?

     

    Niraj Singh said:
    After completing, when i restart the controller, the application will not be executing and when i debug the controller with SARAM based application and checked the FLASH area is all erased still. So it seems that flashing is not executing successfully but when i load the SARAM executable application through the same SCI-A rpogrammer, then it is running perfectly.

    The boot ROM sources for the 28335x device are released in controlSuite...just extract the project. You don't have to rebuild anything but just load symbols from the ROM OUT file and you should be able to debug what's going on. Below are the steps...

    Connect to your device, load symbols by selecting the (RUN->LOAD symbols option) the ROM OUT file and browse throught the SI_Boot.c file, put a breakpint (HW break point) where the function returns the EntryAddr and run through your SCI-A programmer loads. Now when you hit the break point Add symbols from the COFF file that you just sent over via SCI-Port and follow through the return EntryAddr from the SCI_Boot.c to your main()...probably put a break point where your main() is in RAM and see if it hits main. If it doesn't they see if your EntryAddr points to the proper entry point in the application and debug. its either the EntryAddr is messed up or your _C_int00 is messed up or boot ROM execution is overwriting the RAM locations where you think you are downloading the APP.

     

    Edit:- the bootROM project sources for your device can be found at C:\ti\controlSUITE\libs\utilities\boot_rom\2833x

    Hope this helps.

     

    Best Regards

    Santosh Athuru

     

     

  • Hello Santosh,

    I simply wrote one DSP flash erase application, where i'm only doing the erasing of all 8 sectors of F28335 controller.

    This erase program is running from SARAM and not loading in the flash while executing. Also this program will be loading from the same SCI-A Programmer (running in powerpc linux end) and will successfully executing the code from SARAM.  So after doing the erase flash, then i restarted the controller with again in SCI-A boot mode and now i start the to program my application (this is running from flash and not a SARAM application) through the same SCI-A programmer. But after loading this program the application not running anymore.

    Note: My SCI-A programmer monitored all the echoed bytes and found no error in both the case. It seems that when i load the SARAM based application thorugh my SCI-A programmer, then it is loading to SARAM and running perfectly, but when i tried to download the Flash based application then i found that the program is not loading in the flash area at all.

    Why this happens, shall i need to add any flash write time delay or CSM unlock code is not in the bootrom startup sequence or any other possibilities?

    I also debug the control suite bootrom code as per your guideline and found that the Entry address is correct and when it start writing to the flash address location, it is not writing anything, still it 0xFFFF after writing the data to flash location. What would be the issue?

    Best Regards,

    Niraj Kumar Singh

  • Niraj,

    the ROM loaders support loading to RAM, they don't support programming flash.

     

    Is the SCI-A Programmer some host application you wrote? I mean it is not off the shelf SCI based flash programmer like C2Prog or code-skin programmer for 28x controllers right?

    The SCI-A programmer that you use should download a kernel which has the flash API in the RAM using SCI-BOOT. The Kernel, one it starts executing from RAM would then do the flash programming. Usually customers design the kernel as we provide the flash-api library and needed ROM sources for development.

     

    Best Regards

    Santosh

     

  • Santosh,

    Thanks for the above clarification.

    My suggestion is that, it will be better if you furnish the above information in the document also.

    Yes, my SCI-A programmer is just like a C2prog i.e. off the self programmer.

    Now I understand this concept, so can you suggest me that from where i can get this kernel which is responsible to  flash my application or should i write this kernel app (RAM based) for DSP?

    Best Regards,

    Niraj Kumar Singh

  • Hi Niraj,

    I am also facing some what same problem, Now I have got some hint from your discussion.

    I think we will get some hint from document SPRA958— Running an Application from Internal Flash Memory on the TMS320F28xx DSP : http://www-s.ti.com/sc/techlit/spra958

    They have given code too : http://www-s.ti.com/sc/techlit/spra958.zip

    I hope it will help us.

    But I will more happy if anyone suggest existing API for that.

  • thanks for the inputs, I will take it to the documentation team.

    Usually customers write the kernels, since it is part of the application. Between Flash API examples (& the API library) and the ROM sources released to ControlSuite customers have enough sources in hand to get started.

    some customers use C2Prog or CodeSkin and I think Uniflash from TI would be good candidate to checkout as well. All these should allow you to directly program flash over Serial boot modes as long as you are sending over a COFF file properly linked.

    Best Regards

    Santosh

  • Hi neeraj

       i am also  trying to develop the flash programming tool  on host side( Other controller which is having SCI ) to program the F28335 .

    Can u please tell me the steps i have to follow , i Studied Boot rom user gide but i didnt get clear information

  • Hi Naresh,

    the ROM loaders support loading to RAM, they don't support programming flash.

    Hence you have to write your own flash programmer at DSP end.

    At my end i wrote my own flash programming to load my actual DSP application to the flash area because TI bootrom is not capable of programming the DSP application in Flash area and it only support to load it in the SARAM area. So i did the following steps at my end:

    1. Put the controller in Bootrom mode.

    2. Load my own DSP flash programmer application in the RAM area with my host application programmer

    3. Then erase the desired flash sectors which need to program and after that go back into the programming mode (same as TI bootrom concept)

    4. Again with the help of my host application programmer, i load my main DSP application to the flash area without switching of the DSP controller.

    5. Wait till the programming completes and then restart the controller.

    Programming complete and DSP application is running smoothly.

    Niraj

  • Hi Niraj,

    Is it possible to share your boot loader project so that it would be easier to understand? Was there a particular project that you used in order to build your application ?

    It would be great if you can share the project that you made to achieve this.

    I am currently using the F28335 Experimenter's Kit and trying to use the SCI-A to load the program to flash. However, I have to boot into SCI-A oot mode which ends up requiring an input from the user every time it boots up. I would like to just jump to flash when there is nothing provided from the user on the SCI- A bus.

    Thank You,
    Kamal Joshi
  • HI Kamal,

    If you would like additional help with your question, I recommend creating a new thread that would allow it to receive better support. There's a better chance of your question getting answered there, instead of posting in an older thread.

    Thanks,
    Ozino