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.

Boot from memory? TMS320F28377S Launchpad

Other Parts Discussed in Thread: CONTROLSUITE, TMS320F28377S

Hi,

Im trying to make my launchpad boot a stored program from memory however im struggling with how to store the program on the launchpad so when I reset the Launchpad, it automatically boots the program, can anyone help?

Im having no trouble compiling the program and running it on the launchpad however when its reset or unplugged it reverts back to a demo. Ive seen topics which describe linker files and also discusses the use of the on board boot switches however being new to ti launchpads, im struggling to apply this info.

Many thanks

Bryan Savage

  • Hi Bryan,

    I think you are programming code to RAM or your boot switch settings are not configured to GetMode.

    Please check the example projects from below path if controlSUITE is installed in your system for RAM & FLASH buildable projects.
    ..\ti\controlSUITE\device_support\F2837xS\v190
    Also ensure that your boot pin settings are configured to GetMode.

    -Aditya
  • Also refer below attachment  for boot settings

    http://www.ti.com/lit/ug/sprui25a/sprui25a.pdf

    -Aditya

  • Thank you for your reply Aditya,

    I see, so setting the switches to Get Mode then debugging and running loads the program to the launchpad? Then when I want the stored program to run do I set the switches to Parallel IO or do I leave it in Get Mode? Or am I wide of the mark?

    -Bryan
  • One time setting.. You can set it to GetMode and you can use it for debugging as well as storing to Flash.

    If you configured it in GetMode, then during power ON cycle, CPU will start booting from internal Flash.

    -Aditya

  • Im a little confused, setting to GetMode using the switches means TRSTn is 0 and the debugger will not connect? Doesnt TRSTn have to be 1 for me to be able to connect to the debugger and store to flash?

    EDIT: Thinking on it, knowing that I can use GetMode to read my program from the flash, what I should be asking is how to I now write my program to the flash? 


    -Bryan

  • Bryan,

    Setting GetMode does not mean TRSTn will be '0'.  Table is showing two different case here. One when emulator is connected and in that case TRSTn will be driven '1' by emulator (hence table has value '1') and other case is stand-alone means no emulator connected so TRSTn will be '0' (hence table has value '0').

    Regards,

    Vivek Singh

  • Hi Vivek,

    As I understand it, switch 3 is setting TRSTn so when I set the boot switches to '1 1 0' (GetMode?) it will not connect to CCS for debugging I think this is also mentioned in the text above the table.

    Unless I set GetMode another way?

    -Bryan

  • Hi Bryan,

    Ok, I see what you mean. Emulation BOOT further has different boot mode settings and has Get Mode setting based on the value written at address 0xD00. Please refer "Table 3-3. Emulation Boot (TRSTn == 1)" and "Table 3-2. EMU_BOOTCTRL Definition"  in TRM for more detail about this.

    Thinking on it, knowing that I can use GetMode to read my program from the flash, what I should be asking is how to I now write my program to the flash? 

    To load the code select the Wait BOOT, connect the CCS and load the .out on device. CCS flash plug-in will program the flash.

    Once program is loaded, you can disconnect the CCS, change the BOOT MODE to GetMode and reset the device. Now device will boot from Flash and run the code which you have loaded.

    Let me know if this still does not answer the question.

    Regards,

    Vivek Singh

  • Hi Vivek,

    Ok so I need to set it using EMU_KEY, EMU_BMODE, EMU_BOOTPIN0 and EMU_BOOTPIN1?

    So adding the following to my code initializes GetMode?

    EMU_KEY = 0x5A;
    EMU_BMODE = 0xFE;
    EMU_BOOTPIN0 = 1;
    EMU_BOOTPIN1 = 1;

    Are there any change or additional code I need to add that supports this?

    Then after adding this code I use the Boot switches to complete the procedure you mentioned to load the code?

    Thanks again for your help, im finding the launchpads to not be the most intuitive of devices to figure out.

    -Bryan

  • Hi Bryan,

    Im trying to make my launchpad boot a stored program from memory however im struggling with how to store the program on the launchpad so when I reset the Launchpad, it automatically boots the program, can anyone help?

    I think you are deviated from normal procedure for programming the build output file to Flash memory of target device.

    Here are few steps for example project to boot from internal Flash

    1. Build your example project for Flash (Right click on project & set Build Configuration->Set Active->FLASH then build)

    2. Launchpad Boot setting switch set to GetMode (On Lanchpad switch setting.. Manual :http://www.ti.com/lit/ug/sprui25a/sprui25a.pdf)

    3. Then Program your build project code

    4. Reset the device

    The above steps are enough to store program to internal flash & boot device from internal flash

    -Aditya

  • Hi Aditya,

    Thanks for helping us get back to my original problem.

    At step 3 when I try to program the launchpad, CCS says it cannot establish a connection when I run the debugger, I assume this is due to the switches being in GetMode and therefore TRST not being set. Do I need to do this using the emulation boot settings?


    Setting the switch high, building and debugging gives a load program error.

    Thanks,

    Bryan

  • Hi Vivek,

    Here Bryan is try to program the code to internal Flash of TMS320F28377S Launchpad & facing below issues when Boot switch settings are in GetMode.

    At step 3 when I try to program the launchpad, CCS says it cannot establish a connection when I run the debugger, I assume this is due to the switches being in GetMode and therefore TRST not being set. Do I need to do this using the emulation boot settings?


    Setting the switch high, building and debugging gives a load program error.

    Here my question is irrespective state of TRSTn switch & BootMode Switchs (GPIO72 & GPIO84), he should be able to program the code (built for FLASH ) to internal Flash of TMS320F28377S using XDS100v2?

    -Aditya

  • Hi Bryan, Aditya,

    There's been some confusion in this thread.  I'll try to help clear things up.

    1) For the emulator to program/connect to the MCU, the emulator needs to be able to control TRSTn and the various JTAG pins.  No GPIO settings matter*.
    2) For the device to boot from FLASH, TRSTn must be low and the boot GPIO (72 and 84) must be set in Get Mode.  Unless special things are done, Get Mode will be Boot-to-FLASH.
    3) The simplest path to using the kit is the following.  When debugging or programming the FLASH, set S1's switch3 to ON. Then change it to OFF when you want it to boot from FLASH standalone (cold boot).
    4) When you load to FLASH with the emulator, you have the ability to run the code from FLASH and debug with the emulator connected.  This won't run the initial code that would run when a cold boot occurs, but it is often close enough.
    5) If you need to "emulate" a cold boot with a debugger connected, Vivek provided some of the detail necessary to do this.  This is often only needed if (4) works, but cold booting from (3) doesn't.

    * except in the relatively rare situation that bad code is written into FLASH and the boot GPIOs are configured so that the device will boot from FLASH.  The bad code written would then have to reset the device continually to effectively block the emulator.

    Hopefully this helps.


    Thank you,
    Brett

  • Thank you Brett for your detail clarification.

    Bryan should look into point number 3 for his requirement.

    -Aditya
  • Hi Brett, 

    Thank you for shedding some light on this subject.

    I understand all the points however my method for 3 is not working.

    Im setting up the launchpad as in 3, switch3 on, connecting to PC and CCS, building CPU1_FLASH and debugging the program but then im getting the following error when it loads: 

    C28xx_CPU1: GEL: File: C:\ti\controlSUITE\device_support\F2837xS\v190\F2837xS_examples_Cpu1\gpio_toggle\cpu01\ccs\CPU1_FLASH\gpio_toggle_cpu01.out: Load failed.

    Ive navigated to the location and the file is present, is there any further help you can offer me with this?

    Many thanks again, 

    -Bryan

  • Ok, solved that, I wasn't erasing the Flash before programming it. Its working fine now.

    I really appreciate all your help, thanks guys!

    -Bryan