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.

BeagleBone download/debug problem with IAR IDE

Other Parts Discussed in Thread: SEGGER, AM3359, AM3517

I used IAR 6.30 and JLink v8 (Segger) to download StaterWare (02.00.00.07) example projects to my BeagleBone (Rev 6). I did as instructed in

http://processors.wiki.ti.com/index.php/AM335X_StarterWare_Environment_Setup#IAR_Embedded_Workbench_6.10_Projects

I also download MAC file patch and used AM335x_DDR2.mac as debug macro file.

I got these messages when I try to download and debug my project:

Wed Sep 12, 2012 11:49:52: Loaded macro file: C:\Program Files\Texas Instruments\tools\ewarm\AM335x_DDR2.mac
Wed Sep 12, 2012 11:49:52: Device "AM3359" selected (0 KB flash, 0 KB RAM).
Wed Sep 12, 2012 11:49:52: JLINK command: ProjectFile = C:\Program Files\Texas Instruments\build\armv7a\ewarm\am335x\beaglebone\gpio\settings\gpioLEDBlink_Debug.jlink, return = 0
Wed Sep 12, 2012 11:49:52: JLINK command: scriptfile = C:\Program Files\IAR Systems\Embedded Workbench 6.0\arm\config\debugger\TexasInstruments\am335x.jlinkscript, return = 0
Wed Sep 12, 2012 11:49:52: Device "AM3359" selected (0 KB flash, 0 KB RAM).
Wed Sep 12, 2012 11:49:52: JLINK command: device = am335x, return = 0
Wed Sep 12, 2012 11:49:52: DLL version: V4.50m, compiled Jul 20 2012 19:39:26
Wed Sep 12, 2012 11:49:52: Firmware: J-Link ARM V8 compiled Aug 1 2012 13:40:47
Wed Sep 12, 2012 11:49:52: JTAG speed is initially set to: 32 kHz
Wed Sep 12, 2012 11:49:52: Initial reset was performed
Wed Sep 12, 2012 11:49:52: TI AM3517 (Cortex-A8 core) J-Link script
Wed Sep 12, 2012 11:49:53: J-Link script: Init ICEPick
Wed Sep 12, 2012 11:49:53: TotalIRLen = 6, IRPrint = 0x01
Wed Sep 12, 2012 11:49:53: TotalIRLen = 6, IRPrint = 0x01
Wed Sep 12, 2012 11:50:08: AM335x 15x15 EVM Initialization is in progress ..........
Wed Sep 12, 2012 11:50:08: **** Subarctic ALL ADPLL Config for OPP == OPP100 is In Progress .........
Wed Sep 12, 2012 11:50:08: C:\Program Files\Texas Instruments\tools\ewarm\AM335x_DDR2.mac(42,23): Error: Operation error.
Wed Sep 12, 2012 11:50:08: Error while calling macro execUserPreload
Wed Sep 12, 2012 11:50:08: 724 bytes downloaded (22.81 Kbytes/sec)
Wed Sep 12, 2012 11:50:08: Loaded debugee: C:\Program Files\Texas Instruments\binary\armv7a\ewarm\am335x\beaglebone\gpio\gpioLEDBlink.out
Wed Sep 12, 2012 11:50:25: Target reset
Wed Sep 12, 2012 11:50:25: Failed to set breakpoint at 0x00000080 (out of breakpoints?)
Wed Sep 12, 2012 11:50:27: Warning: Hardware breakpoint not possible to set/clear during execution
Wed Sep 12, 2012 11:50:27: Failed to set breakpoint at 0x00000008 (out of breakpoints?)
Wed Sep 12, 2012 11:50:28: Warning: Hardware breakpoint not possible to set/clear during execution
Wed Sep 12, 2012 11:50:28: There were 1 error and 3 warnings during the initialization of the debugging session.

Ignoring all warnings and errors, it look like a successful download but I could not debug, create brakpoints ... Whenever, I try to run, halt or reset my board, I got this message

CPU not hlated

Abort debug session?

And IAR become "Not responding"

So, Are there any errors in AM335X_DDR2.MAC?

Please help me solve this problem! 

