element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Memory mapped I/O?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 15 replies
  • Answers 1 answer
  • Subscribers 676 subscribers
  • Views 2682 views
  • Users 0 members are here
  • raspberry_pi
Related

Memory mapped I/O?

michael.vos
michael.vos over 8 years ago

Does the compiler have memory mapped I/O - at least  byte wide?

  • Sign in to reply
  • Cancel
Parents
  • michaelkellett
    0 michaelkellett over 8 years ago

    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

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rew
    0 rew over 8 years ago in reply to michaelkellett

    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....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • rew
    0 rew over 8 years ago in reply to michaelkellett

    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....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube