For a garbage guy, visiting the seafood market every day is an essential part of life. No, my hand shook and I swiped another electronic price tag from Tofu .
The price is reasonable, 2 yuan each without free shipping , so I bought N pieces directly. . . I calculated it and got a 3.5, and then took it to the group to show off, but the group members got a few points. Let’s get to the point and break it down:
This is probably the best price tag to disassemble, and it can be installed and restored directly without damage.
Let’s take a look at the screen model first: E029A01
This screen model has adaptability to the firmware whether it is lightly snowing, whether the hay is drying, whether it is half asleep in the pond, or whether it is a big man spreading garbage trucks, so this visit to the seafood market is worth it.
Let’s take a look at the motherboard:
Wow, it’s Renesas’ DA14585 . This chip is very popular in BLE Bluetooth . Xiaomi Mi Band also uses this chip as the main control, and other major manufacturers also use it, so the information should be OK. I downloaded it first. Data sheet, open the manual and take a look:
There are these two pins inside, and it seems that it can be hacked. Since I don’t have a convenient JLINK at hand, I bought a JLINK-OB and TTL:
While waiting for them, first use a multimeter to measure the relationship between several metal contacts on the board and the chip. This is directly shown in the picture and data:
DA14585 chip debugging uses related ports:
TP4 → RST
TP2&TP10 → GND
TP8 → P0_5 (RX)
TP7 → P0_4 (TX)
TP1&TP9 → VBAT 3V
TP3 → VDD
TP6 → SWDIO
TP5 → SWCLK
Ink screen interface:
BUSY → P2_0
RST → P0_7
DC → P0_5
CS → P2_1
SDI → P0_6
SCK → P0_0
PED_POWER → P2_3
Flash IO port:
D1 → P2_5
OK, JLINK-OB has also arrived at this time, let’s connect it:
Then I use the software, basically I use these 3
smartsnippets_toolbox_v5.0.10.2434_windows
Keil 5.36
UartAssist.exe
After installing Keil and smartsnippets_toolbox, you need to copy the JLINK-OB PJ tool provided by the merchant to the corresponding directory; the merchant will give you several files to replace and crack, and then we use the everything method to find these files to replace. Just replace Just install it in the installation directory of SmartSnippets Toolbox v5.0.10 and KEIL. The path is as shown below:
TTL is rarely used later because JLINK-OB can take over all the work, so TTL is only used to read the debugging information output log. We first open DA's SmartSnippets Toolbox v5.0.10 tool, and then connect the black price tag board on JLINK-OB+. We need to solder the wires.
Click NEW
Enter a name, whatever you want, then click SAVE
Check the JTAG ID 123456 and chip DA14585-00, and then click OPEN
After entering, the blue log indicates that there is no problem, then click 1 and then 2 to view the OTP table.
In fact, I had misunderstood the OTP table when reading the data sheet and other tutorials before, so let’s click 2 to take a look first.
At this time, the OTP table has not been loaded yet, so I need to click connect, so I clicked and witnessed the strange moment.
Perfect, the log is still blue . If there is a red log, there is a way, don't panic. One is to use the yellow REST line to touch the red VCC line and let it REST, because it is a high level reset. , so touch it for one, two, three seconds or something, then disconnect JLINK-OB and plug it back in, basically it’s fine.
Or you can not unplug it first, perform REST for 3 seconds, and then click connect to try. I have basically tried this and it works. If it really doesn't work, check the offline problem. The Dupont cable will wither after being plugged in too many times. Just replace it and it will be fine. There is also JLINK-OB. The GND of the JLINK-OB I bought is actually soldered. As a result, every time I move the GND cable, the PC will constantly make the sound of USB plugging and unplugging. , so you see my JLINK-OB is naked, but actually the TB comes with a heat shrink sleeve when I buy it. . . So, I took off the heat shrink tube and took a look. I found that the GND side was welded weakly. I fixed it myself. Now it is stable and there is no red alarm log.
Continuing with the previous step, after clicking CONNECT, you can see that the OTP has been written (the first and second lines show YES). At this time, does it feel like a thin blue mushroom? Feel like you're at a loss?
Click Read From memory again to see if anything strange happens.
when. . . Gah! OTP still displays YES. If it is not OTP, it should display NO.
So I went to the seafood market and bought some boards without OTP (I wanted to blow off the ones without OTP and weld and replace them with the DA14585 chip with OTP on the board). The order has been placed. The boss is nice and he is a long-term ink screen player. , tell me, it can actually be used even if it is OTP. . . Nari? ? ?
But you still have to be kind. I bought the ticket and paid some tuition. So when I didn’t get the OTP board, I started researching again. Combining the materials and information given by my brother, I re-understood OTP;
In fact, the OTP part depends on the character of the manufacturer. OTP means one-time writing , and it cannot be changed after writing. So the English translation is one time program, but such a good chip is not designed to How about this? Therefore, DA14585 provides a little trick (secondary startup); that is, if you don’t want others to use it, write the program and generate the binary directly into the OTP, that is, write your own APP in the OTP and start it. (one startup), it will be loaded and started directly into the OTP; but if you want to use it again for development, you cannot directly write the APP in the OTP, so what should you do? Then burn a secondary boot BOOT program in the OTP. This secondary BOOT is combined with the external SPI-Flash to boot. The program APP can be burned into the external SPI-Flash (so the APP can be flashed into the SPI multiple times). However, the secondary BOOT has been solidified into the OTP; that is to say, if the secondary BOOT is burned in the OTP, it can be used multiple times. Then you can continue to play with this chip without fear of being OTPed. Restrictions cannot be used. So the general process for picking up missing OTPs is (the process on the right is the only one that picks up missing OTPs):
So why I mentioned the OTP part above depends on the character of the manufacturer;
So the understanding of OTP actually depends on what program is installed in the OTP of the chip you buy. If it is a secondary BOOT program, you will be happy. If it is a normal APP program, you will buy it. However, secondary BOOT program manufacturers generally go directly to the DA official SDK to compile or directly use the officially compiled HEX files. They are basically official standard codes, so you can also download Renesas’s. Looking at the SDK of DA14585X, there is secondary BOOT code in it. So, what should I say? How to judge whether there is a secondary BOOT or APP written in the OTP? I can’t identify this for the time being. Anyone who knows can teach me, thank you! Then we continue. Since the flow chart says that if the OTP is flashed into the secondary BOOT, the SPI-FLASH should flash the APP, so we write an APP and burn it to the SPI-FLASH to see if it is enough? OK, before we start, let's first see if SPI-FLASH can be read. Click on the red box to enter the SPI-FLASH interface.
Connect successfully
Then read 32K and see, click the Read 32kb button
It seems that this place can be read and erased, so let's start writing a flashing code first.
This board can actually be used as a development board, because there is a space reserved for soldering the LED light on the board. After testing, it is connected to the P2_5 pin of the chip, so the light can be flashed and walked.
Let’s take a look at the board comparison pictures first. One is the one where I didn’t weld the light, and the other one is where I welded the light. On the other side, I added a 600 ohm R4, and the LED was welded to D1 using 0603 old material. The upper board is mine. After welding, the picture below is a comparison of the original without welding R4 and D1.
OK, first go to the official website or other channels to download DA's SDK. I used SDK_6.0.18.1182.1, which comes with the blink project. The path refers to the file path below the picture:
flash code
We need to make some modifications here. Because we want to flash the light, the pins must match. First, let’s take a look at the LED_PORT and LED_PIN in the code.
The good guys are 1 and 0, so they can’t match our P2_5. The Port in the code is P and the underscore 5 is the PIN, so the codes corresponding to P2_5 are GPIO_PORT_2 and GPIO_PIN_5. Change it !
By the way, take a look at the serial port P0_4 above. This matches our black board, so there is no need to change it.
Select project DA14585 and click Rebuild
The build was completed quickly, basically no errors were reported, and the bin file was properly generated.
Then let's DEBUG to see if the light flashes. First, set up JLINK.
Click the magic wand - switch to the DEBUG tab page USE select JLINK, then click Settings
If you have plugged in JLINK-OB and replaced the DLLs and EXEs provided by the merchant, this information will be displayed here:
No need to move, just click OK, and click OK on the outside one. Then we start clicking the DEBUG button
Don't worry about the assembly page, just press F5
After pressing F5
Perfect success shines.
In this section, we just get familiar with the development environment and light up the lights . Interested students will pay attention and wait for our update in the next section.
Regarding the learning of Ink Screen, I hope you will enjoy it. We will open source more open source and fun projects step by step.
Recommended in the past
Brother Lao Yu takes you to play with ESP32 : 05 ADC is too simple to use.