Raspberry Pi 2 with bcm2836

2,949 views
Skip to first unread message

Alexander Kosch

unread,
Feb 3, 2015, 2:54:29 PM2/3/15
to bcm...@googlegroups.com
Hello,

my question is, will there be support for the new raspberry pi2 because it has another SoC(bcm2836)

Roberto Waltman

unread,
Feb 3, 2015, 3:48:42 PM2/3/15
to bcm...@googlegroups.com
On 2/3/2015 2:54 PM, Alexander Kosch wrote:
... will there be support for the new raspberry pi2 because it has another SoC(bcm2836)
Some modules may have to be recompiled for the ARMv7 architecture, but there is a high degree of compatibility.
The peripherals, including the grephics subsystem, seem to be the same.

From http://www.raspberrypi.org/raspberry-pi-2-on-sale/ :

Raspberry Pi 2 ... featuring:

  • A 900MHz quad-core ARM Cortex-A7 CPU (~6x performance)
  • 1GB LPDDR2 SDRAM (2x memory)
  • Complete compatibility with Raspberry Pi 1
-- 
Roberto Waltman

Roberto Waltman

unread,
Feb 3, 2015, 4:07:13 PM2/3/15
to bcm...@googlegroups.com
More comments on compatibility here:

    https://www.youtube.com/watch?v=Xo8RT8Wpv6w
--
You received this message because you are subscribed to the Google Groups "bcm2835" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bcm2835+u...@googlegroups.com.
To post to this group, send email to bcm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bcm2835/54D13427.1070807%40rwaltman.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Roberto Waltman

Roberto Waltman

unread,
Feb 3, 2015, 4:18:14 PM2/3/15
to bcm...@googlegroups.com


And more here:
    http://makezine.com/2015/02/02/eben-upton-raspberry-pi-2/

"The shift from an ARMv6 to ARMv7 is an important move for the Foundation as the original Pi was one of the few boards in widespread circulation using the older v6 architecture, and as a result some software projects had no plans to ever support it. Beyond that, efforts like Ubuntu Core for connected devices — which is only supported on ARMv7 and x86 — can be easily ported to the new generation of Pi boards.

However while the new board will need an ARMv7 kernel and modules, user space binaries built for ARMv6 can continue to be used, which means that the new board is fully software compatible with existing Raspberry Pi distributions of Linux."

----------------------------------

For more options, visit https://groups.google.com/d/optout.

-- 
Roberto Waltman

mad-hatter

unread,
Feb 5, 2015, 3:01:57 PM2/5/15
to bcm...@googlegroups.com
Hello,


The Physical Address mapping has changed, have a look here

http://www.raspberrypi.org/forums/viewtopic.php?f=33&t=98740

Regards

Mike McCauley

unread,
Feb 5, 2015, 5:22:45 PM2/5/15
to bcm...@googlegroups.com
Hi,

thanks.
That thread refers to:

"There is also a routine available that returns the peripheral base address of
the current system ...."

Any idea what hat routine is. I cant find it.

Cheers.
--
Mike McCauley VK4AMM mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com
Phone +61 7 5598-7474

Mike McCauley

unread,
Feb 5, 2015, 8:26:32 PM2/5/15
to bcm...@googlegroups.com, mad-hatter
Hi,

thanks for raising this issue.

New version recently uploaded 1.39 should fix this, though not locally tested
on RPI2 hardware. Testers pls check on RPi2 and report back.

Cheers.

On Thursday, February 05, 2015 12:01:56 PM mad-hatter wrote:

mad-hatter

unread,
Feb 6, 2015, 8:39:07 AM2/6/15
to bcm...@googlegroups.com
Hello,

I've compiled the bcm-1.39 following your instructions and not working???

So I built a shared library and your blink example worked.

gcc -c -Wall -Werror -fPIC bcm2835.c
gcc -shared -o libbcm2835.so bcm2835.o

sudo cp libbcm2835.so /usr/lib
sudo chmod 0755 /usr/lib/libbcm2835.so

Then run 'ldconfig'

Regards

langner...@gmail.com

unread,
Feb 6, 2015, 12:03:30 PM2/6/15
to bcm...@googlegroups.com, mediaservices...@gtempaccount.com
1.39 works for me.
Compiled the new 1.39 on my Rpi Model B+ this morning. Also refreshed the Perl binding and had 1.39 working on the B+ until an hour ago when the RPI2 came in. Swapped it and it was working right away.
I use a Perl script to access an NRF24L01 via the libraries SPI functions. As this also includes driving an enable pin high manually I can also confirm GPIO working (at least for this single pin :-)).

What a speed difference!

Mike McCauley

unread,
Feb 6, 2015, 5:00:32 PM2/6/15
to bcm...@googlegroups.com, langner...@gmail.com
Thanks for the report.

Cheers.

Ching-Cheng Cheng

