SmokinGrunts 5 Posted April 4, 2017 Share Posted April 4, 2017 (edited) Hello all! So, this is happening on BOTH my Ubuntu 16.04 AND Windows 8.1 systems. This is for a TM4C1294NCPDT. To reduce potential variables, I've reverted to using the EK-TM4C1294XL Development Board. To reproduce: Fresh install of CCSv7.1, Fresh install of Energia 18. Open CCSv7, Create a new workspace, select 'Project > New Energia Sketch', Energia Version set to 18, select 'Built-in Examples > 01.Basics > Blink.ino', selected device: 'LaunchPad (Tiva C) w/ tm4c129 (120MHz), select 'Finish'. Right Click 'Blink" project in the Project Explorer, select "Build Project'. Project builds fine. Push F11 (or select 'Debug Blink' from the toolbar). Code is uploaded, but the debug 'Resume' button is grayed out. LED does not blink. Note: 'Blink' runs fine in the Energia IDE itself. What happened in the update to CCSv7? I'm taking a shot in the dark here, but I think the memory map is b0rked. If I disable "On a program load or restart" in the 'Debug > Auto Run and Launch Options' and then attempt to debug, CCS starts the debugger at "void ResetISR(void) {" in startup_gcc.c. See attached image for disassembly view. I think (IIRC) that the two ldr calls in assembly are usually right below that 'push', but my memory ain't what it used to be. Anyhow, if I try to 'Step Into' with F5, I immediately get a dreaded "No source available for "0xfffffffe" ... So, any idea what the hell happened? This shoots me dead until this is resolved... I figured TI would at least test Energia GCC debugging before releasing v7, though I do tend to err with my assumptions quite often. If you need anything, just holler. EDIT: For posterity, here's my TI E2E forum post on the same: https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/586137 Edited April 4, 2017 by SmokinGrunts Added a link to TI E2E board Quote Link to post Share on other sites
SmokinGrunts 5 Posted April 4, 2017 Author Share Posted April 4, 2017 Here's the exact screenshot of what happens once I single-step into ResetISR() Quote Link to post Share on other sites
SmokinGrunts 5 Posted April 4, 2017 Author Share Posted April 4, 2017 Here's a thread, circa 2014, describing a workaround for this issue: (scroll to top of page, link is to my latest post in the thread) https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/363076/2152558#2152558 The linked thread describes a problem and solution for CCSv6, almost identical to the CCSv7 behavior I'm seeing. I don't understand why 1- I never had this issue before, with the same version in the link, and 2- why CCSv7 would have this behavior... Thoughts? Quote Link to post Share on other sites
Rickta59 589 Posted April 4, 2017 Share Posted April 4, 2017 I don't have the arm compiler stuff installed in my CCS install, however I did install the tivac library into energia 1.6.10E18 and then tried to debug it with the arm-none-eabi-gcc tools I have installed on my linux setup. I have arm-none-eabi-gcc version 6.2.1 as my default. It won't debug the .elf file generated with the energia compiler which is arm-none-eabi-g++ version 4.8.4. If I use the arm-none-eabi-gdb in from the energia packages with openocd: $ /home/kimballr/.energia15/packages/energia/tools/arm-none-eabi-gcc/4.8.4-20140725/bin/arm-none-eabi-gdb -ex 'target remote :3333' sketch_mar21a.ino.elf It works fine. I can set a break point on ResetISR without issue. $ /home/kimballr/.energia15/packages/energia/tools/arm-none-eabi-gcc/4.8.4-20140725/bin/arm-none-eabi-gdb -q -ex 'target remote :3333' sketch_mar21a.ino.elf Reading symbols from /tmp/buildf952838f75b6bd4033bf414decbd1185.tmp/sketch_mar21a.ino.elf...done. Remote debugging using :3333 0x0000041a in delayMicroseconds (us=us@entry=500) at /home/kimballr/.energia15/packages/energia/hardware/tivac/1.0.2/cores/tivac/wiring.c:110 110 elapsedTime = (startTime-(HWREG(NVIC_ST_CURRENT) & NVIC_ST_CURRENT_M )) & NVIC_ST_CURRENT_M; (gdb) mon reset init adapter speed: RCLK - adaptive tm4c123gh6pm.cpu: target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x000002a8 msp: 0x20008000 (gdb) b ResetISR Breakpoint 1 at 0x2a8: file /home/kimballr/.energia15/packages/energia/hardware/tivac/1.0.2/cores/tivac/startup_gcc.c, line 432. (gdb) c Continuing. Note: automatically using hardware breakpoints for read-only addresses. Breakpoint 1, ResetISR () at /home/kimballr/.energia15/packages/energia/hardware/tivac/1.0.2/cores/tivac/startup_gcc.c:432 432 void ResetISR(void) { (gdb) You might want to check that the gdb being used in CCS is the same version as the one being used in your energia install. -rick Quote Link to post Share on other sites
Rickta59 589 Posted April 4, 2017 Share Posted April 4, 2017 Looking back at your images, I'm not even sure how debugging with Energia and CCS works. My suggestion, is to use openocd and the arm-none-eabi-gdb that comes in the Energia package directory. In ubuntu, run energia and compile your sketch, note where the /tmp/buildxxxx/ files end up that is where you find the .elf file. Then open two xterms, in one run openocd and in the other run the gdb: [in xterm 1] ... $ openocd -f board/ek-tm4c1294xl.cfg [in xterm 2] .. $ $HOME/.energia15/packages/energia/tools/arm-none-eabi-gcc/4.8.4-20140725/bin/arm-none-eabi-gdb -q -ex 'target remote :3333' /tmp/buildxxxx/yoursketch.ino.elf Reading symbols from /tmp/buildf952838f75b6bd4033bf414decbd1185.tmp/sketch_mar21a.ino.elf...done. Remote debugging using :3333 0x0000041a in delayMicroseconds (us=us@entry=500) at /home/kimballr/.energia15/packages/energia/hardware/tivac/1.0.2/cores/tivac/wiring.c:110 110 elapsedTime = (startTime-(HWREG(NVIC_ST_CURRENT) & NVIC_ST_CURRENT_M )) & NVIC_ST_CURRENT_M; (gdb) mon reset init adapter speed: RCLK - adaptive tm4c123gh6pm.cpu: target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x000002a8 msp: 0x20008000 (gdb) b ResetISR Breakpoint 1 at 0x2a8: file /home/kimballr/.energia15/packages/energia/hardware/tivac/1.0.2/cores/tivac/startup_gcc.c, line 432. (gdb) c Continuing. Note: automatically using hardware breakpoints for read-only addresses. Breakpoint 1, ResetISR () at /home/kimballr/.energia15/packages/energia/hardware/tivac/1.0.2/cores/tivac/startup_gcc.c:432 432 void ResetISR(void) { (gdb) -rick Quote Link to post Share on other sites
SmokinGrunts 5 Posted April 4, 2017 Author Share Posted April 4, 2017 Much obliged, thanks Rick! I'll give this a go in a bit, report back here. Note that I'm able to successfully debug in CCS through a very annoying workaround... By turning off auto-run in the debug options, loading the program, and performing a manual system reset from the debug toolbar... Quote Link to post Share on other sites
Rickta59 589 Posted April 4, 2017 Share Posted April 4, 2017 well that intervention doesn't seem all that bad.That is your only issue? Quote Link to post Share on other sites
Rickta59 589 Posted April 4, 2017 Share Posted April 4, 2017 So ... I just used the offline installer to load the lastest CCS 7.1 on ubuntu 16.04 64 bit. I didn't seem to have any issues debugging the blink.ino program. Maybe you could hop on IRC and explain further. [Edit 1] ... I take that back ... I switched to a TM4C1294 and I see it is faulting right away. [Edit 2] ... appears to be faulting in _init() [Edit 3] ... appears to be faulting in timerInit() ... seems to think I have a tm4c123gxl .. and is trying to set the 80MHz clock ... that is where it crashes ... looking at the properties, look at the GNU Compiler/Symbols I see ${ENERGIA_CORE_SYMBOLS} hovering over that it shows the wrong values [Edit 4] doh ... I had selected the wrong board type .. going back to recreate with proper board [Edit 5] ok .. went back selected proper board no fault, debugging works fine. Maybe you want to check which board you used to create your Energia project are you sure you picked the tm4c1294? It seems picking the wrong board TM4C board will allow you to create a file that is upload and then starts to debug but crashes right alway. Maybe this is your problem? Quote Link to post Share on other sites
SmokinGrunts 5 Posted April 4, 2017 Author Share Posted April 4, 2017 Aye I'll hop on IRC, just got my system reloaded Quote Link to post Share on other sites
SmokinGrunts 5 Posted April 4, 2017 Author Share Posted April 4, 2017 After much finagling and testing with Rick, he discovered that the Stack Pointer register is fuxxed. Here's CCSv6 and Energia 17, Working: http://i.imgur.com/A5n3gzb.jpg Here's CCSv7 and Energia 18, Not working: http://i.imgur.com/Vt4yh2y.jpg Breadcrumbs... If anyone runs into this and needs more help, let me know. Quote Link to post Share on other sites
Rickta59 589 Posted April 4, 2017 Share Posted April 4, 2017 You can hack your gel script: $ diff tm4c1294ncpdt.gel rk1294ncpdt.gel 127a128,132 > OnRestart() > { > GEL_AdvancedReset("System Reset", 1); > } > $ pwd /home/kimballr/ti/ccsv7/ccs_base/emulation/gel bluehash 1 Quote Link to post Share on other sites
srodg68 0 Posted April 15, 2017 Share Posted April 15, 2017 Rick - thanks for the gel script mod - works fine with my older board and my new 1294xl! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.