How can I program an esp 32 stuck in deep sleep [closed] - esp32

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 months ago.
Improve this question
I have an esp32 that I've uploaded a loop of a 2 second LED flash on, followed by a 5 second deep sleep.
When I try to reprogram the unit it becomes undiscoverable (no board connected to port) while in deep sleep.
Is there a way to reset the board so I can get rid of the deep sleep mode?
Or am I stuck with a board I cant re-program?

You are definitely not stuck. See there are 2 modes an ESP32 can be in.
Mode 1 : Programming Running Mode
Mode 2 : Boot Mode
Boot Mode is the mode we put the ESP32 in before we upload a new code. This should be in normal case be independent modes, meaning if in boot mode, the deep sleep code shouldn't work.
I suspect when you try to upload new code, its somehow in program running mode.
Why don't you try this:
Disconnect your ESP32
Keep Pressing the Boot Button
Then connect the ESP32 to USB cable
This way as soon as power flows to the ESP32 it doesn't get to program running mode, and directly will go to Boot Mode.
Now upload the code.
This should work.
If still the issue persists, maybe you need to flash the ESP32 bootloader firmware manually. Please try the above and update your progress.
I hope this answer was helpful.
Thank You.
Naveen PS

Related

BG95 reboot by itself

I am building IOT device using a LTE modem form Quectel, the BG95, together with NXP imx6, running Linux. The sim card I am using has the technology of eMTC.
Normally the device is working fine, the issue I am having now, is that the device lost LTE communication randomly (typically after 3-6 days uptime).
My setup
I have disabled echo mode in the BG95 at my init procedure.
I have a periodical call to send AT command "AT+CREG?" toward BG95, and read the response.
What I am seeing from the debugging is following:
My periodical at command "AT+CREG" toward BG95 is not responding.
Linux kernel reports ttyUSB towards BG95 is disconnected.
3-4 seconds, the kernel reports ttyUSB toward BG95 is connected again.
My periodical AT command "AT+CREG" toward BG95 is returning ERROR.
I see from the serial reading from the BG95 has "APP RDY".
I see from the serial reading from the BG95 has echo mode enabled.
Form what I am seeing, I am assuming that the BG95 is somehow "rebooted".
Is there any reason why the BG95 will reboot itself? Or how to confirm this?
I checked the datasheet of BG95, but I cannot find a AT command or other way to check the boot reason.
Do you have other suggestion on how to debug this further? Or similar experience with BG95?
Thanks

Debugging stm32f4 via bluetooth

I'm rather unexperienced on the field of microcontrollers, I come from a Java background so the question might seem a bit noob but I didn't find much information on this.
So is it possible to debug an STM32F4 board via bluetooth (using eclipse or some othe IDE)? And if so could you send me some links that might help? We're building a robotic car controlled by a discovery board and debugging using an USB cable is not really an option if we don't want to disassemble the whole stuff every time something goes wrong. Hence this would really come in handy. So any help is appreciated
For doing this you would need to find a "Bluetooth Enabled" Debugger. I have never seen any and not sure whether there exists such thing or not.
I would suggest you one thing:
Assuming you have bluetooth connectivity between your board and your Machine,
Insert Debug strings: Send some strings from your board to your PC via Bluetooth. These strings will give you what's going on in Circuit.
For example, After Initialization, send "Init Completed" and like that. You can see these strings and see what's wrong.
I usually do this for my Wireless Device.
What you're wanting to do is really not practical; you're coming at this from way too high a level and trying to imagine the system as if it were running an operating system from the word go.
When you get the STM32 it as empty shell; you need to program it to do what you need to do and the only [sensible] way to get register-level debugging is to use a JTAG interface.
If, and this is a big if, you get it working reliably, but just want to give some debug information back while it is running, you could write a load of routines within the code to send out debugging messages when it enters certain parts of the program - and send it out over Bluetooth - but this is nothing like what you're used to single stepping through your Java code with Eclipse. If you want to do that kind of thing, you are going to have to put a little connector on that allows you to connect your JTAG or two-wire debugger cable to the processor. Even then, when you do that, you will be completely resetting your program and not simply single stepping through from where it went wrong.
You could insert a monitor program within your program to send out register values, program status etc over Bluetooth, but you still have to write the inital code and the only way to do this with out a ridiculous amount of trail and error is via your JTAG or two-wire interface.
Would this product work? It's a "IOGEAR Bluetooth Serial Adapter, GBC232A" for connecting to a serial port over bluetooth. I'm interested in wireless debugging too because my surface-clone dev computer only has one usb and this seems like it could be convenient over a tangle of usb cords and a usb hub. I have zero experience with any of this, so maybe you could validate or invalidate it as an option. I figure it just needs a proper serial connector wired up on the board and power from on-board?

