Go to advanced search

by jahboater
Sun Jul 15, 2018 11:04 pm
Forum: C/C++
Topic: Trying to call an external function-linker can't find it.
Replies: 5
Views: 73

Re: Trying to call an external function-linker can't find it.

Paeryn,

Looks like we cross posted but your explanation is better than my "hint" ...
by jahboater
Sun Jul 15, 2018 10:54 pm
Forum: C/C++
Topic: Trying to call an external function-linker can't find it.
Replies: 5
Views: 73

Re: Trying to call an external function-linker can't find it.

Perhaps buttonsetup is different from ButtonSetup
by jahboater
Sat Jul 14, 2018 8:14 pm
Forum: Beginners
Topic: Looking for Pi 3 B+ overclock Settings
Replies: 14
Views: 8744

Re: Looking for Pi 3 B+ overclock Settings

my rpi3 b+ run at 1.5ghz cpu and 500mhz gpu very fine i only have two tiny heatsink temp=81°c max at 100% running for long time with sysbench Try running this:- wget https://raw.githubusercontent.com/ssvb/cpuburn-arm/master/cpuburn-a53.S gcc -o cpuburn-a53 cpuburn-a53.S ./cpuburn-a53 What temps do ...
by jahboater
Sat Jul 14, 2018 8:04 pm
Forum: General programming discussion
Topic: Question About Compiling RasPi Apps
Replies: 8
Views: 204

Re: Question About Compiling RasPi Apps

rpdom wrote:
Sat Jul 14, 2018 8:02 pm
Build on a Pi 3B and move it to the Zeroes once complete.
A Pi 3B+ .....
by jahboater
Sat Jul 14, 2018 11:17 am
Forum: Troubleshooting
Topic: Crashing RPi when doing "heavy" stuff
Replies: 13
Views: 348

Re: Crashing RPi when doing "heavy" stuff

It sounds like you may be falling into swapping hell. Using too much memory, causing the system to swap large amounts of data between RAM and storage. Oh... Anything I can do about it? Or does it fall under the same category as the suggestion from klricks? The green is almost constantly lighting gr...
by jahboater
Fri Jul 13, 2018 12:39 pm
Forum: Advanced users
Topic: Is there a performance penalty to using two byte structs instead of 4?
Replies: 16
Views: 433

Re: Is there a performance penalty to using two byte structs instead of 4?

