Go to advanced search

by jahboater
Thu May 05, 2016 8:57 am
Forum: General discussion
Topic: unable to set GPIO 17 as an output by assembly program
Replies: 10
Views: 1331

Re: unable to set GPIO 17 as an output by assembly program

You could try "svc #0".
mmap2 is 192 which goes in r7 (looks like there is no mmap. glibc mmap() calls mmap2).
r0 - r6 get the parameters.
r0 is replaced by the return value.

do man mmap2 for the details.

If you memmap "/dev/gpiomem" instead of "/dev/mem", you wont need the sudo.
by jahboater
Sun May 01, 2016 6:37 pm
Forum: C/C++
Topic: GCC 6.1 Released
Replies: 14
Views: 6979

Re: GCC 6.1 Released

echmain wrote:I'm curious...why is it so far behind? Is it because 6.1 (or 5.x) must be released in Debian before appearing in Raspbian?
I guess so. And it probably has to work its way up from "testing" to "stable" in Debian.
by jahboater
Sun May 01, 2016 4:07 pm
Forum: C/C++
Topic: ***Installing gcc???? Please help ***
Replies: 17
Views: 2749

Re: ***Installing gcc???? Please help ***

It says that there is no such file or directory; no input file. Do I place the code in just any text editor? If your are working in the terminal, which many people do, you create or alter the program source code (the .cpp file) with ANY editor that you like. You then use gcc or clang to compile it....
by jahboater
Sat Apr 30, 2016 3:21 pm
Forum: Beginners
Topic: Tried learning Python but don't know if I should continue
Replies: 3
Views: 814

Re: Tried learning Python but don't know if I should continu

Try the tab key instead. In C we have if( x > 4 ) { printf("hello"); } In Python if x > 4 : print "hello" In Pascal { and } are "begin" and "end". Other languages have "if" "then" and "fi" Its just a notation for nesting of the code. In Python there are no brackets, so there is less to type. If you ...
by jahboater
Sat Apr 30, 2016 1:10 pm
Forum: Beginners
Topic: Warning: Got a PI3, Don't cheese out in the power cable.
Replies: 9
Views: 2453

Re: Warning: Got a PI3, Don't cheese out in the power cable.

The "official" Pi3 (2.5A 5.1V) power supply has a heavy duty 18AWG cable.
And it only costs £6.
by jahboater
Sat Apr 30, 2016 7:54 am
Forum: General discussion
Topic: pi 3 wifi range
Replies: 34
Views: 67993

Re: pi 3 wifi range

Have you tried positioning the Pi3 differently?
If the antenna on the router is vertical, try putting the Pi on edge, so the Pi's antenna is vertical too.
by jahboater
Fri Apr 29, 2016 12:29 pm
Forum: General discussion
Topic: pi fan direction airflow question
Replies: 37
Views: 36332

Re: pi fan direction airflow question

http://hackaday.com/2012/06/23/checking-out-the-temperature-of-a-raspberry-pi/ Of course these pictures depend on what the chips are actually doing. On the Pi1, the SoC is covered by the memory chip and so probably appears cooler. On the Pi3 picture there is nothing at all connected to the usb/ethe...
by jahboater
Fri Apr 29, 2016 12:23 pm
Forum: Beginners
Topic: Controlling a 5 volt case fan via PWM
Replies: 4
Views: 1525

Re: Controlling a 5 volt case fan via PWM

When you get the heatsink, measure the temperatures for typical workloads.
It may be enough to keep it from throttling without a fan.
Silence!
by jahboater
Fri Apr 29, 2016 12:13 pm
Forum: General discussion
Topic: pi fan direction airflow question
Replies: 37
Views: 36332

Re: pi fan direction airflow question

I didn't know I'm supposed to have 3 heatsinks, I only got a 6mm high one for the main chip from pimoroni . You are not. The SoC definitely needs one. The sdram chip doesn't produce much heat, but may benefit as the refresh rate is adjusted according to the temperature. It will probably overclock b...
by jahboater
Fri Apr 29, 2016 11:19 am
Forum: General discussion
Topic: pi fan direction airflow question
Replies: 37
Views: 36332

Re: pi fan direction airflow question

I think that a heat sink is enough to keep the temperature low, if a Pi is in normal use. Because the processor is not calculating at 100% all the time, like in CPU test, it has time to cool down. My Pi3 is held upright, outside of a case, with all three heatsinks. The heatsinks are the 25C/W ones ...
by jahboater
Fri Apr 29, 2016 10:51 am
Forum: C/C++
Topic: Strange behavior of EOF in raspbian
Replies: 10
Views: 2903

Re: Strange behavior of EOF in raspbian

Try -fsigned-char on the Pi. That just gives a different bug. Every char value is a valid return from getchar(), and EOF is an additional non-char value. Whether char is signed or not, we need a wider type. (K&R does explain this.) Agreed, most definitely "c" should be declared as "int". I just men...
by jahboater
Fri Apr 29, 2016 9:49 am
Forum: C/C++
Topic: Strange behavior of EOF in raspbian
Replies: 10
Views: 2903

Re: Strange behavior of EOF in raspbian

It looks OK, but it has a subtle bug that will only show up on systems where the char type is signed by default. On the Raspberry Pi, the char type is signed, on many other systems it is unsigned. The value of EOF is -1 (on most systems). On the Raspberry Pi, when the char type is signed in the cod...
by jahboater
Fri Apr 29, 2016 9:28 am
Forum: C/C++
Topic: GCC 6.1 Released
Replies: 14
Views: 6979

