Eclipse AVR Programming - ATMega2560 - eclipse

I am having some trouble uploading code to my Seeeduino ADK (essentially a Arduino Mega 2560) using Eclipse. Basically, this thread explains my problem. Sometimes I get a series of timeouts using the Arduino IDE upload, which is usually fixed by removing and re-inserting the USB. Unfortunately enough, this does not help fix the problem in Eclipse.
I have been trying to do the upload using AVRdude via the command line (I even tried the "hacky" solution in the last comment of the above thread), but to no avail. This is the line I am using for this:
"%AVR_DUDE%" -pm2560 -cstk500v2 -P\\.\%COMM_PORT% -b115200 -F -V -D - Uflash:w:"%HEX_FILE%":a -C"%AVR_DUDE_CONF%"
Which gives me:
avrdude.exe: stk500v2_ReceiveMessage(): timeout
I know the above batch variables are OK, because AVRdude runs correctly (but then it times out). If anyone has any ideas or tips that could help me with my uploading I would greatly appreciate it. Thanks beforehand.
EDIT: As it turns out, the reason for this may be that the Arduino IDE sends a reset to the board before uploading, something which the Eclipse AVR plugin does not do. I will test this and write a uploading perl script, but I am fairly certain this is the problem.

Your suspicion is correct. The Arduino IDE uses a patched version of AVRDude to pulse the DTR line and reset the board before each upload. For some reason, some people have had difficulty getting the right command line parameters to replicate this on the Mega2560. I've had the same problem myself - ATMega328's work with no problem, but the 2560 needs to be reset manually.
There's some further explanation and tips for possibly getting it working here (check the comments too): http://false.ekta.is/2011/05/avrdude-5-10-arduino-mega-2560-command-line-uploading/

Check out the detail here... http://false.ekta.is/2011/05/avrdude-5-10-arduino-mega-2560-command-line-uploading/
If using avrdude > version 5.1 change the programmer to -cwiring
This will reset the chip first

Related

Unity machine learning using internal brain for pre-trained networks results in crash

I try to get the machine learning project of Unity running. The project can be found here: https://github.com/Unity-Technologies/ml-agents
Following all the necessary steps to set everything up, everything works fine until I try to use a pre-trained model in an internal brain, e.g in the 3D-Ball example. On pressing play in the editor, it says to have stopped working and the editor crashes. Same goes for a successfully compiled executable.
Since I can't find any crash logs, I absolutely don't know what's the cause to this. Anybody had the same issue and solved it, or any ideas on this?
I'll just add the steps I made to set my project up, in case somebody wants to reproduce or check for mistakes I made:
Download zipped project from github
Open project with Unity 2018.1.1f1
Add ENABLE_TENSORFLOW to predefined symbols
Download and install TensorflowSharp Plugin
In the 3DBall Scene select the brain and switch BrainType to Internal
Run in editor or compile and run, results both times in a crash
EDIT
What's making me wonder is that I got it working just fine training an external brain in python using a compiled executable. So my thoughts were it should be much more easy to just forward pass a trained net, if it's working doing forward pass and back propagation. But it says though that external brain still is experimental, so not sure if that just will not work until some future patches.
EDIT 2
So I tried using an internal brain in an older version of the githubs project, which then worked quite fine. Also I used an older version of the TensforflowSharp Plugin. I'll try to figure out, which version still works and gonna post my results here ;)
To conclude, the problem was actually the recent version of the TensorflowSharp Plugin. Using an older version, which I found somewhere worked fine. I don't have the link to that version anymore, but in case someone experiences the exact same problem, I could search for it or upload it somewhere.

PIGRRL Gamepad - OS Raspberry Pi in loop

I am new here but I hope you can help me to find a solution to my problem.
I have four PIGRRL Kit from Adafruit and I need to install in it Raspbian (Operating System), the PiTFT and the gamepad as shown here (https://learn.adafruit.com/pigrrl-2/software).
But, when I try to install the gamepad, the OS goes in loop and the only way to exit it is to restart everything. I have checked if there were some problems with the soldering, but the voltage machine is not showing me any problem of the kind. The problem is just on the gamepad, because at the PITFT installation step everything goes fine and works.
But when I install the gamepad it goes in loop.
I used these commands:
cd
curl -O https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/retrogame.sh
sudo bash retrogame.sh
And then I follow the instructions for PIGRRL 2.0. But when I reboot, the OS loops.
Any idea or suggestion?
Thanks anyway!
I didn't tried retrogame, but I'm trying to use PiTFT 28 capacitive.
What I can say is that have some troubles with the display :).
In the first time I follow exactly they procedure and made my software work perfectly. But at some point in time it started to reboot after starting the software.
So I tried to start all over again, but this time I used Diet Pi and follow an alternative solution. I follow the procedure on this page: http://www.0xf8.org/2016/01/complete-rotation-support-for-the-adafruit-pitft-2-8-capacitive-touchscreen-display/
The display works, but:
1. If I use other console font, it starting immediately the font is going active.
2. The mouse don't work so well, it seems to start all the time in the left corner. So I didn't manage this part. :).
Maybe my answer can be useful in the combination of your experience.
Bafta
I found a solution. The problem for me was solved by charging the batteries. Basically, when it first reboots the OS needs more energy and with no charged batteries it went in loop.
All the best!

