ChibiOS Eclipse debug view

Report here problems in any of ChibiOS components. This forum is NOT for support.
Eddie
Posts: 44
Joined: Sat Mar 16, 2013 5:57 pm
Location: Czech Republic
Has thanked: 2 times
Been thanked: 6 times

ChibiOS Eclipse debug view

Postby Eddie » Fri Oct 11, 2019 3:30 pm

Hi, I tried Chibios after a long time. Has anything changed in debuging? If I stop the program in the main routine, the chibios plugin reads the Chibios status and everithing is OK. But if I stop the program in ISR, the plugin writes Chibios not found on target. Thank you.

ChibiStudio Preview 21
ChibiOS 1.9.3

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: ChibiOS Eclipse debug view

Postby Giovanni » Fri Oct 11, 2019 6:18 pm

Hi,

This should not be the case, it is possible you had a stack overflow corrupting the threads list or something else.

Try placing a breakpoint in an ISR and check.

Giovanni

Eddie
Posts: 44
Joined: Sat Mar 16, 2013 5:57 pm
Location: Czech Republic
Has thanked: 2 times
Been thanked: 6 times

Re: ChibiOS Eclipse debug view

Postby Eddie » Fri Oct 11, 2019 9:08 pm

Hi,
I did a long debug until I found a curious mistake. In DAC callback I used the variable ch. If breakpoint is set in main, everything is fine, if breakpoint is set to DAC callback, plugin reports Chibios not found.
I don't exactly understand the problem when variable ch is defined as local.

Code: Select all

/*
 * DAC streaming callback.
 */
size_t nx = 0, ny = 0, nz = 0;
static void end_cb1(DACDriver *dacp) {
  uint32_t ch;

  ch = 0;

  nz++;
  if (dacIsBufferComplete(dacp)) {
    nx += DAC_BUFFER_SIZE / 2;
  }
  else {
    ny += DAC_BUFFER_SIZE / 2;
  }

  if ((nz % 1000) == 0) {
    palTogglePad(GPIOD, GPIOD_LED3);
  }
}

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: ChibiOS Eclipse debug view

Postby Giovanni » Fri Oct 11, 2019 9:20 pm

I will give it a try, moving the topic in "bug reports".

Giovanni

Eddie
Posts: 44
Joined: Sat Mar 16, 2013 5:57 pm
Location: Czech Republic
Has thanked: 2 times
Been thanked: 6 times

Re: ChibiOS Eclipse debug view

Postby Eddie » Fri Oct 11, 2019 9:46 pm

OK, thank you. Here is complete project for F4 discovery.

ChibiStudio Preview 21
ChibiOS 1.9.3
GCC 7.0

I got only warning
main.c:63:12: warning: variable 'ch' set but not used [-Wunused-but-set-variable]
Attachments
STM32F4xx-DAC.zip
(17.41 KiB) Downloaded 165 times

steved
Posts: 825
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: ChibiOS Eclipse debug view

Postby steved » Sat Oct 12, 2019 9:08 am

Isn't 'ch' the name of the variable that OpenOCD looks for to identify a Chibios system?
If so, presumably the local ch is overriding the global one; so changing the variable name in the callback should at least work round the problem.

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: ChibiOS Eclipse debug view

Postby Giovanni » Sat Oct 12, 2019 12:50 pm

Good idea steved, try changing the variable name.

Giovanni

Eddie
Posts: 44
Joined: Sat Mar 16, 2013 5:57 pm
Location: Czech Republic
Has thanked: 2 times
Been thanked: 6 times

Re: ChibiOS Eclipse debug view

Postby Eddie » Sat Oct 12, 2019 1:23 pm

Yes, presumably the local ch is overriding the global one. Changing variable name resolved the problem. Thank you.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 47 guests