Saturday, December 16, 2017

FlashMagic on Ubuntu

Hi all,

Here is the post for using FlashMagic on Linux (Ubuntu 16.04)

FlashMagic is will versed PC tool for ISP programming NXP flash based microcontrollers. Here are the steps for using Flash Magic on Ubuntu.

1) Install "Wine" from Ubuntu Software Center, it also installs Winetricks

2) Downlaod FlashMagic tool from here
3) Right click on "FlashMagic.exe", select "Open With" --> "Wine Windows Program Loader". It opens the installation window, follow the instructions to complete the setup.
4) From applications you can launch "Flash Magic"



Setting up UART for flash Magic.

Its very common that device naming convention/path is different from Linux to Windows.
Devices for wine are located at the following path

ls -l ~/.wine/dosdevices/
total 0
lrwxrwxrwx 1 testingjig testingjig 10 Dec 16 11:47 c: -> ../drive_c
lrwxrwxrwx 1 testingjig testingjig  9 Dec 16 11:52 d:: -> /dev/sdb1
lrwxrwxrwx 1 testingjig testingjig  8 Dec 16 11:52 e:: -> /dev/sdb
lrwxrwxrwx 1 testingjig testingjig  1 Dec 16 11:47 z: -> /

Connect USB-Serial Cable, from dmesg, identify the device node created, in my case it is ttyUSB0

Note: Naming convention to follow in small letters, say com1 instead of COM1


cd ~/.wine/dosdevices/

ln -s /dev/ttyUSB0 com1 

Now from FlashMagic tool select COM1 for programming the device in ISP mode.


This completes setting up FlashMagic in Linux using wine.

Creating Default FlashMagic Configuration

We can create a default configuration for FlashMagic which can be launched just by a single click.

From FlashMagic window, select "File"->"Save Settings", save your settings as mySeetings.fms

you can place this file on Desktop and launch your settings just at a click

 please leave your comments, it will be encouraging :)

Wednesday, February 15, 2017

Read, Modify CPU frequency & Governors in Linux from command Line

Hi Folks welcome to my blog..

I have a short post in changing CPU frequency & governors from command line on a Linux machine. I am using BeagleBoneBlack booted to shell with minimal file-system generated from build-root with Kernel version 3.8.13.

I am at shell prompt as a sudo user.

Reading CPU information: We get the CPU information reading the cpuinfo file in proc file-system.

# cat /proc/cpuinfo



Reading CPU frequency & governors:

Change directory to  /sys/bus/cpu/devices/cpu0/cpufreq

# cd /sys/bus/cpu/devices/cpu0/cpufreq
# ls




To get the available CPU frequencies for  scaling read the below file.
# cat scaling_available_frequencies



To get the current CPU frequency, read the below file.
# cat cpuinfo_cur_freq



CPU is currently running at 1GHz

To read the current CPU governor, read the below file
# cat scaling_available_governors





similarly to read the current CPU governor read the below file
# cat scaling_governor



Changing CPU frequency

In order to change the CPU frequency, we have to change the CPU governor to userspace. This allows to run the CPU at user specified frequencies.

In case of ondemand governor we can set the scaling_max_freq & scaling_min_freq, but we cannot set a specific frequency from the available list of CPU frequencies.

For more details read the following link: https://wiki.archlinux.org/index.php/CPU_frequency_scaling

# echo userspace > scaling_governor
# echo  600000 > scaling_setspeed

#cat cpuinfo_cur_freq





Changing CPU frequency to 600MHz, we can set only values available under scaling_available_frequencies



Now you change the CPU governor to ondemand and try to modify the scaling_max_freq & scaling_min_freq  frequencies and observe the effect when you try to change the CPU current frequency.

Thanks for your time. Please feel free to post your comments.