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
ChibiOS support for ITM on STM32F207 Cortex M3?
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: ChibiOS support for ITM on STM32F207 Cortex M3?
Hi,
I never attempted that, if it works a device driver wrapping ITM could be created.
Giovanni
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?
No problem,
I will keep you posted. Should get time this week to look into it.
Chris
I will keep you posted. Should get time this week to look into it.
Chris
Re: ChibiOS support for ITM on STM32F207 Cortex M3?
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:
but same SWV_puts("hello from stm32f4\n") does not send same debug from under ChibiOS, so I guess ChibiOS is interfering somehow
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
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: ChibiOS support for ITM on STM32F207 Cortex M3?
It shouldn't interfere, the only thing ChibiOS port does is to enable the DWT counter.
Giovanni
Giovanni
Re: ChibiOS support for ITM on STM32F207 Cortex M3?
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.