D1 Clones
Posted: Wed May 20, 2020 2:39 am
Hi All,
A friend of mine showed me uPython on the D1 Mini and I was very impressed. I bought a pack of 10 on AliExpress and have used them in many things. I got a Wio Link from Seeed Studio and put the generic build on it and it has issues, the repl comes up but it randomly resets. To debug that I got spun up on building from source. Since I was down to my last D1, I ordered 10 more from another vendor. These were similar but didn't have a metal can over them like the first ones I bought did. They also report a flash of 4M with a vendor of 0xEF. Looking at the chips they are marked BoyaMicro, which makes a 4M flash but reports a different vendor ID. I started putting the current build in these boards and no REPL, the serial port just spews junk and then stops. I used the same image in my older D1 and it comes up fine (t reports a Winbond flash and the flash ID seems to match). Trying to see if my new clone boards were functional at all I threw them on the Arduino IDE and loaded blink into them, that seems to work fine.
So there are *LOTS* of things going on clearly. I'm in the process of working to eliminate unknowns. I'm an EE/CS engineer that has done embedded programming for several decades with a fully equipped lab including SMT rework capability and a microscope. So I've got the tools and the chops to debug this down to the component level if necessary. I am also fully aware of the kinds of games these no-name Chinese board vendors play to be a few cents cheaper than the next guy.
But BEFORE I dump 20 or 30 hours into doing component swaps or what not. I'd be interested in thoughts on where to start in terms of looking at these systems programmatically. JTAG seems to be out of the question but esptool.py and the Arduino IDE both seem capable of loading arbitrary software into the flash and from the blink example it seems to work. My target is to get Micropython running on all these boards (not a big fan of the Arduino IDE / Wiring model). I had already started digging into the code to see what was what with the Wio Link but being able to hack on these $3 D1 clones is even better (well about 5 times better since a Wio Link board goes for $15 ).
UART1 TX works as expected under the Arduino IDE, and I the IDE lets me load programs and run them, so the current plan is to test FLASH then each of the GPIOs. Assuming that all the hardware works, the question will become "Where is the CPU initialized in the Micropython port and what configuration file controls the configuration options?" I noticed that the Arduino IDE runs things at 80 MHz, does python? Or does it try to run at 160MHz by default? Etc. I'm treating this as a bringup exercise for unknown hardware with a known good hardware example. Ideally the core differences will be isolated quickly and I'll be able to contribute something useful to this community.
--Chuck
A friend of mine showed me uPython on the D1 Mini and I was very impressed. I bought a pack of 10 on AliExpress and have used them in many things. I got a Wio Link from Seeed Studio and put the generic build on it and it has issues, the repl comes up but it randomly resets. To debug that I got spun up on building from source. Since I was down to my last D1, I ordered 10 more from another vendor. These were similar but didn't have a metal can over them like the first ones I bought did. They also report a flash of 4M with a vendor of 0xEF. Looking at the chips they are marked BoyaMicro, which makes a 4M flash but reports a different vendor ID. I started putting the current build in these boards and no REPL, the serial port just spews junk and then stops. I used the same image in my older D1 and it comes up fine (t reports a Winbond flash and the flash ID seems to match). Trying to see if my new clone boards were functional at all I threw them on the Arduino IDE and loaded blink into them, that seems to work fine.
So there are *LOTS* of things going on clearly. I'm in the process of working to eliminate unknowns. I'm an EE/CS engineer that has done embedded programming for several decades with a fully equipped lab including SMT rework capability and a microscope. So I've got the tools and the chops to debug this down to the component level if necessary. I am also fully aware of the kinds of games these no-name Chinese board vendors play to be a few cents cheaper than the next guy.
But BEFORE I dump 20 or 30 hours into doing component swaps or what not. I'd be interested in thoughts on where to start in terms of looking at these systems programmatically. JTAG seems to be out of the question but esptool.py and the Arduino IDE both seem capable of loading arbitrary software into the flash and from the blink example it seems to work. My target is to get Micropython running on all these boards (not a big fan of the Arduino IDE / Wiring model). I had already started digging into the code to see what was what with the Wio Link but being able to hack on these $3 D1 clones is even better (well about 5 times better since a Wio Link board goes for $15 ).
UART1 TX works as expected under the Arduino IDE, and I the IDE lets me load programs and run them, so the current plan is to test FLASH then each of the GPIOs. Assuming that all the hardware works, the question will become "Where is the CPU initialized in the Micropython port and what configuration file controls the configuration options?" I noticed that the Arduino IDE runs things at 80 MHz, does python? Or does it try to run at 160MHz by default? Etc. I'm treating this as a bringup exercise for unknown hardware with a known good hardware example. Ideally the core differences will be isolated quickly and I'll be able to contribute something useful to this community.
--Chuck