Skip to content

Instantly share code, notes, and snippets.

View corecode's full-sized avatar

Simon Schubert corecode

View GitHub Profile
@corecode
corecode / sampler.py
Created August 31, 2017 16:54 — forked from ynsta/sampler.py
Statistic profiling on stm32f4 with openocd by dwt_pcsr sampling
#!/usr/bin/python2
# run openocd (0.9.0) with :
# $ openocd -f stlink-v2-1.cfg -f stm32f4x.cfg &> /dev/null"
# then run
# $ python2 sampler.py path_to_myelf_with_symbols
import sys
import time
import telnetlib
@corecode
corecode / bar.c
Last active August 29, 2015 14:15
extern int __attribute__((section(".data.foo"))) x;
int __attribute__((section(".text.foo"))) foo(int);
int __attribute__((section(".text.bar"), noinline)) bar(int y) {
return foo(x + y);
}
extern "C" void _start(void) {
volatile int i;
volatile int v = bar(i);
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
entity lcd_master is
port (
clk : in std_logic;
reset_n : in std_logic;