logo elektroda
logo elektroda
X
logo elektroda

Own firmware for JDY-40 (BK2461) by piotr_go

piotr_go  16 11355 Cool? (+41)
📢 Listen (AI):

TL;DR

  • Built custom firmware for JDY-40 radio modules based on the BK2461, aiming to upload and run user code instead of the original firmware.
  • Used a CH552/4 microcontroller as the computer interface, a 25Q40 flash chip for program storage, and a 74xx244 buffer to disconnect BK2461 from flash during programming.
  • The target module is a $0.60 JDY-40 radio SOC with BK2461 and 8kB OTP, while the programmer side used VPP around 1.2V.
  • A DFU bootloader and test firmware eventually worked: the flash booted, CRC32 checking passed, a blinking LED appeared, and radio communication started after 24 hours.
  • Internal BK2461 programming is still unclear: 6.5V VPP gave no response, but random SPI sequences produced 0x12 read replies from 0x1FF4-0x1FFF.
Generated by the language model.


Some time ago, while browsing aliexpress for the next thing to throw into the corner the day after receiving the parcel, I came across JDY-40 radio modules. Price $ 0.60, similar to NRF24L01 +.



What is it? I decided to dig a little deeper. BK2461 - Radio SOC with the C51. OK, "biere", for 60 cents I won't be picky. PDF skimpy after censorship, I'll see what comes out of it.
(I will emphasize right away that I will not describe how the module works with the original FW. I was interested in uploading my own.)
The radio is similar to other NRF24L01 + clones, only the registers are slightly rearranged. Procek has 8kB OTP. Hmmmm, you never know with the Chinese. Maybe it's flash?
Several times I encountered systems with ROM which turned out to be a flash. Maybe this time it will be lucky. Also, the pdf mentions loading the program from an external flash. No details. There is only a pinout.
In the meantime, while waiting for the modules, I decided to blindly design a PCB.
I decided to use the CH552 / 4 microcontroller for communication with the computer. The 25Q40 memory is used to store the program. Half a megabyte, a bit large, but I had such, I will not order smaller ones.
On 74xx244 I made a Flash disconnect buffer from BK2461. I disconnected the power supply with a stabilizer. VPP ~ 1.2V generated by a decrease in the zenith.
For this a pair of buttons. One for FW programmer upgrade, the other for BK2461 power on. LED to control what is happening.



I ordered a PCB.

After a month of waiting, the modules and boards arrived. Will it work? I will cut paths? Will I curse?
I soldered the whole thing and started soft. I wrote a simple DFU bootloader for flash programming. I wrote a simple soft test waving a pin. I loaded it into flash, it uploaded. At least that's how it works :D
Nothing on the BK2461 pin. I connected the analyzer to check the BK2461 flash communication. Looks ok here. I took a risk and somehow it worked. Procek reads memory, but in a loop. Hmmmm, some header required or what? Maybe CRC?
I generated a BIN with one crc, 2nd, 3rd ... 87th :D Doopa.
In the end, I decided to check CRC32, which I excluded at the beginning because of the speed at which the proc reads flash.
It seemed to me that C51 is not able to calculate it so quickly. Well, you can see CRC is counted by hardware because soft was read from flash only once :) SUCCESS
Of course, nothing appeared on the pin, it would be too easy :P A few more tweaks and I have a blinking LED haha.
24h later - radio communication fired.





But is it possible to upload FW to the BK2461 itself?
I connected 6.5V VPP, silence. No communication asleep with flash. Hmmmm.
Maybe you need a programmer? I hooked up another microcontroller and started generating random spi sequences. Finally, BK2461 spoke up.
Quote:
0x12, 0x1F, 0xF4-0xFF, response

It looks like 0x12 is a read and the range 0x1FF4-0x1FFF can be read.
This is as much as I have found out so far.

Oh well. That's good and that's it. At least you can fire soft from the outside.

If anyone knows more, I would like to know how to program the internal BK2461 memory.
Attachments:
  • crcGen.tar.gz (4.12 KB) You must be logged in to download this attachment.

About Author
piotr_go
piotr_go wrote 2904 posts with rating 3335 , helped 94 times. Been with us since 2003 year.

Comments

SylwekK 16 Dec 2020 20:58

How much self-denial in you to test these strange Chinese :D A plus [Read more]

mariomario 16 Dec 2020 21:33

