Comments (8)
Is this still a problem in the fbuf branch version ?
I'm trying to set the pwm for the POE hat.
That is register 0x00030049 for the GET and 0x00030050 for the set.
The buffer seems to be 3 bytes according to the Linux kernel driver. The GET somewhat works
but the SET is barking that the mailbox send failed.
I'm doing the following in python:
+ ioctlData = bytearray(struct.pack('<IIIIIII',
+ RPIQ_SHORT_BUFFER_LEN,
+ RPIQ_SET_REQ,
+ RPIQ_MBOX_TAG_SET_POE_HAT,
+ RPIQ_MBOX_SET_POE_HAT_LEN,
+ reg, value, 0))
the RPIQ_SHORT_BUFFER_LEN is set to 24
from thpimon.
The fbuf branch in fact does support variable-sized buffers, since I needed them to implement the framebuffer mailbox interface. The buffer is allocated based on the number of bytes supplied in the buffer len field (as you have done): https://github.com/thebel1/thpimon/blob/fbuf/pimon_charDev.c#L447
Having said that, the mailbox interface is not for interacting with memory-mapped registers, but rather with the VideoCore GPU via a mailbox interface. The struct you're building in Python is the mailbox buffer you're sending to the VideoCore. See the following for a list of supported mailbox properties: https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface . Currently, only channel 8 is supported.
I hope that helps.
from thpimon.
I said register but essentially those are the mailbox properties but it seems the wiki doesn't mention these higher ones e.g. it ends at 0x00030020 and then goes on with 0x00040001
from thpimon.
In that case, it should work. Can you paste the code around the snippet you sent earlier and the tail of the /var/log/vmkernel.log after running your script please. I'll need to have a look at the logging.
from thpimon.
0001-Add-test-version-of-setting-pwm-for-POE-hat.txt
attached the current quick hack. The log looks like the following:
2020-12-01T12:01:36.118Z cpu3:133881)thpimon: pimon_charDevOpen:351: opened file; priv 0x4304d9001340 lock 0x4304d90013c0
2020-12-01T12:01:36.118Z cpu3:133881)WARNING: thpimon: pimon_charDevIoctl:455: failed to allocate memory for ioctl data: Out of memory
2020-12-01T12:01:36.118Z cpu3:133881)thpimon: pimon_charDevIoctl:462: copying ioctl data from 0x36509f31f70 (UW) to 0x4304d9001370 (vmk)
2020-12-01T12:01:36.118Z cpu3:133881)thpimon: pimon_charDevIoctl:480: executing ioctl cmd 8 with data 0x36509f31f70
2020-12-01T12:01:36.118Z cpu3:133881)WARNING: thpimon: rpiq_mboxSend:359: transaction error: 0x80000001
2020-12-01T12:01:36.118Z cpu3:133881)thpimon: pimon_charDevIoctl:462: copying ioctl data from 0x36509f31f70 (UW) to 0x4304d9001370 (vmk)
2020-12-01T12:01:36.118Z cpu3:133881)thpimon: pimon_charDevIoctl:480: executing ioctl cmd 8 with data 0x36509f31f70
2020-12-01T12:01:36.118Z cpu3:133881)WARNING: thpimon: rpiq_mboxSend:359: transaction error: 0x80000001
2020-12-01T12:01:36.119Z cpu3:133881)thpimon: pimon_charDevFileDestroy:726: destroying file 0x4304d9001340
e.g. that was running the pimon_setpwm.py script. So it seems that it gets send but the mailbox responds with an error.
For now I soldered some wires to the 5v and GND pin and plugged the POE HAT fan onto that and then it runs and keeps
things cool but eventually it would be nice to be able to write some python scripting that reads out the temp and sets the pwm.
from thpimon.
Yeah, we're going to need some additional data here, to get the contents of the buffer before it gets sent. If dynamic VProbes were available on Arm this would be easy. Hopefully, they'll be supported soon.
Can you send me the entirety of your script plus the pimon library's init.py file? I'd like to repro this on my Pi.
from thpimon.
I already attached the patch to my previous message which you can just apply and that will give you the extra code and the two scripts. I can also attach that again if that helps.
from thpimon.
init.txt
pimon_getpwm.txt
pimon_setpwm.txt
The python files renamed to .txt extension instead of .py
from thpimon.
Related Issues (9)
- DMA heap may be placed above 1GB
- Making repeated VC mailbox requests will result in response being empty HOT 5
- Automatically identify the correct char device HOT 2
- [Errno 22] Invalid argument HOT 3
- Install of vib fails on ARM release build-17839012 HOT 1
- Is there a way to get the temperature in X64? HOT 3
- Instructions to compile HOT 2
- Not working on ESXi on Arm Fling (Build 20693597) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thpimon.