JLink RTT log not showing with RT1170-EVK

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

JLink RTT log not showing with RT1170-EVK

ソリューションへジャンプ
2,936件の閲覧回数
yfliu
Contributor IV

Dear forum members,

I am trying the RT1170-EVK with SDK 2.11.1 with Ubuntu PC. I am using the on-board debug probe with JLink  firmware. I can use JLinkGDBServer command line tool and gdb to debug the sample apps in step-by-step mode. 

Now I am wondering how to see the printf() or SEGGET_RTT_print dumps using JLinkRTTClient tool? I can connect the RTT client to JLinkGDBServer but can't see any RTT output.

Here is my RTT client screen shot:

SEGGER J-Link V7.66a - Real time terminal output
J-Link LPCXpresso V2 compiled Apr 4 2019 16:54:03  V1.0, SN=726558173
Process: JLinkGDBServerCLExe

 

And in my target program, I have the following lines to output RTT logs:

SEGGER_RTT_Init();
SEGGER_RTT_ConfigUpBuffer( 1, "Log", loguffer, sizeof(logBuffer), SEGGER_RTT_MODE_NO_BLOCK_TRIM);
SEGGER_RTT_printf(0, "hello world 0!\r\n");
SEGGER_RTT_SetTerminal(1);
SEGGER_RTT_printf(0, "hello world 1!\r\n");
SEGGER_RTT_SetTerminal(0);

From within gdb I could step all above lines smoothly, but I couldn't see any log output in RTT Client.

Does anyone know know a solution?

 

Regards,

Yanfeng

 

 

 

タグ(1)
0 件の賞賛
返信
1 解決策
2,838件の閲覧回数
yfliu
Contributor IV

@CarlosGarabito 

I am using Ubuntu16.04LTS in VMware player to try the RT117x SDK.

I did two  tests:

  • Running JLink tools (GDBServer & RTTViewer) v6.98e at Windows host and gdb on Ubuntu side.
  • Running Jboth Link tools v7.66 and gdb on Ubuntu side.

In both cases, I can connect to the on-board JLink probe firmware and run app in step-by-step mode within gdb.

My parameters for JLinkGDBServer when using in Ubuntu are:

-if swd -device MIMXRT1176xxx8_M7

My parameters for JLinkGDBServer when using on Windows host are:

-select USB -device MIMXRT1176xxx8_M7 -endian little -if SWD -speed 4000 -ir -noLocalhostOnly

My toolchain is ARMGCC 10.3.1 on Ubuntu.

My on board Jlink probe firmware is:

Firmware: J-Link LPCXpresso V2 compiled Aug 23 2021 09:30:06
Hardware: V1.00

I guess you can reproduce the issue by running gdb inside your WSL Ubuntu and connect to a JLinkGDBServer on your Windows host.

It seems to me that target side RTT logging works but host side JLink tools could not retrieve logs data from target. As I don't know how to specify "RTT range" parameters with JLinkGDBServer or JLinkRTTClient yet, I can't make JLink tools to work.

 

==== Updates after post above message:

after further trying, I can see RTT logs from JLinkRTTViewer now. The key point is to specify RTT range parameter 0x20000000 0x1000 in RTT viewer panel. So my guess for root cause was verified.

 

Thanks a lot for all the help though!

 

Regards,

yf

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
6 返答(返信)
2,910件の閲覧回数
CarlosGarabito
NXP TechSupport
NXP TechSupport

Hi @yfliu , did you read the blog mcuoneclipse? This excellent blog talk about many thins around the mcu, so i invited you to read it to see if you can solve your question,

 

https://mcuoneclipse.com/2022/02/09/debugging-with-dynamic-printf-breakpoints/

https://mcuoneclipse.com/2019/04/14/tutorial-mcuxpresso-sdk-with-linux-part-1-installation-and-build...

https://mcuoneclipse.com/2019/04/20/tutorial-mcuxpresso-sdk-with-linux-part-2-commandline-debugging-...

 

Could You share with us which example are you doing? And share with us the steps that you are doing? In order to reply this issue in our boards, please

0 件の賞賛
返信
2,903件の閲覧回数
yfliu
Contributor IV

Dear @CarlosGarabito 

 

Thanks for your reply, I checked the URLs you listed and didn't find too much things related to JLink RTT. But thanks a lot for sharing them out as it can save a lot time If I know them before.

 

Now let me answer your questions:

>>> Could You share with us which example are you doing?

