RT1010 Semihosting

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1010 Semihosting

Jump to solution
1,278 Views
Syam_Krishnan
Contributor II

Hi all,

         I am trying to use semihosting on IMXRT1010 Dev kit with Segger Jtrace pro. 

I need to print floating point numbers & hence I am using NewlibNano with printf float and scanf float enabled. 

The prints work fine. However, I cannot use SCANF or GETCHAR. GETCHAR always gives me 255 as return. 

 

I see that Redlib(semihost) is able to execute GETCHAR properly. However, when PRINTF prints %f or %d, it fills console with garbage.

 

My question in a nutshell is. What are the settings to be used ( libraries and others) to

 

1. get %f , %d working with PRINTF with semihosting

2. get SCANF working 

 

Thanks

Syam K

Labels (1)
0 Kudos
Reply
1 Solution
1,231 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Syam_Krishnan ,

Thanks for your interest in NXP MIMXRT series!

I have test a modified with CMSIS-DAP on-board debugger. And it works well!

Gavin_Jia_0-1719390737192.png

 

Here is my configuration for your reference:

Gavin_Jia_1-1719390872139.png

 

And I attached my demo for your test. However, I don't have JTrace available for testing right now, so if you have no problem using my project with CMSIS-DAP, but still have problems with JTrace, we suggest you contact Segger for a solution.

Best regards,
Gavin

View solution in original post

2 Replies
1,194 Views
Syam_Krishnan
Contributor II

Hey Gavin,

                 Thank you very much. I tried your settings on an RTC example and I was able to do printf and scanf of floating point numbers using segger JTAG and semihosting. In my earlier project, I was missing the below settings

PRINTF_ADVANCED_ENABLE=1

SCANF_ADVANCED_ENABLE=1

I had been using Newlib. I will move to redlib

 

0 Kudos
Reply
1,232 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Syam_Krishnan ,

Thanks for your interest in NXP MIMXRT series!

I have test a modified with CMSIS-DAP on-board debugger. And it works well!

Gavin_Jia_0-1719390737192.png

 

Here is my configuration for your reference:

Gavin_Jia_1-1719390872139.png

 

And I attached my demo for your test. However, I don't have JTrace available for testing right now, so if you have no problem using my project with CMSIS-DAP, but still have problems with JTrace, we suggest you contact Segger for a solution.

Best regards,
Gavin

%3CLINGO-SUB%20id%3D%22lingo-sub-1891145%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERT1010%20Semihosting%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1891145%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BI%20am%20trying%20to%20use%20semihosting%20on%20IMXRT1010%20Dev%20kit%20with%20Segger%20Jtrace%20pro.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20print%20floating%20point%20numbers%20%26amp%3B%20hence%20I%20am%20using%20NewlibNano%20with%20printf%20float%20and%20scanf%20float%20enabled.%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20prints%20work%20fine.%20However%2C%20I%20cannot%20use%20SCANF%20or%20GETCHAR.%20GETCHAR%20always%20gives%20me%20255%20as%20return.%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20see%20that%20Redlib(semihost)%20is%20able%20to%20execute%20GETCHAR%20properly.%20However%2C%20when%20PRINTF%20prints%20%25f%20or%20%25d%2C%20it%20fills%20console%20with%20garbage.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMy%20question%20in%20a%20nutshell%20is.%20What%20are%20the%20settings%20to%20be%20used%20(%20libraries%20and%20others)%20to%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E1.%20get%20%25f%20%2C%20%25d%20working%20with%20PRINTF%20with%20semihosting%3C%2FP%3E%3CP%3E2.%20get%20SCANF%20working%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%3C%2FP%3E%3CP%3ESyam%20K%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1891145%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EDevelopment%20Board%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1897208%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20RT1010%20Semihosting%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1897208%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHey%20Gavin%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BThank%20you%20very%20much.%20I%20tried%20your%20settings%20on%20an%20RTC%20example%20and%20I%20was%20able%20to%20do%20printf%20and%20scanf%20of%20floating%20point%20numbers%20using%20segger%20JTAG%20and%20semihosting.%20In%20my%20earlier%20project%2C%20I%20was%20missing%20the%20below%20settings%3C%2FP%3E%3CP%3EPRINTF_ADVANCED_ENABLE%3D1%3C%2FP%3E%3CP%3ESCANF_ADVANCED_ENABLE%3D1%3C%2FP%3E%3CP%3EI%20had%20been%20using%20Newlib.%20I%20will%20move%20to%20redlib%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1894239%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%20RT1010%20Semihosting%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1894239%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F235270%22%20target%3D%22_blank%22%3E%40Syam_Krishnan%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20interest%20in%20NXP%20MIMXRT%20series!%3C%2FP%3E%0A%3CP%3EI%20have%20test%20a%20modified%20with%20CMSIS-DAP%20on-board%20debugger.%20And%20it%20works%20well!%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Gavin_Jia_0-1719390737192.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Gavin_Jia_0-1719390737192.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F285820iFA1272F29DCB0C42%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Gavin_Jia_0-1719390737192.png%22%20alt%3D%22Gavin_Jia_0-1719390737192.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHere%20is%20my%20configuration%20for%20your%20reference%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Gavin_Jia_1-1719390872139.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Gavin_Jia_1-1719390872139.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F285821i64D6177B300975AA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Gavin_Jia_1-1719390872139.png%22%20alt%3D%22Gavin_Jia_1-1719390872139.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAnd%20I%20attached%20my%20demo%20for%20your%20test.%20However%2C%20I%20don't%20have%20JTrace%20available%20for%20testing%20right%20now%2C%20so%20if%20you%20have%20no%20problem%20using%20my%20project%20with%20CMSIS-DAP%2C%20but%20still%20have%20problems%20with%20JTrace%2C%20we%20suggest%20you%20contact%20Segger%20for%20a%20solution.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EGavin%3C%2FP%3E%3C%2FLINGO-BODY%3E