Comments on: Chapter 5: Practical Beagle Board Programming http://exploringbeaglebone.com Companion Site for the Book by Derek Molloy Tue, 22 Jan 2019 23:01:10 +0000 hourly 1 https://wordpress.org/?v=5.9.2 By: Derek http://exploringbeaglebone.com/chapter5/#comment-1688 Wed, 03 Jun 2015 00:33:51 +0000 http://exploringbeaglebone.com/?page_id=643#comment-1688 In reply to Catfang.

Thanks! The C#/Mono MCS 3.2.8 (with mcs -optimize+ -platform:arm) is a factor of 2.47, which is approximately the same as Node.js. However, it may be possible to further optimize the build. Also, the performance of Node.js on the BeagleBone is exceptional — I’m not sure how it was optimized so well. No significant reason for leaving it out (other than page space) — I would also like to have covered Haskell, Lua and Ruby! Kind regards, Derek.

]]>
By: Catfang http://exploringbeaglebone.com/chapter5/#comment-1686 Tue, 02 Jun 2015 21:40:07 +0000 http://exploringbeaglebone.com/?page_id=643#comment-1686 Great book, really enjoying it so far! You included Java in your performance testing but left out C#/Mono. Any reason why? It would be great to see how C#/Mono performs next to Java on the BBB.

]]>
By: vidal http://exploringbeaglebone.com/chapter5/#comment-1270 Sat, 18 Apr 2015 15:03:55 +0000 http://exploringbeaglebone.com/?page_id=643#comment-1270 Hi Derek
I am running a test code in c++ to blink a led at GPIO1_12 , using fet and a resistor from gate to ground, then when disconected i am sure the led is off.
At the end the pin is adjusted to 0, and obviously the led is turned off.
But, just after unexport the pin, it goes high.
Am I missing some adjust ??

==============
Partial code:
.
.
if ((myOutputHandle = fopen(GPIOValue, "rb+")) == NULL)
{
  return 1;
}
strcpy(setValue, "0");            // output = 0
fwrite(&setValue, sizeof(char), 1, myOutputHandle);
fclose(myOutputHandle);
//// >>>> until now ok, the led is off
if ((myOutputHandle = fopen("/sys/class/gpio/unexport", "ab")) == NULL) 
{
  return 1;
}
//// >>>> until now ok, the led is still off
strcpy(setValue, GPIOString);
fwrite(&setValue, sizeof(char), 2, myOutputHandle);
fclose(myOutputHandle);
//// >>>> the led goes high.
]]>
By: Derek http://exploringbeaglebone.com/chapter5/#comment-1258 Wed, 15 Apr 2015 17:43:16 +0000 http://exploringbeaglebone.com/?page_id=643#comment-1258 In reply to Robert P. J. Day.

Hi Robert, Unfortunately I keep losing the executable bits and I don’t know why — I think it is possibly the GitHub Windows client, but I cannot be certain. I will fix that. Thanks, Derek.

]]>
By: Derek http://exploringbeaglebone.com/chapter5/#comment-1256 Wed, 15 Apr 2015 17:41:27 +0000 http://exploringbeaglebone.com/?page_id=643#comment-1256 In reply to Robert P. J. Day.

Thanks. Yes it should be +AggressiveOpts — adding it to the list of errata, Derek.

]]>
By: Robert P. J. Day http://exploringbeaglebone.com/chapter5/#comment-1252 Wed, 15 Apr 2015 12:02:26 +0000 http://exploringbeaglebone.com/?page_id=643#comment-1252 The script “restoreDefaultLEDs” doesn’t have the execute bit(s) set, is this deliberate?

]]>
By: Robert P. J. Day http://exploringbeaglebone.com/chapter5/#comment-1250 Wed, 15 Apr 2015 10:36:41 +0000 http://exploringbeaglebone.com/?page_id=643#comment-1250 p. 152, “+AgressiveOpts” -> “+AggressiveOpts”, no?

]]>
By: Derek http://exploringbeaglebone.com/chapter5/#comment-955 Thu, 12 Mar 2015 23:17:52 +0000 http://exploringbeaglebone.com/?page_id=643#comment-955 In reply to Brett.

Thanks Brett — I appreciate your support! Yes, I would have loved to spend more time on the PRU-ICSS but I had agreed 430 pages and was well over that! I’ll continue to add more content to the chapter web page as I develop it (I’ll have to look at real-time DAC soon), but I’ll have to be honest, I hadn’t considered using the PRU-ICSS quite the way that you have suggested. I can see certainly see the use for controlling PWM, but with the complexity of the AM335x and the (quite) limited set of instructions available on the PRU-ICSS it is going to be hard work! I’ll have to have a look into it though. Another book is off the cards for the moment (on any topic) until I catch up with myself. I wrote this book late at night after I settled my kids in bed and it was hard keeping up with everything in work the next day. I’ll keep adding content to the chapter web pages as I develop it — maybe it will all end up in Revision 2! Kind regards, Derek.

]]>
By: Brett http://exploringbeaglebone.com/chapter5/#comment-951 Wed, 11 Mar 2015 22:36:14 +0000 http://exploringbeaglebone.com/?page_id=643#comment-951 Derek,
Love your book. It’s just fantastic and I may use it for a text book next Spring when I again teach my department’s instrumentation course — I’ll focus on embedded devices. What you’ve written is great and I was happy to see the material in Chapter 13. But you stop a bit short of where I was hoping you’d go, namely directly using more of the power of the cpu (at least as much as the BBB allows). For example, by directly addressing registers in the cpu, one could obtain exquisite — and very fast — control over the pwm functions of the cpu, particularly if one did this via the PRU-ICSS. That is, do not use the bios calls, but go into assembly language so the PRU-ICSS can directly access the appropriate PWM registers. For many of my applications this would be extremely useful. I’ve got much of this worked out but, as you know, the AM335x is a really sophisticated chip (roughly 200 pages on PWM alone!) and getting the register settings correct is driving me a bit batty. So my question is, do you plan to write a follow-up book in which you pick up where Chapter 13 leaves off?

]]>
By: Derek http://exploringbeaglebone.com/chapter5/#comment-921 Mon, 09 Mar 2015 20:12:44 +0000 http://exploringbeaglebone.com/?page_id=643#comment-921 In reply to EvertJan Henken.

Hi Evert, No, they are actually equivalent. When you create a pointer, the dereference type of the pointer defines what a +1 is in terms of bytes. For example, on the BBB if you define int *p; the compiler uses the dereference type size (e.g., 4 bytes in this case) to manipulate the pointer. If you declare char *p; then the pointer will only move by one byte on a ++ or +1 manipulation. You can see this in a short code example:

#include < iostream >
using namespace std;

int main(){
	int numbers[3] = {100,200,300};
	int *p = &numbers[0];
	cout << "[0]The address of p is " << p << " and the dereferenced value is: " << *p << endl;
	p++;
	cout << "[1]The address of p is " << p << " and the dereferenced value is: " << *p << endl;
	p=p+1;
	cout << "[2]The address of p is " << p << " and the dereferenced value is: " << *p << endl;
	return 0;
}

Which gives the output when executed:

 
[0]The address of p is 0x7fffdeeccf10 and the dereferenced value is: 100
[1]The address of p is 0x7fffdeeccf14 and the dereferenced value is: 200
[2]The address of p is 0x7fffdeeccf18 and the dereferenced value is: 300

You can see that the pointer moved by 4 bytes after each pointer operation. Hope that helps! Derek.

]]>