TinND

  • Hi TinND,

    Beaglebone has onboard TI XDS100v2 emulator and it cannot support JLink.

    The User guide page http://processors.wiki.ti.com/index.php/AM335X_StarterWare_Environment_Setup#IAR_Embedded_Workbench_6.10_Projects has an error(i.e. it tells the user to use JLink to use as the debugger). This page will be corrected. However it is mentioned that support for Jlink is not provided in the http://processors.wiki.ti.com/index.php/StarterWare_02.00.00.07_Release_Notes#What_is_Not_Supported

    You will be able to debug via TI XDS100 debugger. AM335x_DDR2.Mac file is proper.

     

    Regards,

    Jeethan

  • Hi Jeethan Castelino,

    Did you mean we can not use Jlink but can use TI XDS100 to debug with IAR?

    BB has onboard TI XDS100v2 emmulator. So can we use this on board emutator with IAR or we must purchase an external TI XDS100 emualtor?

    Actually, I do not think BB can not debug with Jlink because BB have an CTI JTAG header and can configure to use it instead of on board XDS100 (http://circuitco.com/support/index.php?title=BeagleBone#Optional_JTAG_Header). In addtion, Segger said that their Jlink v8 support AM335x MPU.

    So, what do not support Jlink? StarterWare, BeagleBone or even AM335x MPU?

    Regards,

    TinND

  • Hi TinND,

    I was  not aware that beaglebone can be configured to be connected to an external emulator via a JTAG header. Currently Jlink support is not available in StarterWare(Jlink is tried only on AM335x EVM and support is not available).

    To debug via xds100 onboard on beaglebone, no additional hardware is required. Xds100 is accessed via the USB connection(mini USB cable provided with Beaglebone).

    Regards,

    Jeethan

  • Hi Jeethan Castelino,

    After installing newest IAR version (6.4) and a lot of drivers, I finally downloaded/debugged BeagleBone with IAR and on-board XDS100 emulator. I still get some problems:

    1. Debug speed is so slow, and I can not reconfigrue it.

    2. I can not add any break-points when target running. 

    Do you have any suggestion for me?

    Regards,

    TinND

  • Hi TinND,

    StarterWare examples are not tested on IAR version 6.4. It is mentioned at this link http://processors.wiki.ti.com/index.php/AM335X_StarterWare_Environment_Setup#IAR_Embedded_Workbench_6.XX_Projects

    Coming to your queries

    1) Debug speed varies across debuggers. Debugging with XDS510,XDS560 is faster than XDS100. However, we have tested beaglebone only on XDS100(Debug speed is fixed.Cannot be reconfigured).

    2) Are you able to apply breakpoints when target is halted? We have not tested/applied breakpoints when target is running. 

    Regards,

    Jeethan

  • Hi Jeethan Castelino,

    Finally, I could debug Beglebone with JLink. I am able to apply breakpoints when target running when using JLink with IAR IDE. Jlink's debug speed is much faster than XDS100.

    To debug BeagleBone with JLink, you should use Jlink v8 and update to newest firmware. IAR 6.4 was fully support AM335x MPUs, you do not need to add any files. 

    Thanks anyway!

    Best regards,

    TinND

  • does any one was able to Blink led with IAR IDE on Beaglebone ?
    I having hard time doing this. I copied Ledblink program from starterware, added all drivers, code compiled and downloaded with no problems, but i get pointer below stack 0x100h and don't know what to do.
    It would be nice to have IAR  folder with all drivers inside , with led blink program, is it possible that some one who knows what he is doing make one ?

  • Hi Linas,

    Did you used .icf file in the staterware ? Because we download direct into RAM , therefore the .icf file have show the start address for downloading your application . In conclusion , you must add the gpioLEDBlink.icf in your IAR project

  • Hello, thanks for reply.
    i was using preconfigured project , so it had that .inf file.
    I replaced with one you point me (added for linker) and get same problem


    error >> The stack pointer for stack 'FIQ_STACK' (currently 0x80005208) is outside the stack range (0x80005708 to 0x80005710)

    same problem with gpioLEDBLINK.icf  linker file as with original, it looks like FIQ_STACK is below stack  range, and if i lower it , it go down as well...


    also can't find these functions:


        GPIO1ModuleClkConfig();
        GPIO1Pin23PinMuxSetup();


    i added all files, where is no include error, but somehow compiler can't find it. (maybe thats why i get below of stack ? have no idea




  • Ah , I forgot one thing , you must choose using the am335x.mac file , Click Option of project -> choose tab Debug . In Setup macro panel , check "Use macro file" , Browse to link . "C:\Program Files\IAR Systems\Embedded Workbench 6.4\arm\examples\TexasInstruments\AM335x\AM335x_EVM\Getting_Started\config\am335x.mac" , and rebuild and download to beaglebone

    Best Regards

    Happy if this is your question's answer

  • Since project was preconfigured for Texas ARM am335x  devboard, it already had that mac file inside

    and even  with untouched code for that evaluation board, i get same out of stack error

    Thank you for your help

  • Have you configured as my request ? If you can , attach your project in this forum , I will check it for you

    Regards

  • Thank you fro your help.
    I made again clean project with all files, but still have same problems, and can't find first two functions, so i just made them  as comments.
    If you can fix that, and that would be very nice.
    So far i am using STM32F4, and it packs some punch (with overclock to 250MHz) i can't wait to test it against this processor, but programming on top of Linux is not the way to go for me
    I hope you can locate problem source, and thanks again

    beaglebone IAR LED Blink.zip
  • Hi Linas

    I downloaded your IAR project , built , downloaded , and debugged without any errors , I didnt change your project configuration , Let check your  IAR workbench 's version . If it's old version , please update or download the new one.

    Regards

  • Hi. did you uncomment first two functions calls, and led was blinking when you run the program ?
    because i don't get any compilation error (except first two functions) but led is not blinking, and pointer is below stack.
    yes, i have new version of iar 6.40.2

  • Hi , I have just built and downloaded , not change your code , the led was still blinking

    Best regards

  • now that is strange. any ideas why that doesn't work for me? (so that means you uncommented that first two functions, since original they are comments)

        /* Enabling functional clocks for GPIO1 instance. */
        //GPIO1ModuleClkConfig();                                                      // << I can't find this function

        /* Selecting GPIO1[23] pin for use. */
        //GPIO1Pin23PinMuxSetup();                                                    // << I can't find this  function too


    is it possible that i have problem with beaglebone ?

  • Hi 

    Two functions, you used , are contained in gpio.c , but you dont add it in your project , this is the reason made your issue 

  • Sir, you are right, now program is working. i have no idea how i missed that part., but now it blinks

    still get this error , but program still runs
     The stack pointer for stack 'FIQ_STACK' (currently 0x403083F8) is outside the stack range (0x40308500 to 0x40308540)

    next step will be making I80 bus driver for LCD :)


    ( do i have right set 16b bus data with one command, or i have to make code to set each bit to port ? )


    Also best i can do with usb powered Beaglebone is 2,38MHz toggle (on other pin), can i make it faster ?
    i know that STM32F4 can toggle 125MHz, i bet beaglebone should do something in that range

    Have one question about GPIO

    with  STM32F4 i simply could do GPIOx->ODR=16b_data & 0xFF ; (to print 8b to port) (i am going to use GPIO1(0-7) for LSB, and GPIO2(6-13) for MSB)
    How can i do that with beaglebone ? i really don't want to make large if with direct set/reset function , since i need speed


  • Ok,after few hours of surfing through registers and functions made custom functions for multiple pins turn on/off just like GPIOx->IDR command do on M4 core.
    I was able to config all pins for connecting to LCD via I80 bus protocol.
    Now just one problem, i get only 2.387MHz ,i found slew rate control, but have no idea how to make it faster.

    Here is some progress
    http://www.youtube.com/watch?v=IdV_OXv1QtQ
    you can clearly see out of stack warning in debugger window

  • Linas Karpavicius said:
    still get this error , but program still runs
     The stack pointer for stack 'FIQ_STACK' (currently 0x403083F8) is outside the stack range (0x40308500 to 0x40308540)

    We had the same issue, Looks like it's a known problem with IAR-ARM. It exists since 6.21 when they added support for the XDS100v2. Not sure sure if it's in earlier versions.

    From IAR's C-spy release notes here

    When reading the FIQ register group in the XDS100 debugger driver, incorrect values are recorded. The actual behavior depends on the current cpu mode. This will cause the stack checking to give false warnings in the log window. A workaround is to turn off the stack checking from the menu Tools>Options>Stack and disable all stack options.
    [EW22839]


  • Why would you need to add gpio.c to the project? Is it not compiled into the platform library? The beaglebone.h file includes an external reference to it, which is the way I am trying to use it.  I also tried including the gpio.c, but both ways are still failing to produce blinking lights.  The code is downloaded to the board and execution begins, but execution never makes it into my main() in gpioLEDBlink.c.  Any idea?