I used the ".../boards/evkmimxrt1170/demo_apps/hello_world/cm7" example as starting point. Then I added sources from ".../JLink/Samples/RTT/SEGGER_RTT_V766a" to the CMakeLists.txt and added the following lines to the begining of the main function.

SEGGER_RTT_Init();
while(1){
SEGGER_RTT_printf(0, "hello world 0!\r\n");
}

, of course we need include "SEGGER_RTT.h" in hello_world.c before we can use the functions in main(). I successfully built the hello_world_cm77.elf app with these changes using "-DCMAKE_BUILD_TYPE=debug" option. I think this builds an elf for RAM loading and exeuction purpose.

 

>>> And share with us the steps that you are doing? 

1) I started JLinkGDBServerCLExe on my host and connected to the target board correctly via SWD interface.

2) I started JLinkClient on my host and saw it connected to JLinkGDBServer correctly as my above screen shot.

3) started my demo app using gdb: 

   $ arm-none-eabi-gdb ./hello_world_cm7.elf
   (gdb) target remote localhost:2331
   (gdb) load
   (gdb) break main
   (gdb) cont

 

Then I used "(gdb) n" commands to step into the SEGGER_RTT_printf() loop to make sure logs are geneated from target. Then I checked RTTClient console but nothing appears.

My understanding is that RTT logging requires no additional setup as it purely depends on the Cortex-M7 CPU and RAM, so I put all RTT related function calls at the beginning of main() function. This is also in line with the ".../JLink/Samples/RTT/SEGGER_RTT_V766a/Examples/Main_RTT_PrintfTest.c" example.

I guess my issue might be the host side RTT tools failed to find the proper RTT control block in target side, but I don't know how to specify it to JLinkRTTClient yet.

 

Regards,

Yanfeng

 

0 件の賞賛
返信
2,856件の閲覧回数
CarlosGarabito
NXP TechSupport
NXP TechSupport

Hi @yfliu An apology, I have not been able to replicate your problem in a virtual machine, so I am installing Linux on a machine to see if I can replicate your problem but i keep checking your problem

0 件の賞賛
返信
2,849件の閲覧回数
yfliu
Contributor IV

@CarlosGarabito 

I am using Ubuntu in virtual machine as well.

It will be nice if you can share more details about your tests, I can then follow. I very am interested at how your JLinkGDBServer find the correct RTT range in target. 

Regards,

yf

 

 

0 件の賞賛
返信
2,844件の閲覧回数
CarlosGarabito
NXP TechSupport
NXP TechSupport

@yfliu I tested it in WSL and didn't work, but, you have this in a virtual box?, VWare? or QEMU?, for the moment i almost finish to install the Linux native in a old PC to make the test, if you have some details to say before I start with the test, tell me before to have other kind of errors.

Thanks

0 件の賞賛
返信
2,839件の閲覧回数
yfliu
Contributor IV

@CarlosGarabito 

I am using Ubuntu16.04LTS in VMware player to try the RT117x SDK.

I did two  tests:

  • Running JLink tools (GDBServer & RTTViewer) v6.98e at Windows host and gdb on Ubuntu side.
  • Running Jboth Link tools v7.66 and gdb on Ubuntu side.

In both cases, I can connect to the on-board JLink probe firmware and run app in step-by-step mode within gdb.

My parameters for JLinkGDBServer when using in Ubuntu are:

-if swd -device MIMXRT1176xxx8_M7

My parameters for JLinkGDBServer when using on Windows host are:

-select USB -device MIMXRT1176xxx8_M7 -endian little -if SWD -speed 4000 -ir -noLocalhostOnly

My toolchain is ARMGCC 10.3.1 on Ubuntu.

My on board Jlink probe firmware is:

Firmware: J-Link LPCXpresso V2 compiled Aug 23 2021 09:30:06
Hardware: V1.00

I guess you can reproduce the issue by running gdb inside your WSL Ubuntu and connect to a JLinkGDBServer on your Windows host.

It seems to me that target side RTT logging works but host side JLink tools could not retrieve logs data from target. As I don't know how to specify "RTT range" parameters with JLinkGDBServer or JLinkRTTClient yet, I can't make JLink tools to work.

 

==== Updates after post above message:

after further trying, I can see RTT logs from JLinkRTTViewer now. The key point is to specify RTT range parameter 0x20000000 0x1000 in RTT viewer panel. So my guess for root cause was verified.

 

Thanks a lot for all the help though!

 

Regards,

yf

 

 

0 件の賞賛
返信