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.

TM4C123GH6PM: on Keil MDK5

Part Number: TM4C123GH6PM


Dear forum,

I run into the most strange behavior.

On Keil MDK4 everything was working nicely with my board. So I wanted to switch to MDK5. I installed Legacy support and included in my project the startup_TM4C123.s. The project compiles and downloads with no errors, download and it is not running. I used the steps given in SPMU355.

Now if I use startup_TM4C129.s and system_TM4C129.c my board is able to run my software no problem.

What am I missing here?

/**************************************************************************//**
 * @file     system_TM4C129.c
 * @brief    CMSIS Device System Source File for
 *           TI TIVA TM4C129 Snowflake Device Series
 * @version  V1.00
 * @date     15. May 2013
 *
 * @note
 *
 *                                                             modified by Keil
 ******************************************************************************/

#include <stdint.h>
//#include "TM4C129.h" // this is only needed in the old tool chain!! Freaking!!

/*----------------------------------------------------------------------------
  Define clocks
 *----------------------------------------------------------------------------*/
#define __SYSTEM_CLOCK    (16000000ul)


/*----------------------------------------------------------------------------
  Clock Variable definitions
 *----------------------------------------------------------------------------*/
uint32_t SystemCoreClock = __SYSTEM_CLOCK; /*!< System Clock Frequency (Core Clock)*/


/*----------------------------------------------------------------------------
  Clock functions
 *----------------------------------------------------------------------------*/
void SystemCoreClockUpdate (void)            /* Get Core Clock Frequency      */
{
  /* TODO: Updates required to fully work with TM4C129 series devices */
  SystemCoreClock = __SYSTEM_CLOCK;

}

/**
 * Initialize the system
 *
 * @param  none
 * @return none
 *
 * @brief  Setup the microcontroller system.
 *         Initialize the System.
 */
void SystemInit (void)
{
  /* TODO: Updates required to fully work with TM4C129 series devices */
  #if (__FPU_USED == 1)
    SCB->CPACR |= ((3UL << 10*2) |                 /* set CP10 Full Access */
                   (3UL << 11*2)  );               /* set CP11 Full Access */
  #endif

#ifdef UNALIGNED_SUPPORT_DISABLE
  SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk;
#endif

  SystemCoreClock = __SYSTEM_CLOCK;

}
6403.startup_TM4C129.s

  • Hi Ruslan,
    TivaWare library provides examples for different platforms including Keil. Can you try one of the examples?
  • Ruslan Trifonov said:
    project compiles and downloads with no errors, download and it is not running.

    Feel your pain - such is never an enjoyable condition.

    I like vendor Charles' suggestion - but for the fact that those examples (may not) have fully accommodated your newer version of Keil.    (firm/I use IAR - so "in the dark" wrt latest Keil version)

    Many here/universally believe in "KISS" - and that would dictate that you "import - NOT create" the "smallest & simplest vendor supplied, Keil project present."     I'd add the "toggle" of a single LED to the vendor supplied project - and run that!  

    Check slowly & carefully for (any) changes between the Keil supplied "Start-Up files" - past  & present  versions.

    Your code must, "Not Run" for a reason - thus your discovery of that "reason" should rise to, "Job #1" - don't you agree?

    Can you "single step" your program - one code line at a time - and "note & report" those results?

    Recall we're (distant) - cannot see nor appreciate your (close-in) view - thus rely entirely upon your findings & report...

  • Hej Charles,

    Thank for your answer. I tried that and it is working no issues there.
    The problem is that porting my project from v4 to v5 did not work.

    When I import lets say blink project and remove the .c file replace with mine it works like a charm.
    But if I start a new project and import my .c (with the main) and the .s with the start up code. It does not work.

    I do not get any errors, I can single step the code no issue. And that is what throw me off.

    My current solution is import a project - Blinky and replace the .c file and build on top of it. Or that was my starting point.
    The issue is freaking simple. I though it maybe my freaking naming of the files! But it was not.

    The TM4C123GH6PM works like a charm with my own code if I import the .s file with the name startup_rvmdk.s from the blinky project or the startup_TM4C129.s So I start looking at the code and I found out that my startup file was total and full mess. It was around 1K lines O.o that looked weird. The new version is less than 400 lines.

    That will teach me not use chaintool 4 years old.