-
Notifications
You must be signed in to change notification settings - Fork 11
Reading and writing chip memory
There are several ways for reading and writing the internal memory of the BK7252 SoC, depending on the situation and the address range we want to target.
If there is still a working bootloader in the SoC, you can try uartprog to read and write in the APP partition, if not you can try to boot into SPI mode and read/write the memory directly using something like flashrom.
Depending on the firmware running can be an option to flash the APP partition from the SD slot using an SD with the firmware file or perform an OTA update from a local or remote HTTP address.
- Depending on the PCB version, locate the UART pins RX and TX. Try checking if your PCB is already documented: https://github.com/daniel-dona/beken7252-opencam/wiki/PCB-versions,-pictures-and-pinouts
- You will need to solder at least 3 cables to the PCB: RX, TX and some GND point. You can use the USB connector shield as GND or the battery negative terminal. Note: if you are going to power the camera using an USB cable and the USB cable is connected to the same computer as your UART interface, you can skip the GND connection as it's already connected through the USB shield and negative power connection.
- Connect the cables to your UART interface or device, remember that RX on your PC goes in TX of the device and the other way around.
- To check if the connection is correct, try setting the baudrate to 115200 and turn on the camera, you will see the boot log and maybe additional messages. If you see nothing you'll need to check your connections.
- Download the tool here https://github.com/OpenBekenIOT/hid_download_py
- If this is the first time you try to flash the device, make a copy first of the original firmware reading the whole memory:
./uartprogram -l 0x1FFFFF -b 115200 -r -d [your UART device] firmware_dump.bin
You can change the baudrate to a faster one, but 115200 should work in any device even with less than ideal conditions.
7. Repeat the previous step at least 2 or 3 times and check the files are identical with md5sum
or sha1sum
Pending
Pending
Not tested
Not tested yet
Will be available in the custom firmware