Hi,
Just building a system with teensy 3.2/pressure sensor (MS5611) and SD card - to fit inside a Kinder Egg, and fly on MarsBalloon (http://marsballoon.com/). Its where we give school children a chance to fly experiments on a weather balloon, with the constraint that the experiment needs to fit in a kinder egg ...
Anyway I developing code on mbed - as I'm familiar with that set up, have a few hassles bringing up a UART across the usb interface for debugging. That was when I noticed that the teensy wires up the usb device different from many mbed devices. Often there like teensy boards have two arm cpus on, one the target, and one for programming. My other freedom card has a target UART connected to the programming cpu, and that cpu runs the code that puts the uart in a usb-otg gadget.
Now on teensy, the usb d+ and d- go straight into the target cpu (m4), indeed the programming cpu (m0) the only input it has into it seems to be the reset button. So how does it program the m4?
Next clue, the M0 is wired into pins PTA0-3 on the M4, these are the M4 jtag/cjtag/swd pins. So it looks like all the m0 can do to program the m4, is write a program direct to the M4 RAM. That program brings up halfkey on the USB, and writes it to flash. The crux being that it must run on the M4.
Whats interesting is that the M0 is doing this via the debug pins. on the M4. So I got to wondering - can a more general JTAG/cJTAG/SWD interface be brought up via the M0?
Of course the problem is there is no way to communicate with the M0, or is there? One strange bit of the teensy 3.2 schematic (that isn't done on the 3.6) is that the USB id pin goes to one of the lines between the M0 and M4. Now usually with micro-B usb plugs, the id pin is left floating. But if a micro-A plug is used, the id pin gets earthed. Now for the M4, this probably means that it can't be programmed any more - e.g. not enough of the jtag comes up. What isn't clear to me though is what happens to the M0 when PTA6 is pulled to Earth? E.g. does this give extra functionality, e.g. the ability for the M4 to rewrite the M0 flash? If thats possible, then maybe some jtag code could be got on the M0? Alas I don't have a micro-A plug, so can't try this ...
So has anyone else been down this line? Its only possible because of the interesting teensy architecture, and the relation of the M0 to the M4. Any thoughts anyone?
Just building a system with teensy 3.2/pressure sensor (MS5611) and SD card - to fit inside a Kinder Egg, and fly on MarsBalloon (http://marsballoon.com/). Its where we give school children a chance to fly experiments on a weather balloon, with the constraint that the experiment needs to fit in a kinder egg ...
Anyway I developing code on mbed - as I'm familiar with that set up, have a few hassles bringing up a UART across the usb interface for debugging. That was when I noticed that the teensy wires up the usb device different from many mbed devices. Often there like teensy boards have two arm cpus on, one the target, and one for programming. My other freedom card has a target UART connected to the programming cpu, and that cpu runs the code that puts the uart in a usb-otg gadget.
Now on teensy, the usb d+ and d- go straight into the target cpu (m4), indeed the programming cpu (m0) the only input it has into it seems to be the reset button. So how does it program the m4?
Next clue, the M0 is wired into pins PTA0-3 on the M4, these are the M4 jtag/cjtag/swd pins. So it looks like all the m0 can do to program the m4, is write a program direct to the M4 RAM. That program brings up halfkey on the USB, and writes it to flash. The crux being that it must run on the M4.
Whats interesting is that the M0 is doing this via the debug pins. on the M4. So I got to wondering - can a more general JTAG/cJTAG/SWD interface be brought up via the M0?
Of course the problem is there is no way to communicate with the M0, or is there? One strange bit of the teensy 3.2 schematic (that isn't done on the 3.6) is that the USB id pin goes to one of the lines between the M0 and M4. Now usually with micro-B usb plugs, the id pin is left floating. But if a micro-A plug is used, the id pin gets earthed. Now for the M4, this probably means that it can't be programmed any more - e.g. not enough of the jtag comes up. What isn't clear to me though is what happens to the M0 when PTA6 is pulled to Earth? E.g. does this give extra functionality, e.g. the ability for the M4 to rewrite the M0 flash? If thats possible, then maybe some jtag code could be got on the M0? Alas I don't have a micro-A plug, so can't try this ...
So has anyone else been down this line? Its only possible because of the interesting teensy architecture, and the relation of the M0 to the M4. Any thoughts anyone?