Go to advanced search

by PhilE
Wed Nov 30, 2022 11:37 am
Forum: Compute Module
Topic: (Suspected clone?)of CM3 can't boot from MicroSD
Replies: 8
Views: 346

Re: (Suspected clone?)of CM3 can't boot from MicroSD

If you have access to a serial port cable, attach it to pins 6 (GND), 8 (TXD) and 10 (RXD), add the following lines to config.txt on the SD card, and try to boot it.

Code: Select all

enable_uart=1
uart_2ndstage=1
Set the terminal app (e.g. putty or minicom) to 115200 baud, 8 data bits, 1 stop bit, no flow control.
by PhilE
Wed Nov 30, 2022 9:27 am
Forum: Compute Module
Topic: Wifi SDIO SDR104 Card Detection CM4
Replies: 2
Views: 91

Re: Wifi SDIO SDR104 Card Detection CM4

That's correct - it isn't supported, by which I mean the hardware can't do it. The "sdio" overlay enables the old Arasan MMC interface on GPIOs 22-27. It is limited to 3.3V I/O at 50MHz. The interface only supports one sample per clock cycle, which at 4 bits wide gives a maximum throughput...
by PhilE
Wed Nov 30, 2022 9:12 am
Forum: Compute Module
Topic: broadband connectivity issues-3
Replies: 4
Views: 111

Re: broadband connectivity issues-3

You seem to be blaming the world for your inability to make something work, burying what may ultimately be a reasonable question under a pile of invective.
by PhilE
Wed Nov 30, 2022 9:09 am
Forum: Advanced users
Topic: Alignment Trap Error with Xenomai and EtherCAT
Replies: 3
Views: 243

Re: Alignment Trap Error with Xenomai and EtherCAT

The usual rule for portable code is that data elements should be aligned to at least there own size; chars/bytes can be at any address, shorts (16-bit values) must be at even addresses, 32-bit values must be at multiples of 4 etc. Compilers usually take care of alignment within structures by inserti...
by PhilE
Tue Nov 29, 2022 5:32 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Overlay for PWM fan control (from GPIO18)
Replies: 9
Views: 172

Re: Overlay for PWM fan control (from GPIO18)

[Moved to Interfacing]
by PhilE
Tue Nov 29, 2022 3:48 pm
Forum: Advanced users
Topic: Alignment Trap Error with Xenomai and EtherCAT
Replies: 3
Views: 243

Re: Alignment Trap Error with Xenomai and EtherCAT

I'm not familiar with EtherCAT, but alignment errors like that usually arise from compiling code for a different platform from that which it was written for. This can be because the sizes of some data structure elements changes, or simply because the original platform doesn't care about alignment (e...
by PhilE
Tue Nov 29, 2022 3:37 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Overlay for PWM fan control (from GPIO18)
Replies: 9
Views: 172

Re: Overlay for PWM fan control (from GPIO18)

I think you'd get more help with a shorter message which is clearly about fan control, but I will just move the top post if that is what you want.
by PhilE
Tue Nov 29, 2022 2:30 pm
Forum: Compute Module
Topic: broadband & connectivity issues -2
Replies: 3
Views: 143

Re: broadband & connectivity issues -2

I don't understand why the previous thread was locked. In theory this system should work, but we hit a combo of denial, and stonewalling from all concerned. Theory does not translate in any way into reality with the CM4 and M.2 interfaces. Why waste your time and the time of your potential helpers ...
by PhilE
Tue Nov 29, 2022 1:57 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Overlay for PWM fan control (from GPIO18)
Replies: 9
Views: 172

Re: Overlay for PWM fan control (from GPIO18)

Does the overlay you posted do what you want it to? If so, you might be better off asking in a more general forum - Advanced users, or Interfacing, say - since your question is really about fan control rather than Device Tree.
by PhilE
Tue Nov 22, 2022 8:45 am
Forum: Device Tree
Topic: Customizing i2c-pwm-pca9685a-overlay
Replies: 25
Views: 1348

Re: Customizing i2c-pwm-pca9685a-overlay

You can simplify the overlay without changing its behaviour by replacing the on/off pairs of fragments with literal assignments: // Definitions for NXP PCA9685A I2C PWM controller on ARM I2C bus. // i2c-pwm-pca9685a-new-overlay.dts /dts-v1/; /plugin/; #include <dt-bindings/gpio/gpio.h> #include <dt-...
by PhilE
Sun Nov 20, 2022 8:20 pm
Forum: Device Tree
Topic: gpio-keys, connected gpios
Replies: 6
Views: 244

Re: gpio-keys, connected gpios

I assumed the OP wanted to toggle at each push, but it wasn't completely clear.
by PhilE
Sun Nov 20, 2022 5:52 pm
Forum: Advanced users
Topic: Doing something soon via "at", but *after* the time gets set
Replies: 9
Views: 499

Re: Doing something soon via "at", but *after* the time gets set

I've not tried it myself, but does using "at now+<interval>" not persuade it to work in relative time, or does it convert to absolute time at the point the command is run?
by PhilE
Sun Nov 20, 2022 10:33 am
Forum: Device Tree
Topic: gpio-keys, connected gpios
Replies: 6
Views: 244

Re: gpio-keys, connected gpios

It's correct that you need some software to achieve what you are trying to do, but I think the software may already exist - it's the gpio-fsm driver, enabled and configured with the gpio-fsm overlay (fsm here stands for finite state machine). There is a discussion of the overlay and its use on this ...
by PhilE
Sun Nov 20, 2022 10:21 am
Forum: Compute Module
Topic: CM4 green led is always on
Replies: 12
Views: 550

Re: CM4 green led is always on

Apart from the green LED being on all the time, does the CM4 behave as normal? You can test the LED by running the following command: $ echo heartbeat | sudo tee /sys/class/leds/led0/trigger You can return to the usual behaviour where it displays SD card activity with: echo mmc0 | sudo tee /sys/clas...
by PhilE
Fri Nov 18, 2022 1:48 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

Which distribution was this? I don't think it's RPi OS, because that will specify arm_64bit=1.
by PhilE
Fri Nov 18, 2022 1:41 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

[ 0.000000] Linux version 5.15.78-v7l+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutil s for Ubuntu) 2.34) #1599 SMP Fri Nov 11 12:26:36 GMT 2022 [ 13.212388] Starting init: /bin/sh exists but couldn't execute it (error -8) You appear to be loadin...
by PhilE
Wed Nov 16, 2022 4:02 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

