Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

First my Assignment:

I'm a beginner with BSD and low level peripherals like GPIO etc., and I need to toggle Raspberry GPIO Pins from a C programme on BSD.

I am Using this BSD Image i took from here: FreeBSD - easiest way to install on my RPi? and try toggling the GPIO Pins, respectively trying to set a Pin to high by calling MMAP to access the Registers directly form C code.

I took the addresses from the BCM2835 Datasheet, Chapter 1.2.3, page 6 "physical Addresses".

Is my assumption right that it does not matter if I use Raspbian or any other OS - these physical addresses will stay the same, as they are given by the Chip?

I tested my Code as root with Raspbian and it worked fine, I also compiled the code with gcc in BSD, no errors. The programme is running as root, the system does not crash or freeze but there is nothing happening in the pins.

I also discovered there is a gpioc0 device under /dev, but i cant find how to use it. anyone any links or hints? :/

(This is part of an assignment, vital to my grade. I might have overestimated myself by choosing this.)

share|improve this question
    
Just so there's no confusion, the OP is not using direct addressing but memory-mapped I/O via /dev/mem, which presumably serves the same purpose on linux and BSD. –  goldilocks Jan 23 '14 at 20:24
    
This has been crossposted to raspberrypi.stackexchange.com/questions/13193/… –  Martin von Wittich Jan 23 '14 at 20:54
    
@MartinvonWittich : More or less...that was sort of my advice, although I'd thought the question would be refined and re-focussed rather than just mostly copied :/ –  goldilocks Jan 23 '14 at 21:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.