Since MCUxpresso v11.7, "Could not connect to semihosting"

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

Since MCUxpresso v11.7, "Could not connect to semihosting"

3,243 Views
arnogir
Senior Contributor II

Hello

Until today, I used the MCUXpresso v11.6.

I have a target NXP MKL33Z256.

I'm using the PEMicro Multilink (RevC)

Without any problem, I can display into the console the result of a "printf".

 

Today, I installated the MCUXpresso v11.7.

Now, I have the following message when I want debug:

"Could not connect to semihosting port due to connection timeout. Please check that the correct port number is configured."

arnogir_0-1677857229760.png

 

The configuration is identical because it is the same project. It was just migrated on the first openning of MCUxpresso v11.7 when I pointed to the v11.6 workspace.

 

arnogir_1-1677857300183.png

 

arnogir_2-1677857312122.png

 

 

I try to create a new workspace and import again the project, create the launch configuration again.

But problem still present.

I open again the workspace with v11.6: All work properly

It is an issue than somebody else have or not?

 

Regards

 

 

 

0 Kudos
19 Replies

2,692 Views
p3
Contributor II

To anyone who is experiencing this issue with MCUXpresso 11.7, PEMicro has released a new version of the plugin that resolves the issue.

The plugin version that I installed to fix the issue was:
"GNU ARM PEMicro Interface Debugging Support 5.5.5.202303221907"

MCUXpresso 11.7 PEMicro Plugin.pngPEMicro said the you do not need to check the "PEmicro ARM Device Expansion Plugin" in MCUXpresso.

PEMicro has instructions on how to update the plugins at the following link: https://www.pemicro.com/blog/index.cfm?post_id=124

The original thread is here: https://www.pemicro.com/forums/forum.cfm?forum_topic_id=8449&forum_id=8#c28573

Best Regards,
Peter

0 Kudos

3,143 Views
p3
Contributor II

I upgraded our codebase to MCUXpresso IDE v11.7.0 [Build 9198] [2023-01-17] and this regression has a big impact to my company because we are using the PE Micro probe to log to file for overnight and weekend test runs.  The MCU-Link probe does not log to file.

The fact that NXP did not test this very common use case makes NXP look incompetent.

I have submitted a service request for this and will update with what I get back from NXP.

0 Kudos

2,996 Views
lpcxpresso_supp
NXP Employee
NXP Employee

We're working with PEmicro team to identify the root cause of the issue. It is really machine-dependent, making it quite difficult to reproduce. We don't have test machines to cover all possible configurations, and reports like the ones in this thread are quite isolated cases. We suspect the issue is caused by a mixture of updated Eclipse + JRE + PEmicro software and machine-specific configuration. We'll follow-up on this thread once we have updates.

Regards,
MCUXpresso IDE Support

0 Kudos

2,971 Views
p3
Contributor II
JRE as in Java Runtime Environment? Does uninstalling JRE resolve the issue?
0 Kudos

2,930 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Yes... JRE = Java Runtime Environment...

MCUXpresso IDE (Eclipse underneath) needs a JRE in order to run, so you cannot uninstall it. It's also worth mentioning that MCUXpresso IDE is shipped with its own JRE. 

Regards,
MCUXpresso IDE Support

0 Kudos

3,117 Views
ErichStyger
Senior Contributor V

Hi @p3 ,

I can confirm that I see that P&E issue in 11.7.0 (it works in 11.6.x) too.

But on my side I'm able to use the LinkServer file I/O with 11.7.0, both with Mcu-Link and Mcu-Link Pro (see some results in https://mcuoneclipse.com/2023/03/09/using-semihosting-the-direct-way/ ).

I'm using it with a K22F with newlib-nano (semihost). The device should not matter, but the library does: can you check that you have selected the (semihost) library?

I hope this helps,

Erich

0 Kudos

3,074 Views
p3
Contributor II

Erich,

We are using redlib and changing to newlib would require some minor code changes and a lot of regression testing so it's considered a non-trivial change.  I would probably prefer to be on newlib, but that's beside the point.

We currently use the Eclipse CDT feature to save to file by redirecting the semi-hosting output.  I have no idea why it doesn't work with MCU-Link and I have not gone after NXP for that issue as of yet.

