I'm trying to read out the firmware of a ZBS242 which is a microcontoller based on a 8051 structure. The controller is the brain of an older electronic shelf labeling unit and controls radio and display functions.
Actually the system has already been analyzed and documented, but as I do have another hardware revision with another screen controller, the intention was to compare the hex-files and search for differences.
The controller does have 64k flash, but if I try to read out everything with my code (read_flash()),
I get ony values from 0x00 to 0x8C - then everything stops.
So I actually don't know if the problem is caused by my code or the lack of understanding of the 8051 structure.
The connection gets established and I can read and write SFRs and so on (at least the serial output says so), but by using the method of reading out 1 to 65535 with sending low and high bytes I only get to 8C
So then in second attempt I tried to use another way (read_flash_new()), using the on-the-air upgrade functions
in the code documentation, where the code gets read out and gets buffered in the "xdata" of the MC.
I tried to keep to the documentation here, but I had some serious problems to convert the C code for the MC
in the SDK to arduino.
Might someone be able to have a look and maybe an idea what I am doing wrong?
Here is my code.
Please excuse the spagetthi coding