Author Topic: Codeblocks MCU / OpenOCD plugin  (Read 22163 times)

Offline martind

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Codeblocks MCU / OpenOCD plugin
« Reply #15 on: January 26, 2009, 10:57:25 pm »
Hi Joerg,

There is no mechanism for counting breakpoints at the moment, and as you are using hardware breakpoints that is most likely the problem.
From memory there are 2 on the ARM7TDMI. I have done all my testing so far debugging from RAM, which has unlimited breakpoints. We do need a mechanism for limiting and I will add it to the list.

The missing tab sounds like the plugin is not being loaded. When you build the plugin, the plugin files (should) be automatically copied to the codeblocks plugin directory.

After compiling, in the $(#cb)\devel directory there should be libmcumgr.a. This is the mcu manager singleton shared between the mcu.dll plugin and the mcu sub-plugins.
In the $(#cb)\devel\share\CodeBlocks\plugins directory there should be mcu.dll
In $(#cb)\devel\share\CodeBlocks\plugins\mcudrv directory there should be the mcu sub-plugins libSTM32.a, STM32.xml, libSTR7.a, STR7.xml (and soon a generic driver but it's not on SVN yet).

Are you using windows or linux?

Martin.

Offline Joerg

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: Codeblocks MCU / OpenOCD plugin
« Reply #16 on: January 27, 2009, 10:47:31 am »
Hi Martin,

Quote
There is no mechanism for counting breakpoints at the moment, and as you are using hardware breakpoints that is most likely the problem.

Setting and deleting breakpoints the normal way (without your plugin) worked for me.
(I heard gdb always counts up on every breakpoints, so that's not the problem
as I first thought.)

If I set the first breakpoint it doesn't get hit.
If I set the second one the first one gets hit but
gdb points to the code of the second one !  :shock:


Quote
The missing tab sounds like the plugin is not being loaded.

I was talking about the tabs 'Envars Options' and 'Library', expected to show directly after your new tab.
At least, I need Envars Options to compile.
Maybe a clean/build of c::b will put everything in place again?

It's never too late to fail!

Offline martind

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Codeblocks MCU / OpenOCD plugin
« Reply #17 on: January 28, 2009, 01:09:49 am »
Hi Joerg,

Not sure why your tabs are not displaying correctly.
I have comitted an STR7 demo project to SVN, you should be able to get that now. Do you want to give that a try?
Also, I have made a slight change to the patch I issued earler. I originally had cbEVT_DEBUGGER_FINISHED dispatched from here:

Code: [Select]
void DebuggerGDB::Stop()

Which is OK, except when GDB fails to run because of an error. If an error occurrs, it does not stop OpenOCD. So it's better here:

Code: [Select]
void DebuggerGDB::OnGDBTerminated(wxCommandEvent& event)
{
    m_PidToAttach = 0;

    m_TimerPollDebugger.Stop();
    m_LastExitCode = event.GetInt();
    //the process deletes itself
//    m_pProcess = 0L;

    ClearActiveMarkFromAllEditors();
    m_State.StopDriver();
    Manager::Get()->GetLogManager()->Log(F(_("Debugger finished with status %d"), m_LastExitCode), m_PageIndex);

    if (m_NoDebugInfo)
    {
        cbMessageBox(_("This project/target has no debugging info."
                        "Please change this in the project's build options and retry..."),
                        _("Error"),
                        wxICON_STOP);
    }

    // Notify debugger plugins for end of debug session
    PluginManager *plm = Manager::Get()->GetPluginManager();
    CodeBlocksEvent evt(cbEVT_DEBUGGER_FINISHED);
    plm->NotifyPlugins(evt);

    // switch to the user-defined layout when finished debugging
    DoSwitchToPreviousLayout();

    #ifdef __WXGTK__
    // kill any linux console
    if ( m_bIsConsole && (m_nConsolePid > 0) )
    {
        ::wxKill(m_nConsolePid);
        m_nConsolePid = 0;
        m_bIsConsole = false;
    }
    #endif
}

Martin.

Offline Joerg

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: Codeblocks MCU / OpenOCD plugin
« Reply #18 on: January 30, 2009, 10:46:52 am »
I have updated and compiled your plugin project and codeblocks.
I've loaded the STR7 demo but it doesn't compile because the linker script is missing 'ram71x.ld'.

I had to change the openocd.cfg because I use the olimex tiny adapter:
ft2232_device_desc "Olimex OpenOCD JTAG TINY A"

I didn't apply your new patch. Can you post a patch file?

I'm still missing the Envars/Options and Libraries tabs, here is a screenshot:





[attachment deleted by admin]
It's never too late to fail!

Offline martind

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Codeblocks MCU / OpenOCD plugin
« Reply #19 on: February 09, 2009, 01:53:50 am »
Hi Jeorg,

Ok sorry I use the SARM gnu toolchain we use at work, this already contains the ram71x.ld/rom71x.ld file.
I have attached my patch.

Martin.


[attachment deleted by admin]

Offline woehlb

  • Single posting newcomer
  • *
  • Posts: 6
Re: Codeblocks MCU / OpenOCD plugin
« Reply #20 on: January 29, 2010, 09:23:38 pm »
What license is subject to the plugin Codeblocks MCU?

If it is the GPL, it would be possible, you offer a Codeblocks with integrated Codeblocks MCU plugin.

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 81
Re: Codeblocks MCU / OpenOCD plugin
« Reply #21 on: February 02, 2017, 08:05:07 am »
I am looking for openOCD plugin that i can use with codeblocks. can u help?

Online BlueHazzard

  • Lives here!
  • ****
  • Posts: 1231
Re: Codeblocks MCU / OpenOCD plugin
« Reply #22 on: February 02, 2017, 11:20:06 am »
You can use the gdb plugin to work with OpenOCD. Start openocd and connect to it with gdb

You have to set up this settings:
Project->Properties->Debugger->Remote debugging support

For more information:
http://openocd.org/doc/html/GDB-and-OpenOCD.html
http://wiki.micromint.com/index.php/Using_OpenOCD/2

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 81
Re: Codeblocks MCU / OpenOCD plugin
« Reply #23 on: February 05, 2017, 08:30:49 am »
Hi,

I am looking for OpenOCD plugin to link it directly with my codeblocks. I have tried the link mentioned in above replies, but I guess those links had been expired.
Help me to get the plugin.

Thanks
Anand A.

Online BlueHazzard

  • Lives here!
  • ****
  • Posts: 1231
Re: Codeblocks MCU / OpenOCD plugin
« Reply #24 on: February 05, 2017, 01:36:25 pm »
As i told you, you can use OpenOCD without the plugin...
berlios is dead since a lot years i don't think you will find any code from there sry...
« Last Edit: February 05, 2017, 01:52:40 pm by BlueHazzard »