Gissio / radpro

Custom firmware for Geiger counters/radiation meters (FS2011, Bosean FS-600, FS-1000, FS-5000, FNIRSI GC-01)
MIT License
162 stars 20 forks source link

HFS-P3: Support #12

Closed ihrapsa closed 4 months ago

ihrapsa commented 10 months ago

image This is a cheap little pen-like radiation detector/dosimeter from China that apparently could benefit from a lot of firmware improvements:

Here is a nice an thorough review of it.

MCU: ARM Cortex-M0 FM33LC043N MCU from Fudan Micro Sensor: HH614 GM Tube Battery: 150mAh LiPo cell - 50h promised

Click for internal pics: PCB layout [from radmon.org forum] ![radmon_pic](https://radmon.org/media/kunena/attachments/344/20221121_200710.jpg) SWD pins layout under the battery tape [from radmon.org forum] ![](https://radmon.org/media/kunena/attachments/344/HFS-P3Headerpinout.jpg)
ihrapsa commented 3 months ago

Sorry for reviving this but I managed to dump the firmware of this device. SWD port is not locked as previous thought. I used a J-Link device (actually a ST-Link V2 clone flashed with J-Link using STLinkReflash) and I managed to dump it with J-Link Commander as well as with Keil µVision V5

For J-Link Commander I dumped it with    savebin C:\Users\jonah\Downloads\HFS-P3_dump.bin, 0x0, 40000

J-Link Commander Screenshot ![image](https://github.com/Gissio/radpro/assets/40600040/88ce66c4-4d45-4c5c-b9ed-b7c594cd86c9)

For Keil µVision V5 I dumped it with SAVE HFS-P3_dump.hex 0x0, 0x3FFFF Then converted the Intel HEX-386 file format to binary using hex2bin.exe

Keil µVision V5 Screenshot ![image](https://github.com/Gissio/radpro/assets/40600040/59549bb8-0b90-4d64-a939-eb4e3349cced)

HFS-P3_dump.bin.zip

Also, here is the datasheet in English: FM33LC0xx_Datasheet_EN.pdf

Gissio commented 3 months ago

The FM33 is quite different from the STM32. This would require a lot of time and motivation, which I currently don't have.

ihrapsa commented 3 months ago

I can understand that. Thanks anyway! 🙂 In the meantime I found some interesting developing sources for FM33LC0xx here on GitHub. In case anyone else is brave and knowledgeable enough to hop on this I'm willing to help with testing.

https://github.com/xdu-aero-association/FM33LC0XX_Example_0.04 https://github.com/SoCXin/FM33LC0

PS. I also posted all this in that radmon.org post as well since that’s where this thing started

Gissio commented 3 months ago

One more thing... could you test #97?

ihrapsa commented 3 months ago

One more thing... could you test #97?

Will sure do!

ihrapsa commented 1 month ago

[UPDATE]

I manged to trace the board and create a schematic. 🥳 Thanks to a lot of resources online I manged to build a base project (Keil uVision IDE) and control the OLED (over bit-banged I2C) and LEDs. All other GPIOs are mapped and can be controlled as well.

Not sure how to go about sensing the tube counts and all the extras (menu creation, calibration, battery management, internal temp sensor etc.).

I made a GitHub repo with the current state of the IDE project and all the resources I used. https://github.com/ihrapsa/HFS-P3_DevKit

Any help would be really appreciated!