Raspberry-Pi | My public Baremetal Raspberry Pi code
kandi X-RAY | Raspberry-Pi Summary
kandi X-RAY | Raspberry-Pi Summary
My public Baremetal Raspberry Pi code
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Raspberry-Pi
Raspberry-Pi Key Features
Raspberry-Pi Examples and Code Snippets
Community Discussions
Trending Discussions on Raspberry-Pi
QUESTION
I am learning ARM baremetal development using QEMU as emulator. I am following this github repo as example.
The vectors are defined for EL1 :
...ANSWER
Answered 2022-Feb-14 at 11:59A start for debugging this is to turn on the tracing in QEMU of events related to the bcm2835 system timer, which I think is what your code is using. You can do that with the command line option -d trace:bcm2835_systmr*
. In particular the "timer #1 expired" (or whatever timer number it is) messages indicate that the timer has raised its interrupt. If the timer isn't raising the interrupt then you've programmed the timer wrongly; if it is then you've probably not set up the interrupt controller correctly.
You should probably also double-check that you're really executing in EL1 as you expect.
Older versions of QEMU supported the raspi3 board but did not implement this particular system timer device; so if you don't see timer expiry tracing then it's worth checking your QEMU is new enough. 6.2.0 definitely has this device implemented.
QUESTION
I have few raspberry-pi
uploading data to azure iot hub
. I can see all the data on device explorer
. But is there any way I can see the data of specific time frame? Lets say complete data of last 1hour?
ANSWER
Answered 2022-Feb-10 at 15:01You can achieve this with Service Bus Explorer. The name might suggest it's only for Service Bus, but it has Event Hub and IoT Hub support as well. To see the data for the last hour, do the following:
Copy the Event Hub compatible endpoint from the Azure Portal and strip off the EntityPath. Example:
Endpoint=sb://REDACTED.servicebus.windows.net/;SharedAccessKeyName=iothubowner;SharedAccessKey=REDACTED=;EntityPath=hub-name
becomes:
Endpoint=sb://REDACTED.servicebus.windows.net/;SharedAccessKeyName=iothubowner;SharedAccessKey=REDACTED=
Open Service Bus Explorer and create a new IoT Hub Listener.
Add the connection string without the entity path and add the entity path as the Endpoint.
This will open a new listener window. In the window, you can select a start time. Select a time one hour back. The minimum retention period is a day, but if you decide to choose a time further in the past, that time should be within the retention period of the endpoint. If you select a time before the retention period, you will see events from the beginning of the retention period.
If you want to inspect the events, you can go to the Events tab and have a look at the data.
QUESTION
I have GrovePi Zero(GrovePi0) from GrovePi Zero Base Kit and Grove - PH Sensor Kit (E-201C-Blue) I am using Java (I can use any version of JDK 8...17) on a Raspberry Pi Zerro 2. with GrovePi-pi4j with Pi4j version 1.4 (can use any version)
my class GrovePHSensor below represents the PH Sensor.
...ANSWER
Answered 2022-Jan-24 at 11:40@GroveAnalogPin
public class GrovePHSensor extends GroveAnalogInputDevice {
private static final Logger l =
LogManager.getLogger(GrovePHSensor.class.getName());
/*** pH values range */
public static final double PH_RANGE = 14.0;
/***
number of possible samples with 10 bit analog to digital converter
*/
public static final int A2D_RANGE = 1023;
public GrovePHSensor(GrovePi grovePi, int pin) throws IOException {
super(grovePi.getAnalogIn(pin, 4));
}
@Override
public Double get(byte[] data) {
// the extraction of the value is taken from the sample of the
// RotarySensor3Led
// https://github.com/DexterInd/GrovePi/blob/master/Software/Java8/GrovePi-spec/src/main/java/org/iot/raspberry/grovepi/devices/GroveRotarySensor.java
// this is how its is done there
int[] v = GroveUtil.unsign(data);
double sensorValue = (v[1] * 256) + v[2];
// the Analog to Digital is 10 bit -> 1023 intervals that cover the range of pH of 0 to 14
// hence the pH value is the sensor value that is 0 to 1024
// times the pH per interval of the A2D 14/1023
double ph = sensorValue * (PH_RANGE / (double) A2D_RANGE);
l.trace("sensorValue = {} ph={}", sensorValue, ph);
return ph;
}
}
QUESTION
I have compiled this baremetal example : https://github.com/s-matyukevich/raspberry-pi-os/tree/master/src/lesson01. I modified the Makefile to have debug symbols like below :
...ANSWER
Answered 2022-Jan-27 at 10:53GDB is placing breakpoints based on where the ELF file says the code is. You can see that in your transcript it thinks the _start function in boot.S is at address 0x0. However, when you tell QEMU to load your binary file, you are not doing that in a way that matches what the ELF file says. So the actual code being executed is at an entirely different address, and the breakpoints are not in addresses that match the executing code, so they don't hit. Since you're not compiling the code to be position-independent, when it runs from this address it is working mostly by luck (because even non-position-independent aarch64 code often doesn't have position-dependent instructions in it).
The reason the addresses don't match up is because your ELF file is saying code starts at address 0x0, but you're passing QEMU a binary file to the -kernel option, which means "I am a Linux kernel, boot me the way the Linux kernel boot protocol says to do that" (see https://www.kernel.org/doc/Documentation/arm64/booting.txt). This means a number of things, including that (for the current QEMU implementation -- this isn't strictly mandated by the booting protocol) we load the image to the address 0x80000, and run a bit of stub code generated by QEMU which sets up some registers and jumps to that location. That is why when you set your linker script to link the image to that address it happens to start working.
The solution to this is to make a choice about how you want to boot your guest code:
- You can make it honour the various requirements of the Linux kernel boot protocol, and pass it as a binary file to -kernel
- You can write it to be a pure bare-metal image that includes a vector table at address 0x0, and load it with the QEMU "generic loader", which will take an ELF file and load all its segments as the ELF headers specify. (It is also possible to pass an ELF file to -kernel, but the generic loader makes more sense in this situation.)
QEMU does not support "load this ELF file and start it in the way that the Raspberry Pi firmware supports running an ELF file that it loads from an SD card". So you may need to make some adjustments to bare-metal code tutorials that were designed only for running on real hardware.
(For more info on the various QEMU options for loading guest code, see this answer.)
QUESTION
I've installed Debian Bullseye from this page: https://raspi.debian.net/daily-images/
on a Raspberry Pi 4 machine and prepared the required libraries and packages following these guides:
https://github.com/abhiTronix/raspberry-pi-cross-compilers/blob/master/QT_build_instructions.md
This is the compiler I'm using: https://snapshots.linaro.org/gnu-toolchain/12.0-2021.10-1/aarch64-linux-gnu/gcc-linaro-12.0.0-2021.10-x86_64_aarch64-linux-gnu.tar.xz
from this page: https://snapshots.linaro.org/gnu-toolchain/12.0-2021.10-1/aarch64-linux-gnu/
issue description
When I run ./configure... after some processing the compiler throws an error:
aarch64-linux-gnu-g++: error: unrecognized command-line option
-mfloat-abi=softfp
Meanwhile, Linaro or official ARM compilers do not support VFP, FPU, etc. so I had to change the qmake.conf to try to remove that command-line option from the compiler flags.
...ANSWER
Answered 2021-Oct-11 at 03:33fixed this by editing the qmake.conf
used linux_device_post
instead of linux_arm_device_post
QUESTION
Could someone please give me advice to make an openbmc image for Raspberrypi platform ? Before I tried, I looked through related documents and believed an openbmc image can be worked on Raspberrypi. Like OpenBMC with Raspberry Pi (2 or 3) and build bmcweb? and https://kevinleeblog.github.io/project1/2019/11/25/openbmc-for-raspberry-pi-zero/.
So, I followed these instructions and tried the following steps.
#1: Git clone openbmc.git to my local PC.
...ANSWER
Answered 2021-Sep-02 at 16:57Interesting, I don't have a quick fix for you but I did notice the partition that is over sized is the uboot partition. The uboot is a smaller separate binary installed on the machine. It looks as if your uboot build is over 512k and the partition is set for 512k. Your flash size is massize
FLASH_SIZE = 9437184"
that is more then a gig, (because FLASH_SIZE is in K)
If I were you I would first try to build an older version of openbmc for raspberry pi. (It used to work so you just need to find the commit before uboot grew to big). Use git to move back a month until you find it works.
If that does not work I would try to modify the partition table. here is where you failing
- this looks fine building the uboot image looks fine
- increasing the kernel offset make if build, but the other targets in openbmc will not be happy with this solution. So maybe meta-raspberry-pi will have to override the partition table (if uboot can not be shrunk)
What ever you do, open an issue on the github and share you changes. Also use the discord, and gerrit.
I just replicated this issue. We should fix it
QUESTION
I am trying to install PyCharm on my raspberry-pi 4 but I get this error:
ERROR: Cannot start PyCharm: No JDK found
and I also tried:
sudo apt install default-jre
but I'm still getting the error.
...ANSWER
Answered 2021-Aug-31 at 20:50The JRE is a subset of the JDK. It's possible that you need the whole JDK in order for PyCharm to work.
Try this:
QUESTION
I connect my RC522 RFID module to my Raspberry Pi 4 according to https://pimylifeup.com/raspberry-pi-rfid-rc522/ so we have Write.py and Read.py:
Write.py:
...ANSWER
Answered 2021-Aug-30 at 14:56I found out the simple answer. just reinstall the Raspbian OS to reset the SPI configuration (which was set for 3.5 inch LCD) so RFID writing and reading work well and everything goes correct.
QUESTION
I would like to run a CAN shield with MCP2515 controller connected to a Raspberry Pi 4 Model B. It already worked under Raspbian but because I need ROS2 I want to run it under Ubuntu (20.04) now. Here it does not work anymore.
What I did was editing /boot/config.txt
and adding the following lines:
ANSWER
Answered 2021-Aug-29 at 17:04For ubuntu the boot partition is mounted under /boot/firmware
with 3 files: config.txt, syscfg.txt, and usercfg.txt. The usercfg.txt is included by config.txt and is recommended to bearing user customized configuration. So saving your lines in usercfg.txt instead should make it works
QUESTION
Been attempting to update a 2 year old, untouched raspberry pi to be able to run a pip module that only runs on 3.6+. I updated the operating system and I've been attempting to update python following this guide but I get to the last stage and it returns python 3.5.3. (note: i added the line to the bottom of the file because i couldn't find it)
I also tried
sudo update-alternatives --config python
but it returned update-alternatives: error: no alternatives for python
ANSWER
Answered 2021-Aug-26 at 10:20First of all, try removing your current python version:
To know your version:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Raspberry-Pi
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page