Embedded System Hangs - c

I am using TIOMAP/AM3517 based custom board which has ARM7 core + Linux 2.6.32 running on it.
Recently, I started observing an issue in which all the interfaces serial console, RNDIS/USB, Network stops responding (my type on keyboard connected to serial port/console port doesn't go through + no device is detected upon removal/insertion of USB sticks/BT dongle + Ethernet/network activities are stopped (can't login over ssh or access webPage that the system has.
I checked the power to the CPU and other power rails using DMM and it looks fine.
There is no keyboard attached so MagicSysRq cannot be used while the issue happens.
I have watchdog on the system which rebooted the system, however to reproduce the issue and to get more information of the system's state, now i have disabled the watchdog.
Finally, my system/linux is configured to reboot upon detecting softlockup which is not happening either. Also, I have enabled verbose debug options under kernel hacking but nothing seems to give any more information.
How do I debug the issue to identify the rot cause of it?

Related

Enable USB Debugging and remote control (scrcpy) with broken screen

and happy holidays. Apologies if this question is more appropriate for SuperUser, I ask here in case there is a programmatic solution to my problem.
In summary: On an Android device with a broken screen, assuming that USB Debugging is enabled or that the connected device is not trusted, is there any way to perform remote control?
So I have a Pixel 3a which I used to control just fine via scrcpy 1.21. Today the screen broke to the point that I only see a few glitchy lines, even though it looks like I can theoretically control it (based on the sounds, I managed to enter the log-in pattern).
The problem is that adb devices does not recognize it, even though the system (Ubuntu or Windows) recognizes that a Pixel 3a was connected for charging.
Is there any way I can salvage this situation?
ADB commands failed. scrcpy failed.

Connection Failed Error with PicKit3 and MPlabX (IDE and IPE)

I'm trying to programm my PIC 16F628A with PICKIT3 in MPlabX, but I get the following error:
***************************************************** Connection Failed.
When I enable the "Power Target Circuit From Tool", I get another error:
The target circuit may require more power than the debug tool can provide. An external power supply might be necessary.
Connection Failed.
So a provided an external power supply of 5V and my PIC 16F628A is draining 10mA, despite nothing is connected, only the PICKIT3 to the MCLR, ICSPDATA and ICSPCLK pins of PIC.
I'm using Ubuntu 16.04, MPlabX IPE V4.05., and
PS: Yes, I know how to read a datasheet.
PS: Circuit and PICKIT3 works properlyt if I connect to PICKIT3 Programmer running on Windows 7.
The first issue can sometimes be resolved by shutting down MPLABX, disconnecting the PicKit from your computer and reconnecting everything. Seems the firmware and/or driver sometimes gets in a weird state and needs a good boot to get going again. I sometimes have to reboot my computer just to program my main board (Major PITA).
The second issue is not necessarily caused by an over current despite the message. I always got this error when my PicKit was plugged into an unpowered USB hub. It seems the lower USB bus voltage confuses the PicKit into thinking that the device is the cause for the voltage drop instead of the host simply not supplying the normal voltage. Try plugging it into a powered USB hub or directly into your computer.
I know this is an old topic but maybe this answer can help somebody else.
I use as well official PICKIT's as clones.
It could indeed be caused by a hardware issue.
E.g. short or already activated load like a bunch of LED's.
Disconnect all loads if possible.
When using an official PICKIT 3, this issue is often solved by setting the voltage your PICKIT should supply to a lower level e.g. 5 => 4.625.
In MPLAB go to the properties of your project.
Select PICKIT on the left.
Select Power from the selection dropdown at the top.
When you have a SURE electronics clone, this might do the trick. (Maybe this is also valid for other clones) The AMS1117 they used is the adjustable one.
They used a 680 and a 470 feedback resistor which gives a voltage of 3.09V ((680/470 +1))*1.25 + 50u * 680). If you swap the 680 Ohm resistor with a 750, the output will be closer to the probably desired 3.3V.
Source where I got the idea: https://jrainimo.com/build/2018/12/picfix/
Location FB resistor
Close MPlab, reconnect Pickkit, restart MPlab worked for me.
If you've just created a new project or created a new file, MPlab sometimes confuses some things.

TI AM572x Cortex-A15 CPU core stuck