Either is OK - the absence of an assignment is treated as assigning 1/true/"okay" - but I prefer the former.
by PhilE
Wed Nov 16, 2022 3:43 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

The new pwm1 overlay is merged into the kernel source tree - see https://github.com/raspberrypi/linux/commit/bb9476b2aacea2ecf4cf51d139413af8c39d31ae. It will be a few days before it appears in a release (rpi-update, first), but until then you can download it from the same link as before: https://dr...
by PhilE
Wed Nov 16, 2022 2:07 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

Changing the pull makes it a bigger job - give me a while.
by PhilE
Wed Nov 16, 2022 1:20 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

That's good to hear. I'll tart it up a bit - add parameters to select one or both channels - then add it to the official overlays. I'll keep "both channels enabled" as the default.
by PhilE
Wed Nov 16, 2022 12:08 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

Note that it currently also claims GPIO41 and enables PWM1_1 there, but that's something that could be changed. For reference, the current trial pwm1 overlay is just: /dts-v1/; /plugin/; / { compatible = "brcm,bcm2711"; fragment@0 { target = <&pwm1>; __overlay__ { assigned-clock-rates ...
by PhilE
Wed Nov 16, 2022 11:56 am
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

With "dtoverlay=pwm1" in config.txt (leave out "dtoverlay=pwm,..."), this is sufficient to enable a 1kHz PWM on GPIO 40: $ echo 0 | sudo tee /sys/class/pwm/pwmchip0/export $ echo 1000000 | sudo tee /sys/class/pwm/pwmchip0/pwm0/period $ echo 500000 | sudo tee /sys/class/pwm/pwmchi...
by PhilE
Tue Nov 15, 2022 4:40 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

The usual way - find a library, e.g.: https://github.com/zeroping/sysfspwm, or code it yourself.
by PhilE
Tue Nov 15, 2022 4:29 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

That's partly a shell problem - although the command runs as root, the output redirection runs as the regular user (e.g. pi) - and partly because nwpm is read-only. Either of these should work: $ sudo -c "echo 0 > /sys/class/pwm/pwmchip0/export" $ echo 0 | sudo tee /sys/class/pwm/pwmchip0/...
by PhilE
Tue Nov 15, 2022 4:27 pm
Forum: Compute Module
Topic: CM4S Audio on PWM1_0 and PWM1_1
Replies: 47
Views: 1635

Re: CM4S Audio on PWM1_0 and PWM1_1

Good. There is a sysfs API for PWMs in Linux, similar to the now-outdated GPIO sysfs API. See https://www.kernel.org/doc/html/latest/ ... -interface for details.

Go to advanced search