avrdude programmer is not responding when uploading a .hex file

I'm trying to upload a hex file to atmega328 on my arduino UNO board that I builded with eclipse's AVR plugin but when I run avrdude -pm328p -carduino -P/dev/ttyACM0 -b9600 -Uflash:w:/home/bruno/workspace/testAVR/Release/testAVR.hex:a I get avrdude: stk500_recv(): programmer is not responding
I tried to upload a blink led code using arduino IDE and it worked fine.
This is a fairly general error that can be caused by any number of things. Try adding a -vvv flag (or maybe -vvvv) which will give you more verbose output when programming.
One thing to try is hitting the reset button on the Arduino immediately after avrdude writes the first few bytes.
Ensure that there is nothing shorted, and that the Uno has a stable power source. Also, if there is anything connected to the RX/TX pins, that can cause a programming issue.
Make sure you are using the correct programmer, if your Arduino is a clone, you might need -c arduino-ft232r.

Matlab VideoReader on Ubuntu, quicktime codec

My problem
I am using latest Matlab (r2014a) on a 64 bits Ubuntu 14.04 machine. I have tried to load a video with VideoReader, but as soon as I do it an error pops out:
"Error using VideoReader/init (line 457)
The file requires the following codec(s) to be installed on your system: video/quicktime"
Just to clarify, this I how I call it:
VideoReader('video/BigBang.mp4');
What I have tried
I have read almost all pages regarding matlab, quicktime, codecs, and ubuntu, and so far I haven't been able to make it work.
So far I've done and checked:
Ubuntu is able to play that video file (.mp4) on its own
It is also able to play any .mp4 or quicktime labeled video (be it from browser or downloaded)
Installed gstreamer-*, at least all of which I know of
Tried adding mc3man repository and fetching from there, nothing
I'm really lost here and don't have any clue on what could be going on. Any help would be appreciated.
Thank you
I have solved it. I'd like to explain how, but I really have no clue. After several upgrades, dist-upgrades, ppa's added, etc. I got it to work.
I hope if anyone finds this can at least use some of the comments to help out.

MATLAB help/documentation not displaying correctly

I'm having a problem with the built-in help/documentation within MATLAB 2013a (issue also present in 2012b).
Upon opening the help files the pages appear with no formatting, only plain text. Search results do appear correctly though.
I have found only one instance of someone else with this issue, on MATLAB central here. However, there are no responses to the author's question. The issue I'm having is exactly the same as described there.
I have tried removing the preference folder and relaunching MATLAB but this doesn't help.
I'm using Windows 8.1 and MATLAB 2013a.
Any help or suggestions on how to fix this would be very much appreciated.
Edit:
Thank you everyone for the feedback so far. I don't believe java to be the issue, I have the latest version installed (1.7.0_45) while MATLAB uses it's own version (1.6.0_17). Both of which co-exist on my machine.
Following horchler's thread led me to another semi-related bug report here. The following code is listed at the bottom of the workaround (the script attached to the workaround didn't fix anything unfortunately).
com.mathworks.mlwidgets.html.HtmlComponentFactory.setDefaultType('HTMLRENDERER');
This results in a degraded appearance of documentation pages and loss of some functionality but is still an improvement over the plain text and scrambled pages.
Hopefully from this new information we can work towards a solution!
One solution is to go back to IE-10, or to use the patch on http://www.mathworks.com/support/bugreports/989850
Which basically replaces the localnav.js at <MATLAB>/help/includes/product/scripts
The link to download!
This is an old post, but I had the same issue and have a fix (not downloading R2013b or java related). Just downgrade from IE 11 to 10: Go to System (or System & Security)->Windows Update->View Update History->Installed Updates -> Find IE11 and uninstall it. Your system should revert back to the prior installed version. This fixed the help issues.
The problem is related to Internet Explorer 11, which MATLAB uses to render its help files. I was experiencing this problem in Windows 7 and rolling back to IE 10 fixed it right up. Unfortunately, that's not an option with Windows 8.