We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello guys!
I'm having a problem here. I want to use the printf() function in a STM32F3 application to print debug messages to UART1. I've done this before on a M0 and worked like a charm.
The problem on the M4 is this: If I declare
#pragma import (__use_no_semihosting)
to append my own putc function to print the printf() output to a UART I get linker error
L6915E: Library reports error: __use_no_semihosting was requested, but _sys_exit was referenced
I'm using full assert and the std periph lib nothing more...
Any idea to fix that? Thanks!
Thank you! Working fine now after including
struct __FILE { int handle; /* Add whatever you need here */ }; FILE __stdout; FILE __stdin;
and
void _sys_exit(int return_code) { label: goto label; /* endless loop */ }
Just for interest, what's this _sys_exit function for, and why dindn't I need it with the M0?
Cheers
Didn't you use assert? Assert is expected to abort the run if it detects a failure.
Yes I do, but isn't the assert_failed function used for this?
The linker clearly thinks it's being used, perhaps you can mouse over and see where it's referenced, or search through the project files. Or it could be pulled in related to some other library/stdio function you are using.