-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raspberry pi 4 #278
Comments
pigpio does not work on the Pi4B. At the moment I can't get any information so do not know if this is a temporary blip or not. I need to find out what (if any) changes have been made to the memory map and SoC hardware peripherals (e.g. DMA, PWM, PCM, GPIO, SYST, BSC). |
You may have already come across this, but just in case here's the info from the RPI Foundation's website: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/rpi_DATA_2711_1p0_preliminary.pdf |
Unfortunately that gives little to no useful information as far as pigpio is concerned. It doesn't even give the new peripheral address which appears to be 0xfe000000. |
I have made progress. Most of the peripherals used by pigpio seem to work as before (PWM/PCM/GPIO/SYST/DMA). I haven't tried SPI yet. The DMA channels which were free for pigpio use (14 primary, 6 secondary) do not operate quite as before. If you want to experiment using the peripheral address above (change in gpioHardwareRevision) and starting the daemon with -d 6 - e 14 (swapping primary/secondary) should be enough to get pigpio running at least partially. There are PUD changes which need to be incorporated. If I can sort out the DMA channels I'll have a look at making all the changes needed to do a new release. My time to dedicate to pigpio is extremely limited at the moment so I can't provide an estimate of time-scale. If it turns out to be infeasible I'll let you know. |
Thank you very much for all of your valuable time to look into this, Joan. My RPI4 should arrive early next week, and I can test this out then. My main focus will be on the Aux. SPI, and after that on the PWM Generation (using DMA, as I understand it) on the GPIO pins. Is it possible for you to create a branch in github with your work in progress? I will also keep searching for any new information that might be helpful and post it on this issue thread. |
V69 released. There will probably be problems with the DMA channels being used. When the full peripheral specs are available they will probably indicate further software changes. |
Hi Joan, Very excellent; I am very grateful for this. I have tested this and found it to be working so far. I'm not using the deamon, I'm using the C interface. So far, Aux SPI is working, GPIO Outputs are working and PWM Generation on the GPIO Outputs is working. And I've verified this on both RPI4B as well as RPI3B+, so I haven't noticed any regressions. Up next is to do more testing in the areas of GPIO Inputs, verifying the pullup/pulldown on the GPIO pins, and the SPI/UART/I2C interface. As a side note, I've heard that the I2C clock stretching on the Raspberry Pi 4B (BCM2711) is working due to fixes in the silicon, so hopefully that's correct and I'll see if I can verify that, too. |
Hi, |
@jhw84 I will have a look. Could you add the result of grep Revision /proc/cpuinfo and pigs hwver Is the daemon running okay? If DMA fails to start the system will seem sluggish and pigpio will likely be taking 100% CPU. |
Hi @joan2937 , thanks for the quick response. Here is the data you requested:
I just checked: When launching pigpiod without any arguments it consumes about 7% CPU. |
@jhw84 I tried and got the same failure for slave I2C as you. I'm afraid slave I2C will not be possible on the BCM2711/Pi4b. The SPI/BSC slave functionality has been removed. GPIO 18/19 in mode ALT3 now (completely pointlessly) provide SPI device 6. I say completely pointlessly as they already provide a different SPI interface in mode ALT4. Compare page 102 of https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf to https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/rpi_DATA_2711_1p0_preliminary.pdf |
Too bad, fortunately I control both devices on the bus so I can move to a different type of interface. Hard to imagine why this choice was made, as you say there is no point to it, it only loses functionality without gain. |
I'm interested in PWM generation. @kauailabs:
@joan2937: What were the changes to the DMA channels? Is there a detailed datasheet available yet? Any reason to worry that there might be a degradation of performance/quality w.r.t PWM? |
pigpio currently defaults to primary channel 7, secondary channel 6 on the Pi4B. Without a detailed datasheet it's pointless trying to guess why this is needed. The detailed datasheet should be made available to us within a couple of weeks from now. I know of no reason why PWM would be degraded from its previous performance. All I automatically do when testing is run x_pigpio, x_pigpio.py (Python 2 and 3), x_pigpiod_if, x_pigpiod_if2, x_pigs, and x_pipe. They showed no regression with PWM. |
Just to let you know: I've tested a number if I2C (on both the i2c-0 and i2c-1 bus) devices and a SPI devices and they work fine with pigpio on the RPi4B in my hands. I can also confirm that a device that uses clock-stretching and didn't work with the RPi3B+ is working with the RPi4B. |
#284 Got pigpiod running on a RPi4 model B running tumbleweed (arm64). |
Thanks a lot, DMA PWM successfully tested 24/7 on raspberry PI 4 robot |
Are Raspi 4 internal pull up/down already working? |
@hayguen Yes, any version after V68 supports the Pi4B (and pulls). |
Hello everyone. I have RPI4B 2GB and in one code I am using Does anyone knows where is the problem? Thanks for advance. |
@joan2937 Thanks. Is there any way to do not cancel HW PWM with |
@JeffJassky Glad you are sorted. For info. If you are using the Raspbian version then A later version may be available at http://abyz.me.uk/rpi/pigpio/download.html or at https://github.com/joan2937/pigpio I try to keep the abyz.me.uk and github versions the same but occasionally there is a more recent version at github. Please be aware of the following. pigpio places files in the following locations
The (Raspbian) raspberrypi.org image containing pigpio uses different locations.
Mostly this doesn't matter as the /usr/local directories will generally be earlier in the search path. The pigpio built includes, binaries, and manuals are normally found first. However the wrong libraries may be linked during the compilation. If this is the case remove the /usr/lib entries for libpigpio.so , libpigpiod_if.so, and libpigpiod_if2.so |
ℹ️ For the record the use of the different locations is entirely appropriate - distribution provided packages use |
@SlySven Yes, I did not mean to imply there was anything wrong with the choice of file locations. I just meant it as a heads-up as something which might catch people out (as I myself was). |
The documentation for gpioGetPWMrealRange states the following:
To be correct for the Raspberry Pi 4 it looks like it should be:
I'd also like to mention that the pigpio Node.js module works well with V69 or higher of the pigpio C library on the Raspberry Pi 4. @joan2937 Excellent job :) |
Hi there, just wanted to inform that I had weird difficulties with gpio pin 26 and 20 on Raspberry4 as they were not working: Could there be an issue with GPIO Pins 2x when addressing them? |
digitalWrite sounds like a wiringPi command. Have you downloaded and installed the latest version of wiringPi. As shown in your terminal output pigpio sees nothing wrong with the GPIO. |
@joan2937 thanks for your quick reply. Indeed digitalWrite is not from pigpio but its from node-pigpio: It is defined as: I tried finding gpioWrite in .c File but only found in Headers. There is nothing wrong by pygpio-test but still I did not get ~~~5~~3,3V on 26 and 20. Maybe there are other people having similar problems - I am currently using other Pins which is fine so only mentioning. |
ALL the Pi GPIO are 3V3. You will only get 5V on the 5V power rail (pins 2 and 4). What do you mean by 26 and 20? pigpio only uses GPIO numbers (not physical pin numbers). |
@Reda1000 , assuming you are using broadcom gpio pin numbers, can you report what the levels are when you Edit: to make output mode, first do: |
@guymcswain @joan2937 Thank you both for your help. I was afraid short-circuiting pins and used a cable in between like so: |
Not sure if this is related, however, I was trying to use pigpio (v71) with the Pi Camera on a 4 using Python 3. Worked at some point, and then some time later (with an apt full-upgrade because the File Explorer started crashing whenever I tried to open it, then an apt-get update and apt-get upgrade), I stopped being able to access the Pi Camera, and spent some time debugging it - one of the errors that was reported occurred in pigpio.py, so I eventually decided to try swapping the DMA channels, which seemed to do the trick? I'm investigating further - maybe starting pigpiod on startup using rc.local is configured incorrectly and is causing the issue. Edit: figured out the issue. Incorrect configuration of rc.local - needed to add & after the call to pigpiod. When I killed pigpiod and restarted it with different memory channels, the issue was resolved because pigpiod wasn't started properly, I guess? My background's in mechanical and electrical engineering, and Linux isn't something I spend that much time with, so if anybody knows what actually happened, feel free to correct me! |
The SPI/BSC slave functionality is now working(*) on Pi4 model B although the GPIO have moved from 18,19 to 10,11 respectively. Version 7401 is available on the 'develop' branch of the pigpio GitHub repo. See #280 for more details. * Note: SPI slave functionality does not work on any Pi model. |
Hi any way to release PCM and PWM for audio |
@maheshhchandra , your question/issue is not related to Pi4 - the subject of this thread. Please open an separate issue if you believe there is a behavior that is inconsistent with the pigpio documentation. |
For all participants on this thread: I plan to close this issue as it was a catch-all for anything related to Pi4. It is quite stale now and there have been multiple releases since. Any outstanding issues should be opened in a separate thread. Thanks. @joan2937 , looks like we missed this input from @fivdi . Are you ok with this change in doc?
|
Hi, Thanks. |
Please note the text here: This looks like an incredibly supportive community so I'd hate to see people pass by because of an outdated comment :) |
Okay, I have updated the web site. |
@joan2937 - I just noticed a new version of the BCM2711 datasheet on raspberrypi.org:
If you see anything affecting pigpio just open a new issue. |
Hi there !!!
Thank you very much for your time and effort. |
I have a Raspberry Pi 4 Model B Rev 1.4 running as I2C slave via |
Thank you very much for your answer, did you do any special steps to set it up? I am not a very experienced Linux user, i just now my way around. Is there a ressource where i can follow the installation steps or sth similar? |
No, nothing special. I followed the example code for the For the master, I added
|
I’m interested in using pigpio on Raspberry pi 4. If you need beta testing I’m happy to help. Existing Features used would include Aux SPI, SPI, I2C, PWM generation, Serial Port, interrupt handling from GPIO pins, and basic GPIO pin reads and writes.
Thanks for your consideration.
The text was updated successfully, but these errors were encountered: