Monthly Archives: May 2021

STM32 g-code Parser (grbl/CNC/3D Printing)

grbl

github.com/Schildkroet/GRBL-Advanced
github.com/usbcnc/grbl
github.com/dungjk/grbl-stm32

Marlin

github.com/MarlinFirmware/Marlin
github.com/Rejdok/STM32-Marlin-Port (old?)
github.com/MakerLabMe/Marlin_STM32 (old?)

Super Gerbil, the STM32 based Gcode controller
STM32 grbl
GRBL STM32duino?

G-Code

Marlin G-code Index
G Codes
G0 vs G1 Gcode

ST

STEVAL-3DP001V1: Reference design for FDM 3D printing
UM2067 User manual: Getting started with the 3D printer board
STEVAL-3DP001V1: Plug-n-play solution for 3D printers

YouTube

Basic Movements with G-Code
3d Printers G-Code Explored and Explained with Examples
Creating a custom GCODE command – Extending Marlin Firmware

Original AVR

github.com/grbl/grbl
github.com/gnea/grbl/wiki
ARM discussion #67

Qt

github.com/Denvi/Candle

ownClound / SWITCHdrive

CSync unspecified error

c:\Program Files (x86)\switchdrive>switchdrive.exe --logfile c:\Users\andreas\switchdrive_2021_05_28_2.txt

[...]
05-28 09:44:50:164 [ warning sync.database.sql ]:	Sqlite step statement error: 11 "database disk image is malformed" in "SELECT path, inode, modtime, type, md5, fileid, remotePerm, filesize,  ignoredChildrenRemote, contentchecksumtype.name || ':' || contentChecksum FROM metadata  LEFT JOIN checksumtype as contentchecksumtype ON metadata.contentChecksumTypeId == contentchecksumtype.id WHERE phash=?1"
05-28 09:44:50:164 [ warning sync.database ]:	No journal entry found for  "ZHAW_Assistent/FotoFinder/BA19_bmat_02_CoolingStation/2.Recherche/files/104/icon-instagram.svg" Error:  "database disk image is malformed"
05-28 09:44:50:164 [ info sync.database ]:	Closing DB "C:/Users/andreas/switchdrive/._sync_1f3ce89cbf1f.db"
05-28 09:44:50:166 [ warning sync.engine ]:	ERROR during  csync_update :  "CSync unspecified error."
05-28 09:44:50:182 [ info sync.database ]:	Closing DB "C:/Users/andreas/switchdrive/._sync_1f3ce89cbf1f.db"
05-28 09:44:50:182 [ info sync.engine ]:	CSync run took  7183 ms
05-28 09:44:50:182 [ info gui.socketapi ]:	Sending SocketAPI message --> "STATUS:OK:C:\\Users\\andreas\\switchdrive" to QLocalSocket(0x93bb298)
05-28 09:44:50:182 [ info gui.folder ]:	Client version 2.5.4daily20190604 (build 1865)  Qt 5.11.2  SSL  OpenSSL 1.1.1  11 Sep 2018
05-28 09:44:50:182 [ warning gui.folder ]:	SyncEngine finished with ERROR
05-28 09:44:50:182 [ info gui.folder ]:	Folder sync result:  2
05-28 09:44:50:182 [ info gui.folder ]:	the last 3 syncs failed
05-28 09:44:50:182 [ info gui.socketapi ]:	Sending SocketAPI message --> "STATUS:OK:C:\\Users\\andreas\\switchdrive" to QLocalSocket(0x93bb298)
05-28 09:44:50:183 [ info gui.socketapi ]:	Sending SocketAPI message --> "UPDATE_VIEW:C:\\Users\\andreas\\switchdrive" to QLocalSocket(0x93bb298)

ownCloud Client Manual – Appendix C: Troubleshooting
Owncloud Datenbank-Probleme

Download sqlite3: SQLite Download Page, sqlite-tools-win32-x86-3350500.zip

SQLite Commands
Command Line Shell For SQLite

C:\Users\andreas\switchdrive>c:\sqlite-tools-win32-x86-3350500\sqlite3.exe C:/Users/andreas/switchdrive/._sync_1f3ce89cbf1f.db
SQLite version 3.35.5 2021-04-19 18:32:05
Enter ".help" for usage hints.

sqlite> PRAGMA integrity_check;
row 39975 missing from index sqlite_autoindex_metadata_1

sqlite> reindex;

sqlite> PRAGMA integrity_check;
ok

