Go to advanced search

by LdB
Mon Feb 24, 2020 2:08 am
Forum: C/C++
Topic: raspberry pi3 HX711 using loadcell Segmentation fault
Replies: 7
Views: 424

Re: raspberry pi3 HX711 using loadcell Segmentation fault

There are printf errors .... set the compiler to -wall error level which is where it should be for debugging These two are wrong You forgot the % sign printf("read_average_result1: ld \n", result1); This line will probably crash you tell it to take a float and pass a long printf("1: %fg \n", result1...
by LdB
Sat Feb 22, 2020 5:04 pm
Forum: C/C++
Topic: interrupt method with pigpio
Replies: 14
Views: 327

Re: interrupt method with pigpio

What heater is saying is just use a thread to read the serial port your data is slow Here is a sample code it will display the time, spin the cursor and read/display the UART port while waiting for a keypress to exit. You are sort of making complexity where there is no need. #define _DEFAULT_SOURCE ...
by LdB
Sat Feb 22, 2020 11:26 am
Forum: C/C++
Topic: interrupt method with pigpio
Replies: 14
Views: 327

Re: interrupt method with pigpio

So the callback gets called at every edge, that means every time the bit state changes. I could watch at every bit change and process according to that, but this sure is not the to-go solution. So when the first bit of the first byte comes on, the callback is executed and I wait some time to make s...
by LdB
Sat Feb 22, 2020 3:11 am
Forum: C/C++
Topic: interrupt method with pigpio
Replies: 14
Views: 327

Re: interrupt method with pigpio

I don't get the code you hook the interrupt and then proceed to use time for the 14 bytes ???? Why would you not just count them? From what you have described it is one of those classic situations you would have a state machine State1: Count 14 byte header (sid of whatever you call it) State2: Ignor...
by LdB
Thu Feb 20, 2020 2:40 am
Forum: Bare metal, Assembly language
Topic: BCM2711B0
Replies: 37
Views: 7806

Re: BCM2711B0

Wow all I can do is applaud your tenacity and hard work.
by LdB
Thu Feb 20, 2020 2:07 am
Forum: Bare metal, Assembly language
Topic: Invalidation of data cache on Raspberry Pi
Replies: 14
Views: 980

Re: Invalidation of data cache on Raspberry Pi

Unfortunately I have to disagree, but the Cortex-A53 has a Snoop Control Unit , which "maintains coherency between the individual data caches in the processor". Therefore you do not need to use data cache maintenance instructions, when communicating between the four cores of the Cortex-A53. They ar...
by LdB
Wed Feb 19, 2020 3:16 pm
Forum: C/C++
Topic: Can I write and compile C/C++ code on a PC to run on Pi
Replies: 10
Views: 387

Re: Can I write and compile C/C++ code on a PC to run on Pi

PiGraham wrote:
Wed Feb 19, 2020 2:55 pm
Then again I'd probably be looking at ESP32 for that.
Yep ESP32 or PIC32 both which have all that standard, I don't see anything but effort to do that on Pi in baremetal. A uni student might find it fun but the bluetooth is a binary blob anyhow you can't do anything outside what it does.
by LdB
Wed Feb 19, 2020 2:58 pm
Forum: Bare metal, Assembly language
Topic: Invalidation of data cache on Raspberry Pi
Replies: 14
Views: 980

Re: Invalidation of data cache on Raspberry Pi

So on the Pi3 (cortex A53) L1 cache is 32KB per core, L2 is 512KB shared between all cores Now the DATA cache policy is "tends towards exclusive" So data is allocated to the L2 cache only when evicted from the L1 memory system. Note the instruction policy is different it is "tends towards inclusive"...
by LdB
Wed Feb 19, 2020 12:40 pm
Forum: C/C++
Topic: Can I write and compile C/C++ code on a PC to run on Pi
Replies: 10
Views: 387

Re: Can I write and compile C/C++ code on a PC to run on Pi

In the baremetal forum there are a bunch of stickies at the top but equally you can just download the standard Rasbian no GUI version and run the unit just with linux executables. Ultibo suggested above is Pascal so not sure how useful that will be for you given you have asked on C/C++ forum. Anyhow...
by LdB
Fri Feb 14, 2020 10:15 pm
Forum: C/C++
Topic: Libraries for SPI and GPIO in 2020
Replies: 37
Views: 1650

Re: Libraries for SPI and GPIO in 2020

It isn't so much the font that it was explaining it is the function of the thing called a device context. I got the impression you had not written much multithreaded code and if I have that wrong ignore all the next discussion. As we have threads writing to the screen each one may have a different f...
by LdB
Fri Feb 14, 2020 4:54 pm
Forum: C/C++
Topic: Libraries for SPI and GPIO in 2020
Replies: 37
Views: 1650

Re: Libraries for SPI and GPIO in 2020

Sorry I am losing it ... I added font size change to code and managed to not copy the source file to Git This line in SSD1327.c if ((((i + 1) % 4) == 0) && ((i + 1) < tab[0].fontwth)) Was supposed to be this reflecting we write two bits at a time if ((((i + 1) % 4) == 0) && ((i + 1) < tab[0].fontwth...
by LdB
Fri Feb 14, 2020 1:10 pm
Forum: C/C++
Topic: Libraries for SPI and GPIO in 2020
Replies: 37
Views: 1650

Re: Libraries for SPI and GPIO in 2020

You can setup all the normal interrupts and callbacks you are talking to a standard driver. Now my device OLED arrived today and it took but a few minutes to work out the errors on the datasheet. It is an SPI_MODE_3 device it works in SPI_MODE_0 but gets touchy about long wires in mode 0 because the...
by LdB
Thu Feb 13, 2020 11:37 am
Forum: Bare metal, Assembly language
Topic: Baking Pi – Operating Systems Development
Replies: 6
Views: 266

Re: Baking Pi – Operating Systems Development

Yes it's only Pi 1 and you wont even get thru the boot code startup as the later Pi's all enter in higher EL modes.
by LdB
Thu Feb 13, 2020 3:00 am
Forum: C/C++
Topic: Libraries for SPI and GPIO in 2020
Replies: 37
Views: 1650

Re: Libraries for SPI and GPIO in 2020

The GPIO could but the screen can't do anything like that it's a normal SPI screen and that is one of their weaknesses. The SPI is just a shift register process and only the Master (the Pi) can initiate anything on the bus lines the screen itself doesn't signal anything. So to do anything smart you ...
by LdB
Wed Feb 12, 2020 2:43 am
Forum: C/C++
Topic: Libraries for SPI and GPIO in 2020
Replies: 37
Views: 1650

Re: Libraries for SPI and GPIO in 2020

On the Pi under linux the buffer default limit is 4096 because it 1 virtual page so send the screen in two halfs. You can make the calls one after another Its just the single call that can't exceed 4096 Line 92 shows you the default buffer size https://github.com/raspberrypi/linux/blob/rpi-4.4.y/dri...
by LdB
Mon Feb 10, 2020 7:37 pm
Forum: Bare metal, Assembly language
Topic: Pi Zero W - Alternative boot options
Replies: 11
Views: 387

Re: Pi Zero W - Alternative boot options

christinaa explained why she stopped ... #issue 31 It's the same as your idea, why wouldn't you just put another SD card holder on the AVR and avoid all possible collision. What do you conceivably gain by a complex binding on the SD card socket .. you save exactly 1 SD card at what cost and complexi...
by LdB
Mon Feb 10, 2020 6:56 pm
Forum: Bare metal, Assembly language
Topic: Does anyone know what is inside the bootcode.bin, start.elf?
Replies: 2
Views: 220

Re: Does anyone know what is inside the bootcode.bin, start.elf?

Its documented on the Raspberry pages

https://www.raspberrypi.org/documentati ... _folder.md
https://www.raspberrypi.org/documentati ... ootflow.md

basically bootload.bin is the bootstrap loader (except Pi4), start(x).elf is the GPU firmware.
by LdB
Mon Feb 10, 2020 5:53 pm
Forum: Bare metal, Assembly language
Topic: How to set RPi4 (bcm2711) GPIO pull up/down
Replies: 7
Views: 277

Re: How to set RPi4 (bcm2711) GPIO pull up/down

I am not sure the code you are copying works there is time delays required You can loop or do whatever for the delay, I just read the free running clock /*-[gpio_fixResistor]------------------------------------------------------} . Set the GPIO port number with fix resistors to pull up/pull down. . ...
by LdB
Mon Feb 10, 2020 5:40 pm
Forum: Bare metal, Assembly language
Topic: Pi Zero W - Alternative boot options
Replies: 11
Views: 387

Re: Pi Zero W - Alternative boot options

As I said there is no easy way to do it, SD card and USB boot are the only viable options. You dont even have ethernet option of PiZero. If you read up on the Pi startup it is the VC4 that does all the startup and it is the thing that loads the start code into memory and the releases the ARM cpu at ...
by LdB
Mon Feb 10, 2020 4:04 pm
Forum: Bare metal, Assembly language
Topic: Pi Zero W - Alternative boot options
Replies: 11
Views: 387

Re: Pi Zero W - Alternative boot options

To do it just getting one the various AVR Pi Hat boards around something like http://www.onandoffables.com/ You run baremetal code on the Pi and all you need is to get the UART or SPI up so you can talk to the AVR hat board. Then off you go you can run all your peripherals with proper documented det...
by LdB
Mon Feb 10, 2020 4:00 am
Forum: C/C++
Topic: Libraries for SPI and GPIO in 2020
Replies: 37
Views: 1650

Re: Libraries for SPI and GPIO in 2020

let me just check calc so screenwth is 128 divid by 2 = 64 So full screen is 128 x 64 = 8192 So yep you nailed it but it probably needs to be &SSD1327FB[0] I assume is defined like uint8_t SSD1327FB[8192]; The code is technically the same but if you have warning levels turned up it sees your code as...
by LdB
Mon Feb 10, 2020 3:03 am
Forum: C/C++
Topic: Libraries for SPI and GPIO in 2020
Replies: 37
Views: 1650

Re: Libraries for SPI and GPIO in 2020

I worked out after there was a mono and coloured and you had mono from you image. Yes I will put in loop mode but also they give circuits so I can check the start command is acknowledged because the signals will start up to the segment driver. It pricked my interest because they generally aren't thi...
by LdB
Sun Feb 09, 2020 11:07 pm
Forum: C/C++
Topic: Libraries for SPI and GPIO in 2020
Replies: 37
Views: 1650

Re: Libraries for SPI and GPIO in 2020

Yeah I probably can't help anymore until I have one physically later next week .. the documentation to demo code is conflicting. If the BCM is working I would go with that as correct because you can't rely on the documentation. It's reasonably easy to work out what is going on in 4 wire with a scope...
by LdB
Sun Feb 09, 2020 6:14 am
Forum: C/C++
Topic: Libraries for SPI and GPIO in 2020
Replies: 37
Views: 1650

Re: Libraries for SPI and GPIO in 2020

>>> UPDATE <<< Found the problem ... this is one of those unusual SPI devices it is LSB FIRST I noticed it when I started stripping there test code down to only raw linux This hack of there code should still work https://github.com/LdB-ECM/SDD1327_Linux_v1 It was then I noticed this DEV_HARDWARE_SP...
by LdB
Sat Feb 08, 2020 12:26 pm
Forum: C/C++
Topic: Profiling memory mapped framebuffer access
Replies: 13
Views: 660

Re: Profiling memory mapped framebuffer access

Yes I know you are pushing extra data but all your writes then become align 4 so I actually expect you should gain speed. The question comes down to is the speed penalty of writing 3byte data twice higher than pushing one extra byte so both writes are 32bit aligned writes. Be nice if the camera coul...

Go to advanced search