2022-05-18 07:40 AM
After setting up the environment regarding the description (st.com/resource/en/application_note/dm00354244-stm32-microcontroller-debug-toolbox-stmicroelectronics.pdf) it is still not working.
Build is OK.
Download OK.
OCD starts.
The getchar() function receives the typed character in console, but none of the functions - which are using stdout - are working. I've tried printf(), putchar(), puts().
I set:
<main.c>
#include <stdio.h>
extern void initialise_monitor_handles(void);
int main(void)
{
/* USER CODE BEGIN 1 */
initialise_monitor_handles();
printf("Semihosting OK\n");
/* USER CODE END 1 */
...
....
<linker>
@ MCU GCC Linker -> Libraries -> rdimon
@ MCU GCC Linker -> Misc..-> -specs=rdimon.specs -lrdimon -lc
@ MCU settings -> Runtime lib: Reduced C
<Debug config>
ST-LINK (OpenOCD)
monitor arm semihosting enable
I'm using a Nucleo's ST-LINKv2 as a debugger, SWD lines to external board where the MCU is a Stm32L431RCT6, SWO line is not connected.
IDE: STM32CubeIDE Version: 1.9.0
I'm struggling now. I've read all available resources but not found any mention about a 'partially working' thing.
Thanks!
Tamas
Solved! Go to Solution.
2022-05-19 02:01 AM
Do you have syscalls.c excluded from build? Any other __io_putchar or _write lurking around in your project?
hth
KnarfB
2022-05-19 02:01 AM
Do you have syscalls.c excluded from build? Any other __io_putchar or _write lurking around in your project?
hth
KnarfB
2022-05-19 03:56 AM
Yes, that was it. :D
I had a _write definition in my project.
Thanks!