Re: GCC 6.1 Released

Out of interest, was it throttling back? I found adding a heatsink gained half an hour or so because it ran at 1200Mhz all the time (well all the time I happened to be watching anyway). Possibly, I didn't check, I just left it to run to completion. It does have a heat-sink installed (Pimoroni HAT c...
by jahboater
Fri Apr 29, 2016 9:11 am
Forum: C/C++
Topic: GCC 6.1 Released
Replies: 14
Views: 6979

Re: GCC 6.1 Released

ejolson wrote:Does libcilkrts now build by default as it does on Intel, or does one still need to patch the codebase for ARM?
I don't know. I just tried compiling something with "-lcilkrts" and it failed with "/usr/bin/ld: cannot find -lcilkrts".
by jahboater
Thu Apr 28, 2016 4:20 pm
Forum: C/C++
Topic: GCC 6.1 Released
Replies: 14
Views: 6979

Re: GCC 6.1 Released

Out of interest, was it throttling back?
I found adding a heatsink gained half an hour or so because it ran at 1200Mhz all the time (well all the time I happened to be watching anyway).
by jahboater
Thu Apr 28, 2016 7:22 am
Forum: C/C++
Topic: GCC 6.1 Released
Replies: 14
Views: 6979

GCC 6.1 Released

GCC 6.1 is now available if anyone is interested in the latest version. https://gcc.gnu.org/ It runs fine on the Pi. This means the default compiler on Jessie is now two major versions out of date (4.9). To build:- tar xf gcc-6.1.0.tar.bz2 cd gcc-6.1.0 contrib/download_prerequisites mkdir obj cd obj...
by jahboater
Tue Apr 26, 2016 10:39 pm
Forum: Off topic discussion
Topic: 2038 bug(s)
Replies: 13
Views: 3928

Re: 2038 bug(s)

Even if one moves to 64-bit there will still be a problem in the future. A long time off admittedly. But it's that 'too far away to worry about' and 'this code won't be running then anyway', which gets us into a mess in the first place. I agree; 64-bit data is the fix, for now. But it's not the per...
by jahboater
Tue Apr 26, 2016 4:18 pm
Forum: C/C++
Topic: Minimalistic C-Development
Replies: 13
Views: 2068

Re: Minimalistic C-Development

Don't you need the C compiler? You'll need to write your own standard library and system's calls library and the systems calls themselves. Not to mention you'll need to build the actual bare metal booting scheme from the ground up. The OP was only wanting to write his own GUI (!!). As Joan said, Ra...
by jahboater
Tue Apr 26, 2016 11:10 am
Forum: C/C++
Topic: adjust terminal window position & size opened by C program
Replies: 17
Views: 4312

Re: adjust terminal window position & size opened by C progr

davenull wrote: (I would love to start it by the filemanager like I'm used to by the Windows Explorer, but that Linux filemanger is not capable of starting programs which require sudo :evil: )
sudo chown root myprog
sudo chmod u+s myprog

Then "myprog" will run with effective user id root, no sudo required.
by jahboater
Tue Apr 26, 2016 8:02 am
Forum: C/C++
Topic: any advantage for compiling by -std=c++11 ?
Replies: 13
Views: 2345

Re: any advantage for compiling by -std=c++11 ?

void *func() { return 0; } struct foo { int a; }; typedef long foo; int main() { int old = 0; int new = 1; int *err = func(); struct foo bar; foo humbug; bar.a = 4; foo = 5; printf("Hello\n"); return 0; } That has four different errors that C++ will fail on. 1) new is a keyword in C++ so can't be u...
by jahboater
Tue Apr 26, 2016 7:48 am
Forum: C/C++
Topic: any advantage for compiling by -std=c++11 ?
Replies: 13
Views: 2345

Re: any advantage for compiling by -std=c++11 ?

Almost all extensions to ANSI-C starting with C99 and then C11 are incompatible with C++. In addition to the already mentioned semantics involving pointer aliasing, the implementation of stack-allocated variable length arrays, complex numbers and declarations of counter variables in for loops are a...
by jahboater
Mon Apr 25, 2016 9:54 pm
Forum: C/C++
Topic: any advantage for compiling by -std=c++11 ?
Replies: 13
Views: 2345

Re: any advantage for compiling by -std=c++11 ?

The "restrict" keyword in C is not understood by C++.
Obviously C++ keywords should be avoided.
Not sure what else there is?
by jahboater
Mon Apr 25, 2016 12:29 pm
Forum: Advanced users
Topic: L1 L2 Cache size in Raspberry Pi3
Replies: 4
Views: 10387

Re: L1 L2 Cache size in Raspberry Pi3

I wonder if that's 16KB instruction plus 16KB data which would agree with tested value.
by jahboater
Mon Apr 25, 2016 7:33 am
Forum: Beginners
Topic: Unplugged my Pi while it was running. Any risks?
Replies: 23
Views: 25177

Re: Unplugged my Pi while it was running. Any risks?

There is a handy command called "sync". It doesn't stop the final write of the date/time, nor any wear levelling on the SD card, but it does flush the disk cache. It will normally be done anyway when you unmount a disk or cleanly shutdown, and every 30 seconds or so to limit the loss of data in the ...

Go to advanced search