If I can get MCU-Link working that would be great because it is faster to debug and much more affordable to purchase than the P&E Multilink.

Regards

Tags (1)
0 Kudos

3,052 Views
ErichStyger
Senior Contributor V

Hi @p3 ,

I quickly tested that project from https://mcuoneclipse.com/2023/03/09/using-semihosting-the-direct-way/ with Redlib and my MCU-Link (non-pro) probe in IDE 11.7.0, and I'm can open, read and write files:

ErichStyger_0-1678688817806.png

Just one thing to mention: do not use the 'nf' variants (I first was thinking it is for 'no-float', but it is for 'no-file'). So if if using the nf variants, you have no standard library file support.

I hope this helps,

Erich

0 Kudos

2,973 Views
p3
Contributor II

Erich,

This is great information you are providing, but currently I'm trying to use the Eclipse CDT method of redirecting the debug output to file.  I have set my library to Redlib (semihost) and I still do not seem to get a populated log file.

MCU-Link Debug Log SettingsMCU-Link Debug Log Settings

 

0 Kudos

2,731 Views
ErichStyger
Senior Contributor V

To my understanding, that CDT Standard Input and Output file redirection does not work with such a debug probe.

It creates a file, but then expects the GDB server to create an intermediate process to catch stdin and stdout. That works fine for example doing embedded linux debugging with a gdb stub on the target.

If you really want to log things to a file, I recommend to use the approach I had presented in my article.

I hope this helps,

Erich

2,718 Views
p3
Contributor II
Erich,

What I observe using MCU-Link with Eclipse CDT output logging is that it creates a blank file and never pipes any data into the file (as you described). When using PEMicro debugger, it does in fact pipe data into the file.

The advantage of using Eclipse CDT is that we do not have to modify our codebase and the logging can be turned on and off w/o rebuilding. I assume your method requires rebuilding with a flag to log to file.

Regards,
Peter
0 Kudos

2,682 Views
ErichStyger
Senior Contributor V

Hi Peter,

So I tried the console logging with the P&E probe (using 11.6.0), and I can confirm that it does create the file. But what I see is that it logs both the debug and the semihosting console output to a single file.

ErichStyger_0-1679545316507.png

 

Is this the same what you have?

Erich

0 Kudos

2,650 Views
p3
Contributor II

Erich,

I retested this with the new PEMicro plugin with MCUXpresso 11.7 and it does combine the two consoles into one single log file.  I got both the semihosting printf() output and the FreeRTOS kernal logging.

-Peter

2,705 Views
ErichStyger
Senior Contributor V

Hi Peter,

yes, did not try P&E (will do next). I used quickly J-Link and the IDE created a file, but no data in it. So I suppose something is missing in the chain of events here.

3,168 Views
ErichStyger
Senior Contributor V

Hi @arnogir ,

I have published a new article about semihosting (it mentions as well the problem you have seen) here: https://mcuoneclipse.com/2023/03/09/using-semihosting-the-direct-way/

That way you can use semihosting in a different way, and I hope the P&E issue will be resolved soon.

I hope this is useful,

Erich

0 Kudos

3,239 Views
arnogir
Senior Contributor II

Hello

 

Thank for this fast feedback!

"My workaround is to use the J-Link or Multilink instead for semihosting."

Could you explain in details your workarround? I'm using the Multilink. Maybe i'm not an expert on this part.

 

Regards

0 Kudos

3,231 Views
ErichStyger
Senior Contributor V

Segger J-Link or the NXP LinkServer are alternative probes which work for me.

I'm still hoping that a PEMICRO debug firmware/driver update will fix the issue.

0 Kudos

2,692 Views
p3
Contributor II
Erich,
Thanks for your support on this issue! PEMicro published a fix and I put a comment at the bottom of this thread with the details.
-Peter
0 Kudos

3,241 Views
ErichStyger
Senior Contributor V

Hi @arnogir ,

I can confirm that I have the same issue and have already reported it to NXP (they are looking into it). My workaround is to use the J-Link or LinkServer instead for semihosting.

For the J-Link, SEGGER just has fixed an issue with Semihosting too, so be sure to download and use the latest J-Link software.

I hope this helps,

Erich

0 Kudos