unread,
Feb 9, 2015, 1:30:16 PM2/9/15
to bcm...@googlegroups.com, langner...@gmail.com
I installed 1.39(http://www.airspayce.com/mikem/bcm2835/bcm2835-1.39.tar.gz) on a new raspbian that surpport raspi2. But nothing work(GPIO i2c...). For now I tested rpi.gpio and pigpio. They still couldn't work right on raspi2 yet :)


Mike McCauley於 2015年2月7日星期六 UTC+8上午6時00分32秒寫道:

Mike McCauley

unread,
Feb 9, 2015, 6:47:27 PM2/9/15
to bcm...@googlegroups.com
Hello,

I dont think there is enough information here to understand your issue.

Perhaps you should review
http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/How_to_ask_a_software_question
and
http://catb.org/~esr/faqs/smart-questions.html

Ching-Cheng Cheng

unread,
Feb 10, 2015, 2:39:20 AM2/10/15
to bcm...@googlegroups.com
Sorry for that.
I am trying to say that the "bcm2835-1.39" can't work correctly on my raspberry 2 b.
I tried the GPIO function and the I2C function, I didn't get any signal with logic analyzer connected to pi 2.
I have used "bcm2835-1.39" on my raspberry b+, it worked well. I can get correct signal on logic analyzer connected to pi.
Thanks~






Mike McCauley於 2015年2月10日星期二 UTC+8上午7時47分27秒寫道:

Mike McCauley

unread,
Feb 10, 2015, 6:43:41 AM2/10/15
to bcm...@googlegroups.com
Hello,

there is still not very much information. It would be helpful to know:

What version OS?
Is it the latest?
Did you try to run the blink example?
Transcript of the make and running blink?
Are you running the example as root?
Is there a
/proc/device-tree/soc/ranges
in your file system?

Please provide as much information as you can. Everything is helpful.


On Monday, February 09, 2015 11:39:20 PM Ching-Cheng Cheng wrote:
> Sorry for that.
> I am trying to say that the "bcm2835-1.39" can't work correctly on my
> raspberry 2 b.
> I tried the GPIO function and the I2C function, I didn't get any signal
> with logic analyzer connected to pi 2.
> I have used "bcm2835-1.39" on my raspberry b+, it worked well. I can get
> correct signal on logic analyzer connected to pi.
> Thanks~
>
>
>
>
>
>
> Mike McCauley於 2015年2月10日星期二 UTC+8上午7時47分27秒寫道:
>
> > Hello,
> >
> > I dont think there is enough information here to understand your issue.
> >
> > Perhaps you should review
> >
> > http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/How_to_ask_a_softwar
> > e_question
> > <http://www.google.com/url?q=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWikip
> > edia%3AReference_desk%2FHow_to_ask_a_software_question&sa=D&sntz=1&usg=AFQ
> > jCNGxrl3g4LskFaGg6wFTMNVPs5Gwaw> and

Ching-Cheng Cheng

unread,
Feb 12, 2015, 8:49:21 AM2/12/15
to bcm...@googlegroups.com
Thanks for the helps!! It work perfect now!!


Mike McCauley於 2015年2月10日星期二 UTC+8下午7時43分41秒寫道:
Hello,

there is still not very much information. It would be helpful to know:

What version OS?
 self-compiled 3.18.6 for the usb touchscreen
Is it the latest?
YES
Did you try to run the blink example?
YES

Transcript of the make and running blink?
gcc -o blink blink.c

Are you running the example as root?
sudo ./blink

Is there a  
/proc/device-tree/soc/ranges
in your file system?
 No, this help so much!!. I recompile and make sure there is DT in my system, then it work as usual!!


Cortland Setlow

unread,
Feb 18, 2015, 8:04:54 PM2/18/15
to bcm...@googlegroups.com
Hi,

Version 1.39 is working for me on Debian Jessie running on RPi2.  I am using 4-wire SPI.

I had to muck about with the config.txt file and copy over the device tree files from the
/boot directory on Raspbian to get my distro to have a /proc/device-tree, but once I added

device_tree=bcm2709-rpi-2-b.dtb
device_tree_address=0x100

and some other lines to /boot/firmware/config.txt, all worked well.  

Thanks muchly,
Cortland Setlow.

John Ruiz

unread,
Feb 28, 2015, 9:10:52 PM2/28/15
to bcm...@googlegroups.com
I'm using 1.39, driving a sensirion SHT1X temperature and moisture sensor.  Working well.

Roman Haselsberger

unread,
Mar 5, 2015, 7:56:29 AM3/5/15
to bcm...@googlegroups.com
Hi,

Display driver works fine on RPi2 - great job!
I have just some troubles with Touch events.

First i changed in File bcm2835-1.39/src/bcm2835.h on Line 352
#define BCM2835_PERI_BASE               0x20000000
to
#define BCM2835_PERI_BASE               0x3F000000

If i test touch functionality i always get back "my_touch.state = 3"
It seems the coordinates of my_touch.touch_x and my_touch.touch_y are correct.

Maybe you have any ideas to fix this?

Mike McCauley

unread,
Mar 5, 2015, 3:13:48 PM3/5/15
to bcm...@googlegroups.com
Hi,
I think you will need to post your code before we can understand your
question.

Roman Haselsberger

unread,
Mar 6, 2015, 3:35:03 AM3/6/15
to bcm...@googlegroups.com
I use a part of the examples.c of Admatec
In console i get the x and y coordinates but i never get the touch state (my_touch.state)  pressed, down or up. i just get back the value 3.
Sorry it doesnt work to upload my .c file.

Here a part of the code:

void example_Touch ()
{
    int i=0, rt;
    uint8_t btn_old_state = up;
           
    RAIO_clear_screen();
   
    RAIO_SetFontSizeFactor ( 0 );

    while(1)
    {   
        // get new touch value
        rt = RAIO_gettouch();
       
       
        // show touch values and state in console
        printf( "\n....x = %d", my_touch.touch_x );
        printf( "\n....y = %d", my_touch.touch_y );       
        printf( "\nstate=%d", my_touch.state );
       
        if ( ((my_touch.state == pressed) || (my_touch.state == down) || (my_touch.state == up)) && (btn_old_state != my_touch.state) )
        {   
            // safe old touch state
            btn_old_state = my_touch.state;
           
            if( my_touch.touch_x > 25 && my_touch.touch_x < 102 )
.....


Jonathan Perkin

unread,
Mar 6, 2015, 6:23:44 PM3/6/15
to bcm...@googlegroups.com
Just to say I migrated my node.js library[1] over to 1.39 today and can confirm it works great on my RPi2.

Thanks for the library, has worked brilliantly and lots faster than the /sys/class/gpio interface ;)

Regards,

Mike McCauley

unread,
Mar 6, 2015, 7:41:53 PM3/6/15
to bcm...@googlegroups.com
Thanks for the headsup.

Cheers.

On Friday, March 06, 2015 03:23:44 PM Jonathan Perkin wrote:
> Just to say I migrated my node.js library[1] over to 1.39 today and can
> confirm it works great on my RPi2.
>
> Thanks for the library, has worked brilliantly and lots faster than the
> /sys/class/gpio interface ;)
>
> Regards,
>
> [1] https://github.com/jperkin/node-rpio

--

Mike McCauley

unread,
Mar 8, 2015, 4:55:09 AM3/8/15
to bcm...@googlegroups.com
Hello,

There is not enough of your code to tell why my_touch.state is not in the sate
you expect. I cant even tell how or where its being set.

The fact that my_touch.touch_x and my_touch.touch_y are reportedly correct
makes me think the problem is not in the bcm2835 library.

Cheers.

Romux

unread,
Mar 9, 2015, 6:54:25 AM3/9/15
to bcm...@googlegroups.com
It seems the reason is in the code of the RAIO8870.c from admatec.
Here i geht the coords my_touch.touch_x and my_touch.touch_y.
And maybe here is something wrong with my_touch.state.

Im not able to debug this and cant solve that problem - do you have any ideas?

// get touch coords
// ----------------------------------------------------------
int32_t RAIO_gettouch()
{
    uint8_t mask;
    uint8_t dummy_tp;
    uint32_t touch_x, touch_y;
   
    mask= RAIO_GetRegister( INTC );
   
    if ( mask & 0x04 )
    {   
        // read the data for x and y
        touch_x = RAIO_GetRegister ( TPXH );
        touch_y = RAIO_GetRegister ( TPYH );
       
        // fill low pass filter with the new values
        low_pass_x[ low_pass_pointer ] = touch_x;
        low_pass_y[ low_pass_pointer ] = touch_y;
        low_pass_pointer++;
                   
       
        if (low_pass_pointer == debounce_buffer_size)
        {
            low_pass_pointer = 0;
            touch_buffer_full = 1;
        }
       
        // calculate the average
        my_touch.touch_x = (low_pass_x[0] + low_pass_x[1] + low_pass_x[2] + low_pass_x[3] ) >> 2;
        my_touch.touch_y = (low_pass_y[0] + low_pass_y[1] + low_pass_y[2] + low_pass_y[3] ) >> 2;

       
        if (touch_buffer_full == 1)
        {
            switch (my_touch.state)
            {
                case down :     my_touch.state= pressed;
                                break;
                case no_touch : my_touch.state = down;
                                break;
                default :         break;
            }
        }
       
        // clear touch irq
        mask &= 0xf4 ;
        RAIO_SetRegister( INTC, mask );
   
        return ( 1 );
    }
    else
    {
        switch (my_touch.state)
        {
            case up :         my_touch.state = no_touch;
                            break;
            case pressed:    my_touch.state = up;
                            break;
            default :         break;
        }
       
        low_pass_pointer = 0;
        touch_buffer_full = 0;
        return ( 0 );
    }
}

Jonathan Perkin

unread,
Mar 9, 2015, 7:32:57 AM3/9/15
to bcm...@googlegroups.com
Whilst adding SPI support to my module over the weekend, it seems that any
SPI use from bcm2835 causes the /dev/spidev interface to stop working and
require a reboot to fix.  Is this normal?

After a fresh reboot, I can run the Linux kernel spidev loopback test program
with loopback MOSI to MISO:

$ ./spidev_test -D /dev/spidev0.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D

I then run the bcm2835 spi example, which also works:

$ sudo ./bcm2835-1.39/examples/spi/spi
Sent to SPI: 0x23. Read back from SPI: 0x23.

Now when I try to re-run the spidev_test program it fails:

$ ./spidev_test -D /dev/spidev0.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00

Happy to help debug this.  The bcm2835 spi example continues to work each
time, but with adding support to my nodejs module I need to be confident in
the expected behaviour whilst I go chasing bugs.

Thanks!


--
You received this message because you are subscribed to a topic in the Google Groups "bcm2835" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bcm2835/2yEPp9aVMQY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bcm2835+u...@googlegroups.com.

To post to this group, send email to bcm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mike McCauley

unread,
Mar 10, 2015, 2:27:29 AM3/10/15
to bcm...@googlegroups.com
Hi,

On Monday, March 09, 2015 11:32:56 AM Jonathan Perkin wrote:
> Whilst adding SPI support to my module over the weekend, it seems that any
> SPI use from bcm2835 causes the /dev/spidev interface to stop working and
> require a reboot to fix. Is this normal?

I would expect some consequences of interacting with the SPI device behind the
back of the linux device driver.

bcm2835 librray is intended to be used when going via the driver (if avilable)
is not an acceptable option.

If the driver works for you, you should use that instead.

Cheers.

John Ruiz

unread,
Mar 18, 2015, 2:16:19 AM3/18/15
to bcm...@googlegroups.com
I apologize, but I think I might need to take that back.

I rolled my stuff into a shared library and started calling into it from a Java App using JNI.  The whole JVM crashes, claiming that there was a crash in native code, namely within bcm2835_peri_write().  What can I show you that would be helpful in debugging that?  

Here's the setup:
My Java App --> /usr/local/lib/libsht1x-java.so --> /usr/local/lib/libsht1x.so --> /usr/local/lib/libbcm2835.a

obviously, you know what libbcm2835.a is.  :-)

libsht1x.so is a shared library that uses the linker option:
-Wl,--whole-archive -lbcm2835 -Wl,--no-whole-archive
in order to pick up your static library.  The source is more or less this: https://www.john.geek.nz/2012/11/update-reading-data-from-a-sensirion-sht1x-with-a-raspberry-pi/

libsht1x-java is a java binding for libsht1x.  I defined java native methods and used javah to generate a .h file which I implemented in a .c file.

And my java app uses System.loadLibrary to load libsht1x-java.  Here's the source of the Java App:

public class Sht1xSensor {

   
native float getTemperatureInFahrenheit();
   
native float getTemperatureInCelcius();
   
native float getHumidity();


   
static {
       
System.loadLibrary("sht1x-java");
   
}


   
static public void main(String argv[]) {


       
Sht1xSensor sensor = new Sht1xSensor();
       
float temp = sensor.getTemperatureInFahrenheit();
       
float humidity = sensor.getHumidity();


       
System.out.println("The current temperature (degrees F) is: " + temp);
       
System.out.println("The current relative humidity is: " + humidity);
   
}
}

Here's the implementation of the .h file that gets generated via javah:

#include "Sht1xSensor.h"
#include <RPi_SHT1x.h>


/*
 * Class:     Sht1xSensor
 * Method:    getTemperatureInCelcius
 * Signature: ()F
 */

JNIEXPORT jfloat JNICALL
Java_Sht1xSensor_getTemperatureInCelcius
 
(JNIEnv *env, jobject obj)
{
   
unsigned char noError = 1;  
 
unsigned short int sensorTicks;
 
 
 
// Wait at least 11ms after power-up (chapter 3.1)
 delay
(20);
 
 
// Set up the SHT1x Data and Clock Pins
 SHT1x_InitPins
();
 
 
// Reset the SHT1x
 SHT1x_Reset
();
 
 
// Request Temperature measurement
 noError
= SHT1x_Measure_Start( SHT1xMeaT );
 
if (!noError) {
 
return;
 
}
 
 
// Read Temperature measurement
 noError
= SHT1x_Get_Measure_Value( (unsigned short int*) &sensorTicks );
 
if (!noError) {
 
return;
 
}


   
// Calculate the temp based on the reading
   
float tempReading = (float)sensorTicks;
   
return (jfloat)SHT1x_CalcTemperature(&tempReading);
}


/*
 * Class:     Sht1xSensor
 * Method:    getTemperatureInFahrenheit
 * Signature: ()F
 */

JNIEXPORT jfloat JNICALL
Java_Sht1xSensor_getTemperatureInFahrenheit
   
(JNIEnv *env, jobject obj)
{
    jfloat tempInCelcius
= Java_Sht1xSensor_getTemperatureInCelcius(env, obj);
   
return (jfloat) (tempInCelcius * 9 / 5) + 32;
}


/*
 * Class:     Sht1xSensor
 * Method:    getHumidity
 * Signature: ()F
 */

JNIEXPORT jfloat JNICALL
Java_Sht1xSensor_getHumidity
 
(JNIEnv *env, jobject obj)
{
   
}


Here's the JVM error log.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x64cedbe4, pid=11662, tid=1983800432
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b132) (build 1.8.0-b132)
# Java VM: Java HotSpot(TM) Client VM (25.0-b70 mixed mode linux-arm )
# Problematic frame:
# C  [sht1x+0x2be4]  bcm2835_peri_write+0x14
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x00879000):  JavaThread "main" [_thread_in_native, id=11663, stack(0x76397000,0x763e7000)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000027

Registers:
  r0  = 0x00000027
  r1  = 0x00000000
  r2  = 0x00800000
  r3  = 0x00000027
  r4  = 0x74319348
  r5  = 0x742047d0
  r6  = 0x00000000
  r7  = 0x00000000
  r8  = 0x763e5ad4
  r9  = 0x65765238
  r10 = 0x00879000
  fp  = 0x763e5a1c
  r12 = 0x64cedbd0
  sp  = 0x763e5a18
  lr  = 0x64ced0f8
  pc  = 0x64cedbe4
  cpsr = 0x60000010

Top of Stack: (sp=0x763e5a18)
0x763e5a18:   763e5a34 74204754 763e5ad4 0087912c
0x763e5a28:   0000052c 01000000 763e5a4c 742047f0
0x763e5a38:   763e5ad4 0087912c 00000001 00000000
0x763e5a48:   763e5ac8 742e73fc 00879000 00000000
0x763e5a58:   00000001 00000000 763e5bac 00877658
0x763e5a68:   763e5a8c 766cac98 742dd688 00879000
0x763e5a78:   763e5af8 763e5ad4 00000000 00000001
0x763e5a88:   763e5ac8 742e7274 00000000 00000005 

Instructions: (pc=0x64cedbe4)
0x64cedbc4:   e8bd8008 64cf7698 64cef380 e1a02001
0x64cedbd4:   e59f101c e1a03000 e5d11000 e3510000
0x64cedbe4:   05802000 012fff1e e59f0008 e1a01003
0x64cedbf4:   eafffc52 64cf7698 64cef3a4 e1a02001 

Register to memory mapping:

  r0  = 0x00000027
0x00000027 is an unknown value

  r1  = 0x00000000
0x00000000 is an unknown value

  r2  = 0x00800000
0x00800000 is an unknown value

  r3  = 0x00000027
0x00000027 is an unknown value

  r4  = 0x74319348
0x74319348 is at code_begin+1800 in 
[CodeBlob (0x74318c08)]
Framesize: 0
BufferBlob (0x74318c08) used for native signature handlers

  r5  = 0x742047d0
0x742047d0: Java_Sht1xSensor_getTemperatureInFahrenheit+0 in /usr/local/lib/libsht1x-java.so at 0x74204000

  r6  = 0x00000000
0x00000000 is an unknown value

  r7  = 0x00000000
0x00000000 is an unknown value

  r8  = 0x763e5ad4
0x763e5ad4 is pointing into the stack for thread: 0x00879000

  r9  = 0x65765238
0x65765238 is an unknown value

  r10 = 0x00879000
0x00879000 is a thread

  fp  = 0x763e5a1c
0x763e5a1c is pointing into the stack for thread: 0x00879000

  r12 = 0x64cedbd0
0x64cedbd0: bcm2835_peri_write+0 in /usr/local/lib/sht1x at 0x64ceb000

  sp  = 0x763e5a18
0x763e5a18 is pointing into the stack for thread: 0x00879000

  lr  = 0x64ced0f8
0x64ced0f8: SHT1x_InitPins+0x14 in /usr/local/lib/sht1x at 0x64ceb000

  pc  = 0x64cedbe4
0x64cedbe4: bcm2835_peri_write+0x14 in /usr/local/lib/sht1x at 0x64ceb000



Stack: [0x76397000,0x763e7000],  sp=0x763e5a18,  free space=314k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [sht1x+0x2be4]  bcm2835_peri_write+0x14

[error occurred during error reporting (printing native stack), id 0xb]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  Sht1xSensor.getTemperatureInFahrenheit()F+0
j  Sht1xSensor.main([Ljava/lang/String;)V+9
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x64e12000 JavaThread "Service Thread" daemon [_thread_blocked, id=11669, stack(0x64f0a000,0x64f5a000)]
  0x008f5c00 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=11668, stack(0x64f5a000,0x64fda000)]
  0x008f4400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=11667, stack(0x64fda000,0x6502a000)]
  0x008d6400 JavaThread "Finalizer" daemon [_thread_blocked, id=11666, stack(0x651a1000,0x651f1000)]
  0x008d1400 JavaThread "Reference Handler" daemon [_thread_blocked, id=11665, stack(0x651f1000,0x65241000)]
