stlink-org / stlink

Open source STM32 MCU programming toolset
BSD 3-Clause "New" or "Revised" License
4.43k stars 1.24k forks source link

st-term #228

Closed tommyclee042414thu closed 4 years ago

tommyclee042414thu commented 10 years ago

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?

jcw commented 10 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

tommyclee042414thu commented 10 years ago

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.

araasch commented 9 years ago

An example of st-term which works would be great, the code appears to not be currently maintained.

xor-gate commented 8 years ago

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.

Nightwalker-87 commented 4 years ago

st-term has been deprecated with the implementation of ARM semihosting in Release v1.3.0. It was removed in commit 3fd0f099782506532198473b24f643a3f68d5ff9.

Nightwalker-87 commented 4 years ago

Closed by #507.