2024-09-22 06:56 AM - last edited on 2024-09-23 01:05 AM by SofLit
HI
I HAVE ENABLED LOG LIKE THIS
WHAT ELSE NEEDS TO BE DONE I HAVE SEEN OLD POST TO WRITE MAIN.C
BUT STILL NOT SHOWING LOG?
LWIP LOG WILL BE VISIBLE IN CONSOLE OR SWV CONSOLE WHERE?
THANKS IN ADVANCE
2024-09-23 08:36 AM
Hello @MGOEL.1 ,
the output of the log as I see in the redefinition of the write function will be redirected to the itm console.
you need to first enable the swv feature in debug configuration setting the clock frequency and the open the port associated with the redirected print
here is a code tetorial showing how to do it
Using Printf Debugging, LIVE expressions and SWV Trace in CubeIDE || STM32 || ITM || SWV (youtube.com)
Regards
2024-09-24 04:53 AM
@STea thanks for video but i am getting error No source available for "_write _r() at 0x8010be0" i have checked in debugging as per others errors still it is not printing on s w v port
print f ("test= %d \n", count);
count++;
fflush(stdout);
thanks in advance
2024-09-24 06:31 AM
Hello @MGOEL.1 ,
you should add this in you main.c file
/* USER CODE BEGIN 4 */
int _write(int file, char *ptr, int len)
{
(void)file;
int DataIdx;
for (DataIdx = 0; DataIdx < len; DataIdx++)
{ //To get printf working using serial wire viewer (available on cubeIDE only)
ITM_SendChar(*ptr++);
}
return len;
}
/* USER CODE END 4 */
without any ioputchar prototype needed
if you still experiencing issue, send you main.c file to take a look.
Regards
2024-09-24 08:00 PM
@STea i have written in main still getting same error
i have attached main file .Not able to understand this error
Thanks