sqlite> .exit

Windows Subsystem for Linux (WSL)

Windows Subsystem for Linux Installation Guide for Windows 10

What is the Windows Subsystem for Linux?
Frequently Asked Questions about Windows Subsystem for Linux
Run Linux GUI apps on the Windows Subsystem for Linux (Windows 11 Build 22000 or later)
Running WSL GUI Apps on Windows 10

WSL2 Ubuntu GUI (with RDP)
How to install Linux GUI apps with WSL 2 on Windows 10 (Windows 10 Build 21364)
WSL2 soll Linux-GUIs anzeigen können (Wayland Display Server)
GUI-Anwendungen ausführen im Windows Subsystem für Linux (WSL)
Windows Subsystem for Linux GUI startet grafische Linux-Programme

github.com/microsoft/wslg, Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios (Windows 11)

Announcing Windows 10 Insider Preview Build 21364, April 21, 2021
Windows 11 on Unsupported Hardware

How to set up working X11 forwarding on WSL2 [closed]
WSL: Running Graphical Applications

vscode GDB display memory

In computing, endianness is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most significant byte of a word at the smallest memory address and the least significant byte at the largest. A little-endian system, in contrast, stores the least-significant byte at the smallest address.

  • big-endian: most significant byte in smallest memory address
  • little-endian: least significant byte at the smallest address

Question: How to display memory during a debug session #1503
Examine/display memory and register in gdb

const char  str[] = "hello world!";
const int   k = -15;  
-exec x/s str
0x7ff608319998 <str>:    "hello world!"

-exec x/13xb str
0x7ff608319998 <str>:    0x68    0x65    0x6c    0x6c    0x6f    0x20    0x77    0x6f
0x7ff6083199a0 <str+8>:  0x72    0x6c    0x64    0x21    0x00

-exec x &k
0x7ff6083199a8 <k>:      0xf1

-exec x/d &k
0x7ff6083199a8 <k>:      -15

-exec x/4b &k
0x7ff6083199a8 <k>:      -15    -1    -1    -1

-exec x/4xb &k
0x7ff6083199a8 <k>:      0xf1    0xff    0xff    0xff

-exec p sine
$2 = {0x7ff608319000 <sine_300> "", 0x7ff608319260 <sine_400> "", 0x7ff608319420 <sine_500> "", 0x7ff608319580 <sine_600> "", 0x7ff6083196a0 <sine_700> "", 0x7ff6083197a0 <sine_800> "", 0x7ff608319880 <sine_900> ""}

-exec x/7xg &sine
0x7ff608318020 <sine>:       0x00007ff608319000    0x00007ff608319260
0x7ff608318030 <sine+16>:    0x00007ff608319420    0x00007ff608319580
0x7ff608318040 <sine+32>:    0x00007ff6083196a0    0x00007ff6083197a0
0x7ff608318050 <sine+48>:    0x00007ff608319880

-exec x/8xh sine[0]
0x7ff608319000 <sine_300>:	0x0000	0x0000	0x0579	0x0578	0x0aeb	0x0aee	0x1062	0x105d

-exec x/8xh sine[1]
0x7ff608319260 <sine_400>:	0x0000	0x0000	0x074b	0x074a	0x0e8d	0x0e90	0x15ca	0x15c6

-exec x/8xh &m_wave
0x7ff7c3f2d060 <m_wave>:	0x0000	0x0000	0x02bc	0x0578	0x0aeb	0x0aee	0x1062	0x105d

-exec x/8xh wave_16bit
0x7ff7c3f2d060 <m_wave>:	0x0000	0x0000	0x02bc	0x0578	0x0aeb	0x0aee	0x1062	0x105d






-exec tui enable
Cannot enable the TUI when the interpreter is 'mi'

-exec show endian
The target endianness is set automatically (currently little endian).

GCC/clang __attribute__

__attribute__((constructor[(priority)]))

How exactly does __attribute__((constructor)) work?
GCC __attribute__((constructor)) is called before object constructor
C++ static initialization vs __attribute__((constructor))
__attribute__((constructor[(priority)])) function attribute
__attribute__((constructor(priority))) function attribute

__attribute__((init_priority(X)))

__attribute__((init_priority(X))) in GCC

__attribute__((weak))

__attribute__((weak)) and static libraries

void noOsSystickHandler() { } // empty 
void osSystickHandler() __attribute__((weak, alias("noOsSystickHandler")));