Skip to content

Instantly share code, notes, and snippets.

@jaka
jaka / STM32F0.md
Created April 26, 2018 14:34
STM32F0 under Linux Tutorial

STM32F0 under Linux — Tutorial

Updated April, 2018.

Setting up the ARM GCC toolchain, OpenOCD and ST-Link

This is a tutorial on setting up a complete developing environment on Linux OS by using a free and open tools. The official ARM (GNU Tools for ARM Embedded Processors) GCC toolchain, OpenOCD and Texane's ST-Link debugger/programmer utilities will be used.

Why the ARM Cortex-M0 & why the STM32F0 Family Specifically?

The ARM Cortex-M0 is a 32-bit core that strikes an excellent balance between performance, power usage and price. It may not be as sophisticated and powerful as its older siblings the ARM Cortex-M3 and M4, but its simplicity, ease of use, lower cost and reduced power consumption easily makes up for that. The ARM Cortex-M0 core was designed to compete with other 8-bit/16-bit microcontroller cores like ARM and PIC and it succeeds in this goal on all major fronts; performance, low power, low price and short time to market.

openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f0x_stlink.cfg
arm-none-eabi-gdb --eval-command="target extended-remote localhost:3333" usb-cdc.elf
@jaka
jaka / xi.sh
Created February 18, 2018 17:58
while true;
do
x=`digitemp_DS9097 -a -q | sed -r 's/^.*C: ([0-9]+\.[0-9]+) F.*$/\1/g'`
wget --post-data "1=$x" http://10.82.4.23:8000/device/ef85df6a05a6a838/push?sign=t -qO /dev/null
done
for file in `find /usr/share/icons/gnome/`; do
a=${file#/usr/share/icons/gnome/}
size=${a%%/*}
size=${size%x*}
cat=`echo $a | cut -d"/" -f2`
name=${a##*/}
b=/usr/share/icons/Faenza/$cat/$size/$name
[ -e "$b" ] && rm $file
done
function GetElementAttribute(e, a) {
for (var j = 0; e.attributes.length; j++)
if (e.attributes[j].name == a)
return e.attributes[j].value;
}
mail.pmcatalyst-ab.com [193.77.182.143]
mail.pmcatalyst-ac.com [193.77.69.230]
mail.pmcatalyst-ae.com [193.77.69.222]
mail.pmcatalyst-af.com [213.250.20.37]
mail.pmcatalyst-ag.com [193.77.153.28]
mail.prm-marketing.com [90.157.217.234]
vs23.zooom.sk [86.110.225.60]
trolley.laluna.rs [95.85.62.89]
93.186.202.51
46.54.226.43
92.53.140.74
77.234.148.153
dns:
46.54.226.42
sudo apt-get install dnsmasq pxelinux syslinux-common
URL=http://www.memtest.org/download/5.01/memtest86+-5.01.bin
DEST_DIR=~/pxe_memtest
mkdir -p $DEST_DIR
cp /usr/lib/PXELINUX/pxelinux.0 $DEST_DIR
cp /usr/lib/syslinux/modules/bios/ldlinux.c32 $DEST_DIR/
#include <stdio.h>
#include <stdint.h>
uint8_t pack_temp(uint8_t *scratchpad) {
uint8_t v;
if ( *(scratchpad + 1) & 0x80 ) {
*(scratchpad + 1) ^= 0xff;
*scratchpad ^= 0xff;
from onvif import ONVIFCamera
mycam = ONVIFCamera('192.168.0.199', 80, 'admin', '12345', '/usr/local/wsdl')
media = mycam.create_media_service()
media.GetSnapshotUri()