Monday 27 March 2017

STLink V2 installation

In ubuntu, we have to compile the whole thing from source. Just follow taxane's github instructions.

But very importantly, in /stlink root, we have to do "make clean" before the first command "make release". otherwise, we will get:

~/stlink/src$ make release
make: *** No rule to make target 'release'.  Stop.

I guess it is a basic thing so it was not mentioned.

#####################################################
#####################################################

Long time later...in 18.04
- install dependencies:
sudo apt-get install libusb-1.0-0-dev
sudo apt-get -y install cmake

- get code
$> git clone https://github.com/texane/stlink.git
$> cd stlink
- run make and got:
boris@boris-123:~/Softwares/Installations/stlink_texane/stlink$ make
[RELEASE]
make[1]: *** No targets specified and no makefile found.  Stop.
Makefile:27: recipe for target 'release' failed
make: *** [release] Error 2

Just make clean and it should work.

- install
$> cd build/Release && make install DESTDIR=_install
- The above should end up in build/Release
sudo cp st-flash /usr/bin
Now we are able to call st-flash anywhere in the system.

ref:
https://github.com/texane/stlink
https://github.com/texane/stlink/blob/master/doc/tutorial.md


Wednesday 15 March 2017

The branch 'xxxx' is not fully merged.

The error code says:

warning: not deleting branch 'second' that is not yet merged to
         'refs/remotes/origin/second', even though it is merged to HEAD.
error: The branch 'second' is not fully merged.
If you are sure you want to delete it, run 'git branch -D second'.
Force deleting is never a good idea.
It seems that git just wanted me to push my changes to the second branch before deleting it.

This worked for me:
$ git checkout second
$ git push origin second
$ git checkout first
$ git branch -d second

ref:
http://stackoverflow.com/questions/12495756/why-doesnt-git-allow-me-to-safely-delete-a-branch/12520718


How to Pull Remote Branches which Don't Exist Locally

git pull can do some tricks.

More detailed operation:
git checkout -b new_branch origin/new_branch

ref:
https://segmentfault.com/q/1010000000367843

Tuesday 14 March 2017

Particle Takes a Long Timer to Connect to Cloud on Startup (Breathing White for a long time)


When not AUTOMATIC, do particle.connect() at the top!


ref:
https://community.particle.io/t/solved-photon-stuck-breathing-white/16510/6

Wednesday 8 March 2017

Install 32-bit Libraries on Ubuntu 16.04

In 14.04, some tutorial says:

sudo apt-get -y install lib32z1 lib32ncurses5 lib32bz2-1.0

but I got:
E: Unable to locate package lib32bz2-1.0
E: Couldn't find any package by glob 'lib32bz2-1.0'
E: Couldn't find any package by regex 'lib32bz2-1.0'

////////////////////////////////////////////////////////////////////////////////////////////

But I am in 16.04 and this worked for me:

sudo apt-get install libz1:i386 libncurses5:i386 libbz2-1.0:i386 libstdc++6:i386

Note that you might need to do this before:
sudo apt-get update


ref:
http://askubuntu.com/questions/775078/lib32bz2-1-0-missing-on-16-04
http://stackoverflow.com/questions/29916379/unable-to-run-mksdcard-tool-during-android-studio-installation-on-ubuntu-15-04/39567843

Particle Device Setup -- Android




ref:
https://bintray.com/particle/android/devicesetup/
https://github.com/spark/spark-setup-android