VirtualBox: "A disk read error occurred" after migrating Win XP to Virtualbox [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I attempted to migrate an old Win XP Compaq desktop to VirtualBox (4.2.12) under Ubuntu (12.04.1) by following https://www.virtualbox.org/wiki/Migrate_Windows
After the createfromraw step, I created the virtual machine, and tried to boot. Immediately on boot, this message is displayed:
A disk read error occurred
Press Ctrl Alt Del to restart
I have tried to use FIXBMR and FIXBOOT from the recovery console, which seemed to make it worse (a few characters on the screen are corrupted, and the same error message appears).
How can I get this VM to boot?
I solved this, and thought i would share my solution:
By comparing sectors to a working VM, I found that the following change was needed:
Sector 63 offset 0x1A was 0xF0, and this byte needed to be changed to 0xFF.
To do this:
Attach the non booting drive image as a second drive on a working VM
Boot the working VM, and install a low level sector editor (Google!)
Run this editor, and look at sector 63 on the non-working drive image.
Note that depending on how you select the disk, this is either sector 0, or sector 63
It the same physical sector on the disk
Confirm the byte 0xF0 is at offset 0x1A (26), and change it to 0xFF and write the sector
Shutdown the VM, and then in settings, detach the drive image from step 1
The disk image was healed - to a degree. It can now boot in recovery console mode
NOTE: DO NOT run fixboot or fixmbr
Now boot the VM off a System CD (Win XP in my case), and do a install repair
Install any service packs or system updates
The VM now booted - an (almost) exact replica of my old WInXP PC!
I know it seems strange, but this worked for me.
For interest, how did I find this out? I created a fresh install over a copy of the bad VM disk image, and then when it was working I took hex dumps of the MBR and boot sector. I compared these to the bad VM, and worked through the differences one by one, until I found this magic byte. To verify, I did the whole process again, from the original image, and also again verified that fixmbr and fixboot made the problem worse, and were not necessary for the fix.
Hopefully this will save you some time if you face the same issue.

Determining why kernel hangs on boot

hi :
i was building kernel for my gentoo linux . when i start the kernel , i
got this message , and can't going on.
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
non-volatile memory driver v1.3
i don't know how to solve this problem . and i need help . thanks .
Why don't you try to disable pci hotplug support in kernel (if I recall correctly is in main config menu / PCI support)? You probably don't need this.
I'm going to have to disagree with those voting to close, because I think there really is a question here, and the question is "How to debug this?"
I'm going to propose two approaches:
1) Studious approach: Learn about mechanisms intended for handling boot problems. See if you can increase the kernel debug message level. Disable un-needed drivers as Quizzo suggested.
2) Cowboy approach: grep the kernel sources for strings seen in the final messages, and start shotgunning all possibly relevant bits of code with your own "still alive at" printk messages. Once you know where it's hanging, figure out why and either remove that mechanism or fix it.
At an extreme there's also a tool for debugging the kernel - kgdb - which you could set up if you have a second machine available.
If you already have linux running on this box, see if there's a config.gz in /proc or in a boot folder which you can extract and compare to the configuration you are trying to compile. It might not be a bad idea to first recompile and test exactly the same version and configuration as you have running, and then make desired changes one by one.
Also you might see if there's odd hardware in your system you could temporarily remove. For example, an older PC I have has a bios that hangs during drive enumeration if I have a large USB external drive plugged in during boot.
i have solved the problem by enable all pci hotplug flag in kernel config file.
thinks all.

Overcoming "It is being used by another person or program." [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is there a way to unlock Windows files without downloading a utility?
I have a few files on my Windows XP C: drive that are very old and very useless. When I try to delete these files I get the following message:
Cannot delete FILENAME.zip: It is being used by another person or program
Close any programs that might be using the file and try again.
No one is accessing this file. No program is using it currently. Windows has screwed up the file locking mechanism.
Is there a way to delete this file without downloading someone's unlocking utility? I find the sites offering these programs to be a tad sketchy.
How could you force the file to unlock from within a program? I'm competent in Java, Perl, and Ruby, but I haven't seen anything among their libraries that would aid me here.
I've successfully used Process Explorer to find out which process has the file open. It saves a reboot that may not fix the problem anyway.
In process explorer: Find > Handle or DLL... then search for the name of the folder/file, then double click one of the search results. It'll select a handle in the main window, which you can right click and close.
Try downloading "Unlocker". Google it and take my words that it doesn't have any worm/spyware/virus. It is pretty cool utility and works great. Give it a try.
Did you try the commandline command OpenFiles
It is built in (XP and above I believe) and has several arguments that can be passed in.
Use msconfig and start up with everything turned off.
Then try to move / delete the file.
Or you can always boot up in safe mode and delete it.
You do that by hitting f8 when the machine boots up.
If you reboot and the files are still locked, then there is some process on your machine that is still using them. First you should figure out what that process is and determine if the files really aren't used any more or not.
Rebooting to Safe Mode is often a very easy way to do it. When you boot in safe mode, it won't load all the stuff set to run on startup. Press F8 while it's booting to access the boot menu, and choose "safe mode".
I had a .jpg pfile that hasd that issue and I couldn't delete. That brought me to this thread. When nothing else worked I renamed the file and left off the .jpg. THEN I could delete it easily. Not sure why, but worked for me
You don't need any utility.
Just use Win32 api to unlock them (simply close the handle)

Resources