Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9191499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:41:55+00:00 2026-06-17T20:41:55+00:00

I have following code : /* Window size in bytes. */ static uint32_t size

  • 0

I have following code :

    /* Window size in bytes. */
static  uint32_t size = 0;
    /* Window address. */
static  uint32_t address = 0;
    /* Memory Base Address */   
static uint8_t *sharedMemory=NULL;

sharedMemory = memalign(size, size);

void rioShardMemoryWindowGet (uint8_t *baseAddr,uint32_t *memorySize,uint32_t *windowAddress  )
{
    *baseAddr=(int)sharedMemory;
    printf("sharedMemory: #%x",sharedMemory);
    *memorySize=size;
    *windowAddress=address;
}
rioShardMemoryWindowGet(&baseAddr0, &baseSize, &(Addrs.virtualBaseAddr));
printf("baseAddr0 : #%x",baseAddr0);

I have no clue why baseAddr0 is 0 in the second printf, while in the first sharedMemory is 0x500000.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:41:56+00:00Added an answer on June 17, 2026 at 8:41 pm

    Ok I think I understand your problem.

    You’re trying to store the address number in baseAddr0, am I right? (not sure the reasons but this is the only thing I came up with).

    The reason that a 0x500000 is showing as a 0 is because a uint8_t has not enough bits to represent an address and so it’s “culling it down” to only 1 byte (therefore showing a 0).

    Change the baseAddr to a uint32_t and voila, everything works.

    Anyways, the reason the other posters are telling you to use a pointer to pointer is because what you seem to be doing is weird, unless you’re planning on using the address for something special such as displaying it or using as an offset, perhaps?

    p.s.: you’re also going to need to change this line

    *baseAddr=(uint32_t)sharedMemory;
    

    edit: your code should look like this to get what you want:

        /* Window size in bytes. */
    static  uint32_t size = 0;
        /* Window address. */
    static  uint32_t address = 0;
        /* Memory Base Address */   
    static uint8_t *sharedMemory=NULL;
    
    sharedMemory = memalign(size, size);
    
    void rioShardMemoryWindowGet (uint32_t *baseAddr,uint32_t *memorySize,uint32_t     *windowAddress  )
    {
        *baseAddr=(uint32_t)sharedMemory;
        printf("sharedMemory: #%x",sharedMemory);
        *memorySize=size;
        *windowAddress=address;
    }
    rioShardMemoryWindowGet(&baseAddr0, &baseSize, &(Addrs.virtualBaseAddr));
    printf("baseAddr0 : #%x",baseAddr0);
    

    The reason why you NEED an uint32 to store the numeric address is because addresses are 32 bits, and that’s the reason why you see a 0 using an 8 bit value, because 0x500000 maps to 0x00 to a byte

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found the following javascript code to get browser window size and it
I have the following code that opens a new popup window while disabling the
I have the following code which creates a simple window with two buttons which
I have the following code to take screenshots of a window: HDC WinDC; HDC
I have the following code to create my window, my view and my sub
I have the following code to take a screenshot of a window, and get
I have the following code: <Window x:Class=kkk.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow Height=350 Width=525> <Window.Resources> <Style
I have the following code to give a undocked floating AvalonDock window the ability
I have the following code: use strict; function isDefined(variable) { return (typeof (window[variable]) ===
I have the following C# code to launch an outlook window. The one think

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.