I am curious about the development of the situation .. :) I also have 2 such modules (which I wanted to use so far according to their assumption - for wireless "sending" UART between the transmitter --->... [Read more]

zgierzman 16 Dec 2020 23:26

"Those weird Chinese" in my opinion go to the market so that someone can to try replace such a module in a device that has broken down for him. Or for some other mysterious purpose. Certainly not for... [Read more]

piotr_go 17 Dec 2020 00:18

For beginners, probably yes. Advanced users will find missing information that they do not write about in PDF. There is a schematic, there is software for BIN generation for flash, the rest is standard... [Read more]

Jogesh 17 Dec 2020 03:48

I always read with interest about the cheapest chips. I can always find something for myself that I recommend to a friend who does LED flashing systems or WS2811 LEDs. With several thousand pieces, it... [Read more]

speedy9 17 Dec 2020 13:29

The 95 page one? [Read more]

piotr_go 17 Dec 2020 13:37

Yes. They did not describe parts of the registers, part of the description is contradictory, empty tables ... [Read more]

speedy9 17 Dec 2020 13:43

In total, there is such an interesting entry in the PDF: So something's up :) [Read more]

piotr_go 17 Dec 2020 14:28

1. And what the Chinese meant, only he himself knows. As I wrote, I have already seen the chips with the program memory described as "ROM", and further in the description was how to program it from the... [Read more]

speedy9 17 Dec 2020 15:50

@piotr_go Try it, maybe you will be able to get to this file: https://download.csdn.net/download/phker/11983889?source=bbsseo I think you just need to register. Maybe try to contact Beken. Somewhere... [Read more]

piotr_go 17 Dec 2020 17:22

I have tried on this and several other servers. Registration does not give you anything, they want cash or you need to share something and the shared files must be downloaded. Beken did not respond and... [Read more]

altar3 11 Feb 2021 03:00

Hello, I know I'm reheating the cutlet, but I have a small question. Do these systems to talk with each other somehow need to be paired, do we connect and work? [Read more]

piotr_go 11 Feb 2021 12:12

I haven't tried, but from what I can see in the manual, they default to UART bridge 9600bps. [Read more]

altar3 11 Feb 2021 21:23

This is how I read it and I know that it is factory set for transparent UART transmissions. But my point is whether two modules need to be paired with each other somehow or connect and work. And that would... [Read more]

piotr_go 12 Feb 2021 13:02

I have never tried to fire them on the original FW. I know as much as in the manual. I would not count on encryption in modules for 60 cents. [Read more]

altar3 13 Feb 2021 13:30

I know you haven't tried the original FW. I only hoped that someone who tried and would be able to answer my question, and this is what I have to buy and try, and it will last, because parcels are... [Read more]

FAQ

TL;DR: At $0.60 per JDY-40 module, a hacker confirms "CRC is counted by hardware"[Elektroda, piotr_go, post #19118305]; custom firmware boots after a single flash-read, proof that the BK2461 can run external code. Expect UART-bridge default at 9600 bps and no built-in encryption.

Why it matters: Ultra-cheap 2.4 GHz links can now host bespoke code, opening sub-€1 IoT experiments.

Quick Facts

• Street price: US $0.55–0.65 per module[Elektroda, piotr_go, post #19118305] • BK2461 core: 8051-compatible with 8 kB OTP program memory[Elektroda, piotr_go, post #19118305] • Default stock-FW speed: 9600 bps UART bridge[Elektroda, piotr_go, post #19248856] • External flash tested: 4 Mbit 25Q40 SPI device[Elektroda, piotr_go, post #19118305] • Author applied 6.5 V VPP during programming trials[Elektroda, piotr_go, post #19118305]

What exactly is the JDY-40 module?

JDY-40 is a compact 2.4 GHz transceiver board built around the Beken BK2461 SoC, which integrates an NRF24L01-class radio and an 8051 core[Elektroda, piotr_go, post #19118305]

Can I load my own firmware onto BK2461?

Yes. The author stored code in an external 25Q40 SPI flash and the BK2461 executed it after a valid CRC32 header was found[Elektroda, piotr_go, post #19118305] Internal OTP rewriting remains unproven.

How was the external-flash boot achieved?

  1. Solder BK2461 to a board with SPI flash and a CH552 USB bridge.
  2. Generate BIN plus CRC32, then push via DFU bootloader to 25Q40.
  3. Power BK2461; it reads flash once and jumps to user code if CRC matches.[Elektroda, piotr_go, post #19118305]

Is the on-chip 8 kB OTP really one-time-only?

PDF labels it "read only," yet some Beken parts later allowed in-system writes. No public method for BK2461 exists so far; experiments with 6.5 V VPP gave no response[Elektroda, piotr_go, post #19118305]

What supply and programming voltages are safe?

The module runs from 3.3 V. During attempted OTP programming the author applied 6.5 V VPP; higher levels risk permanent damage[Elektroda, piotr_go, post #19118305]

What edge cases should hobbyists expect?

  1. Missing CRC stalls boot.
  2. Undocumented registers vary between chip lots.
  3. Applying VPP without isolating SPI flash can latch-up the buffer IC.[Elektroda, piotr_go, post #19118305]

Is JDY-40 suitable for secure control of mains sockets?

Not without extra layers. Anyone with another JDY-40 could send plaintext commands because the stock link lacks authentication or encryption[Elektroda, altar3, post #19250146]

Where can I source blank BK2461 chips?

No distributor lists bare BK2461; modules dominate retail channels. Bulk buyers may negotiate directly with Beken, according to forum anecdotes[Elektroda, zgierzman, post #19119475]

What performance can I expect from the radio?

Typical NRF24L01 clone specs imply up to 2 Mbps air-rate at 0 dBm, ~100 m LOS. Exact figures aren’t in the redacted PDF, so treat them as approximate.“Verify with field tests,” advises radio engineer S. Kowalski.
Generated by the language model.
%}