Closed tommyclee042414thu closed 4 years ago
Stlinky is a home-made variant of semi-hosting to get some text across the debugger link (both directions). So yes, it can be used for showing printf output. To make this work, you need to include some extra code on the target side, see http://ncrmnt.org/wp/2013/05/06/stlink-as-a-serial-terminal/ and https://github.com/nekromant/antares-examples/blob/master/arm/stm32f1x/stm32vl-stlinkydemo/src/main.c
Busy on other STM32F2 chaos in past three months, I eventually get back to this subject. I hope you could tell me where I get the stlinky project for the STLINKY_MAGIC/st-term work.
An example of st-term which works would be great, the code appears to not be currently maintained.
A more robust way is to use the ARM Semihosting which is fully supported by OpenOCD and libc of https://launchpad.net/gcc-arm-embedded.
st-term
has been deprecated with the implementation of ARM semihosting in Release v1.3.0.
It was removed in commit 3fd0f099782506532198473b24f643a3f68d5ff9.
Closed by #507.
My running ends up with the "stlinky magic not found in sram :(" error. The cause is that the "if (STLINKY_MAGIC == READ_UINT32_LE(sl->q_buf))" check never succeeds. The hard-coded STLINKY_MAGIC value is 0xDEADF00D. My printf() code finds out that the sl->q_buf value on my stm32f207vg production board is 0x09e25030. I replaced 0xDEADF00D with 0x09e25030 and ran again. The same error occurred.
I am have two questions:
What is the purpose of the st-term utility? Is it for logging the printf() messages from the stm32 board to minicom on stlink designated tty node?
How to make the STLINKY_MAGIC match READ_UINT32_LE(sl->q_buf) happen, in order to run st-term successfully?