ChibiOS Eclipse debug view

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

ChibiOS Eclipse debug view

Post by Eddie »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS Eclipse debug view

Post by Giovanni »

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
Has thanked: 2 times
Been thanked: 6 times

Re: ChibiOS Eclipse debug view

Post by Eddie »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS Eclipse debug view

Post by Giovanni »

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

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

Re: ChibiOS Eclipse debug view

Post by Eddie »

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 544 times
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: ChibiOS Eclipse debug view

Post by steved »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS Eclipse debug view

Post by Giovanni »

Good idea steved, try changing the variable name.

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

Re: ChibiOS Eclipse debug view

Post by Eddie »

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