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.

Flash loader: Failed to setup call to 'FlashInit'

Other Parts Discussed in Thread: TM4C129ENCZAD, SEGGER

I have recently picked up the DK-TM4C129X and am attempting to flash the blinky code to the board using a J-Link attached on J38 (underside via tag connect). I have been unsuccessful so far. IAR throws "Flash loader: Failed to setup call to 'FlashInit'". Based on the log (see below) it does appear that it is communicating though. Other than changing the debugger settings in the project options, is there any other modifications that need to be made to facilitate the use of the J-Link?

Sat Jan 24, 2015 11:50:27: Loaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\config\flashloader\TexasInstruments\FlashTC4.mac
Sat Jan 24, 2015 11:50:29: Logging to file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\cspycomm.log
Sat Jan 24, 2015 11:50:29: JLINK command: ProjectFile = C:\TivaWare\TivaWare_C_Series-2.1.0.12573\examples\boards\dk-tm4c129x\blinky\settings\blinky_Debug.jlink, return = 0
Sat Jan 24, 2015 11:50:29: Device "TM4C129ENCZAD" selected (1024 KB flash, 256 KB RAM).
Sat Jan 24, 2015 11:50:29: DLL version: V4.94c, compiled Oct 31 2014 19:59:57
Sat Jan 24, 2015 11:50:29: Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46
Sat Jan 24, 2015 11:50:29: JTAG speed is initially set to: 32 kHz
Sat Jan 24, 2015 11:50:29: TotalIRLen = 4, IRPrint = 0x01
Sat Jan 24, 2015 11:50:29: Found Cortex-M4 r0p1, Little endian.
Sat Jan 24, 2015 11:50:29: FPUnit: 6 code (BP) slots and 2 literal slots
Sat Jan 24, 2015 11:50:30: TPIU fitted.
Sat Jan 24, 2015 11:50:30: ETM fitted.
Sat Jan 24, 2015 11:50:30: Hardware reset with strategy 0 was performed
Sat Jan 24, 2015 11:50:30: Initial reset was performed
Sat Jan 24, 2015 11:50:30: Found 1 JTAG device, Total IRLen = 4:
Sat Jan 24, 2015 11:50:30: #0 Id: 0x4BA00477, IRLen: 4, IRPrint: 0x1 CoreSight JTAG-DP
Sat Jan 24, 2015 11:50:30: Turning off watchdog timers
Sat Jan 24, 2015 11:50:30: 1024 bytes downloaded and verified (16.13 Kbytes/sec)
Sat Jan 24, 2015 11:50:30: Loaded debugee: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\config\flashloader\TexasInstruments\FlashTC4_256KB.out
Sat Jan 24, 2015 11:50:30: Target reset
Sat Jan 24, 2015 11:50:30: Flash loader: Failed to setup call to 'FlashInit'"

  • eeboy said:
    ...flash the blinky code...using a J-Link...J38 (underside via tag connect). I have been unsuccessful so far.

    Believe you've provided "necessary" - but not "sufficient" data - to tease out a full/proper response.  (our small firm uses paid IAR & multiple J-Links)

    You've "picked-up" a kit - but is it new, direct from vendor w/no signs of damage?  (that's implied - yet unstated)

    How recently have you used your IAR V7 & that J-Link?  And - have you used that pairing w/other (lesser) MCUs successfully - from this vendor?  (TM4C123 especially)

    That last question - if answered affirmatively - may best, "open the door to your solution."  That same IAR log should report the details associated with a successful "Flashinit."   And - it's my belief - that the 129x MCU may require different "flash handling" - than that which worked for LX4F and/or TM4C123.  (base this upon my recognition of substantially larger RAM/Flash w/in the 129x) 

    Perhaps of special interest to you - when we attach via SWD to our LX4F MCU boards - that Flashinit is (surprisingly) managed by an LM3S flash file!   And this works - and works well.  

    It would be useful if you'd detail (and provide here) the IAR log resulting from a successful download to a TM4C board.  Believe that's our best bet...

    I should state that vendor's Amit has assisted my small firm in the attempt to connect - via SWD - w/a TM4C123 "grafted" onto (and in place of) our past, LX4F MCU boards.   Unfortunately - with 3 "known good boards" - our download speed is "retarded."   (we harvest the 2 pins "freed from JTAG" - thus only SWD is available for our purposes)   When we "yank" the TM4C - and reflow an LX4F MCU - board downloads and works normally!   Maddening...

    We always (and only) employ external (physical) pull-up Rs for SWD/JTAG.  (MCU's internal WPUs prove too high in value - too often cause rounded signal edges & reduced levels - proving LESS than Robust!   And - what really is the "saving" inttroduced by cost/size of 2 06-03 Rs?)  Word to the wise...

    Interested in your history/success (and IAR log) if you have succeeded w/IAR - J-Link and TM4C.   And - if you could (temporarily) switch to SWD (a tick box w/in IAR's J-Link set-up screen) we'd be in your debt...

  • Somehow I missed this response. Thank you!

    Yes, so the board is quite new and I can't imagine it is faulty hardware. It might be a faulty user though. I have successfully downloaded many applications to this board using the built in ICDI (Debugger set to TI Stellaris). I have no problems with this method. However, I wish to use the J-Link. If anything, I would  suspect it would be the J-Link. It's a $12 chinese job (copy). However, it seems to function correctly with respect to communicating back to the host.

    When you say it works using the LM3S flash file, are you referring to the device description file selected under the setup tab of the debugger category under options? I am currently using the default because I couldn't find one for the EXACT part number on the board.

    I tried SWD and it failed in the same fashion.

    I found something odd which may be a clue. I have two J-Links. The first time I attempted to flash this dev board IAR prompted me to upgrade the firmware on the J-Link. I agreed. This J-Link is the one that throws the error I previously described. I decided to try the second J-Link but not upgrade the firmware. This J-Link goes a bit further in bringing up window with two progress bars. Of course, it doesn't flash, so the progress bars don't move and it sits in this state until I cancel or disconnect the J-Link.

    I will provide any logs you need, however, the only log output I know of is that which shows in the "Debug Log" window. Am I overlooking something?

  • Don't know if (illegal) Chinese copy can be called a, "J-Link."   We find that the use of any "suspect tool" provides (too often) compromised development - and may behave in unexpected manners. We cannot recommend "savings" on something so crucial to your development.

    Delayed response will cascade now - as we're due to fly east (into east coast snow-storm) as far east as our twin will allow.   Doubt that I'll be able to run the necessary test to ID the specific LM3S file for another day or two now - we found that LM3S file selection curious - and Amit himself noted that exact file.

    Recall that I mentioned that our download to 3 TM4C MCUs - placed on previous custom board which worked well w/LX4F MCUs - suffered a very retarded (speed-wise) download.  It seems quite possible - that you are "pulling the plug" prematurely on the download - expecting that it will proceed normally.  ***  In fact you may have "duplicated" our exact issue - gravely retarded download speed into TM4C123 and now into 129x. 

    Suggest you allow the download to continue - may take 10 minutes to complete.   Amit was unable to duplicate our findings - yet we noted this across 3 different TM4C MCUs - and the issue "disappeared" as soon as we replaced TM4C w/ LX4F equivalent.   (know that this is not possible for you - but your confirmation of retarded download will prove useful to many...)

    Again - I really would invest in a "real" J-Link - you'd not be pleased if your work was "pirated" - suspect Segger feels just the same...

  • I should add that our, "time-related, Flash download" was retarded (greatly slowed) while running under StellarisWare 9453 targeting a TM4C123.
    Our clients fear use of rebrandWare - the many hiccups & unanticipated consequences reported here (& elsewhere) have (properly) locked us into the far more secure, stable & robust StellarisWare. It is the StellarisWare - TM4C123 - and IAR V7 w/(real) J-Link which suffers retarded download rate. When we replace the TM4C w/past LX4F - everything returns to normal. We note this effect across 3 of our production boards - we cannot obtain the several hundred LX4F devices needed - which motivated our attempt to "migrate" to TM4C123 - w/out success to this date... (this may not properly duplicate your conditions...)