FRDM-K82F Semihosting from QSPI

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FRDM-K82F Semihosting from QSPI

1,695件の閲覧回数
jozefl
Contributor II

I wrote a simple hello world program for the K82F that uses semihosting rather than UART:

#include <stdio.h>  int main(void) {   printf("Hello World\n");   while(1);   return 1; }

If I build this program using the supporting files from KSDK_2.0 then running the program in GDB successfully prints Hello World to the terminal.

I can build the program using the MK82FN256xxx15_qspi.ld linker script but if I go through the same process of creating an .sb file and flashing it to the device as in the hello_world_qspi example project from KSDK_2.0 then it doesn't print anything when connecting to it with GDB.

Is semihosting supposed to work from QSPI?

ラベル(1)
タグ(4)
0 件の賞賛
返信
3 返答(返信)

1,451件の閲覧回数
xiangjunrong
Contributor IV

Hi, Jozefl,

Regarding you question, I suppose that the "semihosting" is the console of the GDB debugger tools, in the case, Kinetis transfer the words of printf() to console via JTAG port, so the printf() function is valid only in the debugger environment after the debugger tools  has initialized the JTAG port.

In conclusion, the printf() can not run in stand along mode,it is valid in debugger environment. If you want to run it in stand along mode, you have to use UART port.

Hope it can help you.

BR

Xiangjun rong

0 件の賞賛
返信

1,451件の閲覧回数
jozefl
Contributor II

Hi Xiangjun,

Yes, I was talking about using semihosting in GDB.

If I flash the program to QSPI using blhost and then launch GDB, connect to the device and execute the following commands:

mon semihosting enable

mon semihosting IOClient=3

continue

then nothing to get printed to the GDB console.

0 件の賞賛
返信

1,451件の閲覧回数
jozefl
Contributor II

The hello_world_qspi project is built with the -ffreestanding flag by default. By removing this flag semihosting works.

0 件の賞賛
返信