I have a problem with stability running TI AM5728 based custom board, similar to the Beaglebone X15. RTOS SW is running on one Cortex-A15 core MPU0 and sporadically (most often after several hours) freezes. When freezes it is impossible to connect to the MPU0 target by debugger, at the same time I can without any problems connect to the MPU1.
Debugger error:
CortexA15_0: Trouble Halting Target CPU: (Error -1323 # 0x1386AC)
Device failed to enter debug/halt mode because pipeline is stalled.
Power-cycle the board. If error persists, confirm configuration and/or
try more reliable JTAG settings (e.g. lower TCLK). (Emulation package
6.0.504.1)
For test purposes, I have started the simple program on the MPU1, and when MPU0 freezes MPU1 continue normal operation. WFE and WFI flag for MPU0 is inactive, moreover, I have made the additional test with trying to put MPU1 to the WFI/FORCED_OFF state. However, I still can connect with debugger and wakeup it from the FORCED_OFF state, as described in the technical manual.
I have dumped the registers by connection to the CS_DAP_DebugSS and have not found anything special. Register dump attached:
MPU_PRCM_PRM_C0_PM_CPU0_PWRSTCTRL
MPU_PRCM_DEVICE_PRM_RSTST
MPU_WUGEN_WKG_CONTROL_0
MPU_PRCM_CM_C0_CM_CPU0_CLKSTCTRL
What can be the potential stuck problem of just one core with failed attempts to connect with the debugger and second core running without problems?
Which hardware/software problem can potentially cause such behavior?
Thank you for any suggestions.
I just encounter the exact same problem.
Did you check your code at the address provided with the JTAG error (Error -1323 # 0x1386AC)? In my case it is an GPMC access, to a FPGA, which I can still access through CS_DAP_DebugSS.
I'm currently looking at errata i878, from revision L of the document. As it can take more than 48h to hang under stress test, I won't blindly apply the workaround. I'll modify my test, based on i878, trying to increase the failure rate, then I'll apply the workaround.

windows: how to stop irda dongle periodic auto detecting

I'm writing some code in C for an IrDA project on one win7 32bit computer. I have another computer setup to display any data received via in infrared. This part works. However the as soon as I connect the IrDA dongle to the PC, it starts to send periodic data for searching other IrDA devices. I want to disable this behavior programmatically so I see only the data sends as a result of my code. Anyone know which command to use? Is it WSASetService? I didn't learn socket programming, not sure what "removes from the registry a service instance within one or more namespaces. " really means. http://msdn.microsoft.com/en-us/library/windows/desktop/ms742211%28v=vs.85%29.aspx
Have you disabled the Infrared Monitor Service manually?
I experienced problems with this functionality in win7 when using Windows to communicating with an embedded micro-controller based device that worked well with windows XP.
I disabled the Infrared Monitor Service manually and found that windows was still polling the IrDA periodically!
I have not found any documentation available that describes it or how to disable it, I will continue searching...

Raspberry Pi usb redirect issue

Okay I am going to try and be as discriptive as possible here to get this problem solved. I work at a company that makes BIG gear boxes and we have computers that run our Mills/Laths. These computers are currently FIT-PCs running XP. These computers are used to control the laths/mills via a usb to serial converter (PL2303_Prolific usb to serial converter). When it is plugged into an xp machine it is recognized as a com port. SO these machines are very old and are fail left and right, I intend to replace them with a raspberry pi running xfreerdp but I can't seem to get the usb serial device to be redirected to the virtual machine it is remoting into. Has anyone ran into this/know a fix for it? Please ask me questions if you are unsure of something because I am completely stuck here. TLDR Using raspberry pis as thin clients need to push a usb 2 serial cable through to the virtual xp machine
Unfortunately there are known issues with USB on Raspberry Pi. They're aware of the issue and working on it, but it is as of yet unresolved.
The USB Redux thread was created to capture the state of the work as well as the current list of work-arounds. The USB/serial converters are broken is a related thread.
There is hope, however. First, they are working actively to fix it, so I suspect it's just a matter of time. Second, there are a few things you can try.
There's a config file in
/boot/cmdline.txt where you can try adding a few entries. One that appears quite effective is dwc_otg.speed=1 and dwc_otg.fiq_fix_enable=1 (but they didn't help me). See this page for some examples.
Update the kernel (search for rpi-update) to at least #348 (use uname -a to determine the kernel level)
Good luck.
Update (Mar 13 2013). There appears to be a fix for the majority of USB issues as of kernel #389. Use rpi-update to update.

Resources