=>0x00879000 JavaThread "main" [_thread_in_native, id=11663, stack(0x76397000,0x763e7000)]

Other Threads:
  0x008cd000 VMThread [stack: 0x65241000,0x652c1000] [id=11664]
  0x64e14000 WatcherThread [stack: 0x64d80000,0x64e00000] [id=11670]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 def new generation   total 4864K, used 808K [0x65a00000, 0x65f40000, 0x6a740000)
  eden space 4352K,  18% used [0x65a00000, 0x65aca018, 0x65e40000)
  from space 512K,   0% used [0x65e40000, 0x65e40000, 0x65ec0000)
  to   space 512K,   0% used [0x65ec0000, 0x65ec0000, 0x65f40000)
 tenured generation   total 11008K, used 0K [0x6a740000, 0x6b200000, 0x74200000)
   the space 11008K,   0% used [0x6a740000, 0x6a740000, 0x6a740200, 0x6b200000)
 Metaspace       used 1740K, capacity 2202K, committed 2328K, reserved 4400K

Card table byte_map: [0x6598b000,0x65a00000] byte_map_base: 0x6565e000

Polling page: 0x76fbc000

CodeCache: size=32768Kb used=643Kb max_used=643Kb free=32124Kb
 bounds [0x742db000, 0x74383000, 0x762db000]
 total_blobs=155 nmethods=18 adapters=70
 compilation: enabled

