Post by john larkinPost by Michael SchwingenThose are huge. For SWD, I really like the 10-pin Cortex-Debug connectors
(1.27mm pitch). Or a minimal 2*3 pin 2.54mm header.
The half-pitch 20 wire ribbon cable is just 0.5" wide. The box
connector on the target board is just a bit wider. That's not bad.
I plan to use all 20 wires, so I can do the CPU debug and check power
supplies and clocks and stuff, and snoop code execution times.
Ah, OK - I had assumed this was the standard ARM 20-pin 2.54mm connector.
Post by john larkinPost by Michael SchwingenWhat are these for? I would wire a BSS138 to a free GPIO to automate that.
However, when using SWD, you should not really need them.
Pushing the buttons can set the 2040 into USB memory-stick mode, to
access the flash. That could be handy.
Hm. I would assume you use SWD if you have it available - that should be
better for scripted/automatic flashing since it dows not need to wait for a
simulated USB stick to appear and be mounted.
Post by john larkinI think I'll do both, allow the buttons and a couple of Pi400 port
pins to ground RUN and BOOT.
That sounds good.
Post by john larkinDo you know if there is a way for running software to essentialy reset
itself and enter the USB flash-stick mode? That could be handy for
field code upgrades.
Sorry, no - I have some here, but beyond doing some simple tests, I have not
looked into the details. I would guess yes - entering the bootloader for
upgrades is possible on almost any microcontroller I have used in the past.
However, for field upgrades, you should ask yourself if the stock bootloader
is the right thing to use if the upgrade is done by the end user - I would
recommend to use some kind of bootloader that is specific to your product
and makes sure that only correct files that are intended for this exact
board can be uploaded. On our devices, the firmware file has a header with
the device name in it, and the bootloader checks that (plus checksums and a
signature) before allowing an upgrade.
If the field upgrade is performed by trained technicians, the stock
bootloader may be OK - but keep in mind that flashing the wrong file may
damage the hardware (for example by setting pins to output mode that should
be inputs), unless you plan ahead for this scenario and design the hardware
so that it is robust against this kind of abuse.
cu
Michael
--
Some people have no respect of age unless it is bottled.