Category Archives: Uncategorized
Waveshare S3 Zero + Micropython + LVGL
2025/09/12
Scale STM32CubeIDE UI in mac
Run STM32CudeIDE by Changing anything in STM32CubeIDE.ini won't work 2025/08/21
Compile bochs in 2016 old mac with macports
2025/08/17
Useful linux command
List out 10 biggest files in folder List biggest folders 2025/08/11
Why your STM32 is bricked

My STM32 is bricked (can't run anything in STM32CubeIDE) because my main loop has no sleep, after i add it back, my STM32 can run many times in STM32CubeIDE. To recover my weact blackpill, i use "while true; do st-flash erase; sleep 1; done" to keep running the st-flash command, I found out pressing the […] 2025/08/04
Set STM32F411CEU6 to run at 96Mhz with 48Mhz USB (100Mhz is not possible)

With HSE = 25 MHz, the PLL configuration must satisfy: Let’s try the main PLL: Since PLL_Q must be an integer (4-15), 48 MHz USB is not possible with VCO = 200 MHz: To get exactly 48 MHz: Since SYSCLK cannot exceed 100 MHz, VCO = 192 MHz (SYSCLK = 96 MHz, USB = 48 […] 2025/08/03
Create your hardware in libsigrok
In short, you need to build libsigrok then sigrok-cli Step 1: Add your device to Makefile.am Step 2: in configure.ac Step 3: Create /src/hardware/quantr folder add api.c, protocol.c and protocol.h api.c: protocol.c: protocol.h: Step 4: Build libsigrok Step 5: Build sigrok-cli Step 6: Test Then test it by "sigrok-cli -L", you should able to see […] 2025/08/03
STM32 Logic Analyzer Day 1
Trying to build a logic analyzer prototype, today i am using weact black pill board. I am using interrupt to fire the DMA and get the pins values, then use virtual com port to transfer it to PC, so far it works 2025/08/02
Good book : DNA

2025/07/28
STM32L476RG - DMA from register to memory example

Thinking how to build a logic analyzer using STM32. This example keep transfer the value of GPIO A to memory then fire interrupt using DMA. It will toggle PC0 for every complete transfer in my Nucleo L476RG board, I use oscilloscope to test, around 93KHZ 2025/07/21
LVGL_python connecting two SPI devices

All device pins should be connected to the same pins on the ESP32 board except the CS (chip select) pin. 2025/07/10
Quest Migration Manager UI

2025/06/23
Solved : sr: resource: Failed to open resource 'fx2lafw-sigrok-fx2-8ch.fw'

If you have this problem: run: sigrok-cli --loglevel 5 -d fx2lafw --scan , it said failed to find the firmware file So build this project and restart terminal, then you will success 2025/06/19
Muselab Logic Analzyer Nano - Sigrok-cli command
2025/06/18
Micropython for has no SoftI2C
It has no SoftI2C, so change display = ssd1306.SSD1306_I2C(128, 64, SoftI2C(sda=Pin(20), scl=Pin(21))) to import timefrom machine import Pin, I2C, SoftI2Cimport ssd1306 i2c = I2C(1) # Create I2C object display = ssd1306.SSD1306_I2C(128, 64, i2c) # Pass I2C object display.fill(0)display.text("Hello, World", 0, 0)display.show() time.sleep(100) 2025/06/07
香港好多人覺得自己係諸葛亮

諸葛亮勁係無資源嘅情況底下可以有高強嘅執行力。而香港人絕大部份都無執行力。 2025/05/13
STM32 - Serial two 74HC595 shift registers

https://gitlab.quantr.hk/example/stm32/stm32f411ceu6-74hc595-shift-register 2025/04/26
8 segment led display all characters and numbers

2025/04/25
Download Unity international in Hong Kong

I don't understand why US gov list Hong Kong as their enemy Download Unity international tutorial 2025/02/23
command to clone mysql database
of use -p 2025/02/22
Solved: Modules/_curses.cpython-313-darwin.so: no such file or directory

If you are using macports instead of homebrew, you may have this problem. Solved by this: LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/include" pyenv install 3.12.6 2025/02/16
crazy web uart
if you want to send one single byte this is not working writer.write(new Int32Array([0x4]).buffer); this work writer.write(new Uint8Array([0x4])); 2025/01/29
香港神奇的Python仔現象

香港有人係咁,廿幾歲畢業出黎做野,做左幾年對隻language開始熟,佢地唔係鑽落去language下面睇下發生緊乜野,例如啲code點compile呀,debug點做呀咁。佢地會作一出個難以解釋嘅現象,就係跳去另一隻high level language到再玩過,而當佢地玩到興起玩左幾年,佢地再次唔係想知道隻language嘅底層,而係再一次又跳去其它high level language到碌多一次,難道唔想知揸係手裏面把刀係咩黎?我叫呢一種現象做「香港Python仔現象」。舉個例子,2003年班友玩vc++,跟住跳去c#,跟住又跳去java,而家又跳去python。因為咁樣跳法本質上對過去學嘅語言都唔方認識得深,所以如果而家有個阿叔好推崇python,對其它language只停留係誇誇其談攞唔出到戰鬥力,佢大概率係咁。 要改變,就要做好科普,揭露python底層所有野,咁先至有機會改變。但呢班友會唔會變未知。 2025/01/28
gitlab backup guide
2025/01/10
貴族 vs 老土 (貴族之女,第一個程序員Ada Lovelace)

香港人嘅老土活該沒有科技,我而家分析俾你地睇香港人嘅老土係有幾老土,以及老土嘅香港人點解覺得自己唔老土 第一老土 : 你憑咩 佢地所謂嘅論證不外乎係黎自你所受嘅教育同埋經驗,佢地會話你又唔係哈佛MIT學咩野人搞之類嘅言論,但呢班無讀歷史嘅人唔知好多科學家都係自學為主。(見下圖) 香港人老土在永遠人地努力做,佢地就會問"你憑咩",其實呢一句好無敵,因為當你做緊而又未做完嘅時間你的確無力反駁呢一句,由其是你係做緊一啲你自己都唔知做唔做到嘅野時,你更加無力反駁。但呢班友永遠唔明,科學嘅發現好多時就係意外發現,好多野唔做就唔唔知得唔得,而呢班咁嘅人最叻就係用呢句去質疑你,佢地嘅內心世界就係「嘩,你做呀,你有無諗過㗎」,跟住就會覺得自己好似好有經驗,好似真係以為自己曾經做過咁,知道你條路係唔通,其實個現實就係,呢班友根本無做過,而更深一層嘅就係,佢地連去嘗試嘅基本實力都無,佢地唔係連個for-loop都寫唔出就係技術只夠寫啲script仔,真係可憐。 第二老土 : 話人畫餅 呢個世界唔係所有人都需要理想,而理想呢樣野個實現率必定為低。香港地當然多人畫餅,但係係唔係畫餅好容易分,得個噏字唔做咪就係畫餅囉,會做嘅又點會算係畫餅呢,但係呢班咁嘅人就最叻攻擊啲為理想而行動嘅人。佢地個底其實係數佬,內心世界非常現實,我估計佢地後生嘅時候都曾經有理想,但手料跟唔上人到中年完全無哂動手能力,思想上變得越黎越現實,腦裏面諗一百個可能性去否定執行嘅成功率,不停俾借口自己逃避執行以至完全喪失執行力,佢地係編程上嘅實力只能點評人地寫嘅program,而自己乜都寫唔到。 Ada係連電都未係好識運用嘅年代就話要令機器有計算能力,如果香港班友返去佢嗰個時代,呢班友就會話人畫餅。嗰個時代根本就係非常簡陋。當呢班友話人畫餅,佢地嘅內心有一種好充盈嘅感覺,佢地會覺得:「嘿嘿,我真係叻,無俾你利用到」。但係個現實係咩呢,就係呢班友手料根本連俾人利用嘅資格都無,同你講下理想只係發下噏瘋而矣,唔好諗得自己咁有料可以俾人利用。 第三老土:話做唔做或者揾借口唔繼續做 話做唔做嘅人主要會話你唔夠條件做,做緊又揾借口唔繼續做嘅人會話發現你原來唔夠料做,又或者話發現你身上有啲缺點而唔再同你合作做。總之無論係咩原因都好,結果就係唔做。我地睇返Ada Lovelace個Case,當佢話要做一部Thinking machine嘅時候,佢mentor Charles Babbage唔會因為佢太天馬行空而屈佢畫餅,想反地會動手一齊做。而Charles Babbage亦都唔會話Ada無足夠嘅錢同埋未讀過大學就話人無料而做做下唔做。 2025/01/07
A Super Good scala sbt tool tutorial
https://conorfennell.github.io/scala-zen/articles/sbt.html 2024/12/31
重點係Draw small + detail,畫大無用

第一步其實好簡單,就係視覺角度唔好錯,畫細畫detail,畫太大舊野無意思 2024/12/27
香港嘅教育展,其實係教育玩具展

香港花太多時間係用玩具去吸引學生學編程,但無提升到對編程概念嘅表達,其實所有人都應該明白,如果係鐘意寫Program嘅小朋友,絕大部份第一次接觸就會愛上,其實係唔存在你要買好多玩具俾佢試先會所謂「啓發」到佢地嘅興趣。而個社會咁做不外乎得以下幾種可能 上面三個原因互為影響互相加強,所以教育展變教育玩具展。 對香港嘅影響: 大家都係做代理唔研發,而大粒佬係呢啲展到都係得講野兩個字亦都唔會研發,最終後果就係香港洗好多錢係教育到最尾得個殼,香港人可以話俾外國人知香港投資左好多錢落教育,買左好多光鮮嘅玩具,除此之外乜都無。香港唔洗諗會出到Basic之父或者Logo之父等等一系列用實際行動去壓低學習難度嘅教育家,香港人唔洗諗,所以我地要以行動作出改變。 教育展中嘅清泉: 呢間公司做到好Deep,成套教學工具自己出,老細寫左本ROS嘅書有自己嘅學習思想,相信佢係用自己學習ROS嘅學習經驗濃縮出黎 2024/12/13
Java getting millions files from SharePoint online
This function is using SharePoint-Java-API library. 2024/12/08
Port forward port 22 into WSL ubuntu
Run this command in windows host 2024/11/19
dhrystone compile issue in riscv-tests

this problem happens in both mac and ubuntu /home/peter/workspace/riscv-tests/benchmarks/dhrystone/dhrystone.c:20:1: error: return type defaults to 'int' [-Wimplicit-int] Fixed is here https://github.com/riscv-software-src/riscv-tests/compare/master...pratikkedar:riscv-tests:pratik-test 2024/11/07
Code magazine statistics
Total page Total article Editorial (no of page) Longest article (no of page) Advertisement (no of page) 2024 Nov Dec 76 11 1 14 5 2024 Sep Oct 76 12 1 25 8 2024/11/01
Resolved: unable to push to gitlab

if you meet this problem: fatal: the remote end hung up unexpectedly Do this: 2024/10/31
Good bye THEi

2024/10/30
香港編程界必須「代碼脫亞入歐, 工作脫港入陸」
「代碼脫亞入歐」這一概念可以從幾個方面來理解,特別是在香港的編程界與日本的明治維新之間進行比較。 1. 歷史背景 2. 技術與創新 3. 教育與培訓 4. 政策支持 5. 文化與思維轉變 總結來說,「代碼脫亞入歐」不僅是技術上的轉型,更是一種思維方式和文化的變革。香港的編程界若能學習日本明治維新的經驗,將能在全球化的浪潮中更好地立足與發展。 2024/10/27
我估實相係咁 : 時間係亂序執行
1. 時間係亂序執行,否則佛教不能自圓其說。只要亂序執行講得通,佛教整套哲學體系就會自己渝合。而家佛教哲學有幾個不能接合嘅地方,第一就係講所有野係空,但又因緣生。第二就係佛教嘅神通如果係真,根本容唔落係自己套哲學體系裏面。就算講得最清楚嘅龍樹,都只不過係話當「果」出現時,「因」先會被確定。如果時間係線性,呢單野根本完全唔合理,但如果時間就亂序執行,咁就好正確。因為係呢一對事物「因」+「果」佢地嘅時間當然係順序執行,但跳出左呢一對事物,佢地嘅時間線就唔係,所以係佢地時間線黎講果要出現左,因先可以成立。企左出去佢地嘅時間線,其實係果先出現,再到因。我再舉多個你地可以睇到嘅例子。int x; x=123. 呢兩句code,你地用verilator synthesis出logic gate,係呢兩句code嘅時間線上先有int x,先可以有x=123. 但其實係int x之前,係另一條時間線,x已經存在,所以果出現時,姐係int x出現時,佢個因x先被確立。乎合龍樹所講嘅野。古人因為科技所限,無法舉證。 2. 時間係唔係線性,而亂序執行唔會阻擋世情嘅出現。我地感受到時間係線性,因為只係我地要靠時間去圍持呢個身體同識。舉個實制例子,CPU係亂序執行,但被執行嘅program會以為自己嘅時間線係線性,但其實唔係。只係CPU唔會張下一句指令嘅執行結果話比上一句嘅指令知,最終令到program以為自己條時間線有如河流一樣線性。 2024/10/20
Resize ext4 inside ubuntu and virtualbox with lvm

2024/10/11
Resolved : Mac pip unable to get local issuer certificate
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)'))': /simple/matplotlib/ 2024/10/08
Statistics formula in Excel

2024/10/02
Remove old node_modules
2024/08/08