[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-518":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},518,"BMCU-C-PJARCZAK","jarczakpawel\u002FBMCU-C-PJARCZAK","jarczakpawel","BMCU 370C (Hall) firmware for Bambu Lab A1 \u002F A1 mini \u002F P1S with buffer calibration - all known issues fixed, 100% AMS-compatible behavior.",null,"https:\u002F\u002Fgithub.com\u002Fjarczakpawel\u002FBMCU-C-PJARCZAK","C++",479,69,19,17,0,14,30,189,42,87.54,false,"main",[25,26,27,28,29,30,31],"3d-printing","ams","bambu","ch32","lab","370c","bmcu","2026-06-12 04:00:04","# BMCU Firmware – Calibration and Compatibility Notes\n\nThis BMCU firmware has been tested and verified with the latest Bambu Lab A1 firmware.\n\nIMPORTANT:\nThe printer must be configured as AMS, not AMS Lite.\nUsing AMS Lite will cause incompatibility issues.\n\n\n\u003Ch1 align=\"center\">Support\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  Bambu Lab continues tightening compatibility around BMCU, and there is a growing risk that BMCU may eventually become unusable in that ecosystem.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  To prepare for that, I want to build BMCU support for open-source Klipper-based printers.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  I am currently raising funds to buy a test printer for this work.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  The $500 goal does not need to be reached in full. If I manage to save the remaining amount myself, I will cover the rest out of my own pocket.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fko-fi.com\u002Fjarczakpawel\u002Fgoal?g=0\">\n    \u003Cimg src=\".\u002Fbanner-klipper.png\" alt=\"Want BMCU on Klipper? Click the links below to support development.\" width=\"460\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fko-fi.com\u002Fjarczakpawel\u002Fgoal?g=0\">\u003Cstrong>Support on Ko-fi\u003C\u002Fstrong>\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Frevolut.me\u002Fpaweqxdkx\">\u003Cstrong>Support via Revolut\u003C\u002Fstrong>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  Direct Revolut support avoids Ko-fi fees, so more of your contribution goes directly to the project.\n\u003C\u002Fp>\n\n\n# ❗ IMPORTANT - FIRST START (V10.3+) ❗\n\nAt the first startup after flashing, **all channels must be empty**.\n\nFrom **V10.3**, the firmware calibrates empty-channel detection during first boot.\n\nIf you flashed it with filament inserted:\n- remove all filament\n- hold any one buffer for about **5 seconds** to re-calibrate\n\n# ❗ Warning for 2nd generation printers\nA lot of people make a mistake because the drawings are misleading, and it is not always clear from the diagrams whether they show the plug or the socket. As a result, Signal A and Signal B often get connected the wrong way around.\n\nIf your BMCU is not detected by a 2nd generation printer, try swapping Signal A and Signal B - but make sure you know exactly what you are doing.\n\n\n# HMS WARNING STATUS\n\nThis firmware version **triggers an HMS warning immediately after printer startup**.\n\nImportant clarification:\n- This HMS warning **does NOT block BMCU operation**\n- It does **NOT require restarting the printer**\n- It does **NOT affect printing**\n- The printer works normally despite the warning\n- The issue is **purely visual \u002F informational** (HMS icon only)\n\nAt the moment, the HMS warning is known and accepted behavior in this firmware version.\n\nIf the HMS warning in Bambu Studio annoys you:\nI made a Bambu Studio build that bypasses this specific AMS compatibility warning, so you do not see it anymore.\nOther HMS warnings will still be visible (if they happen), so HMS remains useful.\n\nhttps:\u002F\u002Fgithub.com\u002Fjarczakpawel\u002FBambuStudio-BMCU\n\n---\n\n## Supported printers\n\nCorrect operation has been confirmed on both 1st generation and 2nd generation printers.\n\n### 1st generation printers\nSupport is confirmed for 1st generation printers.\n\n### 2nd generation printers\nCorrect operation has been confirmed on:\n- Bambu Lab P2S\n- Bambu Lab H2D\n\nAt this point, it looks like it should work on all printers from both generations.\n\n---\n\n## Download\n\nPlease download ready-to-use firmware from the **\"Releases\"** section (right side of the GitHub page).\nAll firmware variants are generated there together with **.txt guides** that explain which build you should choose.\n\nStart by selecting the correct printer mode folder first (standard(A1) or high_force_load(P1S)), then choose AUTOLOAD \u002F RGB \u002F slots as usual.\n\n## Flashing\n\nTo flash any version of the BMCU (USB or TTL) on:\n\n- Windows\n- Linux\n- macOS\n- Android\n\nuse **BMCU Flasher**:\n\nhttps:\u002F\u002Fgithub.com\u002Fjarczakpawel\u002FBMCU-Flasher\n\nPrecompiled binaries are available in the **Releases** section.\n\nThe flashing process is very simple and **does not require wchisptool**.\n\nYou can flash firmware in two ways:\n\n- **Online flashing** directly from the built-in wizard (recommended)  \n  → the flasher downloads the correct firmware automatically, so you **do not need to download any .bin files manually**.\n\n- **Local flashing** using a firmware file you downloaded yourself.\n\nThe flasher also supports **Android**, so you can even flash the BMCU directly from your **phone** 🙂\n\nIMPORTANT:\n- Do **NOT** flash the BMCU while it is connected to the printer.\n- Do **NOT** connect or disconnect the BMCU while the printer is powered on (risk of damaging the BMCU and\u002For the printer mainboard).\n\n---\n\n## SOLO firmware\n\nExample file:\n\nsolo_0.095f.bin\n\nThis firmware is intended for single BMCU (SOLO) operation.\n\n- Recommended for single-BMCU setups\n- Filament retraction length: 9.5 cm\n\n---\n\n## Filament retraction explanation\n\nFilament retraction must be calculated from the end of the AMS splitter inside the printer\n(the plastic AMS part where four PTFE tubes enter).\n\nExample:\n\n- Distance from BMCU to the end of the AMS splitter: approximately 9.0 cm\n- SOLO firmware retracts the filament about 0.5 cm past the splitter\n- Total retraction length: 9.5 cm\n\nWhen calculating your own retraction length:\n\n- Always measure from the end of the AMS splitter\n- Add the required distance plus approximately 9 cm, depending on your setup\n\n---\n\n## AMS_A \u002F AMS_B \u002F AMS_C \u002F AMS_D firmware\n\nThese firmware versions are intended for:\n\n- Multi-BMCU setups\n- Longer filament retraction distances\n\nIf you want to use SOLO mode with a longer retraction, use AMS_A instead of SOLO.\n\n---\n\n## Calibration (first start)\n\nCorrect calibration is mandatory.\nWithout proper calibration, BMCU will not work correctly.\n\nThe calibration process is shown in the following video:\n\nhttps:\u002F\u002Fwww.youtube.com\u002Fwatch?v=Hn_DNzSmhuc\n\nFollow the calibration steps shown in the video carefully.\n\n---\n\n## Re-calibration\n\nYou can recalibrate the BMCU at any time.\n\nSteps:\n\n1. Remove all filaments from all channels\n2. Hold any one buffer in position for approximately 5 seconds\n\n---\n\n## Safety and usage notes\n\n- Do not flash BMCU while it is connected to the printer\n- Do not disconnect BMCU while the printer is powered on\n- Do not update printer firmware while BMCU is connected\n- Connect\u002Fdisconnect the BMCU ONLY when the printer is completely powered off (unplugged). Doing this while powered can damage the BMCU and\u002For the printer mainboard.\n\nThese recommendations are based on community reports.\nNot all failure scenarios have been tested.\n\nChanging the printer mode from AMS Lite to AMS while BMCU was connected did not cause issues in testing, but this is not recommended.\n\n---\n\n## Disclaimer\n\nYou are using this firmware and performing any modifications at your own risk.\nMake sure you understand what you are doing.\nI am not responsible for any damage, failed prints, hardware issues, or data loss.\n\n---\n\n## Before opening a bug report\n\nPlease verify the basics first:\n\n- Make sure you flashed the correct firmware variant and followed the flashing tutorial correctly.\n- Make sure you really have **BMCU 370C with Hall sensors**.\n    - The only reliable verification is to open the module and inspect the PCB.\n    - Some sellers mix modules and try to get rid of older **370x** boards - sometimes 1-2 modules in the set can be 370x.\n- If you have printer-side issues:\n    - confirm you are on the latest printer firmware\n    - do a factory reset (this often fixes weird AMS-related behavior)\n- If filament detection behaves strangely:\n    - boot the printer once without BMCU connected\n    - then connect BMCU and test again\n- Do a few real tests before creating a thread.\n  Printers can have unrelated issues (rare, but happens) - some users cannot even update printer firmware automatically and must do it via SD card.\n\n## Bug reports\n\nIf you encounter a real bug, you may report it.\nThis firmware has undergone solid testing, and no issues are expected.\n\n---\n\n# Changelog\n\n## V10.5\n\n### User-visible changes\n- Added **automatic filament unload when the buffer is lifted manually**.\n- The serial is generated from the MCU hardware UID, so devices no longer share the same SN.\n- Calibration now performs a **full NVM cleanup**.\n- Fixed the rare issue where the **system LED could blink incorrectly** on some BMCU units.\n- Fixed the **external fan issue on Bambu Lab P2S**.\n\n## V10.4\n\n### User-visible changes\n- Added support for **Bambu Lab P2S**.\n  - Verified to work correctly in real tests.\n  - The **H2 series** will most likely also work as well, because **1st generation AMS support** is confirmed there.\n\n### Fixes\n- **\"filament in use\"** flag is now cleared correctly when filament runs out during printing.\n- Added support for **retraction when the buffer is pulled up manually**, even when there is **no filament inside**.\n\n## V10.3\n\n### User-visible changes\n- Added new firmware mode: **soft_load(A1)**.\n    - Intended mainly for **A1 \u002F A1 Mini** users.\n    - Uses lower filament loading force than **standard(A1)**.\n    - Useful for some BMCU units with weaker lever springs, where stronger loading can cause clicking \u002F grinding during filament load.\n- Improved empty-channel detection calibration.\n    - The firmware now calibrates and stores the \"no filament\" detection point separately for each channel.\n    - This improves reliability on hardware variants where idle detection voltage differs between channels\u002Fmodules.\n- Improved calibration behavior:\n    - calibration now also detects and saves **Hall polarity per channel**\n    - magnet polarity is automatically detected during calibration and stored, so it no longer matters which way the magnet is inserted in the buffer\n\n### Stability and behavior improvements\n- Fixed PWM timer preload configuration on all motor channels.\n    - PWM updates are now buffered correctly before timer update events.\n- Improved AS5600 update timing.\n    - Sensor polling is now rate-limited to about **1 ms**\n    - more stable speed calculation\n    - lower unnecessary CPU load\n- Improved internal timing paths by reusing shared tick snapshots in the main motion loop.\n    - less timing jitter\n    - more consistent runtime behavior\n- Improved high-load \u002F jam timing logic during on_use.\n    - high PWM accumulation now uses **microsecond precision** instead of millisecond buckets\n- Improved motion loop time-step handling.\n    - uses wrap-safe tick delta\n    - clamps oversized time steps\n    - avoids running motor control with invalid zero-step timing\n\n### Notes\n- `soft_load(A1)` is not meant as the default for everyone.\n- If filament gets rejected because push force is too weak, switch back to `standard(A1)` and use a stronger lever spring.\n- On some A1 \u002F A1 Mini units, `soft_load(A1)` works very well and can be used permanently.\n\n## V10.2\n\n### User-visible changes\n- Fixed a problem where **filament run-out could incorrectly trigger a jam condition**.  \n  When filament ended, the motor could run continuously and eventually enter jam protection, which blocked the **automatic filament refill**.\n- Reworked jam protection logic:\n    - real filament jams are now detected separately from temporary motor stops\n    - high motor load alone no longer falsely triggers a jam\n- Improved flash persistence system (less unnecessary flash rewriting).\n- Improved ADC\u002FDMA processing:\n    - faster value updates\n    - lower CPU overhead\n    - smoother runtime behavior\n- Various timing and stability improvements.\n\n### Technical changes\n- **Filament metadata flash storage redesigned.**\n    - append-only journal instead of rewriting a full flash page\n    - each record: **40 bytes (10 words)**\n    - **CRC32 validation**\n    - **6 records per flash page**\n    - page erase only when the page becomes full  \n      This significantly reduces flash wear and makes writes power-loss safe.\n- Loaded-channel persistence reworked into a lightweight **slot log** to reduce erase cycles.\n- Added **skip-if-unchanged** logic to avoid unnecessary flash writes.\n- Simplified and optimized **ADC DMA update\u002Fpublish path**.\n- CRC tables moved to **static compile-time tables** (no runtime generation).\n- Cleanup of timing paths using **wrap-safe 32-bit timers**.\n- Several other smaller fixes and internal optimizations.\n\n## V10\n\n### User-visible changes\n- Improved spool jam handling: jam is detected immediately, the print is paused, the printer waits for you to fix the snag\u002Ftangle, then you can resume normally without ruining the print.\n\n### Flash \u002F persistence (wear + reliability)\n- State (loaded channel) persistence reworked into an append-only slot log: 8 bytes per update, up to 192 updates before any page erase (~192x fewer erase cycles vs rewriting a whole 256B page per update).\n- Filament metadata persistence reworked into a small CRC-protected log: 64B per update, 2 pages per filament (8 records) -> ~8x fewer erase cycles vs erasing a whole 256B page on every change.\n- Per-filament saves: only the modified channel is written (reduces unnecessary flash writes).\n- Power-loss safe commits: records are validated and partially-written data is ignored.\n\n## V9\n\n### User-visible changes\n- Increased filament loading force for improved reliability during filament insertion.\n- Improved filament loading behavior on some materials (e.g. **Sunlu PLA+** and similar filaments) where loading characteristics differ from standard PLA\u002FPETG.\n- Added protection against **spool jams**:\n    - Lock mode activates if the buffer drops too low during printing.\n    - Lock mode also activates if the motor runs at high speed continuously for ~8 seconds.\n    - The lock is automatically released once the buffer returns to the neutral position.\n    - Prevents prolonged motor overrun when filament movement is blocked.\n\n## V8\n\n### User-visible changes\n- Supported print resume after a printer power reset \u002F power loss (printing can be resumed properly).\n- Improved behavior for **P1S** (loading problems due to long\u002Fbent PTFE path).\n- Added AUTOLOAD support for **single-switch PCB** boards:\n    - Triggered by pressing the buffer (\"buffer tap\").\n    - Starts filament loading exactly like the external switch trigger.\n- More stable loading process overall.\n- Improved support for **low-torque BMCU** variants.\n\n## V7\n\n### User-visible changes\n- **Remember loaded filaments (persistent state).**  \n  You can load filament and safely power off the printer.  \n  This allows you to disable the automatic unload-at-end behavior in G-code (if you often print with one filament),\n  keeping filament loaded until you actually need to change it.  \n  More info here: https:\u002F\u002Fwiki.bambulab.com\u002Fen\u002Fams\u002Fmanual\u002Fams-not-unloading-to-save-filament\n- **100% solved filament loading problems.** The system is stable and consistent across hardware variants.\n- **Filament RGB colors.** Modules\u002FLEDs can display the configured filament color.\n\n### AUTOLOAD (short)\n**How AUTOLOAD works**\n- **DM (two microswitches):**\n    - Touch first switch → AUTOLOAD starts (you may need a light manual push until gears grab).\n    - BMCU feeds filament until the second switch (behind extruder) confirms **fully inserted**.\n    - Then it feeds 120 mm to make it print-ready.\n    - **Anti-snag protection:** buffer position is monitored; if the filament catches on housing \u002F PTFE edge, it retracts to safe position and retries (3 retries).\n- **Single-switch boards:**\n    - Stage 1 is manual (no second switch to confirm fully-in).\n    - Once filament is fully in the extruder, Stage 2 behaves the same (incl. anti-snag protection).\n\n### Technical changes\n- **ADC_DMA upgraded (ADC1 + ADC2 in parallel):**\n    - Regular simultaneous mode: ADC1+ADC2 scan channels in parallel to reduce noise and increase throughput.\n    - Lower noise enabled smaller filtering and faster stable readout.\n    - Full filtered update time: **~5 ms instead of ~28 ms**.\n- **AS5600 reading correctness improved** (robustness and stability of reads).\n- **Timer\u002Ftick safety (wrap safety):** all time comparisons reviewed to be correct under wrap-around.\n- Final stabilization and cleanup: overall behavior is faster and more deterministic than previous releases.\n- There were more fixes in V7 as well; easiest is to check the commit history.\n\n**Final note:** all known issues were ultimately resolved. BMCU is fully stable and significantly faster vs older firmware.\nAt this moment I do not expect any further fixes.\n\n---\n\n## V6\n\n## Framework\n- Dropped Arduino Core (PlatformIO: framework = arduino) - the whole firmware was rewritten to pure CH32 (WCH SDK \u002F noneos).\n- Direct use of hardware timers, DMA and interrupts - no Arduino delays, no random timing, deterministic real-time behavior.\n- Faster and correct flash operations (WCH Fast API) - stable writes, faster, without corrupting neighboring data.\n\n## ADC_DMA\n- Separated DMA writes from CPU reads - previously reads happened while DMA was overwriting the buffer.\n- Filter is computed in the background (DMA half\u002Ffull), not during readout - previously `get_value()` blocked CPU and broke timing.\n- Constant CPU load - previously larger filter window slowed the system down.\n- DMA error handling\n\n## BUS (BambuBus + AHUB)\n- Fixed RX\u002FTX buffer race (reading and overwriting the same buffer at the same time).\n- Snapshot-based parsing instead of working on a live buffer\n- Deterministic frame handling timing - constant CPU cost, independent from packet length.\n- Robustness against transmission errors - a bad packet does not break the whole system state.\n\n## Flash \u002F NVM\n- Flash written page-by-page (256B) instead of erasing\u002Fprogramming the whole sector (4KB)\n- Write only when data actually changed\n- Hardware CRC for flash + verification on read\n- AMS data split into separate records - changing one filament does not rewrite the whole structure.\n\n## Soft-I2C \u002F AS5600\n- Rewritten from Arduino, removed timing bugs and Arduino \"magic\".\n- Correct ACK\u002FNACK, START\u002FSTOP, recovery handling\n- Hard isolation of channels with errors\n\n## Motion \u002F mechanics\n- Smoother motor control\n- Added calibration buffers - filament stays in a neutral position, without unnecessary tension.\n- Better state transitions - no jerks and no sudden braking.\n\n## Misc\n- CRC8 \u002F CRC16 rewritten to simple C + lookup tables - faster, deterministic, no objects and no runtime init.\n- Partially de-spaghettified includes\n- and many more - firmware prepared for further development\n\n\n## Final note\n\nThis firmware started as a personal CH32 learning project.\nDuring development it grew far beyond the original scope because working on BMCU turned out to be genuinely enjoyable.\n\nMany solutions are intentionally overengineered.\nEverything was implemented primarily for personal use and experimentation.\n\nThe firmware has been used extensively during development,\nand no practical issues were observed in real-world usage.\n","该项目为Bambu Lab A1、A1 mini和P1S 3D打印机提供了BMCU 370C（霍尔传感器）固件，支持缓冲校准，并修复了所有已知问题，确保与AMS完全兼容。核心功能包括空通道检测的自动校准及对最新Bambu Lab A1固件的支持。技术上采用C++编写，保证了高效稳定运行。适用于需要高精度材料管理系统且偏好开源解决方案的专业或个人3D打印用户。需要注意的是，首次启动时所有通道必须为空以完成正确的初始化设置。",2,"2026-06-11 02:37:01","trending"]