Compilation events (10 events):
Event: 0.466 Thread 0x008f5c00   14   !         java.io.BufferedReader::readLine (304 bytes)
Event: 0.473 Thread 0x008f5c00 nmethod 14 0x74375208 code [0x74375390, 0x7437617c]
Event: 0.474 Thread 0x008f5c00   15             java.util.LinkedList::indexOf (73 bytes)
Event: 0.475 Thread 0x008f5c00 nmethod 15 0x74376bc8 code [0x74376cc0, 0x74376e44]
Event: 0.479 Thread 0x008f5c00   16             sun.nio.cs.UTF_8$Decoder::decodeArrayLoop (671 bytes)
Event: 0.505 Thread 0x008f5c00 nmethod 16 0x74376f48 code [0x74377460, 0x74378778]
Event: 0.505 Thread 0x008f5c00   17             java.io.UnixFileSystem::normalize (75 bytes)
Event: 0.507 Thread 0x008f5c00 nmethod 17 0x7437b7c8 code [0x7437b8e0, 0x7437ba9c]
Event: 0.510 Thread 0x008f5c00   18             java.lang.Math::min (11 bytes)
Event: 0.511 Thread 0x008f5c00 nmethod 18 0x7437bc48 code [0x7437bd20, 0x7437bda8]

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Internal exceptions (3 events):
Event: 0.176 Thread 0x00879000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x65a0f780) thrown at [/HUDSON/workspace/8-2-build-glinux-arm-vfp-hflt/jdk8/2238/hotspot/src/share/v
Event: 0.176 Thread 0x00879000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x65a0fa00) thrown at [/HUDSON/workspace/8-2-build-glinux-arm-vfp-hflt/jdk8/2238/hotspot/src/share/vm/prims/jni.cpp, l
Event: 0.487 Thread 0x00879000 Exception <a 'java/security/PrivilegedActionException'> (0x65ab9348) thrown at [/HUDSON/workspace/8-2-build-glinux-arm-vfp-hflt/jdk8/2238/hotspot/src/share/vm/prims/jvm.cpp, line 1248]

Events (10 events):
Event: 0.503 loading class java/security/AllPermission
Event: 0.503 loading class java/security/AllPermission done
Event: 0.503 loading class java/security/UnresolvedPermission
Event: 0.504 loading class java/security/UnresolvedPermission done
Event: 0.504 loading class java/security/BasicPermissionCollection
Event: 0.505 loading class java/security/BasicPermissionCollection done
Event: 0.507 loading class sun/launcher/LauncherHelper$FXHelper
Event: 0.508 loading class sun/launcher/LauncherHelper$FXHelper done
Event: 0.510 loading class java/lang/ClassLoaderHelper
Event: 0.510 loading class java/lang/ClassLoaderHelper done


Dynamic libraries:
00008000-00009000 r-xp 00000000 b3:06 539716     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java
00010000-00011000 rw-p 00000000 b3:06 539716     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java
00871000-0099f000 rw-p 00000000 00:00 0          [heap]
64ceb000-64cf0000 r-xp 00000000 b3:06 262749     /usr/local/lib/libsht1x.so
64cf0000-64cf7000 ---p 00005000 b3:06 262749     /usr/local/lib/libsht1x.so
64cf7000-64cf8000 rw-p 00004000 b3:06 262749     /usr/local/lib/libsht1x.so
64cf8000-64d2a000 r--s 0023c000 b3:06 664858     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/ext/jfxrt-controls.jar
64d2a000-64d80000 r--s 00408000 b3:06 664860     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/ext/jfxrt-graphics.jar
64d80000-64d81000 ---p 00000000 00:00 0 
64d81000-64e00000 rw-p 00000000 00:00 0          [stack:11670]
64e00000-64e7e000 rw-p 00000000 00:00 0 
64e7e000-64f00000 ---p 00000000 00:00 0 
64f0a000-64f0d000 ---p 00000000 00:00 0 
64f0d000-64f5a000 rw-p 00000000 00:00 0          [stack:11669]
64f5a000-64f5d000 ---p 00000000 00:00 0 
64f5d000-64fda000 rw-p 00000000 00:00 0          [stack:11668]
64fda000-64fdd000 ---p 00000000 00:00 0 
64fdd000-6502a000 rw-p 00000000 00:00 0          [stack:11667]
6502a000-651a1000 r--p 00000000 b3:06 803006     /usr/lib/locale/locale-archive
651a1000-651a4000 ---p 00000000 00:00 0 
651a4000-651f1000 rw-p 00000000 00:00 0          [stack:11666]
651f1000-651f4000 ---p 00000000 00:00 0 
651f4000-65241000 rw-p 00000000 00:00 0          [stack:11665]
65241000-65242000 ---p 00000000 00:00 0 
65242000-65310000 rw-p 00000000 00:00 0          [stack:11664]
65310000-654e4000 r--s 03c85000 b3:06 664771     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/rt.jar
654e4000-65785000 rw-p 00000000 00:00 0 
65785000-6598b000 ---p 00000000 00:00 0 
6598b000-6598e000 rw-p 00000000 00:00 0 
6598e000-659b1000 ---p 00000000 00:00 0 
659b1000-659b7000 rw-p 00000000 00:00 0 
659b7000-659ff000 ---p 00000000 00:00 0 
659ff000-65f40000 rw-p 00000000 00:00 0 
65f40000-6a740000 ---p 00000000 00:00 0 
6a740000-6b200000 rw-p 00000000 00:00 0 
6b200000-74200000 ---p 00000000 00:00 0 
74204000-74205000 r-xp 00000000 b3:06 262735     /usr/local/lib/libsht1x-java.so
74205000-7420c000 ---p 00001000 b3:06 262735     /usr/local/lib/libsht1x-java.so
7420c000-7420d000 rw-p 00000000 b3:06 262735     /usr/local/lib/libsht1x-java.so
7420d000-74213000 rw-p 00000000 00:00 0 
74213000-7425b000 ---p 00000000 00:00 0 
7425b000-7425e000 rw-p 00000000 00:00 0 
7425e000-742db000 ---p 00000000 00:00 0 
742db000-74383000 rwxp 00000000 00:00 0 
74383000-762db000 ---p 00000000 00:00 0 
762db000-762f2000 r-xp 00000000 b3:06 664792     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/libzip.so
762f2000-762f9000 ---p 00017000 b3:06 664792     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/libzip.so
762f9000-762fa000 rw-p 00016000 b3:06 664792     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/libzip.so
762fa000-76304000 r-xp 00000000 b3:06 1707642    /lib/arm-linux-gnueabihf/libnss_files-2.13.so
76304000-7630b000 ---p 0000a000 b3:06 1707642    /lib/arm-linux-gnueabihf/libnss_files-2.13.so
7630b000-7630c000 r--p 00009000 b3:06 1707642    /lib/arm-linux-gnueabihf/libnss_files-2.13.so
7630c000-7630d000 rw-p 0000a000 b3:06 1707642    /lib/arm-linux-gnueabihf/libnss_files-2.13.so
7630d000-76316000 r-xp 00000000 b3:06 1707764    /lib/arm-linux-gnueabihf/libnss_nis-2.13.so
76316000-7631d000 ---p 00009000 b3:06 1707764    /lib/arm-linux-gnueabihf/libnss_nis-2.13.so
7631d000-7631e000 r--p 00008000 b3:06 1707764    /lib/arm-linux-gnueabihf/libnss_nis-2.13.so
7631e000-7631f000 rw-p 00009000 b3:06 1707764    /lib/arm-linux-gnueabihf/libnss_nis-2.13.so
7631f000-76330000 r-xp 00000000 b3:06 1707581    /lib/arm-linux-gnueabihf/libnsl-2.13.so
76330000-76337000 ---p 00011000 b3:06 1707581    /lib/arm-linux-gnueabihf/libnsl-2.13.so
76337000-76338000 r--p 00010000 b3:06 1707581    /lib/arm-linux-gnueabihf/libnsl-2.13.so
76338000-76339000 rw-p 00011000 b3:06 1707581    /lib/arm-linux-gnueabihf/libnsl-2.13.so
76339000-7633b000 rw-p 00000000 00:00 0 
7633b000-76341000 r-xp 00000000 b3:06 1707586    /lib/arm-linux-gnueabihf/libnss_compat-2.13.so
76341000-76348000 ---p 00006000 b3:06 1707586    /lib/arm-linux-gnueabihf/libnss_compat-2.13.so
76348000-76349000 r--p 00005000 b3:06 1707586    /lib/arm-linux-gnueabihf/libnss_compat-2.13.so
76349000-7634a000 rw-p 00006000 b3:06 1707586    /lib/arm-linux-gnueabihf/libnss_compat-2.13.so
7634a000-7636d000 r-xp 00000000 b3:06 664844     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/libjava.so
7636d000-76375000 ---p 00023000 b3:06 664844     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/libjava.so
76375000-76376000 rw-p 00023000 b3:06 664844     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/libjava.so
76376000-7637f000 r-xp 00000000 b3:06 664829     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/libverify.so
7637f000-76387000 ---p 00009000 b3:06 664829     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/libverify.so
76387000-76388000 rw-p 00009000 b3:06 664829     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/libverify.so
76388000-7638e000 r-xp 00000000 b3:06 1707590    /lib/arm-linux-gnueabihf/librt-2.13.so
7638e000-76395000 ---p 00006000 b3:06 1707590    /lib/arm-linux-gnueabihf/librt-2.13.so
76395000-76396000 r--p 00005000 b3:06 1707590    /lib/arm-linux-gnueabihf/librt-2.13.so
76396000-76397000 rw-p 00006000 b3:06 1707590    /lib/arm-linux-gnueabihf/librt-2.13.so
76397000-7639a000 ---p 00000000 00:00 0 
7639a000-763e7000 rw-p 00000000 00:00 0          [stack:11663]
763e7000-7644f000 r-xp 00000000 b3:06 1707752    /lib/arm-linux-gnueabihf/libm-2.13.so
7644f000-76456000 ---p 00068000 b3:06 1707752    /lib/arm-linux-gnueabihf/libm-2.13.so
76456000-76457000 r--p 00067000 b3:06 1707752    /lib/arm-linux-gnueabihf/libm-2.13.so
76457000-76458000 rw-p 00068000 b3:06 1707752    /lib/arm-linux-gnueabihf/libm-2.13.so
76458000-76994000 r-xp 00000000 b3:06 664804     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/client/libjvm.so
76994000-7699b000 ---p 0053c000 b3:06 664804     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/client/libjvm.so
7699b000-769c5000 rw-p 0053b000 b3:06 664804     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/client/libjvm.so
769c5000-76de6000 rw-p 00000000 00:00 0 
76de6000-76e06000 r-xp 00000000 b3:06 1707584    /lib/arm-linux-gnueabihf/libgcc_s.so.1
76e06000-76e0d000 ---p 00020000 b3:06 1707584    /lib/arm-linux-gnueabihf/libgcc_s.so.1
76e0d000-76e0e000 rw-p 0001f000 b3:06 1707584    /lib/arm-linux-gnueabihf/libgcc_s.so.1
76e0e000-76f32000 r-xp 00000000 b3:06 1707613    /lib/arm-linux-gnueabihf/libc-2.13.so
76f32000-76f39000 ---p 00124000 b3:06 1707613    /lib/arm-linux-gnueabihf/libc-2.13.so
76f39000-76f3b000 r--p 00123000 b3:06 1707613    /lib/arm-linux-gnueabihf/libc-2.13.so
76f3b000-76f3c000 rw-p 00125000 b3:06 1707613    /lib/arm-linux-gnueabihf/libc-2.13.so
76f3c000-76f3f000 rw-p 00000000 00:00 0 
76f3f000-76f41000 r-xp 00000000 b3:06 1707611    /lib/arm-linux-gnueabihf/libdl-2.13.so
76f41000-76f48000 ---p 00002000 b3:06 1707611    /lib/arm-linux-gnueabihf/libdl-2.13.so
76f48000-76f49000 r--p 00001000 b3:06 1707611    /lib/arm-linux-gnueabihf/libdl-2.13.so
76f49000-76f4a000 rw-p 00002000 b3:06 1707611    /lib/arm-linux-gnueabihf/libdl-2.13.so
76f4a000-76f5e000 r-xp 00000000 b3:06 664808     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/jli/libjli.so
76f5e000-76f65000 ---p 00014000 b3:06 664808     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/jli/libjli.so
76f65000-76f66000 rw-p 00013000 b3:06 664808     /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/jli/libjli.so
76f66000-76f7a000 r-xp 00000000 b3:06 1707627    /lib/arm-linux-gnueabihf/libpthread-2.13.so
76f7a000-76f81000 ---p 00014000 b3:06 1707627    /lib/arm-linux-gnueabihf/libpthread-2.13.so
76f81000-76f82000 r--p 00013000 b3:06 1707627    /lib/arm-linux-gnueabihf/libpthread-2.13.so
76f82000-76f83000 rw-p 00014000 b3:06 1707627    /lib/arm-linux-gnueabihf/libpthread-2.13.so
76f83000-76f85000 rw-p 00000000 00:00 0 
76f8b000-76f93000 rw-s 00000000 b3:06 1573647    /tmp/hsperfdata_root/11662
76f93000-76f95000 r-xp 00000000 b3:06 1180452    /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so
76f95000-76f9c000 ---p 00002000 b3:06 1180452    /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so
76f9c000-76f9d000 rw-p 00001000 b3:06 1180452    /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so
76f9d000-76fba000 r-xp 00000000 b3:06 1707594    /lib/arm-linux-gnueabihf/ld-2.13.so
76fbc000-76fbd000 r--p 00000000 00:00 0 
76fbd000-76fc0000 rw-p 00000000 00:00 0 
76fc0000-76fc2000 rw-p 00000000 00:00 0 
76fc2000-76fc3000 r--p 0001d000 b3:06 1707594    /lib/arm-linux-gnueabihf/ld-2.13.so
76fc3000-76fc4000 rw-p 0001e000 b3:06 1707594    /lib/arm-linux-gnueabihf/ld-2.13.so
7e7ec000-7e80d000 rw-p 00000000 00:00 0          [stack]
7ecaa000-7ecab000 r-xp 00000000 00:00 0          [sigpage]
ffff0000-ffff1000 r-xp 00000000 00:00 0          [vectors]

VM Arguments:
jvm_args: -Djava.library.path=/usr/local/lib 
java_command: Sht1xSensor
java_class_path (initial): .
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
USERNAME=root
SHELL=/bin/bash
DISPLAY=localhost:10.0

Signal Handlers:
SIGSEGV: [libjvm.so+0x4c7b40], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGBUS: [libjvm.so+0x4c7b40], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGFPE: [libjvm.so+0x3cc1ac], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGPIPE: [libjvm.so+0x3cc1ac], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGXFSZ: [libjvm.so+0x3cc1ac], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGILL: [libjvm.so+0x3cc1ac], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [libjvm.so+0x3cc2dc], sa_mask[0]=0x00000000, sa_flags=0x10000004
SIGHUP: [libjvm.so+0x3cc710], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGINT: [libjvm.so+0x3cc710], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGTERM: [libjvm.so+0x3cc710], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGQUIT: [libjvm.so+0x3cc710], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004


---------------  S Y S T E M  ---------------

OS:PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"

uname:Linux 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l
libc:glibc 2.13 NPTL 2.13 
rlimit: STACK 8192k, CORE 0k, NPROC 7349, NOFILE 4096, AS infinity
load average:0.01 0.02 0.05

/proc/meminfo:
MemTotal:         949328 kB
MemFree:          609384 kB
MemAvailable:     870244 kB
Buffers:           40368 kB
Cached:           234428 kB
SwapCached:            0 kB
Active:           205428 kB
Inactive:         100780 kB
Active(anon):      31556 kB
Inactive(anon):      704 kB
Active(file):     173872 kB
Inactive(file):   100076 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:        102396 kB
SwapFree:         102396 kB
Dirty:                56 kB
Writeback:             0 kB
AnonPages:         31328 kB
Mapped:            40812 kB
Shmem:               852 kB
Slab:              21868 kB
SReclaimable:      14780 kB
SUnreclaim:         7088 kB
KernelStack:        1528 kB
PageTables:         1420 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      577060 kB
Committed_AS:     306896 kB
VmallocTotal:    1105920 kB
VmallocUsed:        3876 kB
VmallocChunk:     865084 kB


CPU:total 4 (ARMv7), vfp

/proc/cpuinfo:
processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 57.60
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 1
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 57.60
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 2
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 57.60
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 3
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 57.60
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

Hardware : BCM2709
Revision : a21041
Serial : 000000005f115d27


Memory: 4k page, physical 949328k(609384k free), swap 102396k(102396k free)

vm_info: Java HotSpot(TM) Client VM (25.0-b70) for linux-arm-vfp-hflt JRE (1.8.0-b132), built on Mar  4 2014 06:39:31 by "java_re" with gcc 4.7.2 20120910 (prerelease)

time: Wed Mar 18 05:40:05 2015
elapsed time: 0 seconds

Mike McCauley

unread,
Mar 18, 2015, 2:20:37 AM3/18/15
to bcm...@googlegroups.com
Is the bcm2835 library being initialized?

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "bcm2835" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bcm2835+u...@googlegroups.com.

To post to this group, send email to bcm...@googlegroups.com.

John Ruiz

unread,
Mar 20, 2015, 8:55:44 PM3/20/15
to bcm...@googlegroups.com
That was exactly the problem.  I added a call to bcm2835_init() in the Init_Pins() method.  How did you know?

Also, if you look at the link that I sent you for the SHT1x c++ code, it runs without errors and it never calls bcm2835_init(), at least not that I can see.  Do you think that's weird?

Thanks again,
~ jR
...

Tonde

unread,
Jul 28, 2015, 10:56:17 PM7/28/15
to bcm2835, kosch.a...@googlemail.com

Hi every body,

I followed all the recommandtions above. I am using  raspbian (release April 2015 kernel 3.18.11). I am using a bcm2835-1.42.tar.gz.
The program below works fine on raspberry pi B but not at all on raspberry pi2.

 I did :
sudo raspi-config
under Advanced Options - enable Device Tree
under Advanced Options - disable SPI
Reboot

I verfied that the file " /proc/device-tree/soc/ranges" exists

No success, my program does not work

My program controls a PIFACE board which is based on theMicrochip MCP23S17 (8 digital inputs and 8  digital outputs drived by SPI). The chip requires 3 bytes while the "CS = Chip Select" pin is driven LOW. I   got the same problem with the ADC MCP3208 which works like the MCP23S17 but  for analog data acsuisition.
The bcm2835 library works fine on RPI2 when I just call bcm2835 functions that transfert ONLY one byte at a time, for example to control a NOKIA LCD 5110. So, I think the problem is not a bad configration or due to the version of raspbian I am using!

The following code works as expected on RPI B but not on RPI2  :


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <bcm2835.h>

/******************************************************************************************************/
/** Consts for the  MCP23S17 **/
#define read_OPCODE_MCP23S17     0b01000001
#define write_OPCODE_MCP23S17    0b01000000

#define GPIOA            0x09
#define GPIOB            0x19
#define IOCON            0x0A
#define GPPUB            0x16

#define IODIRA       0x00
#define IODIRB       0x10


/*****************************  MCP23S17 init and control functions ************************************/
void MCP23S17_init(void)
{
      bcm2835_spi_begin();
      bcm2835_spi_setBitOrder(BCM2835_SPI_BIT_ORDER_MSBFIRST);      // The default
      bcm2835_spi_setDataMode(BCM2835_SPI_MODE0);                            // The default
      bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_512);    //488Khz
      bcm2835_spi_chipSelect(BCM2835_SPI_CS0);                                     // Use CS0 for chip select
      bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0, LOW);            // CS0 is active LOW
}

