-
Notifications
You must be signed in to change notification settings - Fork 47
B2A laser rangefinder modules
PCB of the module is marked as B2A.
PCB is similar to U85x modules, but MCU is changed to STM32G041K8?
PLL was changed from "SI5351A" to "GRANDMICRO GM5351". This IC is NOT compatible with SI5351A in I2C protocol. I can't find Register Map documentation for it, so I had to implement chip init and configuration using logged i2c data.
This is why I can't use my own frequencies and need to use frequencies from original firmware.
B2A version is designed to be powered from Li-ion battery with 3.7-4.2V, and MCU of this module is powered by linear 3.3V LDO.
Power consumption with my "Firmware_dist_calculation_simple" code is near 70mA.
Specific attribute of such modules: they have rectangular lens at the photodiode!
You can find some information about reverse engineering this module here:
https://github.com/iliasam/Laser_tape_reverse_engineering/tree/master/PCB_photos/module_B2A
I did not draw schematic at this time.
Firmware (including HEX files) is placed here: https://github.com/iliasam/Laser_tape_reverse_engineering/tree/master/Code/CortexM0_STM32G0
This module can be reprogrammed in with a special programmer (like St-Link).
Looks like that STM32 UART bootloader is disabled at the factory.
B2A module requires +3.7-4.2V as VBAT.
You can connect power lines (VBAT, GND) to the bigger pads at the PCB, which are used to connect battery.
Notice that original factory firmware is protected from reading, so you can erase and rewrite it, but you can't restore original firmware!
Connect "PWRON" line to VBAT line - to power on module.
You need to connect SWDIO, SWCLK, GND to your programmer (ST-Link for example).
I was able to erase original firmware using cheap ST-Link clone. NRST was not needed for that.
I think that the best way for erasing original firmware and removing protections is to use "STM32 ST-LINK Utility" as described here: https://www.hackster.io/iliasam/making-a-cheap-laser-rangefinder-for-arduino-4dd849
D30 laser tape measure: