Skip to content

Instantly share code, notes, and snippets.

View GOOD-Stuff's full-sized avatar

Gustov Vladimir GOOD-Stuff

  • Russia, Vladimir
View GitHub Profile
@GOOD-Stuff
GOOD-Stuff / dmesg.txt
Created April 24, 2017 10:29
dmesg output
Booting Linux on physical CPU 0x0
Linux version 4.6.0-xilinx-22223-gcda28de-dirty (vldmr@skat) (gcc version 4.9.2 (Sourcery CodeBench Lite 2015.05-17) ) #8 SMP PREEMPT Mon Apr 24 12:16:36 MSK 2017
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: xlnx,zynq-7000
cma: Reserved 64 MiB at 0x1c000000
Memory policy: Data cache writealloc
On node 0 totalpages: 131072
free_area_init_node: node 0, pgdat c0938d40, node_mem_map dbbd8000
Normal zone: 1024 pages used for memmap
@GOOD-Stuff
GOOD-Stuff / pl.dts
Created April 24, 2017 10:33
device tree output
/*
* CAUTION: This file is automatically generated by Xilinx.
* Version:
* Today is: Wed Apr 19 09:25:26 2017
*/
/ {
amba_pl: amba_pl {
#address-cells = <1>;
@GOOD-Stuff
GOOD-Stuff / dmesg_err.txt
Created April 24, 2017 10:54
dmesg error output
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = 5b638000
[00000000] *pgd=1b4cc831, *pte=00000000, *ppte=00000000
Internal error: Oops - BUG: 17 [#1] PREEMPT SMP ARM
Modules linked in: axidma(O)
CPU: 1 PID: 1006 Comm: axidma_benchmar Tainted: G O 3.17.0-xilinx #6
task: 5b7c2640 ti: 5b6b0000 task.ti: 5b6b0000
PC is at axidma_prep_transfer.isra.2+0x54/0x260 [axidma]
LR is at axidma_rw_transfer+0x1a8/0x200 [axidma]
pc : [<3f000ea4>] lr : [<3f0016b4>] psr: 600b0013
@GOOD-Stuff
GOOD-Stuff / main_socket.c
Created June 22, 2017 14:43
Example of using LwIP socket with FreeRTOS
static void udpecho_thread(void *arg){
// socket API
LCD_UsrLog("Start SDF \n");
int sock, newconn, size, count;
struct sockaddr_in address, remote_host;
u8_t buff[1000];
if(( sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
Error_Handler();
@GOOD-Stuff
GOOD-Stuff / main.c
Last active June 26, 2017 14:48
Example of TCP server
/*
* main.cpp
*
* Created on: Jun 26, 2017
* Author: vldmr
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
@GOOD-Stuff
GOOD-Stuff / scan_files.c
Last active June 27, 2017 14:02
Get list of files from SD card
// For FatFs
// src: http://elm-chan.org/fsw/ff/doc/readdir.html
static FRESULT scan_files ( char* path ) { // path = "/";
FRESULT res;
DIR dir;
UINT i;
static FILINFO fno;
res = f_opendir(&dir, path); /* Open the directory */
if (res == FR_OK) {
@GOOD-Stuff
GOOD-Stuff / main.c
Created August 3, 2017 10:41
Some test suit for TMS320C6678
/*
* Project for TMS320C6678
* */
#include <stdio.h>
#include <stdint.h>
#define DEVSTAT 0x02620020
#define JTAGID 0x02620018
#define MM_REVID 0x01812000
#define PWRSTATECTL 0x02620150
@GOOD-Stuff
GOOD-Stuff / OpenMP_mapped.cpp
Last active May 21, 2020 02:34
Example of work with std::map and OpenMP
#include <iostream>
#include <vector>
#include <map>
#include <omp.h>
#include <ctime>
using namespace std;
int main(int argc, char *argv[]) {
unsigned int thread_count;
cout << "Threads: ";
@GOOD-Stuff
GOOD-Stuff / clock_divider.v
Created December 19, 2017 14:06
Example of clock divider
// src: https://electronix.ru/forum/lofiversion/index.php/t111967.html
module divider (
input clk50,
output reg clk2
);
reg [4:0] counter;
reg a,b;
always @(posedge clk50)
@GOOD-Stuff
GOOD-Stuff / Makefile
Last active June 6, 2018 14:41
Example of Makefile for ARM Linux kernel
obj-m := main.o
main-y := ../src/main.o
KDIR := <path_to_kernel_src>
TOOL := <path_to_toolchain>/arm-xilinx-linux-gnueabi-
all:
make -C $(KDIR) CC=$(TOOL)gcc LD=$(TOOL)ld M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean