Update 'Default/standard mode'

Triss 2021-07-30 17:06:01 +00:00
parent 8c937dffaf
commit 4287bca7db
1 changed files with 53 additions and 2 deletions

@ -40,19 +40,70 @@ It is possible to enable hardware flow control (using `CTS` and `RTS` lines), it
The device exposes CMSIS-DAP functionality over a USB HID interface, which can be used for JTAG or SWD debugging. No special configuration is required to use it.
In SWD mode, the pin mapping is entirely as with the standard Picoprobe setup,
as described in Chapter 5 and Appendix A of [Getting Started with Raspberry Pi
Pico](https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf)
In JTAG mode, TCK and TMS have the same pins as SWCLK and SWDIO, respectively,
TDI and TDO are on the next two consecutive free pins.
In your OpenOCD flags, use `-f interface/cmsis-dap.cfg`. Default transport is
JTAG, if OpenOCD doesn't specify a default to the probe.
### SPI
The SPI interface can be used in two ways: using a serprog USB-CDC interface, mostly useful for interacting with SPI flash chips, and a kernel module, for generic SPI operations, though the Linux `spidev` interface.
For Serprog, use the following `flashrom` options (if `/dev/ttyACM1` is the USB
serial device on your machine corresponding to the Serprog CDC interface of the
Pico):
```
flashrom -c <flashchip> -p serprog:dev=/dev/ttyACM1:115200 <rest of the read/write cmd>
```
Different serial speeds can be used, too. Serprog support is *techincally*
untested, as in it does output the correct SPI commands as seen by my logic
analyzer, but I don't have a SPI flash chip to test it on.
### I2C
I2C is exposed only through a Linux kernel module, which can then be used by standard Linux I2C tools (such as utilities from the `i2c-tools` package, eg. `i2cget`, `i2cset`, `i2cdetect`). The `i2c-dev` module needs to be loaded for this to work.
Using `i2cdetect -l`, you should be able to see which I2C device belongs to
the tool:
```
$ sudo i2cdetect -l
[...]
i2c-1 i2c i915 gmbus dpb I2C adapter
i2c-8 i2c Radeon i2c bit bus 0x95 I2C adapter
i2c-15 i2c dmj-i2c-1-1:1.0 I2C adapter
i2c-6 i2c Radeon i2c bit bus 0x93 I2C adapter
i2c-13 i2c AUX C/DDI C/PHY C I2C adapter
```
### Temperature sensor
A temperature sensor is available and used as a Linux hwmon kernel module, making the output available for use in `lm_sensors` output.
If the board/MCU has a temperature sensor, it is made available as a Linux hwmon kernel module, making the output available for use in `lm_sensors` output.
Additionally, it can also be configured to appear on the device's I2C bus as an emulated I2C device, pretending to be a JC42-compliant temperature sensor. This can be achieved using `dmctl tempsensor --set <addr>`.
Additionally, it can also be configured to appear on the device's I2C bus as an emulated I2C device, pretending to be a JC42-compliant temperature sensor (more precisely, the Microchip MCP9808). This can be achieved using `dmctl tempsensor --set <addr>` (with `BUSNUM` the number from the above
`i2cdetect -l` output):
```
$ ./dmctl.sh tempsensor --set 0x18 # need to give it an address first
$ sudo modprobe jc42
$ # now tell the jc42 module that the device can be found at this address
$ echo "jc42 0x18" | sudo tee /sys/bus/i2c/devices/i2c-BUSNUM/new_device
$ sudo sensors # it should show up now:
jc42-i2c-BUSNUM-18
Adapter: i2c-tiny-usb at bus 001 device 032
temp1: +23.1°C (low = -20.0°C)
(high = +75.0°C, hyst = +75.0°C)
(crit = +80.0°C, hyst = +80.0°C)
```
Temperature readout may be a bit higher than the ambient temperature.
### 1-wire