Skip to content

Instantly share code, notes, and snippets.

@benpicco
benpicco / cmake-verbose.log
Created April 24, 2019 11:34
corrupted Zephyr cache
This file has been truncated, but you can view the full file.
Running with expanded trace output on.
/home/benpicco/dev/zeph-stable/zephyr/samples/hello_world/CMakeLists.txt(3): cmake_minimum_required(VERSION 3.13.1 )
/home/benpicco/dev/zeph-stable/zephyr/samples/hello_world/CMakeLists.txt(5): include(/home/benpicco/dev/zeph-stable/zephyr/cmake/app/boilerplate.cmake NO_POLICY_SCOPE )
/home/benpicco/dev/zeph-stable/zephyr/cmake/app/boilerplate.cmake(21): cmake_minimum_required(VERSION 3.13.1 )
/home/benpicco/dev/zeph-stable/zephyr/cmake/app/boilerplate.cmake(24): cmake_policy(SET CMP0002 NEW )
/home/benpicco/dev/zeph-stable/zephyr/cmake/app/boilerplate.cmake(29): cmake_policy(SET CMP0079 OLD )
/home/benpicco/dev/zeph-stable/zephyr/cmake/app/boilerplate.cmake(31): define_property(GLOBAL PROPERTY ZEPHYR_LIBS BRIEF_DOCS Global list of all Zephyr CMake libs that should be linked in FULL_DOCS Global list of all Zephyr CMake libs that should be linked in.
zephyr_library() appends libs to this list. )
/home/benpicco/dev/zeph-stable/zephyr/cmake/app/boilerplate.cmake(35):
/dts-v1/;
/plugin/;
/ {
compatible = "bcrm,bcm2708";
fragment@0 {
target = <&spi0>;
__overlay__ {
#address-cells = <1>;
lowpan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1280
inet6 fe80::e4d6:22ff:306e:d847 prefixlen 64 scopeid 0x20<link>
inet6 fe80::23:ff:fe00:2 prefixlen 64 scopeid 0x20<link>
unspec E6-D6-22-FF-30-6E-D8-47-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 27 bytes 3212 (3.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 43 bytes 4984 (4.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wpan0: flags=195<UP,BROADCAST,RUNNING,NOARP> mtu 123
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
static const int bits_per_nibble[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 };
#define BITS_PER_U8(x) (bits_per_nibble[(x) & 0xf] + bits_per_nibble[((x) >> 4) & 0xf])
#define BITS_PER_U16(x) (BITS_PER_U8((x) & 0xff) + BITS_PER_U8(((x) >> 8) & 0xff))
#define __builtin_popcount(x) (BITS_PER_U16((x) & 0xffff) + BITS_PER_U16(((x) >> 16) & 0xffff))
#define SERIAL_FLAG_EXT_PAREN (1 << 6)
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/kd.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
#define LOG_PAGE_SIZE 128
static u8_t spiffs_work_buf[LOG_PAGE_SIZE*2];
static u8_t spiffs_fds[32*4];
static u8_t spiffs_cache_buf[(LOG_PAGE_SIZE+32)*4];
void my_spiffs_mount(void) {
spiffs_config cfg;
cfg.phys_addr = 0; // start spiffs at start of spi flash
cfg.phys_size = flash_get_size() - cfg.phys_addr; // use all spi flash
cfg.phys_erase_block = BLOCK_4K; // according to datasheet
#include "printf.h"
#include "flash.h"
#include "spiffs.h"
#define LOG_PAGE_SIZE 128 // can't read more than this in one go
static u8_t spiffs_work_buf[LOG_PAGE_SIZE*2];
static u8_t spiffs_fds[32*4];
static u8_t spiffs_cache_buf[(LOG_PAGE_SIZE+32)*4];
static spiffs fs;
int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed) {
uint32_t _speed;
switch (speed) {
case SPI_SPEED_100KHZ:
_speed = 100000;
break;
case SPI_SPEED_400KHZ:
_speed = 400000;
break;
####
#### Sample Makefile for building apps with the RIOT OS
####
#### The Sample Filesystem Layout is:
#### /this makefile
#### ../../RIOT
#### ../../boards for board definitions (if you have one or more)
####
# name of your application
#include <stdio.h>
#include <destiny.h>
#define IF_ID (0)
#define NODE_ID (23)
static void init(void) {
ipv6_addr_t tmp;
net_if_set_hardware_address(IF_ID, NODE_ID);