Play with Bluetooth ink screen electronic tags (1) Light up

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 .

71358714efed7d40104ac7f545e477be.png

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:

6e18c00725e64bf38b44a087d416ced3.png

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

fdbc5bedd1c39f41eff27a029c167dd2.png

a2779f4a8fe720db8e048d2bfc1caa44.png

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:

87976d12a34c6555095319b19e2a2fa6.png

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:

a687dfaff660ef9995223d65cd9deb28.png

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:

7c989f80ee28ebb0601b1fa16e6792a7.png

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

15cc254ef213d9144eb4057c8a284b96.png

OK, JLINK-OB has also arrived at this time, let’s connect it:

5fa77639db403e16ae827c52eac25167.png

Then I use the software, basically I use these 3

  • smartsnippets_toolbox_v5.0.10.2434_windows

  • Keil 5.36

  • UartAssist.exe

4a4ca7e7f7cbb000b01b2ed14c0c6ba0.png

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:

b8710e068dcd3da8571fd133d20b93a8.png

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

01f19cd6b4db3f34991251374e0d381c.png

9d5b64d33ee71b2a4296d4431d729623.png

Enter a name, whatever you want, then click SAVE

3a2600a42d91a6b180677c79b937e251.png

Check the JTAG ID 123456 and chip DA14585-00, and then click OPEN

b1186c22ce3fd866aab2cba2218c5bbf.png

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.

548a7e3a972f24d0a3506c0f186226b9.png

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.

7ae7f53a328a1e5f2ecc2374588cd4f1.png

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.

813e1b4df28bc158b39be0c41a6314de.png

when. . . Gah! OTP still displays YES. If it is not OTP, it should display NO.

09d290375240a63ac4fa1b6c927f220e.png

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):

2d46f237a1e49e5f26051ef33d9a4311.png

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.

c1ec8fe7f2429c414f99d9a8bd756da9.png

495779bc399ee4d8c325e0ba6bef15fd.png

Connect successfully

71ec7e7c219d90a5ea32f083e7b0e68e.png

Then read 32K and see, click the Read 32kb button

a142283cc7e2b92d41acbe8c64182b40.png

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.

ecd294175fd89acdf9c030f770486a65.png

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:

76a61577c99baf0cb8d82a9a1626eb4f.png

flash code

57bb4a4d353e48ae6d82eda05094d8f8.png

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.

97638a02179c00720eb1759517e8c66c.png

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.

a0fe1cfa44dc57f37d0dd556ded13e8f.png

Select project DA14585 and click Rebuild

f217abb1cdfb40737ff37b54add14fe2.png

The build was completed quickly, basically no errors were reported, and the bin file was properly generated.

455ccdfedd957ded298a5356f9bd6e20.png

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

dd4d26782c775bb8806600f22f8a5c3f.png

If you have plugged in JLINK-OB and replaced the DLLs and EXEs provided by the merchant, this information will be displayed here:

3d88da72546c3b3c0f6d8fcaff3d9f8f.png

No need to move, just click OK, and click OK on the outside one. Then we start clicking the DEBUG button

bf7425f71a4b1247517993e9376fa1fb.png

Don't worry about the assembly page, just press F5

2484fccd61e490f20fe3e698e24c0678.png

After pressing F5

00da28dc71939e17f8337d52a21867aa.png

62ccc028306bf021ee3e88a65aa591a9.png

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

6f56580c58babc9c0cb2a218e2c87b31.jpeg

Brother Lao Yu takes you to play with ESP32 : 14. Make a two-way communication wireless remote control yourself (1)

6d992f2ec1d3b8bfcf717eccb5892f5e.jpeg

Brother Lao Yu takes you to play with ESP32 . The 12 basic tutorials have been updated. Next is the advanced tutorial.

49fff6c234f0c1df745e64a90a86008a.jpeg

Brother Lao Yu takes you to play with ESP32 : 05 ADC is too simple to use.

eb79c941cab5d67eaeaee8e533c675fe.jpeg

Brother Lao Yu takes you to play with ESP32 : 02 Use VSCode+PlatformIO to build a development environment

Guess you like

Origin blog.csdn.net/karaxiaoyu/article/details/133154027