Does the compiler have memory mapped I/O - at least byte wide?
Does the compiler have memory mapped I/O - at least byte wide?
I'm not a Pi expert but I'll try to help.
The Pi hardware (in common with all similar processors) does not support memory mapped IO in the way that, for example, an ARM Cortex M part does. This is because it is designed to work with DDRAM which is hard enough to get to work in the very special case of a processor or FPGA to memory interface - as far as I know no one uses the DDRAM interface for IO. The usual solution is to provide some additional IO ports which will require some kind of drivers to operate them - they are rarely mapped into normal memory space.
The PI has very limited IO (Beagles are much better) but it is supported by lots of low cost IO expanded boards from many sources but they are all slow.
To be fair the PI is not alone in having this problem - the best way to get data in and out of most computers at high speed is often to use Ethernet or PCI but both require serious hardware.
It's this (hardware) limitation which allows small Cortex M class micros to beat the ****** out of GHz application processors like that on the PI when it comes to low latency fast IO. And even with Gbit Ethernet, although you can get 100Mbytes/s in and out of the processor the round trip latency will be measured in us - perhaps 100x slower than an STM32F4xx can bit bang IO !!!
Roger is correct in implying that it isn't a compiler issue - you'll have the same problem with Python, C or anything else.
What are you trying to do - there are (almost) always ways round these problems.
MK
The pi has memory mapped IO just like any cortex-M does. Just like a cortex-M the processor on the pi has several peripherals. On the 'pi, because it runs Linux, there are usually drivers for these peripherals. These are mapped into normal memory space. Now, on Linux user-space processes get a virtual memory space that does not allow them access to the hardware (memory mapped IO). But a simple open(/dev/mem) + mmap system call will map the memory mapped peripherals into your process space.
Especially on the pi, PCI or Ethernet is NOT the way to get data in or out the computer. The first because the pi processor doesn't have PCI, and the second because the pi procesor doesn't have Ethernet, and ethernet was included by using and USB-ethernet chip on the board.
If you program the pi at the right level, it can beat the *** out of a slower (e.g. 48MHz) embedded arm processor. First because it runs at 700MHz+, second because it has caches, and third because it has a GPU co-processor that can do enormous amounts of floating point operations....
The pi has memory mapped IO just like any cortex-M does. Just like a cortex-M the processor on the pi has several peripherals. On the 'pi, because it runs Linux, there are usually drivers for these peripherals. These are mapped into normal memory space. Now, on Linux user-space processes get a virtual memory space that does not allow them access to the hardware (memory mapped IO). But a simple open(/dev/mem) + mmap system call will map the memory mapped peripherals into your process space.
Especially on the pi, PCI or Ethernet is NOT the way to get data in or out the computer. The first because the pi processor doesn't have PCI, and the second because the pi procesor doesn't have Ethernet, and ethernet was included by using and USB-ethernet chip on the board.
If you program the pi at the right level, it can beat the *** out of a slower (e.g. 48MHz) embedded arm processor. First because it runs at 700MHz+, second because it has caches, and third because it has a GPU co-processor that can do enormous amounts of floating point operations....