MicrosoftDocs / azure-sphere-issues

Creative Commons Attribution 4.0 International
11 stars 8 forks source link

Debugging RTApp on Azure Sphere fails. #199

Closed ravipath closed 4 years ago

ravipath commented 4 years ago

I have a Azure Sphere kit from USI. I am trying to run in azure sphere sample (GPIO, UART etc) in debug mode. While I am able to debug the High level apps and see the logs without any issues, debugging the RTApp fails. I am using Visual Studio 2019 community and Azure Sphere SDK 19.11. Here's the output from device update Tab:

Copying application to the device Device update succeeded. Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726a-dirty (2019-09-19-03:27) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : FTDI SWD mode enabled force hard breakpoints 4444

TargetName         Type       Endian TapName            State       

0* io0 cortex_m little mt3620.cpu unknown

Error: couldn't bind tcl to socket on port 6666: No error Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726a-dirty (2019-09-19-03:27) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : FTDI SWD mode enabled force hard breakpoints 4444

TargetName         Type       Endian TapName            State       

0* io0 cortex_m little mt3620.cpu unknown

Error: couldn't bind tcl to socket on port 6666: No error "C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\3\tools\openocd\openocd.exe" -s "C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\3\tools\openocd" -f "mt3620-rdb-ftdi.cfg" -f "mt3620-io0.cfg" -c "gdb_port" -c "targets" has exited with code '1'. "C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\3\tools\openocd\openocd.exe" -s "C:\Program Files (x86)\Microsoft Azure Sphere SDK\Sysroots\3\tools\openocd" -f "mt3620-rdb-ftdi.cfg" -f "mt3620-io0.cfg" -c "gdb_port" -c "targets" has exited with code '1'. (Exception)

Its worth noting that the same source with the same board with same visual studio version and azure sphere version works fine on a different computer.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

asergaz commented 4 years ago

Hello @ravipath and thank you for the feedback! Can you please confirm that you are following this doc? https://docs.microsoft.com/en-us/azure-sphere/app-development/develop-debug-rt-app

Also I am not sure what board is Azure Sphere kit from USI? On our docs we assume that you are using hardware that follows the MT3620 reference board design, such as the Seeed MT3620 Development Kit.

Thanks!

ravipath commented 4 years ago

USI evaluation kit is a lesser known board from www.usiglobal.com. The kit is based on MT3620 ref board design. Azure hub samples includes pin specific configuration files for USI. You can find it here: azure-sphere-samples/Samples/WifiSetupAndDeviceControlViaBle/Nrf52App/usi_evb/s132/

Also, please let me confirm that I have followed the document from the link above.

asergaz commented 4 years ago

Thanks for adding more details.

Its worth noting that the same source with the same board with same visual studio version and azure sphere version works fine on a different computer.

If I understand well you have two developer machines (working and non-working)... how do they differ from each other?

Can you double check that you followed the steps "Prepare your device for development and debugging" on both machines?

Thanks

ravipath commented 4 years ago

Hi António,

The two machine are both WIndows 10 laptops. I cannot see any relevant difference apart from the fact that the Windows 10 OS build on my laptop is newer. However, for all the relevant part are same (Visual Studio Community 2019, Azure Sphere SDK v19.11 etc)

I have retried and this time starting from the device recovery. I am attaching the Azure Sphere Developer Command Promt (elevated - open as admin) output and also build and debug logs from Visual Studio. AzureSphereConsoleOutPut.log build_and_debug_log_visual_studio.log

ravipath commented 4 years ago

I would like to point out that there is no issue with debugging the High level application. I can successfully build and debug High Level Applications. It's only the RTApp that has issues with debugging.

ravipath commented 4 years ago

Found the issue. A third party software was using the port number 6666. After uninstalling that software, the debugging works.

asergaz commented 4 years ago

Thanks for sharing the resolution :)!

We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.