Welcome to my thecnical blog

Welcome to my thecnical blog

Welcome to my thecnical blog

This blog is about technical stuff like: Linux, embedded, RT, algorithm, web, etc'


Zephyr RTOS BringUp on stm32

Published at May 7, 2021 ·  7 min read

The Zephyr RTOS is one of the best around. It makes me feel like working on embedded Linux in the sense of device integration, code styling, device tree (DTS), CMake build systems and more. It has many build-in stacks for USB, networking, BLE, file system, boot loader, DFU, and more. Its API reaches and has partial POSIX support with a custom build system that makes tiny footprints. This post is a tutorial on bringing up for STM32 board with USB and USART interfaces....

Linux Gadget Device.

Published at January 19, 2021 ·  4 min read

This post is an example of making a USB device from a Linux embedded machine where any HOST can control it. From Linux documention: Most Linux developers will not be able to use this API since they have USB host hardware in a PC, workstation, or server. Linux users with embedded systems are more likely to have USB peripheral hardware. To distinguish drivers running inside such hardware from the more familiar Linux “USB device drivers,” which are host-side proxies for the real USB devices, a different term is used: the drivers inside the peripherals are “USB gadget drivers....

Install embedded Linux toolchain on windows

Published at November 25, 2020 ·  2 min read

The toolchain for embedded Linux should be matched for the target image, and that is why we can’t just find and download it from somewhere. Therefore, we should be it. This is a tutorial on how to build and install YOCTO SDK on a windows machine. This allows developing embedded Linux on windows using eclipse or even visual studio. Setup YOCTO build If you already have a YOCTO build, you need to make the following simple steps:...

Debugging of cypress psoc6 in Linux terminal.

Published at November 5, 2020 ·  3 min read

I have used OpenOCD in my embedded projects, and here is a simple explanation how to work with OpenOCD with PSOC6 of cypress and here. Cypress has its own porting for OpenOCD for its interfaces: kitprog3 & kitprog4. Usually, I work on a Linux terminal using a command line with cgdb but, OpenOCD is already installed on modus, the default IDE of cypress. The PSOC6 is dual-core MCU: CM0+ and CM4, and when booting, it first powers on the CM0+, and if the CM4 is also needed, the CM0+ has to power it on....

Simple OpenAMP application for stm32mp157

Published at October 25, 2020 ·  3 min read

The stm32mp157 is SOC from STMicroelectronics , and it has within it a dual-core Cortex-A7 MPU and Cortex-M4 MCU. The Cortex-A7 is the application processor that operates Linux, and the Cortex-m4 runs RTOS or bare-metal application. The Cortex-M4 can be used for real-time tasks, such as creating a periodic and accurate control signal without jitter. In this kind of application, the Cortex-aA7 will run the master application and control the application of the Cortex-m4 using RPMsg Messaging Protocol....

Compile Linux kernel for zynq

Published at October 17, 2020 ·  2 min read

In previous post I shoed how to build and install Linux system on microzed board. When one tries to modify the kernel & u-boot, it is better to build and test it separately outside the Yocto build. I use Yocto’s kernel & u-boot sources and its SDK for the custom build. build the kernel To enable SDK , just type the following command. . /opt/poky/3.0.3/environment-setup-cortexa9t2hf-neon-poky-linux-gnueabi This script will define a series of enviement variables like $CC & $CXX that needed for the build....

Eclipse with CMake project on windows

Published at September 12, 2020 ·  5 min read

CMake is a powerful tool to manage c/c++ projects, and I prefer to use it in on my embedded projects also. Usually, the MCU has some communication with other processors (usually PC), and CMake also allows easy integration between both projects: MCU and HOST. For example, a shared source code that simultaneously able to recompile in both processors when any change occurs in these shared files. Usually, I work in a Linux environment in the terminal where everything is installed correctly in its place, and things work great....

install linux on microzed board

Published at August 1, 2020 ·  4 min read

The microzed development board has Xilinx zynq7000 chip. It has an application process unit with cortex a9 and FPGA fabric. The board also contains interfaces like SDIO and QSPI. I want to install Linux on it directly with yocto and without petalinux, which runs yocto behind the scene, so I tried to eliminate the need to use it. Why do so? It is interesting, and I have a lot of experience with yocto and it very easy to work with its script once you know it easy porting to other processors: IMX, stm32Mp157, etc' using build tools like CMake,Autotools, and yocto scripts make it very easy to port SW between different processors....

Custom opkg repository

Published at June 18, 2020 ·  2 min read

The post presenst simple example to create opkg repository to upgrade embbded linux systems using nginx server. The opkg pakcge should be installed as part of the image furing the first instalation. To add opkg to yocto image type type folloing line in file conf/local.conf IMAGE_INSTALL_append = " opkg \ " downlad and install opkg utils: git clone git://git.yoctoproject.org/opkg-utils and create Packages.gz file: cd /path-to-yocto-build/build/tmp/deploy/ipk ~/opkg-utils/opkg-make-index . > Packages.gz install nginx I haved used gentoo system , so inorder to install nginx on gentoo type:...

Kalman filter and pair trading

Published at May 1, 2020 ·  4 min read

Pair trading is a type of cointegration approach to statistical arbitrage trading strategy in which usually a pair of stocks are tcraded in a market-neutral strategy, i.e. it doesn’t matter whether the market is trending upwards or downwards, the two open positions for each stock hedge against each other. The key challenges in pairs trading are to: Choose a pair which will give you good statistical arbitrage opportunities over time Choose the entry/exit points One of the challenges with the pair trading is that cointegration relationships are seldom static....