Skip to main content
warcatz
Associate III
April 27, 2013
Question

stm32f4 and PSRAM

  • April 27, 2013
  • 3 replies
  • 1159 views
Posted on April 27, 2013 at 17:53

The original post was too long to process during our migration. Please click on the attachment to read the original post.
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    April 27, 2013
    Posted on April 27, 2013 at 20:09

    The address increments by two because 16-bit contains TWO 8-bit bytes. The address inside the CPU is for bytes. It is a byte offset.

    You know you can read/write to it like normal memory?

    uint16_t *p = (uint16_t *)0x64000000; // As a pointer to 16-bit WORDS

    p[0] = 0x1234;

    p[1] = 0x5678;

    p[2] = 0x9ABC;

    p[3] = 0xDEF0;

    printf(''%04X\n'',p[0]);

    printf(''%04X\n'',p[1]);

    printf(''%04X\n'',p[2]);

    printf(''%04X\n'',p[3]);

    uint8_t *q = (uint8_t *)0x64000000; // As a pointer to 8-bit BYTES

    printf(''%02X\n'',q[0]);

    printf(''%02X\n'',q[1]);

    printf(''%02X\n'',q[2]);

    printf(''%02X\n'',q[3]);

    The RAM should extent 0x64000000..0x647FFFFF

    ie through p[0x3FFFFF] or q[0x7FFFFF]

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    warcatz
    warcatzAuthor
    Associate III
    April 28, 2013
    Posted on April 28, 2013 at 09:11

    Thank you Clive :)

    I understand a little more now.

    I have do this test :

    void test_Clive_ram(void)

    {

    uint8_t ReadRam[4] = {0};

    uint16_t *p = (uint16_t *)Bank1_SRAM2_ADDR; // As a pointer to 16-bit WORDS

    uint8_t *q = (uint8_t *)Bank1_SRAM2_ADDR; // As a pointer to 8-bit BYTES

    p[0] = 0x1234;

    p[2] = 0x5678;

    p[4] = 0x9ABC;

    p[6] = 0xDEF0;

    ReadRam[0] = q[0]; // Result is : 0x34

    ReadRam[1] = q[1]; // Result is : 0x12

    ReadRam[2] = q[2]; // Result is : 0x78

    ReadRam[3] = q[3]; // Result is : 0x56

    }

    I see that the data are LSB first ...

    My point was to use the PSRAM as a little buffer for a TFT screen (SSD1963 480 x 272).

    I get the rest of the components and will be able to use the board i have made at end of the

    week day's.

    As i understand a little more now i will have to use a step of 2 for the address because the data

    i have to send to the screen controller are in 16bits.

    It's just 2M x 16bits but better than nothing .....

    I will have to look how the DMA work and prey that it can handle a step of 2 for the address too

    so i can use it in background to send pixels continuously to the screen ;)

    You can see the old board i made here :

    http://www.youtube.com/watch?v=tx9YSFPpKLw&list=UUPP_IrS9eBG80PxEURo0Ctw&index=1

    I made hw mistake with the memory and cant use it on that board.

    It use a Core407i from waveshare.

    The actual board i use is the HY-STM32F4xxCore144 from here :

    http://www.hotmcu.com/hystm32f4xxcore144-coredev-board-p-10.html

    So i don't have to solder any memory and don't made error again ;)

    Anyway many thanks for your advice and i hope that my Frenglish language is

    not too bad.

    Cheers.

    joerg23
    Associate
    February 25, 2014
    Posted on February 25, 2014 at 13:54

    Hello darth,

    did You use the HY_Board?

    I run into trouble use that board with stemwin gui and the ps ram.  It is hard to debug because the trouble seems to be in the precompiled lib.