So presumably the compiler realises the copy is small as its a literal and does something different. Yes indeed, exactly that. Any small call to memset or memcpy will be replaced with a simple instruction sequence - which may include SIMD registers if the length is 16 bytes or more (gcc may use NEO...
by jahboater
Thu Jul 12, 2018 2:56 pm
Forum: Beginners
Topic: Heatsink for RPI 3B+
Replies: 19
Views: 591

Re: Heatsink for RPI 3B+

The Kintaro heat sink is mounted with four bolts so a thermal compound is used instead of adhesive tape.
It came with some kind of metallic looking compound that was easy to apply.
Maybe I should have searched for a old tube of Arctic Silver 5 in my tool box, but this stuff seems to work.
by jahboater
Thu Jul 12, 2018 9:12 am
Forum: Beginners
Topic: Heatsink for RPI 3B+
Replies: 19
Views: 591

Re: Heatsink for RPI 3B+

I purchased the Kintaro heat sink (purely for interest, my 3B+ was fine anyway).
https://www.amazon.com/dp/B07CTSNZYK/
It keeps my Pi3B+ (very approx) 10C cooler than the Adafruit 15mm cube heatsink.
It also cools the USB/Ethernet chip.
I am impressed!
by jahboater
Thu Jul 12, 2018 8:13 am
Forum: C/C++
Topic: Autorun C program on Raspberry Pi
Replies: 5
Views: 160

Re: Autorun C program on Raspberry Pi

One simple way is to put the full path of your executable in a file called
/etc/rc.local
place it just before the final "exit 0" line.
It will be run as "root", so be careful.
There are other methods, a systemd service or a crontab entry.
by jahboater
Wed Jul 11, 2018 5:06 am
Forum: Beginners
Topic: Heatsink for RPI 3B+
Replies: 19
Views: 591

Re: Heatsink for RPI 3B+

It is capped at 70C, if you set it to a higher value it remains at 70C.

Use "vcgencmd get_config int" to see what its actually been set to.
by jahboater
Tue Jul 10, 2018 8:41 am
Forum: C/C++
Topic: [Solved] Reading from stdin
Replies: 7
Views: 213

Re: Reading from stdin

lianergoist wrote:
Tue Jul 10, 2018 7:53 am
Most of the code I have seen use a char to hold the value returned from fgetc():
Its an extremely common beginners error - don't feel bad about it :)
by jahboater
Tue Jul 10, 2018 7:19 am
Forum: Beginners
Topic: Heatsink for RPI 3B+
Replies: 19
Views: 591

Re: Heatsink for RPI 3B+

Are you sure the throttling while running cpuburn is heat related? Most definitely. It is slightly over-clocked though:- sdram_freq=500 core_freq=500 disable_l2cache=0 If it stays around 60℃ you're fine. If it sits around 70℃, its a bit hot, but still within safe operating limits. If it hits 85℃, i...
by jahboater
Tue Jul 10, 2018 7:01 am
Forum: C/C++
Topic: [Solved] Reading from stdin
Replies: 7
Views: 213

Re: Reading from stdin

In addition, you can test for end of file with feof().

Code: Select all

The function feof() tests the end-of-file indicator for the stream pointed to  by  stream,
returning  nonzero  if  it  is  set.  The end-of-file indicator can be cleared only by the
function clearerr()
by jahboater
Tue Jul 10, 2018 6:54 am
Forum: Beginners
Topic: Heatsink for RPI 3B+
Replies: 19
Views: 591

Re: Heatsink for RPI 3B+

Wow! This Kintaro heatsink is a new idea. There are no mounting holes on the Pi for a heatsink so sticky tape is usually used. The thermal management on the 3B+ is very good, the PCB ground plane acts as a heatsink. So as JamesH says, try it first and monitor the temps with "vcgencmd measure_temp". ...
by jahboater
Tue Jul 10, 2018 6:34 am
Forum: Advanced users
Topic: Is there a performance penalty to using two byte structs instead of 4?
Replies: 16
Views: 433

Re: Is there a performance penalty to using two byte structs instead of 4?

Seems wasteful to use memcpy for 4bytes. Just cast the pointers to uint32 and write. Avoids the overhead of a function call. Sorry, no its not. @ try.c:39: memcpy(&ups,mvect_buffer+offset,sizeof(struct vector_package)); ldr r3, [r0, #12] There is no function call. Writing things like: *(uint32_t*)p...
by jahboater
Tue Jul 10, 2018 6:19 am
Forum: Advanced users
Topic: Is there a performance penalty to using two byte structs instead of 4?
Replies: 16
Views: 433

Re: Is there a performance penalty to using two byte structs instead of 4?

"Make it work, then make it fast" .... Personally I would just get the latest version of GCC (8.1). This will (a) produce the best code, and (b) will annotate the assembler listing with the source code lines making it very easy to find out whats going on. Using a recent compiler and playing with the...
by jahboater
Mon Jul 09, 2018 4:53 pm
Forum: Advanced users
Topic: Is there a performance penalty to using two byte structs instead of 4?
Replies: 16
Views: 433

Re: Is there a performance penalty to using two byte structs instead of 4?

The compiler will keep such small structs in registers as far as possible. The ARM CPU on the Pi has some very handy instructions for dealing with these structs while they are in registers "bfi", "ubfx", the amusingly named "sbfiz" and "ubfiz" and others. With these, there is no extra cost - the com...
by jahboater
Mon Jul 09, 2018 4:41 pm
Forum: C/C++
Topic: Problem writing to /dev/tty
Replies: 4
Views: 154

Re: Problem writing to /dev/tty

I've not had a chance to look at you code, but I use this little function:- /* * Ensure fd's 0 (read) and 1 (write) refer to a terminal. * Return the original file for later use. */ static int tty( const int fd ) { const int new_fd = dup(fd); if( new_fd < 0 || close(fd) != 0 || open( "/dev/tty", fd ...
by jahboater
Mon Jul 09, 2018 7:45 am
Forum: General discussion
Topic: 64-bit operating system
Replies: 83
Views: 5745

Re: 64-bit operating system

I see the latest ARM CPU, the Cortex-A76, mandates a 64-bit kernel.
by jahboater
Sun Jul 08, 2018 11:50 pm
Forum: Bare metal, Assembly language
Topic: Any tricks to further optimize this memory diffing code?
Replies: 3
Views: 205

Re: Any tricks to further optimize this memory diffing code?

I'm not sure it gains anything as there doesn't seem to be an instruction that compares two vectors and sets the flags directly. Looks like you need about 4 insns to do it, but it is comparing four 32 bit integers each time. I saw this on SO: vceq.i32 q15, q0, q3 vlsi.32 d31, d30, #16 vcmp.f64 d31, ...
by jahboater
Sun Jul 08, 2018 10:00 pm
Forum: Beginners
Topic: Processor frequency [answered]
Replies: 6
Views: 162

Re: Processor frequency

The doct is here: https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt It is the "ondemand" governor. All the files you need are in here:- [email protected]:/sys/devices/system/cpu/cpufreq/ondemand $ ls ignore_nice_load io_is_busy powersave_bias sampling_down_factor sampling_rate up_threshold up_thr...
by jahboater
Sun Jul 08, 2018 9:40 pm
Forum: C/C++
Topic: Mutex format for C++
Replies: 9
Views: 240

Re: Mutex format for C++

Heater wrote:
Sun Jul 08, 2018 9:10 pm
C++ the language has no idea about threads. Not even in its standard library.
I think the presumption with C++ should be that it has the feature ....

There is also std::async (simple threads), std::memory_order (atomics) and probably lots of other stuff.
by jahboater
Sun Jul 08, 2018 9:27 pm
Forum: Beginners
Topic: Processor frequency [answered]
Replies: 6
Views: 162

Re: Processor frequency

The load is obviously either 100% or idle (it cant "half" be executing instructions). the processor of an RPi running a fair number of services is never idle. there is always something that needs some attention. When something like top says 50% cpu utilization, it really means 100% utilization for ...
by jahboater
Sun Jul 08, 2018 9:22 pm
Forum: Beginners
Topic: Processor frequency [answered]
Replies: 6
Views: 162

Re: Processor frequency

a Raspberry Pi 3B has 2 basic frequencies: 600 and 1200 MHz. under low loads the frequency is 600 MHz. at what load does the processor change from 600 to 1200 MHz ?? Its probably more the period of time at 100% before the scaling governor increases the frequency. The load is obviously either 100% o...
by jahboater
Sun Jul 08, 2018 9:22 am
Forum: Other
Topic: AplineLinux(aarch64) is coming!
Replies: 4
Views: 160

Re: AplineLinux(aarch64) is coming!

Does it support the new 3B+ model ?

Go to advanced search