void  MCP23S17_sendData(uint8_t destAddr, uint8_t data)
{
    char buf[3];
    buf[0] = (uint8_t)write_OPCODE_MCP23S17 ;
    buf[1] = destAddr ;
    buf[2] = data ;
       bcm2835_spi_writenb(buf, 3) ;
}


uint8_t MCP23S17_receiveData(uint8_t destAddr)
{
    char tbuf[3]; //transmitt buffer
    char rbuf[3] = {0, 0, 0}; //receive buffer

    tbuf[0] = (uint8_t)read_OPCODE_MCP23S17 ;
    tbuf[1] = destAddr ;
    tbuf[2] = 0 ; //A dummy value
   
    bcm2835_spi_transfernb (tbuf, rbuf, 3 );
 
    return(rbuf[2]) ;
}


void initMCP23S17_Mode(void)
{
        MCP23S17_sendData(IOCON, 0b10101100);    // IOCON.BANK = 1, No sequential mode,
     MCP23S17_sendData(IODIRB, 0xFF);        // IODIRB = FF => GPIOB =  inputs,
     MCP23S17_sendData(IODIRA, 0x00);        // IODIRA =00 => GPIOA = OUTputs,
     MCP23S17_sendData(GPPUB, 0xFF);        // PULL UP RESISTORS for Input pins : nécessaire pour pouvoir lire les entrées
}


