Geopolitics Cheap Debug, OpenOCD, ETC.

The study into acquiring a cheap debug environment for *any* arm processor is complex and confusing. I previously wrote about using a SEGGER, but that was not ideal. The reason is cost. One can be had for about $90, but it is iffy to use as a debugger at the moment.

Skip down to Evaluation Board Trend if you are not interested in the why of the current chip shortage situation.

The “Mature” chip technology which the PSOC5 and the JLink debug probes (especially the EDU probes) are built on is in the middle of the current IC bottleneck. These “mature” fabrication created chips are the ones in short supply. Read on for why.

Geopolitics

This is partly due to geopolitics. Grownups acting like children. Neither side of any of the current contretemps are acting like adults. The CCP has stolen designs from the US for their new stealth bomber via cyberattacks, as well as having stolen information for AI development. To be fair, there is counter espionage on U.S. part too. It is the way the world works.

The US has reacted by placing embargoes on certain products into and out of China. The latest EUV (Extreme Ultraviolet Light) chip manufacturing technology is now banned to China. I am sure they are trying to get around that problem.

Couple that with a pandemic, which the U.S. Government’s own D.O.E. has stated came from a lab in Wuhan. Repercussions from this are still ringing world wide. The U.S. is not innocent in this imbroglio. There was funding from our own CDC to that lab for that type of research. Fully documented. The result for the U.S. engineers is we have many issues getting parts for the W.E. (Weekend Engineer) projects.

New and Unusual Parts

The interesting thing about the parts shortage for the W.E. is the shortages are not for the EUV chips (7nm), but for the above 28nm devices which China can easily make and export. Unfortunately, chip acquisition moves by auto makers at the beginning of the pandemic backfired.

The vehicle manufacturers assumed buying by consumers would slow. So, they cancelled orders.

The government blew this assumption by throwing helicopter money at the problem. People suddenly had excess cash. I assume many thought the lockdown would last as long as they were promised, and bought vehicles with the excess cash. They expected to return to work at a good pay rate and continue paying. The result is delinquencies for auto loans is highest in over a decade, and defaults are lagging only because not enough repossessors are out there to claim the vehicles.

That surge in sales caused a surge in chip orders to unprepared chip makers, catching them without capacity. Many of whom had idled plants and laid off workers. They have been struggling to catch up with the surge of orders ever since.

The bottleneck is not behind us, because many of the Chinese fabs are still mainly offline due to zero covid policies. Since these are “mature” IC processes, no one is willing to spend money to bring a new plant online for those mature production lines. So, a very long (3 year) shortage.

Of the parts available for any weekend research, many newly developed ones are not fully supported, making them difficult to play with. The QuickLogic QuickFeather is one of them. I bought one of those boards and bricked it. So I went looking for a debugger.

Debuggers I Had Never Thought About Much

OpenOCD. FT232H. XIAO M0 (samd21). Segger EDU / mini (neither are available). Black Magic Probe. Segger JLink. CC Debugger. Board connected stubs: (Segger-OB, STLink, KitProg, CMSIS-DAP). All of these are in use today. Some are even available for purchase. Prices vary wildly.

Evaluation Board Trend I had Ignored

If you can spend money for an evaluation board, you almost always get a debugger attached. It can almost always be broken off and used to debug the manufacturer’s other CPU’s. That is where the Segger JLink-OB comes from (OB stands for On Board). This is a great source of a debugger, manufacturer specific. This does not help with the QuickFeather, which lacks such a device.

New W.E. Debugger trend

Arm processors have taken the “mature” SOC (System On Chip) chips by storm. OpenOCD is finally fairly mature, and with work, it is supported by VSCode. (See earlier posts for debugging the PSOC5 on the Mac and Linux.)

The ARM is unique in that its SWD debug system is a 2 wire system. A clock line and a half-duplex i/o line are all that is needed. Reset can be handled many different ways, but often a third line is involved.

Blue Pill, Black Magic

The “Blue Pill” board, spoken of (with web page links) in a previous socmaker post, allows you a debug probe device that works with OpenOCD and VSCode.

DAPLink

You can create a DAPLink device from a XIAO M0 device, available from Amazon. Get the samd21 device, following the information on the seeedstudio page.

(Some of the following links have had their descriptions shortened.)

The page for programming this device is here: https://wiki.seeedstudio.com/Seeeduino-XIAO-DAPLink/ Using it to program an Arduino is here: https://wiki.seeedstudio.com/Flashing-Arduino-Bootloader-DAPLink

Daplink was used by José Morales to debug his QuickFeather Board. His YouTube video on the Quickfeather debugging is here: https://www.youtube.com/watch?v=n6j7Qh_ql2s. That video has links to his github page for the SVD for debugging the EOS S3. He used a cheap XIAO M0 board (at $4 at the time).

FTDI 232H Board

To me, the most intriguing possibility is to get an FTDI RS232 breakout board. This is possible because only two lines are required. Makes for a cheap device.

One possibility from amazon is here: https://www.amazon.com/KOOBOOK-FT232H-High-Speed-Multifunction-Module/

The web page for setting up the FT232H breakout board with OpenOCD for debugging is here: https://www.allaboutcircuits.com/technical-articles/getting-started-with-openocd-using-ft2232h-adapter-for-swd-debugging/

The OpenOCD website has a lot of text on hardware configurations: https://openocd.org/doc/html/Debug-Adapter-Configuration.html

Fini

Enjoy!

Add a Comment

Your email address will not be published. Required fields are marked *