hooku

Please enjoy some eccentric technologies.

Lineage OS

Run airodump-ng on Xiaomi8(dipper)

The dipper comes with qalcd 3.0 driver, it is possible to do wireless raw packet capture on the device directly.


Compile kernel for dipper

Follow the steps on https://wiki.lineageos.org/devices/dipper/build

cd ~/android/lineage
repo init -u https://github.com/LineageOS/android.git -b lineage-20.0 --git-lfs --depth=1
repo sync
source build/envsetup.sh
breakfast dipper
lunch lineageos_dipper_userdebug
mka kernel
mka boot_image

proj_spacelight

Spacelight

HW

OLED controller: SSD1309

Compile

Prerequisite Software

  • Git for Windows

  • STM32CubeMX 6.8.0 with the following components installed:

    • STM32CubeF4 Firmware Package V1.27.0
    • Azure RTOS STM32Cube expansion package for STM32F4 series V1.1.0
  • IAR 8.40.2

Compile Procedure

  1. create a generate dir(Z:\generated)
  2. run command prompt as administrator, and create a directory symbolic link under spacelight\cubemx: mklink /d generated Z:\generated
  3. update the generate_dir(which stores all the files that cubemx generated) inside generate_code.cmd
  4. run generate_code.cmd, the script will
    • generate the IAR project & code and include the STM32F4 CMSIS lib
    • patch the generated code to call user written code
  5. open cubemx\generated\project\EWARM\Project.eww in IAR
  6. compile and run

Code Structure

  • app: user written code for the project
  • cubemx
    • generate_code.cmd: script to generate the IAR project
    • spacelight.ioc: cubemx config file
    • .extSettings: additional IAR project setting
  • lib
    • u8g2: monochrome graphics library

GUI Block Diagram

[object Promise]

Menu Item

  • CCT Mode
  • Effect Mode
  • Lamp Count
  • DMX Addr
  • DMX Mode
  • Wireless
  • Lock Time
  • Version
  • Exit

Workload components

  • CMSIS Lib
  • RTOS: Azure RTOS(ThreadX)
  • GUI: u8g2
    • Font library embedding
    • Icon embedding
  • DMX512 protocol stack
  • Algorithm
    • Blink
    • Breather
    • Lightning
    • CCT Drift
    • Fire

Peripherals

The project use the following IOMUX & peripherals:

GPIO

GPIO Input

  • KEY1
  • KEY2
  • KEY3
  • KEY4

GPIO Output

  • R_LED
  • G_LED
  • B_LED

TIM

Thread design

  • GUI thread: draw main interface
  • worker thread:
  • controller thread: handle key input, and

C++ Notes

CPP

Concurrency

Presenter: rainer@grimm-jaud.de

Mutex

  • Be as constant as possible, be as local as possible

  • Bad

    m.lock();	
    sharedVariable = getVar();
    m.unlock();
    
  • Good

    auto res = getVar();
    m.lock();
    sharedVariable = getVar();
    m.unlock();
    
  • NNN=No Naked New

  • NNM=No Naked Mutex