Page 1 of 1

ChibiOS support for ITM on STM32F207 Cortex M3?

Posted: Sat Jan 26, 2013 4:14 am
by obe1line
I have an STM32F207 and previously used semihosting to output debug information via the CodeSourcery libraries on bare-metal.
The UART output is not an option since all of the pins are in use, but enabling the ITM an using the trace facility with OpenOCD looks like an option.

Is there anyone that has used the ITM facility of the Cortex M3 with ChibiOS, or have come across any useful links ?

Thanks,
Chris

Re: ChibiOS support for ITM on STM32F207 Cortex M3?

Posted: Sat Jan 26, 2013 8:23 am
by Giovanni
Hi,

I never attempted that, if it works a device driver wrapping ITM could be created.

Giovanni

Re: ChibiOS support for ITM on STM32F207 Cortex M3?

Posted: Sat Jan 26, 2013 2:39 pm
by obe1line
No problem,
I will keep you posted. Should get time this week to look into it.

Chris

Re: ChibiOS support for ITM on STM32F207 Cortex M3?

Posted: Sun Feb 15, 2015 7:12 pm
by russian
I wonder if anyone has managed to initialize ITM / use ITM_SendChar within a ChibiOS env?

Re: ChibiOS support for ITM on STM32F207 Cortex M3?

Posted: Tue Sep 08, 2015 3:14 am
by russian
Still wondering how to get ITM_SendChar work within ChibiOS.

Without ChibiOS one does not really need to initialize anything. Here is a _complete_ example which successfully blinks an LED and sends debug via serial for me:

Code: Select all

void SWV_puts(const char *s )
{
    while (*s) ITM_SendChar(*s++);

}
int main(void) {
   SysTick_Config(SystemCoreClock / 1000); // 1 ms in each tick

   STM_EVAL_LEDInit(LED5);

   while (1) {
      SWV_puts("hello from stm32f4\n");

      STM_EVAL_LEDToggle(LED5);
      Delay(200);
   }
   return 0;
}


but same SWV_puts("hello from stm32f4\n") does not send same debug from under ChibiOS, so I guess ChibiOS is interfering somehow :)

Re: ChibiOS support for ITM on STM32F207 Cortex M3?

Posted: Tue Sep 08, 2015 8:31 am
by Giovanni
It shouldn't interfere, the only thing ChibiOS port does is to enable the DWT counter.

Giovanni

Re: ChibiOS support for ITM on STM32F207 Cortex M3?

Posted: Wed Sep 09, 2015 1:06 am
by russian
As usual I am my own biggest enemy - I was using pin PB3 (SWO) for something else. Once I've stopped using pin PB3 for spi clock, I got SWO functioning. Sorry.