Can't connect to D1 Mini with Micropython after running a program - esp32

I'm using D1 Mini with micropython
It happens a lot that I upload some code that has a main loop in it, and afterwards I lose connection to the board
I can see the console output, but can't see the files, can't burn a new firmware, can't stop the code from running, anything...
If I press ctrl+c or ctrl+d it holds for a second, then continues
I'm using a raspberry pi and Thonny for the development
Same from esptool and ampy
Tried looking for an answer online, but couldn't find anything relevant
What can I do?

What I do in my apps- I add time.sleep(3) at the beginning of my application. And when I wish to do code upload, I connect to the board, press CTRL+D for soft reset and CTRL+C to kill code. Then do upload required code. This approach works best for me.

Moved from pi to windows, I was able to delete and write the firmware again using esptool
The only thing is that now I have to press the reset button while connecting the USB so the computer will recognize the controller

Related

raspberry pi3 can not launch application on primary HDMI Display, can launch on remote using ssh -x

I had built console core image for raspberry Pi3, and I am able to boot the Rpi3 successfully using SD card.
I have created an electron app which is able to launch on remote display over ssh.
However when I launch the application on Monitor connected through HDMI Cable, It gives following error
Can not open Display :0.0
I have seen many people asking this question for not able to launch on remote display, which works fine in my case.
Can anyone help in this?
With console core, you don't have an X server running to display on.
You can upgrade your system to include the X installation -- search for 'install pixel desktop' -- or you could just refresh the card with the lite or full image.
If you set the Pi to auto login to the pi account, you can start your application on login by adding it to the bottom of .xinitrc. You could also start it from a remote ssh, displaying on the local display, by setting DISPLAY=:0 in the environment before you start. You'll need to explore the world of X Windows authentication to make this work. See the man page for the xhost command, for instance.
(This is an expansion of LetoThe2nd's comment, which probably should have been an answer instead.)
Console core image means that there is no xserver running, and hence no display :0. Try getting started with core-image-x11 maybe, or whatever suits the RasPi.

PS2 Keyboard interface runs smoothly in Active-HDL simulator, but not working on Nexys2 Board

I have to make a PS2 Keyboard Controller project at the university and i encountered a few problems when trying to test the system on the FPGA board.
It had worked perfectly in the simulator of Active-HDL, but i am not sure what it might be that stops it from working on the board, because when i try to program the board, the .bit file gets uploaded, but it does not react when i plug the PS/2 Keyboard in it and try to press a key.
I thought that probably a problem might be related to the PS/2 Keyboard protocol or the way it is synthesized for the board, but i really do not know.
The source code is here https://wetransfer.com/downloads/1d000a9feb241ff84693fca2084b0e9a20180513165005/8f7ca4 and the top level is called "ps2_top_src".
I am sorry for the way of uploading the code, but i couldn`t make it upload anywhere else.

st link utility cannot stay connected to the device

So, I'm trying to connect to a custom board using ST-Link. My board uses STM32 Microcontroller and I use ST link utility software to see if I can connect to it.
Right now, If I press connect on utility software and press reset on my board at the same time, the connection is successful. But as soon as I remove my finger from the reset button the connection to the device is lost. Is this expected? And how can I make it stay connected without me keeping the reset button pressed!
Also, assuming I keep pressing it, the utility software gives me an internal command error when I try to erase chip. this happens when I try to program the chip as well.
Any suggestions are appreciated.
So the way to resolve the issue was to pull-up the NRST pin on the board and st link and disconnect it after pressing the reset button.
I still have not found a solution for erasing the chip but I believe the flash is protected. When I try to change the Option Bytes in st link utility, it disconnects from the board saying:
Could not set Option bytes!
Please reset the target and retry!
And then disconnects from the device.
Any clues how I can change the options bytes? That might actually solve the problem!
Thanks
By my experience all of such this problems come from bad assembling one way that may help you to find out first put a light in the back of your PCB right under your micro-controller and see if any pin is outside of footprint if it is aligned correctly,gently press your micro to the PCB and and test if it is disconnecting if it solves your problem then some of pins are not soldered correctly

Sending text via Screen in Terminal OSX

I have connected an Arduino to a MacBookPro using USB, by using Screen (serial) in Terminal on the MBP. I cannot figure out how to send text, via Screen, from the MBP to the Arduino. Can anyone kindly point me in the right direction?
I didn't see anything helpful in a very quick read of the 'screen' manual page. So, I'd be tempted to use the old 'cu' command. Something like this might work to connect to the Arduino:
cu -l /dev/cu.usbmodem0000001 -s 38400
(use whatever cu device your Arduino has, and pick whatever speed you want), then do:
~> filename
to send the named file to the Arduino. When you're done, a "~." will end the session.
Check the man page for the 'cu' command - you can receive files, too, and run commands with their output sent to the serial line.
Have fun!

IOStorageFamily deleted in error

I have accidentally deleted the file System/Library/Extensions/IOStorageFamily.kext by mistake. I know how stupid this was!
Now my iMac (model 2008, running Mavericks) gets stuck on the grey startup screen and hangs forever after the Apple logo turns into a no entry sign whilst the wheel continues to turn forever, see the following link for image showing this screen:
No entry sign on startup screen
I have run Disk Utility from the install CD and repaired the disk permissions with no success.
I have tried to run the rescue partition by using the Command + R key but this just displays my exsisting HD and does not show another option.
I have tried to boot into single user start with no success. The screen eventually hangs and says it can not find IOStorageFamily.kext.
I have tried to boot into safe mode with no success. It simply fails with the no entry sign as above.
I have reset the PRAM but this did not make any difference.
I have done a hardware test using the D key on startup but this returned no errors.
Please can someone advise if there is any way to fix this problem and if the is then what is the best way to do it? I know that it is not a harddrive failing or anything else and is simply because I accidently deleted the IOStorageFamily.kext file. Surely there is a way to repair this?
I appreciate any help or advice.
Many thanks
I have managed to fix the problem by using the following method:
http://support.apple.com/kb/PH13842
It says:
If you have two Mac computers with FireWire or Thunderbolt ports, you
can connect them so that one of them appears as an external hard disk
on the other. This is called “target disk mode.”
Connect the two computers with a FireWire or Thunderbolt cable. Start
up the computer to be used as a disk in target disk mode: If the
computer is off, start it up while holding down the T key.
If the computer is on, choose Apple menu > System Preferences, click
Startup Disk, then click Target Disk Mode.
When the computer has started up, a disk icon appears on the desktop
of the other computer.
Transfer files by dragging them to and from the disk. Eject the disk
by dragging its icon to the Trash. While you drag, the Trash icon
changes to an Eject icon.
On the computer you used as a disk, push the power button to shut it
down, then disconnect the cable.
After connecting to another Mac I simply copied the deleted file back into the correct directory from the host Mac.
I then booted my Mac successfully and repaired the file permissions via Disk Utility.

Resources