Hardware-set-ups

From Wiki at Neela Nurseries
Jump to: navigation, search

(1) Rpi RP2040 DEV-18288 set up 2022 Q2:

On Rpi Sparkfun board, DEV-18288 have an LED connected from GPIO p0_7, through 22kOhm resistor to plus rail pin left of the USB-C connector.

   +---------+
   |        9|     ^^
   |        8|    //
   |        7|---|>|---/\/\/---+
   |        6|          22k    |   
   |        5|                 |
   |        4|                 |zephyr
   |        3|                 |
   |        2|                 |
   |3V3   GND|                 |
   |RST   GND|                 |
   |GDN    RX|                 |
+--|+      TX|                 |
|  +---------+                 |
|                              |
+------------------------------+


^ Serial port loopback test on Linux

In two terminal windows, programs `echo` and `cat` can be used to test a serial port connected to a loopback cable. This testing also effectively demonstrates the working of serial drivers under Linux. Works for USB-based FTDI cables which convert USB to a serial link. Works for the much older 16550 based serial port peripheral chips.

A third and precursor command, `stty` is also needed to configure given serial port for sane operation during these tests. A couple of options to `stty` utility disable a default echoing behavior on given serial port. Another option suppresses a conversion or handling of carriage return bytes, e.g. stops serial port driver at some level from converting CR to CRLF.

Invocation of stty is:

 stty -F /dev/ttyUSB4 -echo -onlcr

Reference: https://super-unix.com/unixlinux/unexpected-results-testing-serial-loopback-using-echo-and-cat/


^ lpcxpresso55x69 Eval Board DTS files and SCTimer0

See file in Zephyr 3.2.0 source tree, path `zephyr/boards/arm/lpcxpresso55s69/lpcxpresso55s69-pinctrl.dtsi` and review lines:

76         pinmux_sctimer_default: pinmux_sctimer_default {
77                 group0 {
78                         pinmux = <SCT0_OUT2_PIO0_15>,
79                                 <SCT0_OUT0_PIO1_4>;
80                         slew-rate = "standard";
81                 };
82         };

Signal names PIO0_15 and PIO1_4 can be located on NXP schematic file for eval board, file `LPCXpresso55S69_Board_Schematic_RevA2_dec4.pdf`. The connection from SCTIMER_OUT0 appears to tie to `LEDB` which is the blue LED on this eval board. A build of the sample app without modifications however produces following Zephyr console output, ending with a PWM setting error message:

*** Booting Zephyr OS build zephyr-v3.2.0  ***
PWM-based blinky
Calibrating for channel 0...
[00:00:00.008,000] <dbg> pwm_mcux_sctimer: mcux_sctimer_pwm_set_cycles: SETUP dutycycle to 50

Done calibrating; maximum/minimum periods 1000000000/7812500 usec
[00:00:04.023,000] <dbg> pwm_mcux_sctimer: mcux_sctimer_pwm_set_cycles: SETUP dutycycle to 50

[00:00:08.032,000] <dbg> pwm_mcux_sctimer: mcux_sctimer_pwm_set_cycles: SETUP dutycycle to 50

[00:00:12.041,000] <dbg> pwm_mcux_sctimer: mcux_sctimer_pwm_set_cycles: SETUP dutycycle to 50

[00:00:16.050,000] <dbg> pwm_mcux_sctimer: mcux_sctimer_pwm_set_cycles: SETUP dutycycle to 50

[00:00:20.059,000] <dbg> pwm_mcux_sctimer: mcux_sctimer_pwm_set_cycles: SETUP dutycycle to 50

[00:00:24.068,000] <dbg> pwm_mcux_sctimer: mcux_sctimer_pwm_set_cycles: SETUP dutycycle to 50

[00:00:28.077,000] <dbg> pwm_mcux_sctimer: mcux_sctimer_pwm_set_cycles: SETUP dutycycle to 50

[00:00:32.086,000] <dbg> pwm_mcux_sctimer: mcux_sctimer_pwm_set_cycles: SETUP dutycycle to 50

[00:00:32.095,000] <err> pwm_mcux_sctimer: Could not set up pwm
Error -134: failed to set pulse width