int main(void)
{
  
   int i;

   if (!bcm2835_init())
   {
        printf("\n bcm2835 init failed") ;
        return 1;
   }

   printf("\n SPI initialised succefully \n") ;

   MCP23S17_init() ;
   initMCP23S17_Mode() ;

   MCP23S17_sendData(GPIOA, 0x00); //Set all output pins to ZERO

   while(1){
      for(i = 0; i <255; i++) {
             MCP23S17_sendData(GPIOA, i );
            usleep(1000000);
      }
   }

   MCP23S17_sendData(GPIOA, 0);
   bcm2835_spi_end();
   bcm2835_close();
   return 0;

}
/********************************** end of the program *********************************************/
Best regards,
TONDE.N

Arjan van Vught

unread,
Jul 29, 2015, 6:05:35 AM7/29/15
to bcm2835, kosch.a...@googlemail.com, kad...@free.fr
Hi Tonde,

The MCP23S17 should work fine with this library.

For reference I have a MCP23S17 tester here https://github.com/vanvught/rpi-raspbian/blob/master/mcp23s17-tester-libbob/src/main.c
And the specific MCP23S17 functions here https://github.com/vanvught/rpi-raspbian/blob/master/bob/src/mcp23s17.c

Hope this helps.

Thanks, Arjan

Looking for RPI DMX512 - RDM open source solutions? Check http://www.raspberrypi-dmx.com/


Op woensdag 29 juli 2015 04:56:17 UTC+2 schreef Tonde:

Tonde

unread,
Jul 29, 2015, 7:40:23 AM7/29/15
to bcm2835, kosch.a...@googlemail.com, arjan.v...@gmail.com

Hi Arjan,

Thank you for your prompt reponse, I am happy to know that it works. I was sure the problem is related to the functions bcm2835_spi_transfernb () and bcm2835_spi_transfern () which do not do  their job on RPI2, but succeed on RPI B.
I am going to study your example in order to capitalise on it.
Best regards,
TONDE.N
 

Tonde

unread,
Jul 29, 2015, 6:55:07 PM7/29/15
to bcm2835, kosch.a...@googlemail.com, arjan.v...@gmail.com, kad...@free.fr

Hello every body,

I tested the same program on another RPI2 board and it works!. So, I apologise for this mistake.Thank you again Arjan.
TONDE.N
Reply all
Reply to author
Forward
0 new messages